mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Renaming and moving some modules
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
local ExitScene = SCENE:extend()
|
||||
require 'load.save'
|
||||
require 'settings'
|
||||
|
||||
ExitScene.title = "Exit Game"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local FullscreenScene = SCENE:extend()
|
||||
require 'load.save'
|
||||
require 'settings'
|
||||
|
||||
FullscreenScene.title = "Fullscreen"
|
||||
|
||||
@@ -7,9 +7,8 @@ function FullscreenScene:new()
|
||||
end
|
||||
|
||||
function FullscreenScene:update()
|
||||
config["fullscreen"] = not config["fullscreen"]
|
||||
saveConfig()
|
||||
love.window.setFullscreen(config["fullscreen"])
|
||||
SETTINGS["fullscreen"] = not SETTINGS["fullscreen"]
|
||||
love.window.setFullscreen(SETTINGS["fullscreen"])
|
||||
SCENE = TitleScene()
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ local GameScene = SCENE:extend()
|
||||
|
||||
GameScene.title = "Game"
|
||||
local tas = false
|
||||
require 'load.save'
|
||||
require 'settings'
|
||||
|
||||
function GameScene:new(player_name, replay_file, replay_grade)
|
||||
game_mode = require 'game.gamemode'
|
||||
|
||||
@@ -50,7 +50,7 @@ function ConfigScene:onInputPress(e)
|
||||
self:changeOption(-1)
|
||||
elseif e.input == "down" or e.scancode == "down" then
|
||||
self:changeOption(1)
|
||||
elseif config.input and (
|
||||
elseif SETTINGS.input and (
|
||||
e.input == "menu_back" or e.input == "rotate_right" or e.scancode == "backspace" or e.scancode == "delete"
|
||||
) then
|
||||
SCENE = TitleScene()
|
||||
|
||||
@@ -2,7 +2,7 @@ local KeyConfigScene = SCENE:extend()
|
||||
|
||||
KeyConfigScene.title = "Key Config"
|
||||
|
||||
require 'load.save'
|
||||
require 'settings'
|
||||
|
||||
local minos = {'R_d', 'O_d', 'Y_d', 'G_d', 'C_d', 'B_d', 'M_d'}
|
||||
|
||||
@@ -59,7 +59,7 @@ function KeyConfigScene:render()
|
||||
end
|
||||
end
|
||||
if self.input_state > #configurable_inputs then
|
||||
drawText("Press enter to confirm, delete/backspace to retry" .. (config.input and ", escape to cancel" or ""),0,0,1000)
|
||||
drawText("Press enter to confirm, delete/backspace to retry" .. (SETTINGS.input and ", escape to cancel" or ""),0,0,1000)
|
||||
else
|
||||
drawText("Press key input for " .. input_names[configurable_inputs[self.input_state]] .. ", tab to skip, escape to cancel",0,0,1000)
|
||||
drawText("Function keys (F1, F2, etc.), escape, and tab can't be changed", 0, 20,1000)
|
||||
@@ -73,10 +73,9 @@ function KeyConfigScene:onInputPress(e)
|
||||
SCENE = InputConfigScene()
|
||||
elseif self.input_state > #configurable_inputs then
|
||||
if e.scancode == "return" then
|
||||
config.input.keys = self.new_input
|
||||
saveConfig()
|
||||
SCENE = config.firstTime and TitleScene() or InputConfigScene()
|
||||
config.firstTime = false
|
||||
SETTINGS.input.keys = self.new_input
|
||||
SCENE = SETTINGS.firstTime and TitleScene() or InputConfigScene()
|
||||
SETTINGS.firstTime = false
|
||||
elseif e.scancode == "delete" or e.scancode == "backspace" then
|
||||
-- retry
|
||||
self.input_state = 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local MusicToggleScene = SCENE:extend()
|
||||
require 'load.save'
|
||||
require 'settings'
|
||||
|
||||
MusicToggleScene.title = "Play music during game:"
|
||||
|
||||
@@ -7,8 +7,7 @@ function MusicToggleScene:new()
|
||||
end
|
||||
|
||||
function MusicToggleScene:update()
|
||||
config["music"] = not config["music"]
|
||||
saveConfig()
|
||||
SETTINGS["music"] = not SETTINGS["music"]
|
||||
SCENE = TitleScene()
|
||||
end
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
local NameEntryScene = SCENE:extend()
|
||||
local Grid = require 'game.grid'
|
||||
local bitser = require 'libs.bitser'
|
||||
require 'load.save'
|
||||
require 'settings'
|
||||
|
||||
NameEntryScene.title = "Game Start"
|
||||
|
||||
@@ -26,8 +26,8 @@ function NameEntryScene:new()
|
||||
"10k", "9k", "8k", "7k", "6k", "5k", "4k", "3k", "2k", "1k",
|
||||
"1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D"
|
||||
}
|
||||
if config['last_entry'] ~= nil then
|
||||
self.name_entry = {config['last_entry']:sub(1,1),config['last_entry']:sub(2,2),config['last_entry']:sub(3,3)}
|
||||
if SETTINGS['last_entry'] ~= nil then
|
||||
self.name_entry = {SETTINGS['last_entry']:sub(1,1),SETTINGS['last_entry']:sub(2,2),SETTINGS['last_entry']:sub(3,3)}
|
||||
self.entry_pos = 3
|
||||
end
|
||||
if love.filesystem.getInfo(HIscoreFILE) then
|
||||
@@ -115,8 +115,7 @@ function NameEntryScene:onInputPress(e)
|
||||
self.delete_confirm = false
|
||||
self.delete_input_count = 0
|
||||
if self.entry_pos == 4 then
|
||||
config['last_entry'] = name:upper()
|
||||
saveConfig()
|
||||
SETTINGS['last_entry'] = name:upper()
|
||||
SCENE = GameScene(name:lower())
|
||||
else
|
||||
if self.entry_pos == 3 then
|
||||
|
||||
@@ -2,7 +2,7 @@ local StickConfigScene = SCENE:extend()
|
||||
|
||||
StickConfigScene.title = "Controller Config"
|
||||
|
||||
require 'load.save'
|
||||
require 'settings'
|
||||
|
||||
local minos = {'R_d', 'O_d', 'Y_d', 'G_d', 'C_d', 'B_d', 'M_d'}
|
||||
|
||||
@@ -59,7 +59,7 @@ function StickConfigScene:render()
|
||||
end
|
||||
end
|
||||
if self.input_state > #configurable_inputs then
|
||||
drawText("Press enter to confirm, delete/backspace to retry" .. (config.input and ", escape to cancel" or ""), 0, 0, 1000)
|
||||
drawText("Press enter to confirm, delete/backspace to retry" .. (SETTINGS.input and ", escape to cancel" or ""), 0, 0, 1000)
|
||||
else
|
||||
drawText("Press joystick input for " .. input_names[configurable_inputs[self.input_state]] .. ", tab to skip, escape to cancel", 0, 0, 1000)
|
||||
end
|
||||
@@ -81,10 +81,9 @@ function StickConfigScene:onInputPress(e)
|
||||
elseif self.input_state > #configurable_inputs then
|
||||
if e.scancode == "return" then
|
||||
-- save new input, then load next scene
|
||||
local had_config = config.input ~= nil
|
||||
if not config.input then config.input = {} end
|
||||
config.input.joysticks = self.new_input
|
||||
saveConfig()
|
||||
local had_config = SETTINGS.input ~= nil
|
||||
if not SETTINGS.input then SETTINGS.input = {} end
|
||||
SETTINGS.input.joysticks = self.new_input
|
||||
SCENE = had_config and InputConfigScene() or TitleScene()
|
||||
elseif e.scancode == "delete" or e.scancode == "backspace" then
|
||||
-- retry
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local TitleScene = SCENE:extend()
|
||||
require 'load.save'
|
||||
require 'settings'
|
||||
require 'funcs'
|
||||
|
||||
TitleScene.title = "Title"
|
||||
@@ -16,7 +16,7 @@ local main_menu_screens = {
|
||||
}
|
||||
|
||||
function TitleScene:new()
|
||||
if sounds['bgm_firsthalf']:isPlaying() or sounds['bgm_secondhalf']:isPlaying() or not config["music"] then
|
||||
if SOUNDS['bgm_firsthalf']:isPlaying() or SOUNDS['bgm_secondhalf']:isPlaying() or not SETTINGS["music"] then
|
||||
love.audio.stop()
|
||||
end
|
||||
self.main_menu_state = 1
|
||||
@@ -68,7 +68,7 @@ function TitleScene:render()
|
||||
drawText("Based on Cambridge - t-sp.in/cambridge", 20, 420, 1000)
|
||||
drawText("Music for Tromi by Jerry Martin, all rights reserved - jerrymartinmusic.com", 20, 435, 1000)
|
||||
drawText("Game backgrounds by Pixabay users Joe_hackney, yokim, Favorisxp, Any_Ann, VisualSkyFX ", 20, 450, 1000)
|
||||
if config["music"] == true then
|
||||
if SETTINGS["music"] == true then
|
||||
drawText("On", 230, 320, 1000)
|
||||
else
|
||||
drawText("Off", 230, 320, 1000)
|
||||
|
||||
@@ -2,7 +2,7 @@ local TrainingScene = SCENE:extend()
|
||||
|
||||
TrainingScene.title = "Max Gravity Training"
|
||||
|
||||
require 'load.save'
|
||||
require 'settings'
|
||||
|
||||
function TrainingScene:new()
|
||||
game_mode = require 'game.gamemode'
|
||||
|
||||
Reference in New Issue
Block a user