summaryrefslogtreecommitdiff
path: root/games/minimal
diff options
context:
space:
mode:
Diffstat (limited to 'games/minimal')
-rw-r--r--games/minimal/mods/default/init.lua2
-rw-r--r--games/minimal/mods/default/textures/bubble.pngbin273 -> 0 bytes
-rw-r--r--games/minimal/mods/default/textures/crack_anylength.pngbin255 -> 0 bytes
-rw-r--r--games/minimal/mods/default/textures/heart.pngbin248 -> 0 bytes
-rw-r--r--games/minimal/mods/default/textures/player.pngbin157 -> 0 bytes
-rw-r--r--games/minimal/mods/default/textures/player_back.pngbin149 -> 0 bytes
-rw-r--r--games/minimal/mods/default/textures/wieldhand.pngbin212 -> 0 bytes
-rw-r--r--games/minimal/mods/test/formspec.lua84
-rw-r--r--games/minimal/mods/test/textures/test_animation.jpgbin0 -> 4376 bytes
-rw-r--r--games/minimal/mods/test/textures/test_animation.pngbin0 -> 3161 bytes
-rw-r--r--games/minimal/mods/test/textures/test_bg.pngbin0 -> 972 bytes
-rw-r--r--games/minimal/mods/test/textures/test_bg_9slice.pngbin0 -> 1017 bytes
-rw-r--r--games/minimal/mods/test/textures/test_bg_9slice_hovered.pngbin0 -> 1016 bytes
-rw-r--r--games/minimal/mods/test/textures/test_bg_9slice_pressed.pngbin0 -> 1016 bytes
-rw-r--r--games/minimal/mods/test/textures/test_bg_hovered.pngbin0 -> 972 bytes
-rw-r--r--games/minimal/mods/test/textures/test_bg_pressed.pngbin0 -> 971 bytes
16 files changed, 60 insertions, 26 deletions
diff --git a/games/minimal/mods/default/init.lua b/games/minimal/mods/default/init.lua
index 02d195cbc..772cca881 100644
--- a/games/minimal/mods/default/init.lua
+++ b/games/minimal/mods/default/init.lua
@@ -1801,7 +1801,7 @@ function default.spawn_falling_node(p, nodename)
spawn_falling_node(p, nodename)
end
--- Horrible crap to support old code
+-- Horrible stuff to support old code
-- Don't use this and never do what this does, it's completely wrong!
-- (More specifically, the client and the C++ code doesn't get the group)
function default.register_falling_node(nodename, texture)
diff --git a/games/minimal/mods/default/textures/bubble.png b/games/minimal/mods/default/textures/bubble.png
deleted file mode 100644
index 3bca7e11c..000000000
--- a/games/minimal/mods/default/textures/bubble.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/default/textures/crack_anylength.png b/games/minimal/mods/default/textures/crack_anylength.png
deleted file mode 100644
index d9b49f911..000000000
--- a/games/minimal/mods/default/textures/crack_anylength.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/default/textures/heart.png b/games/minimal/mods/default/textures/heart.png
deleted file mode 100644
index c25f43b9a..000000000
--- a/games/minimal/mods/default/textures/heart.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/default/textures/player.png b/games/minimal/mods/default/textures/player.png
deleted file mode 100644
index cf5d83f10..000000000
--- a/games/minimal/mods/default/textures/player.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/default/textures/player_back.png b/games/minimal/mods/default/textures/player_back.png
deleted file mode 100644
index d498674eb..000000000
--- a/games/minimal/mods/default/textures/player_back.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/default/textures/wieldhand.png b/games/minimal/mods/default/textures/wieldhand.png
deleted file mode 100644
index dbed6ad0c..000000000
--- a/games/minimal/mods/default/textures/wieldhand.png
+++ /dev/null
Binary files differ
diff --git a/games/minimal/mods/test/formspec.lua b/games/minimal/mods/test/formspec.lua
index a4d120b41..d2123b4af 100644
--- a/games/minimal/mods/test/formspec.lua
+++ b/games/minimal/mods/test/formspec.lua
@@ -1,15 +1,9 @@
+local color = minetest.colorize
+
local clip_fs = [[
- style_type[label;noclip=%c]
- style_type[button;noclip=%c]
- style_type[image_button;noclip=%c]
- style_type[item_image_button;noclip=%c]
- style_type[tabheader;noclip=%c]
- style_type[field;noclip=%c]
- style_type[textarea;noclip=%c]
- style_type[checkbox;noclip=%c]
- style_type[dropdown;noclip=%c]
- style_type[scrollbar;noclip=%c]
- style_type[table;noclip=%c]
+ style_type[label,button,image_button,item_image_button,
+ tabheader,scrollbar,table,animated_image
+ ,field,textarea,checkbox,dropdown;noclip=%c]
label[0,0;A clipping test]
button[0,1;3,0.8;x;A clipping test]
@@ -23,23 +17,28 @@ local clip_fs = [[
scrollbar[0,9;3,0.8;horizontal;x9;3]
tablecolumns[text;text]
table[0,10;3,1;x10;one,two,three,four;1]
+ animated_image[-0.5,11;4.5,1;;test_animation.png;4;100]
]]
local style_fs = [[
- style[one_btn1;bgcolor=red;textcolor=yellow]
+ style[one_btn1;bgcolor=red;textcolor=yellow;bgcolor_hovered=orange;
+ 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_pressed=heart.png]
+ style[one_btn3;bgimg=bubble.png;bgimg_hovered=default_apple.png;
+ bgimg_pressed=heart.png]
button[0,2.1;1,1;one_btn3;Bor]
- style[one_btn4;bgimg=bubble.png;bgimg_pressed=heart.png;border=false]
+ style[one_btn4;bgimg=bubble.png;bgimg_hovered=default_apple.png;
+ bgimg_pressed=heart.png;border=false]
button[1.25,2.1;1,1;one_btn4;Bub]
- style[one_btn5;bgimg=bubble.png;bgimg_pressed=heart.png;border=false;alpha=false]
+ style[one_btn5;bgimg=bubble.png;bgimg_hovered=default_apple.png;
+ bgimg_pressed=heart.png;border=false;alpha=false]
button[0,3.35;1,1;one_btn5;Alph]
style[one_btn6;border=true]
@@ -66,6 +65,16 @@ local style_fs = [[
style[one_btn13;border=false]
item_image_button[1.25,8.35;1,1;default:sword_steel;one_btn13;NoBor]
+ style[one_btn14;border=false;bgimg=test_bg.png;bgimg_hovered=test_bg_hovered.png;bgimg_pressed=test_bg_pressed.png;fgimg=bubble.png;fgimg_hovered=default_apple.png;fgimg_pressed=heart.png]
+ image_button[0,9.6;1,1;bubble.png;one_btn14;Bg]
+
+ style[one_btn15;border=false;bgimg=test_bg.png;bgimg_hovered=test_bg_hovered.png;bgimg_pressed=test_bg_pressed.png]
+ item_image_button[1.25,9.6;1,1;default:sword_steel;one_btn15;Bg]
+
+ style[one_btn16;border=false;bgimg=test_bg_9slice.png;bgimg_hovered=test_bg_9slice_hovered.png;bgimg_pressed=test_bg_9slice_pressed.png;bgimg_middle=4,6]
+ button[2.5,9.6;2,1;one_btn16;9-Slice Bg]
+
+
container[2.75,0]
@@ -103,8 +112,8 @@ local style_fs = [[
local pages = {
[[
+ formspec_version[3]
size[12,12]
- real_coordinates[true]
image_button[0,0;1,1;logo.png;;1x1]
image_button[1,0;2,2;logo.png;;2x2]
button[0,2;1,1;;1x1]
@@ -133,16 +142,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]" ..
+ "formspec_version[3]size[12,12]" ..
+ ("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]" ..
@@ -152,17 +163,35 @@ local pages = {
style_fs:gsub("one_", "two_"):gsub("style%[[^%]]+%]", ""):gsub("style_type%[[^%]]+%]", "") ..
"container_end[]",
- "size[12,12]real_coordinates[true]" ..
+ "formspec_version[3]size[12,13]" ..
"label[0.1,0.5;Clip]" ..
"container[-2.5,1]" .. clip_fs:gsub("%%c", "false") .. "container_end[]" ..
"label[11,0.5;Noclip]" ..
"container[11.5,1]" .. clip_fs:gsub("%%c", "true") .. "container_end[]",
+
+ [[
+ formspec_version[3]
+ size[12,12]
+ animated_image[0.5,0.5;1,1;;test_animation.png;4;100]
+ animated_image[0.5,1.75;1,1;;test_animation.jpg;4;100]
+ animated_image[1.75,0.5;1,1;;test_animation.png;100;100]
+ animated_image[3,0.5;1,1;ani_img_1;test_animation.png;4;1000]
+ button[4.25,0.5;1,1;ani_btn_1;Current
+Number]
+ animated_image[3,1.75;1,1;ani_img_2;test_animation.png;4;1000;2]
+ button[4.25,1.75;1,1;ani_btn_2;Current
+Number]
+ animated_image[3,3;1,1;;test_animation.png;4;0]
+ animated_image[3,4.25;1,1;;test_animation.png;4;0;3]
+ animated_image[5.5,0.5;5,2;;test_animation.png;4;100]
+ animated_image[5.5,2.75;5,2;;test_animation.jpg;4;100]
+ ]]
}
local function show_test_formspec(pname, page_id)
page_id = page_id or 2
- local fs = pages[page_id] .. "tabheader[0,0;6,0.65;maintabs;Real Coord,Styles,Noclip;" .. page_id .. ";false;false]"
+ local fs = pages[page_id] .. "tabheader[0,0;6,0.65;maintabs;Real Coord,Styles,Noclip,MiscEle;" .. page_id .. ";false;false]"
minetest.show_formspec(pname, "test:formspec", fs)
end
@@ -177,6 +206,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
return true
end
+ if fields.ani_img_1 and fields.ani_btn_1 then
+ minetest.chat_send_all(fields.ani_img_1)
+ elseif fields.ani_img_2 and fields.ani_btn_2 then
+ minetest.chat_send_all(fields.ani_img_2)
+ end
end)
minetest.register_node("test:node", {
diff --git a/games/minimal/mods/test/textures/test_animation.jpg b/games/minimal/mods/test/textures/test_animation.jpg
new file mode 100644
index 000000000..b98ca2677
--- /dev/null
+++ b/games/minimal/mods/test/textures/test_animation.jpg
Binary files differ
diff --git a/games/minimal/mods/test/textures/test_animation.png b/games/minimal/mods/test/textures/test_animation.png
new file mode 100644
index 000000000..1752362ff
--- /dev/null
+++ b/games/minimal/mods/test/textures/test_animation.png
Binary files differ
diff --git a/games/minimal/mods/test/textures/test_bg.png b/games/minimal/mods/test/textures/test_bg.png
new file mode 100644
index 000000000..f0f392926
--- /dev/null
+++ b/games/minimal/mods/test/textures/test_bg.png
Binary files differ
diff --git a/games/minimal/mods/test/textures/test_bg_9slice.png b/games/minimal/mods/test/textures/test_bg_9slice.png
new file mode 100644
index 000000000..f9fe6870b
--- /dev/null
+++ b/games/minimal/mods/test/textures/test_bg_9slice.png
Binary files differ
diff --git a/games/minimal/mods/test/textures/test_bg_9slice_hovered.png b/games/minimal/mods/test/textures/test_bg_9slice_hovered.png
new file mode 100644
index 000000000..e614a5eee
--- /dev/null
+++ b/games/minimal/mods/test/textures/test_bg_9slice_hovered.png
Binary files differ
diff --git a/games/minimal/mods/test/textures/test_bg_9slice_pressed.png b/games/minimal/mods/test/textures/test_bg_9slice_pressed.png
new file mode 100644
index 000000000..125c774fb
--- /dev/null
+++ b/games/minimal/mods/test/textures/test_bg_9slice_pressed.png
Binary files differ
diff --git a/games/minimal/mods/test/textures/test_bg_hovered.png b/games/minimal/mods/test/textures/test_bg_hovered.png
new file mode 100644
index 000000000..b9ce8fd31
--- /dev/null
+++ b/games/minimal/mods/test/textures/test_bg_hovered.png
Binary files differ
diff --git a/games/minimal/mods/test/textures/test_bg_pressed.png b/games/minimal/mods/test/textures/test_bg_pressed.png
new file mode 100644
index 000000000..76aafb8c1
--- /dev/null
+++ b/games/minimal/mods/test/textures/test_bg_pressed.png
Binary files differ