mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Moving VCTRL related calls and adding buttons for name entry screen
This commit is contained in:
@@ -58,7 +58,6 @@ function TitleScene:render()
|
||||
love.graphics.setColor(0,0,0,0.7)
|
||||
love.graphics.rectangle("fill", 14, 174, 260, 210, 10, 10)
|
||||
love.graphics.setColor(0.4, 1, 1, 0.5)
|
||||
love.graphics.rectangle("fill", 14, 40, 260, 120, 10, 10)
|
||||
love.graphics.rectangle("fill", 20, 198 + 20 * self.main_menu_state, 240, 22)
|
||||
--
|
||||
drawBigText('Tromi', 30, 180, 120, "left")
|
||||
@@ -93,7 +92,33 @@ end
|
||||
|
||||
function TitleScene:onInputPress(e)
|
||||
if e.type == "touch" then
|
||||
|
||||
if -- PENTO mode
|
||||
e.x >= 14 and
|
||||
e.y >= 40 and
|
||||
e.x <= 274 and
|
||||
e.y <= 160
|
||||
then
|
||||
if e.x >= 137 then -- Right
|
||||
table.remove(self.code, 8)
|
||||
table.insert(self.code, 1, 1)
|
||||
else -- Left
|
||||
table.remove(self.code, 8)
|
||||
table.insert(self.code, 1, -1)
|
||||
end
|
||||
else -- Select option from menu
|
||||
local selecting = math.floor((e.y - 198) / 20)
|
||||
|
||||
if (e.x >= 20 and e.x <= 260) and
|
||||
(selecting > 0 and selecting <= #main_menu_screens)
|
||||
then
|
||||
if self.main_menu_state ~= selecting then
|
||||
self.main_menu_state = selecting
|
||||
else
|
||||
VCTRL.toggle(true)
|
||||
SCENE = main_menu_screens[selecting]()
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if e.input == "menu_decide" or e.input == "rotate_left" or e.scancode == "return" then
|
||||
SCENE = main_menu_screens[self.main_menu_state]()
|
||||
@@ -112,32 +137,6 @@ function TitleScene:onInputPress(e)
|
||||
end
|
||||
|
||||
function TitleScene:onInputRelease(e)
|
||||
if e.type ~= "touch" then return end
|
||||
local selecting = math.floor((e.y - 198) / 20)
|
||||
if
|
||||
(e.x >= 20 and e.x <= 260) and
|
||||
(selecting > 0 and selecting <= #main_menu_screens)
|
||||
then
|
||||
if self.main_menu_state ~= selecting then
|
||||
self.main_menu_state = selecting
|
||||
else
|
||||
VCTRL.toggle(true)
|
||||
SCENE = main_menu_screens[selecting]()
|
||||
end
|
||||
elseif
|
||||
e.x >= 14 and
|
||||
e.y >= 40 and
|
||||
e.x <= 274 and
|
||||
e.y <= 160
|
||||
then
|
||||
if e.x >= 137 then -- Right
|
||||
table.remove(self.code, 8)
|
||||
table.insert(self.code, 1, 1)
|
||||
else -- Left
|
||||
table.remove(self.code, 8)
|
||||
table.insert(self.code, 1, -1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return TitleScene
|
||||
|
||||
Reference in New Issue
Block a user