[Mod] Unified Inventory [1.0] [unified_inventory]

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

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by ExeterDad » Sun Jun 28, 2015 13:08

unified_inventory_lite = true

Is this setting server or client side? I like the inventory as it was except when using a Android client. The outside of the formspec isn't accessible for exiting the inventory, making it impossible to play once the inventory was opened. If this lite version could be enabled client side, or if a small screen was detected, it would be the bomb!

Whatever the case, Thanks for your update :)
 

User avatar
VanessaE
Moderator
 
Posts: 4181
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by VanessaE » Sun Jun 28, 2015 20:07

The setting is server-side. Although switching formspec styles can easily be done in realtime on a per-client basis, there's no way for a mod to detect a client's capabilities or settings, unfortunately. Otherwise I could make it auto-adapt if say iOS or Android were in use on the client.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
 

Sokomine
Member
 
Posts: 3563
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by Sokomine » Mon Jun 29, 2015 20:12

I wonder if it would be possible (and not too much work...) to present a user with a menu which contains two buttons: A centered one for the new, reduced inventory, and one further to the side for the larger, normal inventory. Players who can't see or operate the button for the larger version would only see the small one and hit that button. The decision of which size to take would have to remain in memory until the player logs out. After all he might come online with other hardware next time.
A list of my mods can be found here.
 

User avatar
VanessaE
Moderator
 
Posts: 4181
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by VanessaE » Mon Jun 29, 2015 21:25

That could be done pretty easily I suppose. Aside from adding the buttons, it's otherwise just a matter of moving the lite-mode-dependent table entries into a function to set/un-set them, maintaining a per-user table of lite/full mode flags, and making sure *all* references to those flags are read where they're needed (in a couple of places, the global flag is only used at startup, for example the aforementioned table entries).

However, I would present it as a button among the various other "tab" buttons, to be consistent with the rest of UI. Any thoughts on what the icons (for "go lite" and "go full") should look like?
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
 

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

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by ExeterDad » Tue Jun 30, 2015 10:28

Any thoughts on what the icons (for "go lite" and "go full") should look like?

lol
How about a feather and a dumbbell?
 

User avatar
VanessaE
Moderator
 
Posts: 4181
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by VanessaE » Tue Jun 30, 2015 16:12

Kilbith also suggested a feather for the "lite" icon, which sounds good, but a dumbbell or anvil (my first thought as the analogous opposite) seems like it would suggest "heavy" rather than "full".
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
 

Sokomine
Member
 
Posts: 3563
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by Sokomine » Tue Jun 30, 2015 16:26

Would it be possible to scale screenshots of (empty!) inventories in both versions down so much that they get the right size for the buttons? Maybe one with a symbolic smartphone as background and the other one with a symbolic computer monitor.
A list of my mods can be found here.
 

User avatar
VanessaE
Moderator
 
Posts: 4181
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by VanessaE » Tue Jun 30, 2015 17:27

I thought about that, but an icon-size, scaled screenshot might be unintelligible. That said, icons of a monitor and a smart phone are a good idea.

EDIT: after some experimentation, switching modes on-the-fly would require a significant rewrite of the mod's formspec and button handling/registration code. Not nearly as simple as I expected. I'll not do that at this time.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
 

User avatar
VanessaE
Moderator
 
Posts: 4181
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
 

User avatar
Prot
Member
 
Posts: 36
Joined: Thu Apr 02, 2015 13:20
Location: SaratOFF
GitHub: EuPhobos
In-game: EuPhobos

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by Prot » Sun Jul 19, 2015 19:16

And again abount unified_Inventory i fix the bug with set and teleport to home position without "home" privelege.
i can post diff/patch file, but easier way add in unified_inventory/register.lua 41 row next code:
Code: Select all
        action = function(player)
            local player_name = player:get_player_name()
            if minetest.check_player_privs(player_name, {home=true}) then
                unified_inventory.set_home(player, player:getpos())
                local home = unified_inventory.home_pos[player_name]
                if home ~= nil then
                    minetest.sound_play("dingdong",
                            {to_player=player_name, gain = 1.0})
                    minetest.chat_send_player(player_name,
                        S("Home position set to: %s"):format(minetest.pos_to_string(home)))
                end
            else
                minetest.chat_send_player(player_name,
                    S("You don't have the home priviledge!"))
            end
        end,

this for "Set home" and 63 row:
Code: Select all
        action = function(player)
            local player_name = player:get_player_name()
            if minetest.check_player_privs(player_name, {home=true}) then
                minetest.sound_play("teleport",
                    {to_player=player:get_player_name(), gain = 1.0})
                unified_inventory.go_home(player)
            else
                minetest.chat_send_player(player_name,
                    S("You don't have the home priviledge!"))
            end
        end,

for "Go Home"..
This work as button "Set time", it's a just send message that no privelege, but now i look around and learn lua, i want to remove this button if no privelege at all, but at this time i do not known how to do this..
 

User avatar
VanessaE
Moderator
 
Posts: 4181
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by VanessaE » Sun Jul 19, 2015 21:02

Changes merged in, with minor tweaks to the warning message.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
 

User avatar
VanessaE
Moderator
 
Posts: 4181
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

Re: [Mod] Unified Inventory [1.0] [unified_inventory]

by VanessaE » Mon Oct 05, 2015 08:45

New feature: per-user "full mode override", for use when "lite" mode is configured as default. Give users "ui_full" privilege to switch it on for them.

API changes: For those whose mods work with UI, you will need to make a couple of changes...

First, for any button you register, if it should be hidden from the formspec in Lite mode, set "hide_lite=true" in that button's definition, like so:

https://github.com/minetest-technic/uni ... er.lua#L46

Second, you will need to change your formspec registrations slightly to grab the per-user form info and use its various X/Y offset values, like this:

https://github.com/minetest-technic/uni ... r.lua#L144

The available per-user offsets are described here:

https://github.com/minetest-technic/uni ... al.lua#L21
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
 

User avatar
VanessaE
Moderator
 
Posts: 4181
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
 

Previous

Return to Old Mods



Who is online

Users browsing this forum: No registered users and 5 guests