|
|
@ -78,6 +78,11 @@ function resetSkillColor(id)
|
|
|
|
widget:setColor('#bbbbbb')
|
|
|
|
widget:setColor('#bbbbbb')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toggleSkill(id, state)
|
|
|
|
|
|
|
|
local skill = skillsWindow:recursiveGetChildById(id)
|
|
|
|
|
|
|
|
skill:setVisible(state)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function setSkillBase(id, value, baseValue)
|
|
|
|
function setSkillBase(id, value, baseValue)
|
|
|
|
if baseValue <= 0 or value < 0 then
|
|
|
|
if baseValue <= 0 or value < 0 then
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -118,12 +123,14 @@ end
|
|
|
|
function setSkillPercent(id, percent, tooltip)
|
|
|
|
function setSkillPercent(id, percent, tooltip)
|
|
|
|
local skill = skillsWindow:recursiveGetChildById(id)
|
|
|
|
local skill = skillsWindow:recursiveGetChildById(id)
|
|
|
|
local widget = skill:getChildById('percent')
|
|
|
|
local widget = skill:getChildById('percent')
|
|
|
|
|
|
|
|
if widget then
|
|
|
|
widget:setPercent(math.floor(percent))
|
|
|
|
widget:setPercent(math.floor(percent))
|
|
|
|
|
|
|
|
|
|
|
|
if tooltip then
|
|
|
|
if tooltip then
|
|
|
|
widget:setTooltip(tooltip)
|
|
|
|
widget:setTooltip(tooltip)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function checkAlert(id, value, maxValue, threshold, greaterThan)
|
|
|
|
function checkAlert(id, value, maxValue, threshold, greaterThan)
|
|
|
|
if greaterThan == nil then greaterThan = false end
|
|
|
|
if greaterThan == nil then greaterThan = false end
|
|
|
@ -204,17 +211,26 @@ function refresh()
|
|
|
|
onRegenerationChange(player, player:getRegenerationTime())
|
|
|
|
onRegenerationChange(player, player:getRegenerationTime())
|
|
|
|
onSpeedChange(player, player:getSpeed())
|
|
|
|
onSpeedChange(player, player:getSpeed())
|
|
|
|
|
|
|
|
|
|
|
|
for i=0,6 do
|
|
|
|
local hasAdditionalSkills = g_game.getFeature(GameAdditionalSkills)
|
|
|
|
|
|
|
|
for i = Skill.Fist, Skill.ManaLeechAmount do
|
|
|
|
onSkillChange(player, i, player:getSkillLevel(i), player:getSkillLevelPercent(i))
|
|
|
|
onSkillChange(player, i, player:getSkillLevel(i), player:getSkillLevelPercent(i))
|
|
|
|
onBaseSkillChange(player, i, player:getSkillBaseLevel(i))
|
|
|
|
onBaseSkillChange(player, i, player:getSkillBaseLevel(i))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if i > Skill.Fishing then
|
|
|
|
|
|
|
|
toggleSkill('skillId'..i, hasAdditionalSkills)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
update()
|
|
|
|
update()
|
|
|
|
|
|
|
|
|
|
|
|
local contentsPanel = skillsWindow:getChildById('contentsPanel')
|
|
|
|
local contentsPanel = skillsWindow:getChildById('contentsPanel')
|
|
|
|
skillsWindow:setContentMinimumHeight(44)
|
|
|
|
skillsWindow:setContentMinimumHeight(44)
|
|
|
|
|
|
|
|
if hasAdditionalSkills then
|
|
|
|
|
|
|
|
skillsWindow:setContentMaximumHeight(480)
|
|
|
|
|
|
|
|
else
|
|
|
|
skillsWindow:setContentMaximumHeight(390)
|
|
|
|
skillsWindow:setContentMaximumHeight(390)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function offline()
|
|
|
|
function offline()
|
|
|
|
if expSpeedEvent then expSpeedEvent:cancel() expSpeedEvent = nil end
|
|
|
|
if expSpeedEvent then expSpeedEvent:cancel() expSpeedEvent = nil end
|
|
|
|