Skip to content

Commit

Permalink
update goaltracker lua to reflect changes in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 3, 2017
1 parent 44ec91e commit c317251
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ local function makescoregoal(i)
SetCommand=function(self)
if update then
if sg then
self:settextf("%5.f%%", sg:GetPercent())
self:settextf("%5.f%%", sg:GetPercent() * 100)
self:visible(true)
else
self:visible(false)
Expand Down Expand Up @@ -251,13 +251,13 @@ local function makescoregoal(i)
InitCommand=cmd(y,goalrow2Y;halign,0;zoomto,25,buttonheight;diffuse,getMainColor('positive');diffusealpha,buttondiffuse),
MouseLeftClickMessageCommand=function(self)
if isOver(self) and update then
sg:SetPercent(sg:GetPercent()+1)
sg:SetPercent(sg:GetPercent()+0.01)
MESSAGEMAN:Broadcast("UpdateGoals")
end
end,
MouseRightClickMessageCommand=function(self)
if isOver(self) and update then
sg:SetPercent(sg:GetPercent()-1)
sg:SetPercent(sg:GetPercent()-0.01)
MESSAGEMAN:Broadcast("UpdateGoals")
end
end
Expand Down Expand Up @@ -300,6 +300,9 @@ local function makescoregoal(i)
if sg and sg:IsAchieved() then
self:settext("Achieved: "..datetimetodate(sg:WhenAchieved()))
self:visible(true)
elseif sg:IsVacuous() then
self:visible(true)
self:settext("Vacuous goal")
else
self:visible(false)
end
Expand All @@ -313,12 +316,11 @@ local function makescoregoal(i)
SetCommand=function(self)
if update then
if sg then
self:settextf(sg:GetPriority())
self:settext(sg:GetPriority())
self:visible(true)
else
self:visible(false)
end
self:diffuse(byAchieved(sg))
end
end,
UpdateGoalsMessageCommand=cmd(queuecommand,"Set")
Expand Down

0 comments on commit c317251

Please sign in to comment.