mirror of
https://github.com/mt-mods/mail.git
synced 2025-03-15 06:01:25 +00:00
Harmonize options widgets
This commit is contained in:
parent
c6d8543c85
commit
fc7b438de3
2 changed files with 18 additions and 13 deletions
|
@ -63,7 +63,7 @@ function mail.show_about(name)
|
||||||
|
|
||||||
box[0,2.6;3,0.45;]] .. mail.get_color("highlighted") .. [[]
|
box[0,2.6;3,0.45;]] .. mail.get_color("highlighted") .. [[]
|
||||||
label[0.2,2.6;]] .. S("Note") .. [[]
|
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("Communication using this system is NOT guaranteed to be private!") .. " " ..
|
||||||
S("Admins are able to view the messages of any player.") .. [[]
|
S("Admins are able to view the messages of any player.") .. [[]
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ function mail.show_settings(name)
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local x = 3.5
|
local x = 3.5
|
||||||
local y = -0.6
|
local y = -0.7
|
||||||
-- put settings in order
|
-- put settings in order
|
||||||
local ordered_settings = {}
|
local ordered_settings = {}
|
||||||
for setting, data in pairs(mail.settings) do
|
for setting, data in pairs(mail.settings) do
|
||||||
|
@ -86,7 +86,7 @@ function mail.show_settings(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif data.type == "index" then
|
elseif data.type == "index" then
|
||||||
y = y + 0.55
|
y = y + 0.2
|
||||||
local formatted_dataset = table.copy(data.dataset)
|
local formatted_dataset = table.copy(data.dataset)
|
||||||
if data.format then
|
if data.format then
|
||||||
for i, d in ipairs(formatted_dataset) do
|
for i, d in ipairs(formatted_dataset) do
|
||||||
|
@ -107,22 +107,27 @@ function mail.show_settings(name)
|
||||||
tooltip[]] .. setting .. ";" .. data.tooltip .. [[]
|
tooltip[]] .. setting .. ";" .. data.tooltip .. [[]
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
y = y + 0.2
|
||||||
elseif data.type == "list" then
|
elseif data.type == "list" then
|
||||||
y = y + 0.5
|
y = y + 0.3
|
||||||
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 .. [[
|
formspec = formspec .. [[
|
||||||
tablecolumns[color;text]
|
tablecolumns[color;text]
|
||||||
table[]] .. x-0.0125 .. "," .. y .. ";3.8125,2.5;" .. setting .. ";" ..
|
table[]] .. x-0.0125 .. "," .. y .. ";3.8125,2.5;" .. setting .. ";" ..
|
||||||
mail.get_color("header") .. "," .. data.label .. ",," ..
|
mail.get_color("header") .. "," .. data.label .. ",," ..
|
||||||
table.concat(field_default, ",,") .. "]"
|
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.4
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
formspec = formspec .. mail.theme
|
formspec = formspec .. mail.theme
|
||||||
|
|
Loading…
Add table
Reference in a new issue