Life_Skill_Update()
for(var/item in Life_Skill_var["Level"])
if(Life_Skill_var["Level"][item] != Life_Skill_var["Previous_Level"][item])
Life_Skill_var["Previous_Level"][item] = Life_Skill_var["Level"][item]
winset(src, "Life_pane_2.[item]_Label", {"text = "[Life_Skill_var["Level"][item]] of [Max_Life_Level]""})
winset(src, "Life_pane_2.[item]_Level_Bar", {"value = [round(max((Life_Skill_var["Level"][item] / Max_Life_Level * 100),1),1)]"})
if(Life_Skill_var["EXP"][item] != Life_Skill_var["Previous_EXP"][item])
Life_Skill_var["Previous_EXP"][item] = Life_Skill_var["EXP"][item]
winset(src, "Life_pane_2.[item]_EXP_Bar", {"value = [round(max((Life_Skill_var["EXP"][item] / Life_Skill_var["Max_EXP"][item] * 100),1),1)]"})
Life_Skill_Level_Up()
Problem:
What I'm trying to do here is update skills in the bar as I train, and save the current variable to another variable and if the two does not equal, it'll update the bar.
When should I call this proc to level up the bar? I think about putting it in Stat() since it calls itself automatically. But if someone isn't training, it'll just be wasting up the space.
Is what I'm doing efficient (speed-wise)?
As far as when to use it, I would suggest calling it when they gain the experience. For example:
If you have it so that your experience goes up when you kill a monster, after you gain the experience from the kill run the proc.