diff --git a/config.lua b/config.lua index 4401b07..9f8a7c0 100644 --- a/config.lua +++ b/config.lua @@ -32,6 +32,7 @@ local function add_setting(category, name, default, options) end add_setting("Gameplay", "game_resolution_scale", 1, { min = 1, max = 10, step = 1 }) +add_setting("UI", "gui_scale", 1, { min = 0.5, max = 2, step = 0.1 }) add_setting("UI", "area_based_gui_scale", false) add_setting("UI", "background_preview", true) add_setting("UI", "background_preview_has_text", false) diff --git a/ui/init.lua b/ui/init.lua index 83c2e64..f64fb35 100644 --- a/ui/init.lua +++ b/ui/init.lua @@ -9,7 +9,6 @@ local ui = {} local keyboard_navigation = require("ui.keyboard_navigation") local current_screen local transform = love.math.newTransform() -local gui_scale = 1 ---set gui scale ---@param scale number @@ -38,10 +37,10 @@ local function calculate_layout() transform:translate(game_handler.get_game_position()) end local width, height = ui.get_dimensions() - local scale = gui_scale + local scale = config.get("gui_scale") if config.get("area_based_gui_scale") then -- 1080p as reference for user setting in this scale mode - scale = gui_scale / math.max(1920 / width, 1080 / height) + scale = scale / math.max(1920 / width, 1080 / height) end ui.set_scale(scale) local res_width, res_height = current_screen:calculate_layout(width, height)