mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Small changes on how virtual key call action
This commit is contained in:
@@ -6,11 +6,14 @@ require 'settings'
|
||||
|
||||
function GameScene:new(player_name, replay_file, replay_grade)
|
||||
game_mode = require 'game.gamemode'
|
||||
|
||||
VCTRL[9].show = false; VCTRL[10].show = false -- Hide SELECT and QUIT button
|
||||
if PENTO_MODE then
|
||||
ruleset = require 'game.rotation_pent'
|
||||
else
|
||||
ruleset = require 'game.rotation'
|
||||
end
|
||||
|
||||
self.retry_mode = game_mode
|
||||
self.retry_ruleset = ruleset
|
||||
self.secret_inputs = inputs
|
||||
@@ -60,6 +63,9 @@ function GameScene:update(nosound, tas_update)
|
||||
if not self.paused then
|
||||
self.game:update(inputs, self.ruleset)
|
||||
end
|
||||
if self.game.input_playback or self.game.game_over or self.game.game_completed then
|
||||
VCTRL[9].show = true; VCTRL[10].show = true
|
||||
end
|
||||
end
|
||||
|
||||
function GameScene:render()
|
||||
|
||||
@@ -1,42 +1,8 @@
|
||||
local TouchConfigScene = SCENE:extend()
|
||||
TouchConfigScene.title = "Touchscreen config\n(you can tap anywhere on touch screen to select this)"
|
||||
|
||||
local origin_touchPressed, origin_touchReleased, origin_touchMoved
|
||||
|
||||
local function onPressed(id, x, y)
|
||||
if not VCTRL.press(x, y, id) then
|
||||
-- TODO
|
||||
end
|
||||
end
|
||||
local function onMoved(id, _, _, dx, dy)
|
||||
VCTRL.drag(dx, dy, id)
|
||||
end
|
||||
local function onReleased(id)
|
||||
if not VCTRL.release(id) then
|
||||
-- TODO
|
||||
end
|
||||
end
|
||||
|
||||
function TouchConfigScene:new()
|
||||
-- TODO
|
||||
-- Temproraily hijacking game's touch-related functions
|
||||
origin_touchPressed, origin_touchReleased, origin_touchMoved = love.touchpressed, love.touchreleased, love.touchmoved
|
||||
|
||||
SETTINGS.input.keys = table.merge(
|
||||
SETTINGS.input.keys,
|
||||
{
|
||||
enter = 'menu_decide',
|
||||
acback = 'menu_back',
|
||||
f13 = 'up',
|
||||
f14 = 'down',
|
||||
f15 = 'left',
|
||||
f16 = 'right',
|
||||
f17 = 'rotate_left',
|
||||
f18 = 'rotate_left2',
|
||||
f19 = 'rotate_right',
|
||||
f20 = 'rotate_right2',
|
||||
}
|
||||
)
|
||||
end
|
||||
function TouchConfigScene:update()
|
||||
-- TODO
|
||||
@@ -46,8 +12,8 @@ function TouchConfigScene:render()
|
||||
MainBackground()
|
||||
end
|
||||
|
||||
function TouchConfigScene:onQuit()
|
||||
love.touchpressed, love.touchreleased, love.touchmoved = origin_touchPressed, origin_touchReleased, origin_touchMoved
|
||||
function TouchConfigScene:onInputPress(e)
|
||||
if e.key == 'menu_back' then SCENE = TitleScene() end
|
||||
end
|
||||
|
||||
return TouchConfigScene
|
||||
Reference in New Issue
Block a user