[Mod] Sfinv Unified Inventory [0.1][unified_inventory]

User avatar
rubenwardy
Moderator
 
Posts: 5541
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

[Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by rubenwardy » Fri Dec 30, 2016 23:50

Image

Image

Adds unified inventory features to sfinv.

This mod implements a fake unified inventory API and passes usage through to sfinv

Download: https://github.com/rubenwardy/sfinv_uni ... master.zip
GitHub: https://github.com/rubenwardy/sfinv_unified_inventory
Depends: sfinv (is in Minetest Game 0.4.15) and sfinv_buttons
Supports: creative and sethome (from Minetest Game)
License: LGPL 2 or later

Some code was reused from the original Unified Inventory - (C) 2012-2014 Maciej Kasatkin (RealBadAngel), LGPLv2+

TODO: bags, craft guide, refill slot
Last edited by rubenwardy on Sat Dec 31, 2016 01:00, edited 3 times in total.
 

User avatar
cHyper
Member
 
Posts: 759
Joined: Fri May 06, 2011 08:49
Location: Austria
GitHub: cHyper-0815OL
IRC: cHyper
In-game: cHyper
 

User avatar
mahmutelmas06
Member
 
Posts: 367
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by mahmutelmas06 » Sat Dec 31, 2016 09:03

It doesnt add buttons. I still see More tab even i added sfinv_buttons_use_icon_bar = true to config.
My Mods:

Beverage
 

User avatar
rubenwardy
Moderator
 
Posts: 5541
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 

hajo
Member
 
Posts: 596
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by hajo » Sat Dec 31, 2016 16:17

rubenwardy wrote:TODO: bags, craft guide, refill slot

How about Journalist/Note-taker: appends an entry to your travel-log (book-with-text),
i.e. date and coordinates.
 

User avatar
cd2
Member
 
Posts: 562
Joined: Mon Jun 01, 2015 06:30
Location: Linux
GitHub: cdqwertz
In-game: cd cd2
 

User avatar
Warrior_4_Christ
Member
 
Posts: 30
Joined: Thu Oct 27, 2016 18:16
Location: Palm Bay, FL U.S.
GitHub: Warrior-4-Christ
In-game: Warrior_4_Christ

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by Warrior_4_Christ » Sat Dec 31, 2016 20:14

TODO: bags, craft guide, refill slot

How long do you think it would take for craft guide to be added? I run a server with lots of mods and people need the craft guide to fully experience the game. :)
For God so loved the world that He gave his only begotten Son, that whosoever believeth in Him should not perish, but have everlasting life. -- John 3:16 KJV
____
| [] []|
| _>/
 

ShadMOrdre
Member
 
Posts: 126
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by ShadMOrdre » Sat Dec 31, 2016 22:16

rubenwardy,

after figuring out which forum post you were actually talking about regarding the PR, i manually edited the init.lua from sfinv_buttons, to include the code on your git. not all of us are users of git source code management, and general non IT users, probably not at all.

I get an error regarding a missing end to an if statement at line 52. there follows an elseif, and so I'm not sure if I should add the end before the else if, or try to trace the lua to find which actual if is missing its related end.

Any help?


Thanks,

Shad MOrdre
My other virtual world is an Opensimulator.
 

User avatar
rubenwardy
Moderator
 
Posts: 5541
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 

User avatar
TumeniNodes
Member
 
Posts: 2534
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by TumeniNodes » Sun Sep 03, 2017 00:58

Ummm, how the heck did I not see this until now? 0_o
Downloading with sfinv buttons to try out.
I'm not your buddy, guy...
 

User avatar
rubenwardy
Moderator
 
Posts: 5541
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by rubenwardy » Sun Sep 03, 2017 01:12

I think I'm going to deprecate this, and instead write mods for sfinv to add UI features. Adding a compatibility layer is just asking for trouble, I feel
 

User avatar
ExeterDad
Member
 
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
Location: New Hampshire U.S.A
In-game: ExeterDad

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by ExeterDad » Sun Sep 03, 2017 03:12

Deprecate or depreciate? It's still got value to me. I like the look of the buttons on the side, and the extra width of the formspec because of it. Our mods and extra code is so intertwined that pulling that layer out of the server will be like pulling teeth. I'm likely to keep it as long as I can.
 

User avatar
TumeniNodes
Member
 
Posts: 2534
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by TumeniNodes » Sun Sep 03, 2017 04:57

rubenwardy wrote:I think I'm going to deprecate this, and instead write mods for sfinv to add UI features. Adding a compatibility layer is just asking for trouble, I feel


you're a poopie head. just merge Wuzzy's buttons, and write this setup as one mod and then add mods to add addtl UI features. :P
I'm tired... headin to bed (I just wanted to call you a poopie head, the rest was sporadic rambling) ; )
I'm not your buddy, guy...
 

User avatar
apienk
Member
 
Posts: 24
Joined: Tue Mar 10, 2015 15:38
GitHub: apienk
In-game: apienk

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by apienk » Thu Oct 12, 2017 10:10

Hi, I read your tutorial for sfinv and it states that I can use is_in_nav to limit tab display per privilege. I am unclear however how to use it. Is it a property of sfinv page? If so, this should work but it does not:

Code: Select all
sfinv.register_page("mymod:mytab", {
   title = "mytabname",
   get = function(self, player, context)
      return sfinv.make_formspec(player, context,
                "label[0.1,0.1;Hello world!]", true)
   end,
   is_in_nav = function(self, player, context)
      local privs = player:get_privs()
      return privs.server
   end,
})


The error is: attempt to call method 'get_privs' (a nil value).
 

User avatar
rubenwardy
Moderator
 
Posts: 5541
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by rubenwardy » Thu Oct 12, 2017 10:20

apienk wrote:Hi, I read your tutorial for sfinv and it states that I can use is_in_nav to limit tab display per privilege. I am unclear however how to use it. Is it a property of sfinv page? If so, this should work but it does not:

Code: Select all
sfinv.register_page("mymod:mytab", {
   title = "mytabname",
   get = function(self, player, context)
      return sfinv.make_formspec(player, context,
                "label[0.1,0.1;Hello world!]", true)
   end,
   is_in_nav = function(self, player, context)
      local privs = player:get_privs()
      return privs.server
   end,
})


The error is: attempt to call method 'get_privs' (a nil value).


use minetest.check_player_privs(player, { server = true})


Code: Select all
sfinv.register_page("mymod:mytab", {
   title = "mytabname",
   get = function(self, player, context)
      return sfinv.make_formspec(player, context,
                "label[0.1,0.1;Hello world!]", true)
   end,
   is_in_nav = function(self, player, context)
      return minetest.check_player_privs(player, { server = true})
   end,
})


also, make sure to check the privs again in on_receive_fields
 

User avatar
apienk
Member
 
Posts: 24
Joined: Tue Mar 10, 2015 15:38
GitHub: apienk
In-game: apienk
 

User avatar
Fixer
Member
 
Posts: 866
Joined: Sun Jul 31, 2011 11:23
Location: Ukraine
IRC: Fixer
In-game: Fixer

Re: [Mod] Sfinv Unified Inventory [0.1][unified_inventory]

by Fixer » Thu Oct 12, 2017 19:58

I dislike layout of buttons on right side, does not feels aesthetic enough.
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 3 guests