mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Apply V2.2 patch
This commit is contained in:
@@ -164,7 +164,6 @@ function GameMode:readHiScores()
|
||||
end
|
||||
|
||||
function GameMode:updateGradeHistory()
|
||||
promo_string = ""
|
||||
if self.grade_score >= self.promo_table[self.grade] then
|
||||
if (self.grade == 28 and self.grade_history[2] < 4) or self.grade < 28 then self.grade_history[2] = self.grade_history[2] + 1 end
|
||||
self.point_flash = 60
|
||||
@@ -201,14 +200,13 @@ function GameMode:updateGradeHistory()
|
||||
self.grade_history[2] = 2
|
||||
end
|
||||
self.grade_history[4] = self.grade_history[4] + 1
|
||||
return promo_string
|
||||
end
|
||||
|
||||
function GameMode:updateHiScores()
|
||||
self:readHiScores()
|
||||
hiscore_pos = {0,0}
|
||||
i = 2
|
||||
score_position = -1
|
||||
local hiscore_pos = {0,0}
|
||||
local i = 2
|
||||
local score_position = -1
|
||||
while i <= 10 do
|
||||
if score_position == -1 and self.hi_scores[i] < self.grade_score then
|
||||
score_position = i
|
||||
@@ -556,7 +554,6 @@ function GameMode:stackQualityCheck()
|
||||
end
|
||||
|
||||
function GameMode:doStackQuality()
|
||||
local total_speed = 0
|
||||
local contiguous_holes = self:stackQualityCheck()
|
||||
local total_speed = 0
|
||||
if contiguous_holes > self.last_holes then
|
||||
@@ -708,7 +705,9 @@ function GameMode:onGameOver()
|
||||
if not self.input_playback and not self.training and not PENTO_MODE then
|
||||
if not self.did_grades then
|
||||
self.grade_score = self.grade_score + self.speed_level
|
||||
promo_string = self:updateGradeHistory()
|
||||
if #self.speed_table >= 49 then
|
||||
self:updateGradeHistory()
|
||||
end
|
||||
hiscore_pos = self:updateHiScores()
|
||||
bitser.dumpLoveFile(SAVE_DIR..self.player_name.."_grade_history.sav", self.grade_history)
|
||||
self.did_grades = true
|
||||
@@ -728,7 +727,7 @@ function GameMode:drawEndScoringInfo()
|
||||
if not PENTO_MODE then
|
||||
drawText("Best scores:", 247, 220, 1000, "left")
|
||||
|
||||
i = 2
|
||||
local i = 2
|
||||
while i <= 10 do
|
||||
if i == hiscore_pos[1] or i == hiscore_pos[2] then
|
||||
drawText(self.hi_scores[i-1]..' - '..self.hi_scores[i], 255, 220+(i*10), 1000, "left", {0,1,0,1})
|
||||
|
||||
11
scene.lua
11
scene.lua
@@ -7,17 +7,15 @@ function SCENE:update() end
|
||||
function SCENE:render() end
|
||||
|
||||
-- e in 3 below functions will contain:
|
||||
-- key - input, key, scancode
|
||||
-- key - input, key, scancode
|
||||
-- joystick - input, button, name
|
||||
-- touch - x, y, dx, dy, id
|
||||
-- virtual - key
|
||||
-- virtual - input
|
||||
-- touch - x, y, dx, dy, id
|
||||
|
||||
function SCENE:onInputPress(e) end
|
||||
function SCENE:onInputMove(e) end
|
||||
function SCENE:onInputRelease(e) end
|
||||
|
||||
ExitScene = require "scene.exit"
|
||||
|
||||
GameScene = require "scene.game"
|
||||
NameEntryScene = require "scene.name_entry"
|
||||
|
||||
@@ -31,4 +29,7 @@ TrainingScene = require "scene.training"
|
||||
|
||||
FullscreenScene = require "scene.fullscreen"
|
||||
MusicToggleScene = require "scene.music_toggle"
|
||||
LinesToggleScene = require "scene.lines_toggle"
|
||||
|
||||
ExitScene = require "scene.exit"
|
||||
TitleScene = require "scene.title"
|
||||
21
scene/lines_toggle.lua
Normal file
21
scene/lines_toggle.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
local LinesToggleScene = SCENE:extend()
|
||||
LinesToggleScene.title = "Show lines during game:"
|
||||
|
||||
function LinesToggleScene:new()
|
||||
end
|
||||
|
||||
function LinesToggleScene:update()
|
||||
SETTINGS["lines"] = not SETTINGS["lines"]
|
||||
SCENE = TitleScene()
|
||||
end
|
||||
|
||||
function LinesToggleScene:render()
|
||||
end
|
||||
|
||||
function LinesToggleScene:changeOption(rel)
|
||||
end
|
||||
|
||||
function LinesToggleScene:onInputPress(e)
|
||||
end
|
||||
|
||||
return LinesToggleScene
|
||||
@@ -1,8 +1,6 @@
|
||||
local ReplaySelectScene = SCENE:extend()
|
||||
ReplaySelectScene.title = "Replay"
|
||||
|
||||
require 'funcs'
|
||||
|
||||
function ReplaySelectScene:new()
|
||||
self:initList()
|
||||
PENTO_MODE = false
|
||||
@@ -38,6 +36,9 @@ function ReplaySelectScene:initList()
|
||||
self.dialog = false
|
||||
self.dialog_select = 1
|
||||
self.replay_select = 1
|
||||
self.direction = nil
|
||||
self.repeat_limit = 10
|
||||
self.repeat_counter = self.repeat_limit-1
|
||||
end
|
||||
|
||||
function ReplaySelectScene:render()
|
||||
@@ -74,6 +75,22 @@ function ReplaySelectScene:render()
|
||||
end
|
||||
end
|
||||
|
||||
function ReplaySelectScene:update()
|
||||
if self.direction == "up" then
|
||||
if self.repeat_counter >= self.repeat_limit then
|
||||
self:changeOption(-1)
|
||||
self.repeat_counter = 0
|
||||
end
|
||||
self.repeat_counter = self.repeat_counter + 1
|
||||
elseif self.direction == "down" then
|
||||
if self.repeat_counter >= self.repeat_limit then
|
||||
self:changeOption(1)
|
||||
self.repeat_counter = 0
|
||||
end
|
||||
self.repeat_counter = self.repeat_counter + 1
|
||||
end
|
||||
end
|
||||
|
||||
function ReplaySelectScene:changeOption(rel)
|
||||
local len = #self.replays
|
||||
self.replay_select = self.replay_select + rel
|
||||
@@ -106,21 +123,6 @@ function ReplaySelectScene:onInputPress(e)
|
||||
if e.input == "menu_decide" or e.input == "rotate_left" or e.scancode == "return" then
|
||||
if self.replays[1] == nil then
|
||||
SCENE = TitleScene()
|
||||
--if not self.dialog then
|
||||
-- self.dialog_select = 1
|
||||
-- self.dialog = true
|
||||
--elseif self.dialog_select == 2 then
|
||||
-- love.filesystem.remove(selected_replay)
|
||||
-- self:initList()
|
||||
--elseif self.dialog_select == 1 then
|
||||
-- line_components = {}
|
||||
-- for str in string.gmatch(selected_replay_text, "([^".."-".."]+)") do
|
||||
-- table.insert(line_components, str)
|
||||
-- end
|
||||
-- player_name = line_components[1]
|
||||
-- player_grade = string.gsub(line_components[2], " ", "")
|
||||
-- scene = GameScene(player_name, selected_replay, player_grade)
|
||||
--end
|
||||
else
|
||||
line_components = {}
|
||||
for str in string.gmatch(selected_replay_text, "([^".."-".."]+)") do
|
||||
@@ -131,17 +133,20 @@ function ReplaySelectScene:onInputPress(e)
|
||||
SCENE = GameScene(player_name, selected_replay, player_grade)
|
||||
end
|
||||
elseif e.input == "up" or e.scancode == "up" then
|
||||
if self.replays[1] == nil then SCENE = TitleScene() end
|
||||
if not self.dialog then self:changeOption(-1)
|
||||
else self:changeDialog(-1) end
|
||||
if self.replays[1] == nil then scene = TitleScene() end
|
||||
self.direction = 'up'
|
||||
elseif e.input == "down" or e.scancode == "down" then
|
||||
if self.replays[1] == nil then SCENE = TitleScene() end
|
||||
if not self.dialog then self:changeOption(1)
|
||||
else self:changeDialog(1) end
|
||||
if self.replays[1] == nil then scene = TitleScene() end
|
||||
self.direction = 'down'
|
||||
elseif e.input == "menu_back" or e.input == "rotate_right" or e.scancode == "backspace" or e.scancode == "delete" then
|
||||
if self.replays[1] == nil then SCENE = TitleScene() end
|
||||
if not self.dialog then SCENE = TitleScene()
|
||||
else self.dialog = false end
|
||||
scene = TitleScene()
|
||||
end
|
||||
end
|
||||
|
||||
function ReplaySelectScene:onInputRelease(e)
|
||||
if e.input == "up" or e.scancode == "up" or e.input == "down" or e.scancode == "down" then
|
||||
self.direction = nil
|
||||
self.repeat_counter = self.repeat_limit-1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
local TitleScene = SCENE:extend()
|
||||
require 'settings'
|
||||
require 'funcs'
|
||||
|
||||
TitleScene.title = "Title"
|
||||
TitleScene.restart_message = false
|
||||
@@ -12,6 +10,7 @@ local main_menu_screens = {
|
||||
InputConfigScene,
|
||||
FullscreenScene,
|
||||
MusicToggleScene,
|
||||
LinesToggleScene,
|
||||
ExitScene,
|
||||
}
|
||||
|
||||
@@ -56,7 +55,7 @@ end
|
||||
function TitleScene:render()
|
||||
MainBackground()
|
||||
love.graphics.setColor(0,0,0,0.7)
|
||||
love.graphics.rectangle("fill", 14, 174, 260, 200, 10, 10)
|
||||
love.graphics.rectangle("fill", 14, 174, 260, 220, 10, 10)
|
||||
love.graphics.setColor(0,0,0,0.7)
|
||||
love.graphics.rectangle("fill", 14, 400, 605, 75, 10, 10)
|
||||
love.graphics.setColor(0.4, 1, 1, 0.5)
|
||||
@@ -73,6 +72,11 @@ function TitleScene:render()
|
||||
else
|
||||
drawText("Off", 230, 320, 1000)
|
||||
end
|
||||
if SETTINGS["lines"] == true then
|
||||
drawText("On", 230, 340, 1000)
|
||||
else
|
||||
drawText("Off", 230, 340, 1000)
|
||||
end
|
||||
for i, screen in pairs(main_menu_screens) do
|
||||
drawText(screen.title, 40, 200 + 20 * i, 1200, "left")
|
||||
end
|
||||
|
||||
@@ -7,6 +7,7 @@ local _defaultSettings = {
|
||||
|
||||
fullscreen = false,
|
||||
music = true,
|
||||
lines = true,
|
||||
|
||||
---@class input
|
||||
---@field keys table <string, string>
|
||||
@@ -22,8 +23,7 @@ SETTINGS = setmetatable(
|
||||
{},
|
||||
{
|
||||
__index = function(_, k)
|
||||
if _settings[k] == nil then _settings[k] = _defaultSettings[k] end
|
||||
return _settings[k]
|
||||
return _settings[k] == nil and _defaultSettings[k] or _settings[k]
|
||||
end,
|
||||
__newindex = function(_, k, v)
|
||||
_settings[k] = v
|
||||
|
||||
Reference in New Issue
Block a user