mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-22 13:36:14 +02:00
skins fixerino
This commit is contained in:
@@ -9,7 +9,9 @@ return function(game)
|
||||
|
||||
local dir = os.getenv("SHOT_DIR") or "/tmp/studio"
|
||||
os.execute('mkdir -p "' .. dir .. '" 2>/dev/null')
|
||||
love.window.setMode(1440, 900, { resizable = true, highdpi = true })
|
||||
local shotW = tonumber(os.getenv("STUDIO_SHOT_W")) or 1440
|
||||
local shotH = tonumber(os.getenv("STUDIO_SHOT_H")) or 900
|
||||
love.window.setMode(shotW, shotH, { resizable = true, highdpi = true })
|
||||
U.wait(2)
|
||||
|
||||
local pending = nil
|
||||
@@ -41,6 +43,14 @@ return function(game)
|
||||
U.log("skin:", Studio.skin and Studio.skin.id, "pages:", #(Studio.skin.pages or {}))
|
||||
U.log("controls:", #Studio.page().controls, "images:", #(Studio.images or {}))
|
||||
shot("studio_open.png")
|
||||
Studio.enterEditor()
|
||||
U.wait(2)
|
||||
shot("studio_editor.png")
|
||||
|
||||
Studio.openPageMenu()
|
||||
U.wait(2)
|
||||
shot("studio_pages.png")
|
||||
Studio.closeModal()
|
||||
|
||||
Studio.selected = 9
|
||||
U.wait(3)
|
||||
|
||||
@@ -10,7 +10,9 @@ return function(game)
|
||||
local dir = os.getenv("SHOT_DIR") or "/tmp/skin"
|
||||
local skinId = os.getenv("SKIN") or "gb_anim"
|
||||
|
||||
love.window.setMode(432, 768, { resizable = true, highdpi = true })
|
||||
local shotW = tonumber(os.getenv("SHOT_W")) or 432
|
||||
local shotH = tonumber(os.getenv("SHOT_H")) or 768
|
||||
love.window.setMode(shotW, shotH, { resizable = true, highdpi = true })
|
||||
U.wait(2)
|
||||
|
||||
game.save.party = { Pokemon.new(game.data, "CHARIZARD", 50) }
|
||||
@@ -43,10 +45,26 @@ return function(game)
|
||||
U.shot(game, dir .. "/skin_idle.png")
|
||||
|
||||
local ww, wh = love.graphics.getDimensions()
|
||||
local function at(nx, ny) return nx * ww, ny * wh end
|
||||
local function centerFor(button)
|
||||
local current = TouchSkin.page()
|
||||
for _, ctl in ipairs(current and current.controls or {}) do
|
||||
for _, bind in ipairs(ctl.buttons or {}) do
|
||||
if bind == button then
|
||||
local x, y = TouchSkin.controlGeometry(current, ctl, ww, wh)
|
||||
return x, y
|
||||
end
|
||||
end
|
||||
for _, hotkey in ipairs(ctl.hotkeys or {}) do
|
||||
if hotkey == button then
|
||||
local x, y = TouchSkin.controlGeometry(current, ctl, ww, wh)
|
||||
return x, y
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
TouchControls:touchpressed("t1", at(0.87407, 0.72417))
|
||||
TouchControls:touchpressed("t2", at(0.24074, 0.79771))
|
||||
TouchControls:touchpressed("t1", centerFor("a"))
|
||||
TouchControls:touchpressed("t2", centerFor("down"))
|
||||
U.wait(4)
|
||||
U.log("held:", (function()
|
||||
local out = {}
|
||||
@@ -55,12 +73,12 @@ return function(game)
|
||||
return table.concat(out, ",")
|
||||
end)())
|
||||
U.shot(game, dir .. "/skin_pressed.png")
|
||||
TouchControls:touchreleased("t1", at(0.87407, 0.72417))
|
||||
TouchControls:touchreleased("t2", at(0.24074, 0.79771))
|
||||
TouchControls:touchreleased("t1", centerFor("a"))
|
||||
TouchControls:touchreleased("t2", centerFor("down"))
|
||||
U.wait(4)
|
||||
|
||||
TouchControls:touchpressed("t3", at(0.95, 0.528))
|
||||
TouchControls:touchreleased("t3", at(0.95, 0.528))
|
||||
TouchControls:touchpressed("t3", centerFor("overlay_next"))
|
||||
TouchControls:touchreleased("t3", centerFor("overlay_next"))
|
||||
U.wait(6)
|
||||
U.log("page after overlay_next:", TouchSkin.page() and TouchSkin.page().name)
|
||||
U.shot(game, dir .. "/skin_page2.png")
|
||||
|
||||
Reference in New Issue
Block a user