Skip to content

Commit

Permalink
add fullscreen setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bauumm committed Feb 5, 2024
1 parent 4d09377 commit 3b0f7a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ add_setting("Audio", "background_preview_sound_volume", 0, {
})
add_setting("General", "preload_all_packs", false)
add_setting("Display", "fps_limit", 200, { min = 30, max = 1001, step = 5 })
add_setting("Display", "fullscreen", "exclusive", {
options = { "exclusive", "borderless", "windowed" },
onchange = function(value)
if love.window and love.window.isOpen() then
love.window.setFullscreen(value ~= "windowed", value == "borderless" and "desktop" or "exclusive")
end
end,
})
add_setting("Gameplay", "official_mode", true, { game_version = { 192, 20, 21, 3 } })
add_setting("Audio", "sound_volume", 1, { game_version = { 192, 20, 21, 3 }, min = 0, max = 1, step = 0.05 })
add_setting("Audio", "music_volume", 1, { game_version = { 192, 20, 21, 3 }, min = 0, max = 1, step = 0.05 })
Expand Down
2 changes: 2 additions & 0 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ local main = async(function()
ui.open_screen("loading")
local game_handler = require("game_handler")
global_config.init()
-- apply fullscreen setting initially
config.get_definitions().fullscreen.onchange(config.get("fullscreen"))

local fps_limit = config.get("fps_limit")
local delta_target = 1 / fps_limit
Expand Down

0 comments on commit 3b0f7a7

Please sign in to comment.