This function highlights the talentbuttons in one of my talentrees in dependence to the allready spent talentpoints. The talenttiers are packed together in unitgroups. In my GUI version it works perfect. But in this to jass converted version it doesn't. does anyone has an idea?
For comparing reasons, here is the GUI version:
JASS:
function AdjustButtonBrightness takes nothing returns nothing
call SetUnitVertexColor( GetEnumUnit(), 100, 100, 100, 0 )
endfunction
function LightTalentButton takes nothing returns nothing
if ( HeroStatPointsTalent > 0 ) then
// STRENGTH DEF
if ( TalentSpentTotalSTRDEF >= 20 ) then
call ForGroup( TalentTierGroupSTRDEF[5], function AdjustButtonBrightness)
else
if ( TalentSpentTotalSTRDEF >= 15 ) then
call ForGroup( TalentTierGroupSTRDEF[4], function AdjustButtonBrightness)
else
if ( TalentSpentTotalSTRDEF >= 10 ) then
call ForGroup( TalentTierGroupSTRDEF[3], function AdjustButtonBrightness)
else
if ( TalentSpentTotalSTRDEF >= 5 ) then
call ForGroup( TalentTierGroupSTRDEF[2], function AdjustButtonBrightness)
else
call ForGroup( TalentTierGroupSTRDEF[1], function AdjustButtonBrightness)
endif
endif
endif
endif
For comparing reasons, here is the GUI version:
-
TalentLightTalentbutton
- Ereignisse
-
Bedingungen
- HeroStatsPointsTalent (>) 0
-
Aktionen
-
-------- STRENGTH DEF --------
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
- TalentSpentTotalSTRDEF (>=) 20
-
'THEN'-Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[5] and do (Actions)
-
Schleifen - Aktionen
- Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
-
Schleifen - Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[5] and do (Actions)
-
'ELSE'-Aktionen
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
- TalentSpentTotalSTRDEF (>=) 15
-
'THEN'-Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[4] and do (Actions)
-
Schleifen - Aktionen
- Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
-
Schleifen - Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[4] and do (Actions)
-
'ELSE'-Aktionen
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
- TalentSpentTotalSTRDEF (>=) 10
-
'THEN'-Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[3] and do (Actions)
-
Schleifen - Aktionen
- Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
-
Schleifen - Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[3] and do (Actions)
-
'ELSE'-Aktionen
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
- TalentSpentTotalSTRDEF (>=) 5
-
'THEN'-Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[2] and do (Actions)
-
Schleifen - Aktionen
- Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
-
Schleifen - Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[2] and do (Actions)
-
'ELSE'-Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[1] and do (Actions)
-
Schleifen - Aktionen
- Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
-
Schleifen - Aktionen
-
Einheitengruppe - Pick every unit in TalentTierGroupSTRDEF[1] and do (Actions)
-
'IF'-Bedingungen
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
-------- STRENGTH DEF --------