diff options
| author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-02-10 19:50:36 +0100 |
|---|---|---|
| committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-02-10 19:50:36 +0100 |
| commit | 1fbbb768252f872dfa961d3a73460d996164d527 (patch) | |
| tree | e9faf93dbd894b253ac3d1f0895b7468e8fee50d /games/devtest | |
| parent | 74f5f033e04c0d8694815fedb795838d4926cbc9 (diff) | |
| parent | 9736b9cea5f841bb0e9bb2c9c05c3b2560327064 (diff) | |
| download | dragonfireclient-1fbbb768252f872dfa961d3a73460d996164d527.tar.xz | |
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'games/devtest')
| -rw-r--r-- | games/devtest/mods/basenodes/init.lua | 36 | ||||
| -rw-r--r-- | games/devtest/mods/soundstuff/init.lua | 11 | ||||
| -rw-r--r-- | games/devtest/mods/testformspec/formspec.lua | 36 | ||||
| -rw-r--r-- | games/devtest/mods/testnodes/drawtypes.lua | 111 | ||||
| -rw-r--r-- | games/devtest/mods/testnodes/liquids.lua | 16 | ||||
| -rw-r--r-- | games/devtest/mods/testnodes/properties.lua | 6 | ||||
| -rw-r--r-- | games/devtest/mods/testnodes/textures.lua | 65 | ||||
| -rw-r--r-- | games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png | bin | 90 -> 0 bytes | |||
| -rw-r--r-- | games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png | bin | 239 -> 0 bytes | |||
| -rw-r--r-- | games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png | bin | 591 -> 0 bytes | |||
| -rw-r--r-- | games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png | bin | 143 -> 0 bytes |
11 files changed, 128 insertions, 153 deletions
diff --git a/games/devtest/mods/basenodes/init.lua b/games/devtest/mods/basenodes/init.lua index 0cb85d808..2c808c35e 100644 --- a/games/devtest/mods/basenodes/init.lua +++ b/games/devtest/mods/basenodes/init.lua @@ -1,4 +1,4 @@ -local WATER_ALPHA = 160 +local WATER_ALPHA = "^[opacity:" .. 160 local WATER_VISC = 1 local LAVA_VISC = 7 @@ -128,12 +128,12 @@ minetest.register_node("basenodes:water_source", { "Drowning damage: 1", drawtype = "liquid", waving = 3, - tiles = {"default_water.png"}, + tiles = {"default_water.png"..WATER_ALPHA}, special_tiles = { - {name = "default_water.png", backface_culling = false}, - {name = "default_water.png", backface_culling = true}, + {name = "default_water.png"..WATER_ALPHA, backface_culling = false}, + {name = "default_water.png"..WATER_ALPHA, backface_culling = true}, }, - alpha = WATER_ALPHA, + use_texture_alpha = "blend", paramtype = "light", walkable = false, pointable = false, @@ -156,10 +156,12 @@ minetest.register_node("basenodes:water_flowing", { waving = 3, tiles = {"default_water_flowing.png"}, special_tiles = { - {name = "default_water_flowing.png", backface_culling = false}, - {name = "default_water_flowing.png", backface_culling = false}, + {name = "default_water_flowing.png"..WATER_ALPHA, + backface_culling = false}, + {name = "default_water_flowing.png"..WATER_ALPHA, + backface_culling = false}, }, - alpha = WATER_ALPHA, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "flowingliquid", walkable = false, @@ -181,12 +183,12 @@ minetest.register_node("basenodes:river_water_source", { "Drowning damage: 1", drawtype = "liquid", waving = 3, - tiles = { "default_river_water.png" }, + tiles = { "default_river_water.png"..WATER_ALPHA }, special_tiles = { - {name = "default_river_water.png", backface_culling = false}, - {name = "default_river_water.png", backface_culling = true}, + {name = "default_river_water.png"..WATER_ALPHA, backface_culling = false}, + {name = "default_river_water.png"..WATER_ALPHA, backface_culling = true}, }, - alpha = WATER_ALPHA, + use_texture_alpha = "blend", paramtype = "light", walkable = false, pointable = false, @@ -209,12 +211,14 @@ minetest.register_node("basenodes:river_water_flowing", { "Drowning damage: 1", drawtype = "flowingliquid", waving = 3, - tiles = {"default_river_water_flowing.png"}, + tiles = {"default_river_water_flowing.png"..WATER_ALPHA}, special_tiles = { - {name = "default_river_water_flowing.png", backface_culling = false}, - {name = "default_river_water_flowing.png", backface_culling = false}, + {name = "default_river_water_flowing.png"..WATER_ALPHA, + backface_culling = false}, + {name = "default_river_water_flowing.png"..WATER_ALPHA, + backface_culling = false}, }, - alpha = WATER_ALPHA, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "flowingliquid", walkable = false, diff --git a/games/devtest/mods/soundstuff/init.lua b/games/devtest/mods/soundstuff/init.lua index 40ad8f562..b263a3f35 100644 --- a/games/devtest/mods/soundstuff/init.lua +++ b/games/devtest/mods/soundstuff/init.lua @@ -60,11 +60,13 @@ minetest.register_node("soundstuff:footstep_liquid", { description = "Liquid Footstep Sound Node", drawtype = "liquid", tiles = { - "soundstuff_node_sound.png^[colorize:#0000FF:127", + "soundstuff_node_sound.png^[colorize:#0000FF:127^[opacity:190", }, special_tiles = { - {name = "soundstuff_node_sound.png^[colorize:#0000FF:127", backface_culling = false}, - {name = "soundstuff_node_sound.png^[colorize:#0000FF:127", backface_culling = true}, + {name = "soundstuff_node_sound.png^[colorize:#0000FF:127^[opacity:190", + backface_culling = false}, + {name = "soundstuff_node_sound.png^[colorize:#0000FF:127^[opacity:190", + backface_culling = true}, }, liquids_pointable = true, liquidtype = "source", @@ -73,7 +75,7 @@ minetest.register_node("soundstuff:footstep_liquid", { liquid_renewable = false, liquid_range = 0, liquid_viscosity = 0, - alpha = 190, + use_texture_alpha = "blend", paramtype = "light", walkable = false, pointable = false, @@ -92,7 +94,6 @@ minetest.register_node("soundstuff:footstep_climbable", { tiles = { "soundstuff_node_climbable.png", }, - alpha = 120, paramtype = "light", sunlight_propagates = true, walkable = false, diff --git a/games/devtest/mods/testformspec/formspec.lua b/games/devtest/mods/testformspec/formspec.lua index 5495896ce..2a2bdad60 100644 --- a/games/devtest/mods/testformspec/formspec.lua +++ b/games/devtest/mods/testformspec/formspec.lua @@ -33,6 +33,34 @@ local tabheaders_fs = [[ tabheader[8,6;10,1.5;tabs_size2;Height=1.5;1;false;false] ]] +local inv_style_fs = [[ + style_type[list;noclip=true] + list[current_player;main;-0.75,0.75;2,2] + + real_coordinates[false] + list[current_player;main;1.5,0;3,2] + real_coordinates[true] + + real_coordinates[false] + style_type[list;size=1.1;spacing=0.1] + list[current_player;main;5,0;3,2] + real_coordinates[true] + + style_type[list;size=.001;spacing=0] + list[current_player;main;7,3.5;8,4] + + box[3,3.5;1,1;#000000] + box[5,3.5;1,1;#000000] + box[4,4.5;1,1;#000000] + box[3,5.5;1,1;#000000] + box[5,5.5;1,1;#000000] + style_type[list;spacing=.25,.125;size=.75,.875] + list[current_player;main;3,3.5;3,3] + + style_type[list;spacing=0;size=1.1] + list[current_player;main;.5,7;8,4] +]] + local hypertext_basic = [[ <bigger>Normal test</bigger> This is a normal text. @@ -199,6 +227,7 @@ local scroll_fs = "box[1,1;8,6;#00aa]".. "scroll_container[1,1;8,6;scrbar;vertical]".. "button[0,1;1,1;lorem;Lorem]".. + "animated_image[0,1;4.5,1;clip_animated_image;testformspec_animation.png;4;100]" .. "button[0,10;1,1;ipsum;Ipsum]".. "pwdfield[2,2;1,1;lorem2;Lorem]".. "list[current_player;main;4,4;1,5;]".. @@ -211,6 +240,8 @@ local scroll_fs = "tooltip[0,11;3,2;Buz;#f00;#000]".. "box[0,11;3,2;#00ff00]".. "hypertext[3,13;3,3;;" .. hypertext_basic .. "]" .. + "hypertext[3,17;3,3;;Hypertext with no scrollbar\\; the scroll container should scroll.]" .. + "textarea[3,21;3,1;textarea;;More scroll within scroll]" .. "container[0,18]".. "box[1,2;3,2;#0a0a]".. "scroll_container[1,2;3,2;scrbar2;horizontal;0.06]".. @@ -310,6 +341,9 @@ local pages = { "size[12,13]real_coordinates[true]" .. "container[0.5,1.5]" .. tabheaders_fs .. "container_end[]", + -- Inv + "size[12,13]real_coordinates[true]" .. inv_style_fs, + -- Animation [[ formspec_version[3] @@ -341,7 +375,7 @@ Number] local function show_test_formspec(pname, page_id) page_id = page_id or 2 - local fs = pages[page_id] .. "tabheader[0,0;8,0.65;maintabs;Real Coord,Styles,Noclip,Hypertext,Tabs,Anim,ScrollC;" .. page_id .. ";false;false]" + local fs = pages[page_id] .. "tabheader[0,0;8,0.65;maintabs;Real Coord,Styles,Noclip,Hypertext,Tabs,Invs,Anim,ScrollC;" .. page_id .. ";false;false]" minetest.show_formspec(pname, "testformspec:formspec", fs) end diff --git a/games/devtest/mods/testnodes/drawtypes.lua b/games/devtest/mods/testnodes/drawtypes.lua index b3ab2b322..ff970144d 100644 --- a/games/devtest/mods/testnodes/drawtypes.lua +++ b/games/devtest/mods/testnodes/drawtypes.lua @@ -350,68 +350,72 @@ minetest.register_node("testnodes:plantlike_rooted_degrotate", { }) -- Demonstrative liquid nodes, source and flowing form. -minetest.register_node("testnodes:liquid", { - description = S("Source Liquid Drawtype Test Node"), - drawtype = "liquid", - paramtype = "light", - tiles = { - "testnodes_liquidsource.png", - }, - special_tiles = { - {name="testnodes_liquidsource.png", backface_culling=false}, - {name="testnodes_liquidsource.png", backface_culling=true}, - }, - use_texture_alpha = true, - - - walkable = false, - liquidtype = "source", - liquid_range = 1, - liquid_viscosity = 0, - liquid_alternative_flowing = "testnodes:liquid_flowing", - liquid_alternative_source = "testnodes:liquid", - groups = { dig_immediate = 3 }, -}) -minetest.register_node("testnodes:liquid_flowing", { - description = S("Flowing Liquid Drawtype Test Node"), - drawtype = "flowingliquid", - paramtype = "light", - paramtype2 = "flowingliquid", - tiles = { - "testnodes_liquidflowing.png", - }, - special_tiles = { - {name="testnodes_liquidflowing.png", backface_culling=false}, - {name="testnodes_liquidflowing.png", backface_culling=false}, - }, - use_texture_alpha = true, +-- DRAWTYPE ONLY, NO LIQUID PHYSICS! +-- Liquid ranges 0 to 8 +for r = 0, 8 do + minetest.register_node("testnodes:liquid_"..r, { + description = S("Source Liquid Drawtype Test Node, Range @1", r), + drawtype = "liquid", + paramtype = "light", + tiles = { + "testnodes_liquidsource_r"..r..".png^[colorize:#FFFFFF:100", + }, + special_tiles = { + {name="testnodes_liquidsource_r"..r..".png^[colorize:#FFFFFF:100", backface_culling=false}, + {name="testnodes_liquidsource_r"..r..".png^[colorize:#FFFFFF:100", backface_culling=true}, + }, + use_texture_alpha = "blend", + + + walkable = false, + liquid_range = r, + liquid_viscosity = 0, + liquid_alternative_flowing = "testnodes:liquid_flowing_"..r, + liquid_alternative_source = "testnodes:liquid_"..r, + groups = { dig_immediate = 3 }, + }) + minetest.register_node("testnodes:liquid_flowing_"..r, { + description = S("Flowing Liquid Drawtype Test Node, Range @1", r), + drawtype = "flowingliquid", + paramtype = "light", + paramtype2 = "flowingliquid", + tiles = { + "testnodes_liquidflowing_r"..r..".png^[colorize:#FFFFFF:100", + }, + special_tiles = { + {name="testnodes_liquidflowing_r"..r..".png^[colorize:#FFFFFF:100", backface_culling=false}, + {name="testnodes_liquidflowing_r"..r..".png^[colorize:#FFFFFF:100", backface_culling=false}, + }, + use_texture_alpha = "blend", + + + walkable = false, + liquid_range = r, + liquid_viscosity = 0, + liquid_alternative_flowing = "testnodes:liquid_flowing_"..r, + liquid_alternative_source = "testnodes:liquid_"..r, + groups = { dig_immediate = 3 }, + }) +end - walkable = false, - liquidtype = "flowing", - liquid_range = 1, - liquid_viscosity = 0, - liquid_alternative_flowing = "testnodes:liquid_flowing", - liquid_alternative_source = "testnodes:liquid", - groups = { dig_immediate = 3 }, -}) +-- Waving liquid test (drawtype only) minetest.register_node("testnodes:liquid_waving", { description = S("Waving Source Liquid Drawtype Test Node"), drawtype = "liquid", paramtype = "light", tiles = { - "testnodes_liquidsource.png^[brighten", + "testnodes_liquidsource.png^[colorize:#0000FF:127", }, special_tiles = { - {name="testnodes_liquidsource.png^[brighten", backface_culling=false}, - {name="testnodes_liquidsource.png^[brighten", backface_culling=true}, + {name="testnodes_liquidsource.png^[colorize:#0000FF:127", backface_culling=false}, + {name="testnodes_liquidsource.png^[colorize:#0000FF:127", backface_culling=true}, }, - use_texture_alpha = true, + use_texture_alpha = "blend", waving = 3, walkable = false, - liquidtype = "source", liquid_range = 1, liquid_viscosity = 0, liquid_alternative_flowing = "testnodes:liquid_flowing_waving", @@ -424,18 +428,17 @@ minetest.register_node("testnodes:liquid_flowing_waving", { paramtype = "light", paramtype2 = "flowingliquid", tiles = { - "testnodes_liquidflowing.png^[brighten", + "testnodes_liquidflowing.png^[colorize:#0000FF:127", }, special_tiles = { - {name="testnodes_liquidflowing.png^[brighten", backface_culling=false}, - {name="testnodes_liquidflowing.png^[brighten", backface_culling=false}, + {name="testnodes_liquidflowing.png^[colorize:#0000FF:127", backface_culling=false}, + {name="testnodes_liquidflowing.png^[colorize:#0000FF:127", backface_culling=false}, }, - use_texture_alpha = true, + use_texture_alpha = "blend", waving = 3, walkable = false, - liquidtype = "flowing", liquid_range = 1, liquid_viscosity = 0, liquid_alternative_flowing = "testnodes:liquid_flowing_waving", @@ -443,8 +446,6 @@ minetest.register_node("testnodes:liquid_flowing_waving", { groups = { dig_immediate = 3 }, }) - - -- Invisible node minetest.register_node("testnodes:airlike", { description = S("Airlike Drawtype Test Node"), diff --git a/games/devtest/mods/testnodes/liquids.lua b/games/devtest/mods/testnodes/liquids.lua index e316782ad..3d2ea17f5 100644 --- a/games/devtest/mods/testnodes/liquids.lua +++ b/games/devtest/mods/testnodes/liquids.lua @@ -9,11 +9,9 @@ for d=0, 8 do {name = "testnodes_liquidsource_r"..d..".png", backface_culling = false}, {name = "testnodes_liquidsource_r"..d..".png", backface_culling = true}, }, - alpha = 192, + use_texture_alpha = "blend", paramtype = "light", walkable = false, - pointable = false, - diggable = false, buildable_to = true, is_ground_content = false, liquidtype = "source", @@ -30,12 +28,10 @@ for d=0, 8 do {name = "testnodes_liquidflowing_r"..d..".png", backface_culling = false}, {name = "testnodes_liquidflowing_r"..d..".png", backface_culling = false}, }, - alpha = 192, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "flowingliquid", walkable = false, - pointable = false, - diggable = false, buildable_to = true, is_ground_content = false, liquidtype = "flowing", @@ -53,11 +49,9 @@ for d=0, 8 do {name = "testnodes_liquidsource_r"..d..".png"..mod, backface_culling = false}, {name = "testnodes_liquidsource_r"..d..".png"..mod, backface_culling = true}, }, - alpha = 192, + use_texture_alpha = "blend", paramtype = "light", walkable = false, - pointable = false, - diggable = false, buildable_to = true, is_ground_content = false, liquidtype = "source", @@ -74,12 +68,10 @@ for d=0, 8 do {name = "testnodes_liquidflowing_r"..d..".png"..mod, backface_culling = false}, {name = "testnodes_liquidflowing_r"..d..".png"..mod, backface_culling = false}, }, - alpha = 192, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "flowingliquid", walkable = false, - pointable = false, - diggable = false, buildable_to = true, is_ground_content = false, liquidtype = "flowing", diff --git a/games/devtest/mods/testnodes/properties.lua b/games/devtest/mods/testnodes/properties.lua index 01846a5f0..a52cd1d6f 100644 --- a/games/devtest/mods/testnodes/properties.lua +++ b/games/devtest/mods/testnodes/properties.lua @@ -114,11 +114,10 @@ minetest.register_node("testnodes:liquid_nojump", { {name = "testnodes_liquidsource.png^[colorize:#FF0000:127", backface_culling = false}, {name = "testnodes_liquidsource.png^[colorize:#FF0000:127", backface_culling = true}, }, - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", pointable = false, liquids_pointable = true, - diggable = false, buildable_to = true, is_ground_content = false, post_effect_color = {a = 70, r = 255, g = 0, b = 200}, @@ -143,12 +142,11 @@ minetest.register_node("testnodes:liquidflowing_nojump", { {name = "testnodes_liquidflowing.png^[colorize:#FF0000:127", backface_culling = false}, {name = "testnodes_liquidflowing.png^[colorize:#FF0000:127", backface_culling = false}, }, - use_texture_alpha = true, + use_texture_alpha = "blend", paramtype = "light", paramtype2 = "flowingliquid", pointable = false, liquids_pointable = true, - diggable = false, buildable_to = true, is_ground_content = false, post_effect_color = {a = 70, r = 255, g = 0, b = 200}, diff --git a/games/devtest/mods/testnodes/textures.lua b/games/devtest/mods/testnodes/textures.lua index e0724c229..f6e6a0c2a 100644 --- a/games/devtest/mods/testnodes/textures.lua +++ b/games/devtest/mods/testnodes/textures.lua @@ -46,77 +46,22 @@ for a=1,#alphas do tiles = { "testnodes_alpha"..alpha..".png", }, - use_texture_alpha = true, + use_texture_alpha = "blend", groups = { dig_immediate = 3 }, }) - -- Transparency set via "alpha" parameter + -- Transparency set via texture modifier minetest.register_node("testnodes:alpha_"..alpha, { description = S("Alpha Test Node (@1)", alpha), - -- It seems that only the liquid drawtype supports the alpha parameter - drawtype = "liquid", + drawtype = "glasslike", paramtype = "light", tiles = { - "testnodes_alpha.png", + "testnodes_alpha.png^[opacity:" .. alpha, }, - alpha = alpha, - + use_texture_alpha = "blend", - liquidtype = "source", - liquid_range = 0, - liquid_viscosity = 0, - liquid_alternative_source = "testnodes:alpha_"..alpha, - liquid_alternative_flowing = "testnodes:alpha_"..alpha, groups = { dig_immediate = 3 }, }) end - --- Bumpmapping and Parallax Occlusion - --- This node has a normal map which corresponds to a pyramid with sides tilted --- by an angle of 45°, i.e. the normal map contains four vectors which point --- diagonally away from the surface (e.g. (0.7, 0.7, 0)), --- and the heights in the height map linearly increase towards the centre, --- so that the surface corresponds to a simple pyramid. --- The node can help to determine if e.g. tangent space transformations work --- correctly. --- If, for example, the light comes from above, then the (tilted) pyramids --- should look like they're lit from this light direction on all node faces. --- The white albedo texture has small black indicators which can be used to see --- how it is transformed ingame (and thus see if there's rotation around the --- normal vector). -minetest.register_node("testnodes:height_pyramid", { - description = "Bumpmapping and Parallax Occlusion Tester (height pyramid)", - tiles = {"testnodes_height_pyramid.png"}, - groups = {dig_immediate = 3}, -}) - --- The stairs nodes should help to validate if shading works correctly for --- rotated nodes (which have rotated textures). -stairs.register_stair_and_slab("height_pyramid", "experimantal:height_pyramid", - {dig_immediate = 3}, - {"testnodes_height_pyramid.png"}, - "Bumpmapping and Parallax Occlusion Tester Stair (height pyramid)", - "Bumpmapping and Parallax Occlusion Tester Slab (height pyramid)") - --- This node has a simple heightmap for parallax occlusion testing and flat --- normalmap. --- When parallax occlusion is enabled, the yellow scrawl should stick out of --- the texture when viewed at an angle. -minetest.register_node("testnodes:parallax_extruded", { - description = "Parallax Occlusion Tester", - tiles = {"testnodes_parallax_extruded.png"}, - groups = {dig_immediate = 3}, -}) - --- Analogously to the height pyramid stairs nodes, --- these nodes should help to validate if parallax occlusion works correctly for --- rotated nodes (which have rotated textures). -stairs.register_stair_and_slab("parallax_extruded", - "experimantal:parallax_extruded", - {dig_immediate = 3}, - {"testnodes_parallax_extruded.png"}, - "Parallax Occlusion Tester Stair", - "Parallax Occlusion Tester Slab") diff --git a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png Binary files differdeleted file mode 100644 index 8c787b740..000000000 --- a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png +++ /dev/null diff --git a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png Binary files differdeleted file mode 100644 index 5ab7865f2..000000000 --- a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png +++ /dev/null diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png Binary files differdeleted file mode 100644 index 7e1c32398..000000000 --- a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png +++ /dev/null diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png Binary files differdeleted file mode 100644 index b134699d0..000000000 --- a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png +++ /dev/null |
