Commit ec4226ac by Arun Joseph

Squad size label in Beacon Menu was not updating correctly. Fix to update the squad size.

parent dc583c41
......@@ -139,6 +139,8 @@ function m.create()
for k,v in pairs(tSquads) do
if not tList[k] then
self:addEntry(k)
else
self:updateEntry(k)
end
end
if isSelectionDisbanded then
......@@ -146,6 +148,13 @@ function m.create()
end
end
-- Finds the beacon entry and updates all the labels associated with it
-- @param sName The name of the squad
function Ob:updateEntry(sName)
rEntryToUpdate = rUIList:getList()[sName]
rEntryToUpdate:updateLabels(squadList.getSquad(sName))
end
function Ob:addEntry(sName)
local rNewEntry = BeaconMenuEntry.new(self)
local w,h = rNewEntry:getDims()
......
......@@ -34,6 +34,14 @@ function m.create()
self:_calcDimsFromElements()
end
-- updates all the labels associated with the beacon menu entry. e.g. Size
-- @param _rsquad Reference to the squad
function Ob:updateLabels(_rSquad)
rSquad = _rSquad
self.rSizeLabel:setString('Size: '..rSquad.getSize())
self.rStatusLabel:setString('Status: '..rSquad.getStatusString())
end
function Ob:setName(_rSquad, rCallback)
rSquad = _rSquad
self.rNameLabel:setString(rSquad.getName())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment