mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Fix virtual button method
This commit is contained in:
@@ -45,6 +45,8 @@ local buttonList = {
|
||||
local menuKey -- MENU key used to go main menu XD
|
||||
|
||||
function GameScene:new(player_name, replay_file, replay_grade)
|
||||
VCTRL[9].show = false
|
||||
|
||||
menuKey = BUTTON.new{
|
||||
text = "MENU",
|
||||
x = 265, y = 0, w = 60, h = 25,
|
||||
@@ -130,7 +132,7 @@ end
|
||||
|
||||
function GameScene:onInputPress(e)
|
||||
if e.type == "mouse" or (e.type == "touch" and not VCTRL.press(e.x, e.y, e.id)) then
|
||||
BUTTON.press(buttonList, e.x, e.y, e.id)
|
||||
if self.game.input_playback then BUTTON.press(buttonList, e.x, e.y, e.id) end
|
||||
menuKey:press(e.x, e.y, e.id)
|
||||
elseif (self.game.game_over or self.game.completed) and (e.input == "menu_decide" or e.input == "menu_back" or e.input == "rotate_right") and self.game.game_over_frames > 50 then
|
||||
SCENE = TitleScene()
|
||||
@@ -171,7 +173,7 @@ end
|
||||
|
||||
function GameScene:onInputRelease(e)
|
||||
if e.type == "mouse" or (e.type == "touch" and not VCTRL.release(e.id)) then
|
||||
BUTTON.release(buttonList, e.x, e.y, e.id)
|
||||
if self.game.input_playback then BUTTON.release(buttonList, e.x, e.y, e.id) end
|
||||
menuKey:release(e.x, e.y, e.id)
|
||||
elseif e.input and string.sub(e.input, 1, 5) ~= "menu_" then
|
||||
self.inputs[e.input] = false
|
||||
|
||||
Reference in New Issue
Block a user