fix: adapt HUD to new turn system
This commit is contained in:
parent
34eb8e5ba5
commit
84cab7c92a
1 changed files with 5 additions and 4 deletions
|
@ -8,12 +8,13 @@ function HUD:new(scene)
|
|||
self.scene = scene
|
||||
self.world = scene.world
|
||||
self.assets = scene.assets
|
||||
self.turns = scene.turns
|
||||
|
||||
self.frame = gui.newBorder(424, 30, 4)
|
||||
self.tweens = TweenManager(self)
|
||||
|
||||
self.playerHUDPosition = -64
|
||||
self.battlerCursor = self.world.turns.current
|
||||
self.battlerCursor = self.turns.turns.current
|
||||
end
|
||||
|
||||
function HUD:update(dt)
|
||||
|
@ -41,12 +42,12 @@ function HUD:draw()
|
|||
battler:drawHUD()
|
||||
end
|
||||
|
||||
for i, action in ipairs(self.world.actionlist) do
|
||||
for i, action in ipairs(self.turns.actionList) do
|
||||
action.actor:drawIcon(4 + (i-1)*(20), 6)
|
||||
end
|
||||
local cursorx = self.battlerCursor * 20 - 6
|
||||
|
||||
if #self.world.actionlist > 0 then
|
||||
if #self.turns.actionList > 0 then
|
||||
self.assets.images["menucursor"]:draw(cursorx, 26, math.rad(-90), 1, 1, 4, 8)
|
||||
end
|
||||
|
||||
|
@ -55,7 +56,7 @@ function HUD:draw()
|
|||
love.graphics.draw(self.frame, 424, 20, 0, -1, -1)
|
||||
self.assets.images["hudturn"]:draw(x, y)
|
||||
self.assets.fonts["hudnbrs"]:set()
|
||||
local turnnbr = self.world.turns.number
|
||||
local turnnbr = self.turns.turns.number
|
||||
if (turnnbr < 10) then
|
||||
turnnbr = "0" .. turnnbr
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue