mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-15 07:41:21 +02:00
Keep wide layout through battle menus
This commit is contained in:
@@ -6,12 +6,20 @@ package.path = "./?.lua;./?/init.lua;" .. package.path
|
||||
local T = require("tests.modkit")
|
||||
local WideBattle = require("src.battle.WideBattle")
|
||||
local Renderer = require("src.render.Renderer")
|
||||
local Game = require("src.core.Game")
|
||||
|
||||
T.eq(WideBattle.WIDTH, 304, "the wide layout runs on a 304px native surface")
|
||||
T.eq(WideBattle.HEIGHT, 144, "the wide surface keeps the native height")
|
||||
T.eq(WideBattle.FIELD_BOTTOM, 104,
|
||||
"the lower 40 rows are the message / command windows")
|
||||
|
||||
local wide = { isWideBattleLayout = function() return true end }
|
||||
local normal = { isWideBattleLayout = function() return false end }
|
||||
T.eq(Game.wideBattleInStack({ states = { normal, wide, normal } }), wide,
|
||||
"a wide battle remains the surface owner under a classic overlay")
|
||||
T.eq(Game.wideBattleInStack({ states = { normal } }), nil,
|
||||
"a classic stack keeps the normal surface")
|
||||
|
||||
-- move grid: slots are laid out 1 2 / 3 4
|
||||
T.eq(WideBattle.moveGridIndex(1, 4, "right"), 2, "RIGHT crosses the row")
|
||||
T.eq(WideBattle.moveGridIndex(2, 4, "left"), 1, "LEFT crosses the row")
|
||||
|
||||
Reference in New Issue
Block a user