diff --git a/sonic-radiance.love/game/modules/gui/statusbar.lua b/sonic-radiance.love/game/modules/gui/statusbar.lua index 91d8fdc..1ef4f5f 100644 --- a/sonic-radiance.love/game/modules/gui/statusbar.lua +++ b/sonic-radiance.love/game/modules/gui/statusbar.lua @@ -6,14 +6,12 @@ local gui = require "game.modules.gui" local HUDBASE = 8 local HUDSEP = 152 -function StatusBar:new(fighter) - self.fighter = fighter - self.hud = fighter.turnSystem.hud - self.assets = self.fighter.assets +function StatusBar:new(abstract, scene) + self.assets = scene.assets + self.abstract = abstract - self.charid = self.fighter.name - self.stats = self.fighter:getStats() - self.abstract = self.fighter.abstract + self.charid = self.abstract.simplename + self.stats = self.abstract:getStats() self.hp = self.abstract.hp self.pp = self.abstract.pp @@ -44,10 +42,7 @@ function StatusBar:drawEmblem(x, y) self.assets.images[emblem2]:draw(x, y) end -function StatusBar:draw() - local x = HUDBASE + (self.fighter.id-1)*HUDSEP - local y = self.hud:getPlayerHUDPosition() - +function StatusBar:draw(x, y) self:drawEmblem(x, y) self.assets.images["statusbar"]:draw(x+12, y-6) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index 365d894..ed63881 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -8,11 +8,14 @@ local actionList = require "scenes.battlesystem.controllers.fighters.systems.act local POSITIONS = {3, 1, 5} local HEROES_LINE = 2; +local HUDBASE = 8 +local HUDSEP = 152 + function HeroFighter:new(owner, character, id) self.name = character self.super.new(self, owner, true, id) - self.statusbar = StatusBar(self) + self.statusbar = StatusBar(self.abstract, self.turnSystem.scene) self:initVoices() self.action = nil @@ -149,7 +152,9 @@ function HeroFighter:drawIcon(x, y) end function HeroFighter:drawHUD() - self.statusbar:draw() + local x = HUDBASE + (self.id-1)*HUDSEP + local y = self.turnSystem.hud:getPlayerHUDPosition() + self.statusbar:draw(x, y) end return HeroFighter