- Joined
- Nov 13, 2006
- Messages
- 1,814
after a time floating text doesn't appear :/
i have no ideea why screwed up the whole system, because at begining floating text work well
How it must work?
i created 26 destructible, in hashtable stored to (Inv_Slot, 100-199,0) and (Inv_Slot, 200-205,0), i want write to every slot a number with floating text.
i have function what each time when player click to a trackable (what is at destructible position) i want refresh the numbers at every destructible (3rd jass)
notice: on screenshot 1st items was in that 3x2 slot then i moved to bigger inventory then after a time dont appeared the text anymore also was problem with refresh the texts.(each time when i moved something then the must be refreshed the text everywhere)
i tryed with displaying text for all player and everything was fine, slot/charges/coords was with right value in FT_Charges function
i have no ideea why screwed up the whole system, because at begining floating text work well
How it must work?
i created 26 destructible, in hashtable stored to (Inv_Slot, 100-199,0) and (Inv_Slot, 200-205,0), i want write to every slot a number with floating text.
i have function what each time when player click to a trackable (what is at destructible position) i want refresh the numbers at every destructible (3rd jass)
JASS:
function FT_Charges takes player p, string txt, real fsize, real x, real y, integer slot returns nothing
local integer alpha = 255
local integer pl = GetPlayerId(p) + 1
local texttag tt = CreateTextTag( )
if GetLocalPlayer() == p then
call SetTextTagText( tt, txt, fsize * 0.023 )
call SetTextTagPos( tt, x, y, 100.00 )
call SetTextTagColor( tt, 255, 255, 255, alpha )
call SetTextTagPermanent( tt, false )
endif
call SaveTextTagHandle(udg_Inv_Slots, pl+1000, slot, tt)
set tt = null
endfunction
JASS:
function SetChargeSlotText takes integer pl, integer slot returns nothing
local real x = LoadReal(udg_Inv_Slots, 0, 1)
local real x1 = LoadReal(udg_Inv_Slots, slot, 1)
local real y1 = LoadReal(udg_Inv_Slots, slot, 2)
local real shiftX = (x1-x)/16
local integer ilv = 0
local integer charge = 0
if slot < 200 then
set ilv = LoadInteger(udg_Stat_Table, 10000*pl+slot,99)
if ilv <=72 or ilv >= 1100 then
set charge = R2I(LoadReal(udg_Stat_Table, 10000*pl+slot,5))
endif
elseif slot < 300 then
set ilv = GetItemLevel(UnitItemInSlot(udg_Hero[pl], slot - 200))
if ilv <=72 or ilv >= 1100 then
set charge = GetItemCharges(UnitItemInSlot(udg_Hero[pl], slot - 200))
endif
endif
if LoadTextTagHandle(udg_Inv_Slots, pl+1000, slot) != null and ilv==0 then
call DestroyTextTag (LoadTextTagHandle(udg_Inv_Slots, pl+1000, slot))
endif
if charge > 0 then
call FT_Charges(Player(pl - 1), I2S(charge), 0.7, x1+45-shiftX, y1-15, slot)
endif
endfunction
JASS:
.....................
set n1 = 100
loop
exitwhen n1 == 206
call SetChargeSlotText (pl, n1)
if n1==119 then
set n1 = 199
endif
set n1 = n1 + 1
endloop
notice: on screenshot 1st items was in that 3x2 slot then i moved to bigger inventory then after a time dont appeared the text anymore also was problem with refresh the texts.(each time when i moved something then the must be refreshed the text everywhere)
i tryed with displaying text for all player and everything was fine, slot/charges/coords was with right value in FT_Charges function