UI tweaks
This commit is contained in:
parent
383e2e55f7
commit
99d9377b8f
15
init.lua
15
init.lua
|
@ -1744,7 +1744,7 @@ end
|
||||||
|
|
||||||
local function add_subtitle(fs, title, x, y, ctn_len, font_size)
|
local function add_subtitle(fs, title, x, y, ctn_len, font_size)
|
||||||
fs(fmt("style_type[label;font=bold;font_size=%s]", font_size), fmt("label", x, y, title),
|
fs(fmt("style_type[label;font=bold;font_size=%s]", font_size), fmt("label", x, y, title),
|
||||||
"style_type[label;font=normal;font_size=+0]", fmt("box", x, y + 0.3, ctn_len, 0.05, "#666"))
|
"style_type[label;font=normal;font_size=+0]", fmt("box", x, y + 0.3, ctn_len, 0.045, "#bababa50"))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_award_list(fs, ctn_len, yextra, award_list, awards_unlocked, award_list_nb)
|
local function get_award_list(fs, ctn_len, yextra, award_list, awards_unlocked, award_list_nb)
|
||||||
|
@ -1918,21 +1918,24 @@ local function make_fs(player, data)
|
||||||
shift = #tabs - 3
|
shift = #tabs - 3
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local selected = i == data.current_tab
|
||||||
|
|
||||||
fs(fmt([[style_type[image_button;fgimg=%s;fgimg_hovered=%s;fgimg_middle=14;noclip=true;
|
fs(fmt([[style_type[image_button;fgimg=%s;fgimg_hovered=%s;fgimg_middle=14;noclip=true;
|
||||||
font_size=+0;content_offset=0;sound=i3_tab]
|
font_size=+0;textcolor=%s;content_offset=0;sound=i3_tab] ]],
|
||||||
]], (i == data.current_tab) and
|
selected and (btm and PNG.tab_hover or PNG.tab_hover_top) or (btm and PNG.tab or PNG.tab_top),
|
||||||
(btm and PNG.tab_hover or PNG.tab_hover_top) or (btm and PNG.tab or PNG.tab_top),
|
btm and PNG.tab_hover or PNG.tab_hover_top,
|
||||||
btm and PNG.tab_hover or PNG.tab_hover_top))
|
selected and "#fff" or "#ddd"))
|
||||||
|
|
||||||
local X = (data.xoffset / 2) + (c * (tab_len + 0.1)) - ((tab_len + 0.05) * (shift / 2))
|
local X = (data.xoffset / 2) + (c * (tab_len + 0.1)) - ((tab_len + 0.05) * (shift / 2))
|
||||||
local Y = btm and full_height or -tab_hgh
|
local Y = btm and full_height or -tab_hgh
|
||||||
|
|
||||||
|
fs("style_type[image_button:hovered;textcolor=#fff]")
|
||||||
fs(fmt("image_button", X, Y, tab_len, tab_hgh, "", fmt("tab_%s", def.name), ESC(def.description)))
|
fs(fmt("image_button", X, Y, tab_len, tab_hgh, "", fmt("tab_%s", def.name), ESC(def.description)))
|
||||||
|
|
||||||
if def.image and def.image ~= "" then
|
if def.image and def.image ~= "" then
|
||||||
fs("style_type[image;noclip=true]")
|
fs("style_type[image;noclip=true]")
|
||||||
local desc = translate(data.lang_code, def.description)
|
local desc = translate(data.lang_code, def.description)
|
||||||
fs(fmt("image", X + (tab_len / 2) - ((#desc * 0.1) / 2) - 0.6,
|
fs(fmt("image", X + (tab_len / 2) - ((#desc * 0.1) / 2) - 0.55,
|
||||||
Y + 0.05, 0.35, 0.35, fmt("%s^\\[resize:16x16", def.image)))
|
Y + 0.05, 0.35, 0.35, fmt("%s^\\[resize:16x16", def.image)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
i3.new_tab {
|
i3.new_tab {
|
||||||
name = "test1",
|
name = "test1",
|
||||||
description = "Test 1",
|
description = "Test 1 Test 1",
|
||||||
image = "i3_heart.png",
|
image = "i3_heart.png",
|
||||||
|
|
||||||
formspec = function(player, data, fs)
|
formspec = function(player, data, fs)
|
||||||
|
|
Ŝarĝante…
Reference in New Issue