Skip to content

Commit

Permalink
Harmonize options widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
Athozus committed Apr 6, 2024
1 parent c6d8543 commit fc7b438
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ui/about.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function mail.show_about(name)
box[0,2.6;3,0.45;]] .. mail.get_color("highlighted") .. [[]
label[0.2,2.6;]] .. S("Note") .. [[]
textarea[0.5,3.1;4,5.5;;;]] ..
textarea[0.5,3.15;4,5.5;;;]] ..
S("Communication using this system is NOT guaranteed to be private!") .. " " ..
S("Admins are able to view the messages of any player.") .. [[]
Expand Down
23 changes: 14 additions & 9 deletions ui/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function mail.show_settings(name)
]]

local x = 3.5
local y = -0.6
local y = -0.7
-- put settings in order
local ordered_settings = {}
for setting, data in pairs(mail.settings) do
Expand Down Expand Up @@ -86,7 +86,7 @@ function mail.show_settings(name)
end

elseif data.type == "index" then
y = y + 0.55
y = y + 0.2
local formatted_dataset = table.copy(data.dataset)
if data.format then
for i, d in ipairs(formatted_dataset) do
Expand All @@ -107,22 +107,27 @@ function mail.show_settings(name)
tooltip[]] .. setting .. ";" .. data.tooltip .. [[]
]]
end
y = y + 0.2
elseif data.type == "list" then
y = y + 0.5
y = y + 0.3
formspec = formspec .. [[
tablecolumns[color;text]
table[]] .. x-0.0125 .. "," .. y .. ";3.8125,2.5;" .. setting .. ";" ..
mail.get_color("header") .. "," .. data.label .. ",," ..
table.concat(field_default, ",,") .. "]"

y = y + 3.1
formspec = formspec .. [[
field[]] .. x+0.275 .. "," .. y .. ";2.975,0.5;field_" .. setting .. [[;;]
button[]] .. x+2.75 .. "," .. y-0.325 .. ";0.75,0.5;add_" .. setting .. [[;+]
button[]] .. x+3.25 .. "," .. y-0.325 .. ";0.75,0.5;remove_" .. setting .. [[;-]
]]

if data.tooltip then
formspec = formspec .. "tooltip[field_" .. setting .. ";" .. data.tooltip .. "]"
end
y = y + 0.5
formspec = formspec .. [[
tablecolumns[color;text]
table[]] .. x-0.0125 .. "," .. y .. ";3.8125,2.5;" .. setting .. ";" ..
mail.get_color("header") .. "," .. data.label .. ",," ..
table.concat(field_default, ",,") .. "]"

y = y - 0.4
end
end
formspec = formspec .. mail.theme
Expand Down

0 comments on commit fc7b438

Please sign in to comment.