Zwiebelchen
Hosted Project GR
- Joined
- Sep 17, 2009
- Messages
- 7,234
This is an excerpt from a periodicly executed script that updates a buff status monitor multiboard.
Depending on the number of buffs registered, the size of the multiboard expands (3 static rows plus one row per buff).
All stuff works perfectly. The number of rows of the multiboard changes correctly. Also, all values retrieved are correct all the time (tested with debug messages).
The only issue: When 2 remaining buffs vanish at the same time and the multiboard shrinks back to rowcount 3, when adding a new buff, the rowcount expands back to 4 (like it should), but no values are displayed in row 3! The values of row 4 get displayed correctly. I checked the values for row 3 with debug messages and they are correct ... they just won't get displayed for row 3 for some weird reason.
What is even more strange: If I set the rowcount to a constant value (like 7), the bug is gone. It seems to have something to do with the rowcount thing.
PS: The rowcount expansion works all the time; it's just that there is no values or icons displayed in the "bugged" row.
Depending on the number of buffs registered, the size of the multiboard expands (3 static rows plus one row per buff).
All stuff works perfectly. The number of rows of the multiboard changes correctly. Also, all values retrieved are correct all the time (tested with debug messages).
The only issue: When 2 remaining buffs vanish at the same time and the multiboard shrinks back to rowcount 3, when adding a new buff, the rowcount expands back to 4 (like it should), but no values are displayed in row 3! The values of row 4 get displayed correctly. I checked the values for row 3 with debug messages and they are correct ... they just won't get displayed for row 3 for some weird reason.
What is even more strange: If I set the rowcount to a constant value (like 7), the bug is gone. It seems to have something to do with the rowcount thing.
PS: The rowcount expansion works all the time; it's just that there is no values or icons displayed in the "bugged" row.
JASS:
set j = 0
set maxeffect = MonitorGetEffectNumber(i)
call MultiboardSetRowCount(PlayerThreatMeters[i], maxeffect+3)
loop
exitwhen j >= maxeffect
set monitorTime = MultiboardGetItem(PlayerThreatMeters[i], j+3, 1)
set monitorTarget = MultiboardGetItem(PlayerThreatMeters[i], j+3, 0)
call MultiboardSetItemStyle(monitorTime, true, false)
call MultiboardSetItemStyle(monitorTarget, true, true)
call MultiboardSetItemIcon(monitorTarget, MonitorGetEffectIcon(i, j))
call MultiboardSetItemWidth(monitorTime, 0.03)
call MultiboardSetItemWidth(monitorTarget, 0.12)
set r = MonitorGetEffectTime(i, j)
if r >= 0.1 then
call MultiboardSetItemValue(monitorTime, I2S(R2I(r)))
else
call MultiboardSetItemValue(monitorTime, "")
endif
set u = MonitorGetEffectTarget(i, j)
if IsUnitType(u, UNIT_TYPE_HERO) then
set color = ARGB.fromPlayer(GetOwningPlayer(u))
set s = GetUnitName(u) + " ["+ color.str(GetPlayerName(GetOwningPlayer(u))) + "]"
else
if GetOwningPlayer(u) == Player(PLAYER_NEUTRAL_AGGRESSIVE) then
set s = "|cffffdab9" + GetUnitName(u) + " ("+ I2S(GetUnitLevel(u)) + ")|r"
elseif GetOwningPlayer(u) != Player(PLAYER_NEUTRAL_PASSIVE) then
set color = ARGB.fromPlayer(GetOwningPlayer(u))
set s = color.str(GetUnitName(u))
else
set s = GetUnitName(u)
endif
endif
call MultiboardSetItemValue(monitorTarget, s)
call MultiboardReleaseItem(monitorTarget)
call MultiboardReleaseItem(monitorTime)
set monitorTarget = null
set monitorTime = null
set j = j + 1
endloop