Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/engine/game/battle/ui/actionbutton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ function ActionButton:select()
})
end

Game.battle:setState("MENUSELECT", "SPELL")
if #Game.battle.menu_items > 0 then
Game.battle:setState("MENUSELECT", "SPELL")
end
elseif self.type == "item" then
Game.battle:clearMenuItems()
for i,item in ipairs(Game.inventory:getStorage("items")) do
Expand Down
36 changes: 19 additions & 17 deletions src/engine/game/battle/ui/battleui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function BattleUI:init()

local size_offset = 0
local box_gap = 0

if #Game.battle.party == 3 then
size_offset = 0
box_gap = 0
Expand Down Expand Up @@ -189,7 +189,7 @@ function BattleUI:update()
self.animation_y = 0
end
end

self.y = lower - self.animation_y

for _, box in ipairs(self.action_boxes) do
Expand Down Expand Up @@ -344,22 +344,24 @@ function BattleUI:drawState()
end

-- Print information about currently selected item
local tp_offset, _ = 0, nil --initialize placeholdder variable so it doenst go in global scope
local current_item = Game.battle.menu_items[Game.battle:getItemIndex()]
if current_item.description then
Draw.setColor(COLORS.gray)
love.graphics.print(current_item.description, 260 + 240, 50)
Draw.setColor(1, 1, 1, 1)
_, tp_offset = current_item.description:gsub('\n', '\n')
tp_offset = tp_offset + 1
end
if current_item then
if current_item.description then
Draw.setColor(COLORS.gray)
love.graphics.print(current_item.description, 260 + 240, 50)
Draw.setColor(1, 1, 1, 1)
local tp_offset, _ = 0, nil --initialize placeholdder variable so it doenst go in global scope
_, tp_offset = current_item.description:gsub('\n', '\n')
tp_offset = tp_offset + 1
end

if current_item.tp and current_item.tp ~= 0 then
Draw.setColor(PALETTE["tension_desc"])
love.graphics.print(math.floor((current_item.tp / Game:getMaxTension()) * 100) .. "% "..Game:getConfig("tpName"), 260 + 240, 50 + (tp_offset * 32))
Game:setTensionPreview(current_item.tp)
else
Game:setTensionPreview(0)
if current_item.tp and current_item.tp ~= 0 then
Draw.setColor(PALETTE["tension_desc"])
love.graphics.print(math.floor((current_item.tp / Game:getMaxTension()) * 100) .. "% "..Game:getConfig("tpName"), 260 + 240, 50 + (tp_offset * 32))
Game:setTensionPreview(current_item.tp)
else
Game:setTensionPreview(0)
end
end

Draw.setColor(1, 1, 1, 1)
Expand Down Expand Up @@ -486,7 +488,7 @@ function BattleUI:drawState()

Draw.setColor(128/255, 128/255, 128/255, 1)


if ((80 + namewidth + 60 + (font:getWidth(enemy.comment) / 2)) < 415) then
love.graphics.print(enemy.comment, 80 + namewidth + 60, 50 + y_off)
else
Expand Down