mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 15:59:02 -06:00
Tuning scene
This commit is contained in:
parent
605add7e94
commit
c343014d6f
57
scene/tuning.lua
Normal file
57
scene/tuning.lua
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
local TuningScene = Scene:extend()
|
||||||
|
|
||||||
|
TuningScene.title = "Tuning Settings"
|
||||||
|
|
||||||
|
require 'load.save'
|
||||||
|
require 'libs.simple-slider'
|
||||||
|
|
||||||
|
function TuningScene:new()
|
||||||
|
DiscordRPC:update({
|
||||||
|
details = "In menus",
|
||||||
|
state = "Changing tuning settings",
|
||||||
|
})
|
||||||
|
|
||||||
|
self.dasSlider = newSlider(290, 200, 400, config.das, 0, 20, function(v) config.das = math.floor(v) end, {width=20})
|
||||||
|
self.arrSlider = newSlider(290, 300, 400, config.arr, 0, 6, function(v) config.arr = math.floor(v) end, {width=20})
|
||||||
|
end
|
||||||
|
|
||||||
|
function TuningScene:update()
|
||||||
|
self.dasSlider:update()
|
||||||
|
self.arrSlider:update()
|
||||||
|
end
|
||||||
|
|
||||||
|
function TuningScene:render()
|
||||||
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
|
love.graphics.draw(
|
||||||
|
backgrounds["game_config"],
|
||||||
|
0, 0, 0,
|
||||||
|
0.5, 0.5
|
||||||
|
)
|
||||||
|
|
||||||
|
love.graphics.setFont(font_3x5_4)
|
||||||
|
love.graphics.print("TUNING SETTINGS", 80, 40)
|
||||||
|
|
||||||
|
love.graphics.setFont(font_3x5_2)
|
||||||
|
love.graphics.print("These settings will not apply to every gamemode!", 80, 90)
|
||||||
|
|
||||||
|
love.graphics.setFont(font_3x5_3)
|
||||||
|
love.graphics.print("Delayed Auto-Shift (DAS): " .. math.floor(self.dasSlider:getValue()) .. "F", 80, 150)
|
||||||
|
love.graphics.print("Auto-Repeat Rate (ARR): " .. math.floor(self.arrSlider:getValue()) .. "F", 80, 250)
|
||||||
|
|
||||||
|
love.graphics.setColor(1, 1, 1, 0.75)
|
||||||
|
self.dasSlider:draw()
|
||||||
|
self.arrSlider:draw()
|
||||||
|
end
|
||||||
|
|
||||||
|
function TuningScene:onInputPress(e)
|
||||||
|
if e.input == "menu_decide" or e.scancode == "return" then
|
||||||
|
playSE("mode_decide")
|
||||||
|
saveConfig()
|
||||||
|
scene = TitleScene()
|
||||||
|
elseif e.input == "menu_back" or e.scancode == "delete" or e.scancode == "backspace" then
|
||||||
|
loadSave()
|
||||||
|
scene = TitleScene()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return TuningScene
|
Loading…
Reference in New Issue
Block a user