aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/test
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2020-01-22 19:09:11 +0100
committerGitHub <noreply@github.com>2020-01-22 19:09:11 +0100
commit1892ff3c0db23ccdf7b0f6dc83cb1bdf4579b4ec (patch)
treec49c16a69e9c555141960b4bca22a88df9b17a61 /games/minimal/mods/test
parentfab3f5f7c8ce0cbfc27e509f065e3f4cfe28c514 (diff)
downloadminetest-1892ff3c0db23ccdf7b0f6dc83cb1bdf4579b4ec.tar.gz
minetest-1892ff3c0db23ccdf7b0f6dc83cb1bdf4579b4ec.tar.bz2
minetest-1892ff3c0db23ccdf7b0f6dc83cb1bdf4579b4ec.zip
StaticText/EnrichedString: Styling support (#9187)
* StaticText/EnrichedString: Styling support * Fix tooltip fg/bgcolor * Fix default color for substr(), add unittests
Diffstat (limited to 'games/minimal/mods/test')
-rw-r--r--games/minimal/mods/test/formspec.lua16
1 files changed, 10 insertions, 6 deletions
diff --git a/games/minimal/mods/test/formspec.lua b/games/minimal/mods/test/formspec.lua
index 64b9ec0d5..bac82c965 100644
--- a/games/minimal/mods/test/formspec.lua
+++ b/games/minimal/mods/test/formspec.lua
@@ -1,3 +1,5 @@
+local color = minetest.colorize
+
local clip_fs = [[
style_type[label;noclip=%c]
style_type[button;noclip=%c]
@@ -31,8 +33,8 @@ local style_fs = [[
bgcolor_pressed=purple]
button[0,0;2.5,0.8;one_btn1;Button]
- style[one_btn2;border=false;textcolor=cyan]
- button[0,1.05;2.5,0.8;one_btn2;Text Button]
+ style[one_btn2;border=false;textcolor=cyan] ]]..
+ "button[0,1.05;2.5,0.8;one_btn2;Text " .. color("#FF0", "Yellow") .. [[]
style[one_btn3;bgimg=bubble.png;bgimg_hovered=default_apple.png;
bgimg_pressed=heart.png]
@@ -144,16 +146,18 @@ local pages = {
list[current_player;main;6,8;3,2;1]
button[9,0;2.5,1;name;]
button[9,1;2.5,1;name;]
- button[9,2;2.5,1;name;]
- label[9,0;This is a label.\nLine\nLine\nLine\nEnd]
- button[9,3;1,1;name;]
+ button[9,2;2.5,1;name;] ]]..
+ "label[9,0.5;This is a label.\nLine\nLine\nLine\nEnd]"..
+ [[button[9,3;1,1;name;]
vertlabel[9,4;VERT]
label[10,3;HORIZ]
tabheader[6.5,0;6,0.65;name;Tab 1,Tab 2,Tab 3,Secrets;1;false;false]
]],
"size[12,12]real_coordinates[true]" ..
- "label[0.375,0.375;Styled]" ..
+ ("label[0.375,0.375;Styled - %s %s]"):format(
+ color("#F00", "red text"),
+ color("#77FF00CC", "green text")) ..
"label[6.375,0.375;Unstyled]" ..
"box[0,0.75;12,0.1;#999]" ..
"box[6,0.85;0.1,11.15;#999]" ..