i3 trash only on creative

master
daretmavi 2021-03-19 00:06:25 +01:00
parent 43486e81ae
commit 5e7f552f5b
3 changed files with 46 additions and 6 deletions

View File

@ -47,7 +47,7 @@ buildings/doors:doors_update.patch" "buildings/doors:doors_update54.patch" \
"player/fire_plus:extend_fire.patch" \
"mobs/mobs_mobs/advanced_npc:adv_npc_log.patch" "mobs/mobs_mobs/advanced_npc:bugtrade184.patch" \
"mobs/mobs_mobs/mg_villages_npc:bug.patch" "mobs/mobs_mobs/mg_villages_npc:patch_log.patch" \
"gui/i3:progressive_creative.patch")
"gui/i3:progressive_creative.patch" "gui/i3:notrash.patch")
#"mobs/mobs_mobs/goblins:goblins_nil.patch"
#MOD_PATCHES=( )
@ -80,7 +80,7 @@ do
SRC_DIR="$SRC${MOD_PATH[MOD_INDEX]}/"
DST_DIR="$DST${MOD_PATH[MOD_INDEX]}/"
echo "---------------------------------------------------------------"
#echo "---------------------------------------------------------------"
echo "Apllying patch ${MOD_PATCH[MOD_INDEX]} to ${MOD_PATH[MOD_INDEX]}."
echo

View File

@ -1874,9 +1874,13 @@ local function get_ctn_content(fs, data, player, xoffset, yoffset, ctn_len, awar
fs(fmt("list[current_player;craft;%f,%f;3,3;]", xoffset, yoffset + 1.45),
fmt("image", xoffset + 3.47, yoffset + 2.69, 0.85, 0.85, PNG.arrow),
fmt("list[current_player;craftpreview;%f,%f;1,1;]", xoffset + 4.45, yoffset + 2.6),
fmt("list[detached:i3_trash;main;%f,%f;1,1;]", xoffset + 4.45, yoffset + 3.75),
fmt("image", xoffset + 4.45, yoffset + 3.75, 1, 1, PNG.trash))
fmt("list[current_player;craftpreview;%f,%f;1,1;]", xoffset + 4.45, yoffset + 2.6))--,
--fmt("list[detached:i3_trash;main;%f,%f;1,1;]", xoffset + 4.45, yoffset + 3.75),
--fmt("image", xoffset + 4.45, yoffset + 3.75, 1, 1, PNG.trash))
if core.is_creative_enabled(name) then
fs(fmt("list[detached:i3_trash;main;%f,%f;1,1;]", xoffset + 4.45, yoffset + 3.75),
fmt("image", xoffset + 4.45, yoffset + 3.75, 1, 1, PNG.trash))
end
local yextra = 5.4
local bag_equip = data.equip == "bag"
@ -2334,11 +2338,12 @@ local function get_inventory_fs(player, data, fs)
fs("scroll_container_end[]")
local btn = {
{"trash", ES"Trash all items"},
--{"trash", ES"Trash all items"},
{"sort_az", ES"Sort items (A-Z)"},
{"sort_za", ES"Sort items (Z-A)"},
{"compress", ES"Compress items"},
}
if core.is_creative_enabled(name) then table.insert(btn, 1, {"trash", ES"Trash all items"}) end
for i, v in ipairs(btn) do
local btn_name, tooltip = unpack(v)

View File

@ -0,0 +1,35 @@
diff --git a/init.lua b/init.lua
index 811b5c6..a5f9a34 100644
--- a/init.lua
+++ b/init.lua
@@ -1874,9 +1874,13 @@ local function get_ctn_content(fs, data, player, xoffset, yoffset, ctn_len, awar
fs(fmt("list[current_player;craft;%f,%f;3,3;]", xoffset, yoffset + 1.45),
fmt("image", xoffset + 3.47, yoffset + 2.69, 0.85, 0.85, PNG.arrow),
- fmt("list[current_player;craftpreview;%f,%f;1,1;]", xoffset + 4.45, yoffset + 2.6),
- fmt("list[detached:i3_trash;main;%f,%f;1,1;]", xoffset + 4.45, yoffset + 3.75),
- fmt("image", xoffset + 4.45, yoffset + 3.75, 1, 1, PNG.trash))
+ fmt("list[current_player;craftpreview;%f,%f;1,1;]", xoffset + 4.45, yoffset + 2.6))--,
+ --fmt("list[detached:i3_trash;main;%f,%f;1,1;]", xoffset + 4.45, yoffset + 3.75),
+ --fmt("image", xoffset + 4.45, yoffset + 3.75, 1, 1, PNG.trash))
+ if core.is_creative_enabled(name) then
+ fs(fmt("list[detached:i3_trash;main;%f,%f;1,1;]", xoffset + 4.45, yoffset + 3.75),
+ fmt("image", xoffset + 4.45, yoffset + 3.75, 1, 1, PNG.trash))
+ end
local yextra = 5.4
local bag_equip = data.equip == "bag"
@@ -2334,11 +2338,12 @@ local function get_inventory_fs(player, data, fs)
fs("scroll_container_end[]")
local btn = {
- {"trash", ES"Trash all items"},
+ --{"trash", ES"Trash all items"},
{"sort_az", ES"Sort items (A-Z)"},
{"sort_za", ES"Sort items (Z-A)"},
{"compress", ES"Compress items"},
}
+ if core.is_creative_enabled(name) then table.insert(btn, 1, {"trash", ES"Trash all items"}) end
for i, v in ipairs(btn) do
local btn_name, tooltip = unpack(v)