From 8bb2c6004418620bf2c054ab8bbfd1db9d8d45dd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 12 Aug 2022 16:43:39 +0200 Subject: [PATCH] Remove 'notabs' pages (get_pages handles it now) --- mods/rp_book/init.lua | 2 +- mods/rp_default/container.lua | 4 ++-- mods/rp_default/furnace.lua | 4 ++-- mods/rp_formspec/API.md | 11 ++--------- mods/rp_formspec/init.lua | 4 ---- mods/rp_gold/init.lua | 2 +- mods/rp_jewels/init.lua | 2 +- mods/rp_locks/init.lua | 2 +- 8 files changed, 10 insertions(+), 21 deletions(-) diff --git a/mods/rp_book/init.lua b/mods/rp_book/init.lua index a10f9d5..4abe78a 100644 --- a/mods/rp_book/init.lua +++ b/mods/rp_book/init.lua @@ -40,7 +40,7 @@ minetest.register_craftitem( title = data:get_string("book:title") end - local form = rp_formspec.get_page("rp_formspec:notabs") + local form = rp_formspec.get_page("rp_formspec:default") form = form .. "field[0.5,1.25;8,0;title;"..F(S("Title:"))..";"..F(title).."]" form = form .. "textarea[0.5,1.75;8,6.75;text;"..F(S("Contents:"))..";"..F(text).."]" form = form .. rp_formspec.button_exit(2.75, 7.75, 3, 1, "write", S("Write")) diff --git a/mods/rp_default/container.lua b/mods/rp_default/container.lua index 6b844d8..c6a14ee 100644 --- a/mods/rp_default/container.lua +++ b/mods/rp_default/container.lua @@ -63,7 +63,7 @@ minetest.register_node( end, }) -local form_chest = rp_formspec.get_page("rp_formspec:notabs_2part") +local form_chest = rp_formspec.get_page("rp_formspec:2part") form_chest = form_chest .. "list[current_name;main;0.25,0.25;8,4;]" form_chest = form_chest .. "listring[current_name;main]" form_chest = form_chest .. rp_formspec.get_itemslot_bg(0.25, 0.25, 8, 4) @@ -113,7 +113,7 @@ minetest.register_node( end, }) -local form_bookshelf = rp_formspec.get_page("rp_formspec:notabs_2part") +local form_bookshelf = rp_formspec.get_page("rp_formspec:2part") form_bookshelf = form_bookshelf .. "list[current_player;main;0.25,4.75;8,4;]" form_bookshelf = form_bookshelf .. "listring[current_player;main]" form_bookshelf = form_bookshelf .. rp_formspec.get_hotbar_itemslot_bg(0.25, 4.75, 8, 1) diff --git a/mods/rp_default/furnace.lua b/mods/rp_default/furnace.lua index 7a59213..ca648a3 100644 --- a/mods/rp_default/furnace.lua +++ b/mods/rp_default/furnace.lua @@ -6,7 +6,7 @@ local S = minetest.get_translator("rp_default") local F = minetest.formspec_escape function default.furnace_active_formspec(percent, item_percent) - local form = rp_formspec.get_page("rp_formspec:notabs_2part") + local form = rp_formspec.get_page("rp_formspec:2part") form = form .. "list[current_player;main;0.25,4.75;8,4;]" form = form .. rp_formspec.get_hotbar_itemslot_bg(0.25, 4.75, 8, 1) form = form .. rp_formspec.get_itemslot_bg(0.25, 5.75, 8, 3) @@ -35,7 +35,7 @@ function default.furnace_active_formspec(percent, item_percent) return form end -local form_furnace = rp_formspec.get_page("rp_formspec:notabs_2part") +local form_furnace = rp_formspec.get_page("rp_formspec:2part") form_furnace = form_furnace .. "list[current_player;main;0.25,4.75;8,4;]" form_furnace = form_furnace .. rp_formspec.get_hotbar_itemslot_bg(0.25, 4.75, 8, 1) form_furnace = form_furnace .. rp_formspec.get_itemslot_bg(0.25, 5.75, 8, 3) diff --git a/mods/rp_formspec/API.md b/mods/rp_formspec/API.md index 2578b93..3c3a5d5 100644 --- a/mods/rp_formspec/API.md +++ b/mods/rp_formspec/API.md @@ -159,17 +159,10 @@ pages to build the player inventory. This mod offers a few built-in pages for mods to use: -* `"rp_formspec:default"`: A simple empty formspec frame, about the size of an inventory. With tabs. -* `"rp_formspec:notabs"`: A simple empty formspec frame, about the size of an inventory. Without tabs. -* `"rp_formspec:2part"`: A page with two parts, separated by a horizontal line in the middle. With tabs. -* `"rp_formspec:notabs_2part"`: A page with two parts, separated by a horizontal line in the middle. Without tabs. +* `"rp_formspec:default"`: A simple empty formspec frame +* `"rp_formspec:2part"`: An empty frame with two parts, separated by a horizontal line in the middle * `"rp_formspec:field"`: A small page containing a single text input field and a button “Write” (the text field ID is `"text"`) -“Tabs” here means whether the tabs for the player inventory pages like crafting, armor, achievements, etc. -are shown. Using a page with tabs is only recommended for the player inventory. Outside the -player inventory, these tabs are buggy. - - ### `rp_formspec.register_page(name, form)` diff --git a/mods/rp_formspec/init.lua b/mods/rp_formspec/init.lua index c944227..37dd0d1 100644 --- a/mods/rp_formspec/init.lua +++ b/mods/rp_formspec/init.lua @@ -331,10 +331,6 @@ local form_2part = form_default .. "background[0,0;8.5,4.5;ui_formspec_bg_short. rp_formspec.register_page("rp_formspec:default", form_default) -- 2-part frame rp_formspec.register_page("rp_formspec:2part", form_2part) --- 1-part frame (legacy). TODO: remove -rp_formspec.register_page("rp_formspec:notabs", form_default) --- 2-part frame (legacy). TODO: remove -rp_formspec.register_page("rp_formspec:notabs_2part", form_2part) -- Simple text input field local form_default_field = "" diff --git a/mods/rp_gold/init.lua b/mods/rp_gold/init.lua index 4f4fdd0..d094c0a 100644 --- a/mods/rp_gold/init.lua +++ b/mods/rp_gold/init.lua @@ -183,7 +183,7 @@ end local form_trading = "" -form_trading = form_trading .. rp_formspec.get_page("rp_formspec:notabs_2part") +form_trading = form_trading .. rp_formspec.get_page("rp_formspec:2part") form_trading = form_trading .. "list[current_player;main;0.25,4.75;8,4;]" form_trading = form_trading .. rp_formspec.get_hotbar_itemslot_bg(0.25, 4.75, 8, 1) diff --git a/mods/rp_jewels/init.lua b/mods/rp_jewels/init.lua index 69dcc85..18cae82 100644 --- a/mods/rp_jewels/init.lua +++ b/mods/rp_jewels/init.lua @@ -18,7 +18,7 @@ jewels.registered_jewel_parents = {} -- Formspec -local form_bench = rp_formspec.get_page("rp_formspec:notabs_2part") +local form_bench = rp_formspec.get_page("rp_formspec:2part") form_bench = form_bench .. "list[current_name;main;2.25,1.75;1,1;]" form_bench = form_bench .. "listring[current_name;main]" diff --git a/mods/rp_locks/init.lua b/mods/rp_locks/init.lua index c556f69..1ed97c2 100644 --- a/mods/rp_locks/init.lua +++ b/mods/rp_locks/init.lua @@ -246,7 +246,7 @@ minetest.register_node( if not locks.is_locked(meta, player) then local np = pos.x .. "," .. pos.y .. "," .. pos.z - local form = rp_formspec.get_page("rp_formspec:notabs_2part") + local form = rp_formspec.get_page("rp_formspec:2part") form = form .. "list[nodemeta:" .. np .. ";main;0.25,0.25;8,4;]" form = form .. "listring[nodemeta:" .. np .. ";main]" form = form .. rp_formspec.get_itemslot_bg(0.25, 0.25, 8, 4)