Skip to content

Commit

Permalink
Improve settings GUI (#1238)
Browse files Browse the repository at this point in the history
* Improve settings GUI

* Edit `FORMSIZE.y` instead

* What happened to the formatting?

* Fix code editor's auto formatting
  • Loading branch information
a-blob authored Nov 20, 2023
1 parent 2fa7f3c commit 4d8bfa6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mods/apis/ctf_settings/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ctf_settings = {
settings_list = {},
}

local FORMSIZE = {x = 8, y = 5}
local FORMSIZE = {x = 8, y = 9.4}
local SCROLLBAR_W = 0.4

minetest.after(0, function()
Expand Down Expand Up @@ -84,7 +84,7 @@ minetest.register_on_mods_loaded(function()
local form = {
{"box[-0.1,-0.1;%f,%f;#00000055]", FORMSIZE.x - SCROLLBAR_W, FORMSIZE.y},
{"scroll_container[-0.1,0.3;%f,%f;settings_scrollbar;vertical;0.1]",
FORMSIZE.x - SCROLLBAR_W,
FORMSIZE.x - SCROLLBAR_W + 2,
FORMSIZE.y + 0.7
},
ctf_gui.list_to_formspec_str(setting_list),
Expand All @@ -98,7 +98,7 @@ minetest.register_on_mods_loaded(function()
},
}

return sfinv.make_formspec(player, context, ctf_gui.list_to_formspec_str(form), true)
return sfinv.make_formspec(player, context, ctf_gui.list_to_formspec_str(form), false)
end,
on_player_receive_fields = function(self, player, context, fields)
local refresh = false
Expand Down

0 comments on commit 4d8bfa6

Please sign in to comment.