diff --git a/lib/controls.lua b/lib/controls.lua index ea0a42f..e91e21b 100644 --- a/lib/controls.lua +++ b/lib/controls.lua @@ -18,7 +18,8 @@ controls.keymap = { cameraMoveDown = control("key", "s"), cameraMoveScroll = control("mouse", "3"), fullMana = control("key", "m"), - select = control("mouse", "1") + select = control("mouse", "1"), + endTurnTest = control("key", "e") } local currentKeys = {} diff --git a/lib/level/selector.lua b/lib/level/selector.lua index fb9f9f6..db894bb 100644 --- a/lib/level/selector.lua +++ b/lib/level/selector.lua @@ -25,6 +25,8 @@ function selector:update(dt) local selectedId = Tree.level.characterGrid:get(Vec3 { mousePosition.x, mousePosition.y }) if not self.id then + -- print(selectedId, Tree.level.turnOrder.order[1]) + if selectedId ~= Tree.level.turnOrder.order[1] then return end return self:select(selectedId) else local char = Tree.level.characters[self.id] diff --git a/lib/spellbook.lua b/lib/spellbook.lua index c1f91ba..e117065 100644 --- a/lib/spellbook.lua +++ b/lib/spellbook.lua @@ -52,8 +52,6 @@ function walk:cast(caster, target) onEnd = function() caster:has(Tree.behaviors.spellcaster):endCast() end, }:run() - Tree.level.turnOrder:next() - return true end diff --git a/main.lua b/main.lua index 2722bee..24847cf 100644 --- a/main.lua +++ b/main.lua @@ -25,6 +25,13 @@ function love.update(dt) Widgets:update(dt) -- логика UI-слоя должна отработать раньше всех, потому что нужно перехватить жесты и не пустить их дальше Tree.panning:update(dt) Tree.level:update(dt) + + -- для тестов очереди ходов + -- удалить как только появится ui для людей + if Tree.controls:isJustPressed("endTurnTest") then + Tree.level.turnOrder:next() + end + Tree.controls:cache() local t2 = love.timer.getTime()