[Mod] Bags [bags] Attach bags to your inventory to increase storarage.

User avatar
lightonflux
Member
 
Posts: 384
Joined: Mon Nov 11, 2013 07:22
In-game: lof

Re: [Mod] Bags [bags] Attach bags to your inventory to incre

by lightonflux » Thu Jan 22, 2015 21:04

It would be nice if the player could assign names to the bags. It would make it easier to keep everything sorted.
 

DoyleChris
Member
 
Posts: 176
Joined: Sat Jul 25, 2015 19:54
In-game: DoyleChris

Re: [Mod] Bags [bags] Attach bags to your inventory to incre

by DoyleChris » Wed Sep 23, 2015 22:37

I was wondering if there was a way to add the Shift Click option to the bags.
Look at this post https://forum.minetest.net/viewtopic.php?f=18&t=12629&hilit=listring

I need to use listring
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]" ..
"listring[current_name;main]"..
"listring[current_player;main]"


but in the bags mod this is the way the lists are listed.
.."list[detached:"..player:get_player_name().."_bags;bag1;0.5,1;1,1;]"

So im not sure how to add the listring.
 

User avatar
Ferk
Member
 
Posts: 330
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: [Mod] Bags [bags] Attach bags to your inventory to incre

by Ferk » Wed Sep 23, 2015 23:19

Does the shorthand added at the end work?
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
"listring[]"

I think the shorthand is supposed to automatically create a listring and you only require to specify the lists in order if you want to fine-tune it.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }
 

DoyleChris
Member
 
Posts: 176
Joined: Sat Jul 25, 2015 19:54
In-game: DoyleChris

Re: [Mod] Bags [bags] Attach bags to your inventory to incre

by DoyleChris » Thu Sep 24, 2015 00:59

Ill try tommorow.
 

DoyleChris
Member
 
Posts: 176
Joined: Sat Jul 25, 2015 19:54
In-game: DoyleChris

Re: [Mod] Bags [bags] Attach bags to your inventory to incre

by DoyleChris » Fri Sep 25, 2015 02:17

Well i tried it in both sections of the form spec. Not at the same time but separate times and it still didn't work.

local get_formspec = function(player,page)
if page=="bags" then
return "size[8,7.5]"
.."list[current_player;main;0,3.5;8,4;]"
.."button[0,0;2,0.5;main;Back]"
.."button[0,2;2,0.5;bag1;Bag 1]"
.."button[2,2;2,0.5;bag2;Bag 2]"
.."button[4,2;2,0.5;bag3;Bag 3]"
.."button[6,2;2,0.5;bag4;Bag 4]"
.."list[detached:"..player:get_player_name().."_bags;bag1;0.5,1;1,1;]"
.."list[detached:"..player:get_player_name().."_bags;bag2;2.5,1;1,1;]"
.."list[detached:"..player:get_player_name().."_bags;bag3;4.5,1;1,1;]"
.."list[detached:"..player:get_player_name().."_bags;bag4;6.5,1;1,1;]"
.."listring[]"
end
for i=1,4 do
if page=="bag"..i then
local image = player:get_inventory():get_stack("bag"..i, 1):get_definition().inventory_image
return "size[8,9.5]"
.."list[current_player;main;0,5.5;8,4;]"
.."button[0,0;2,0.5;main;Main]"
.."button[2,0;2,0.5;bags;Bags]"
.."image[7,0;1,1;"..image.."]"
.."list[current_player;bag"..i.."contents;0,1;8,4;]"
.."listring[]"
end
end
end
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Bags [bags] Attach bags to your inventory to incre

by Don » Fri Sep 25, 2015 03:36

This tread might help you to understand.
viewtopic.php?t=12629
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

DoyleChris
Member
 
Posts: 176
Joined: Sat Jul 25, 2015 19:54
In-game: DoyleChris

Re: [Mod] Bags [bags] Attach bags to your inventory to incre

by DoyleChris » Fri Sep 25, 2015 10:03

I have refered to that in the previous reply but i cant figure out the formspec sturcture of the bags init.lua.
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Bags [bags] Attach bags to your inventory to incre

by Don » Fri Sep 25, 2015 13:28

DoyleChris wrote:I have refered to that in the previous reply but i cant figure out the formspec sturcture of the bags init.lua.

You can not use listring[]
Because they have different names but are part of the main formspec you have to do each name I think.

.."listring[current_name:bags1]"
.."listring[current_player:main]"
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Bags [bags] Attach bags to your inventory to incre

by TenPlus1 » Fri Sep 25, 2015 13:52

inside the get formspec function add these lines to the end of the formspec string return:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   .. "listring[current_player;main]"
   .. "listring[current_player;bag"..i.."contents]"


note: sometimes shift+clicking an item from inventory into a bag results in that item/stack going into the 1st bag with a space.
 

Previous

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 17 guests

cron