Page 1 of 1
[Mod] Simple Fast Inventory Buttons [1.0.0] [sfinv_buttons]

Posted:
Mon Dec 19, 2016 21:34
by Wuzzy
Adds a tab to your default Minetest Game inventory in which other mods can add simple buttons to access special functionality.Just open the inventory menu, select the “More” tab and click on a button.
The mod itself does not add these buttons on its own, instead other mods need to depend on this mod.
Example:

(Your inventory menu might look different because of different mods.)
This list may be incomplete.
Download (and stuff)Download:
sfinv_buttons1.0.0.zip
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Mon Dec 19, 2016 21:53
by mahmutelmas06
This is must have if using default inventory.
Could you also make possible to choose icons only mode? Then there could be buton grid instead of list
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Mon Dec 19, 2016 22:09
by Wuzzy
I don't see an use of an icon-only mode.
IMO it would be less usable since the corresponding text is now hidden inside a tooltip. I think the button+icon variant is the best because the text makes it clear what it is for and the icon makes it easier on the eye.
Also, this tab disables the normal inventory grid to make room for all buttons.
But if I hear feedback from actual users on how they perceive the mod's usability, I'd gladly take it. :-)
But the mod already has a fallback mode if the space for buttons is completely used up: It displays a scrollable text list instead. This means, this mod supports an arbitrary amount of buttons.
However, I would generally not recommend mods to add huge amounts of buttons, to keep things simple. Buttons should only be added for accessing their core functionality, such as the main form.
If a modder would like to add, let's say, a complete “control panel”, adding a new sfinv tab would be better. Note: sfinv is a new Minetest Game mod by rubenwardy, it has a quite powerful API. Interested modders should take a look at it.
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Tue Dec 27, 2016 20:37
by cHyper
How can i execute a command?
What are the lines of code therefore?
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Tue Dec 27, 2016 21:57
by Wuzzy
Do you want to learn how to add your own button with this mod?
In this case, read API.md which is included with the mod.
http://repo.or.cz/minetest_sfinv_button ... er:/API.mdIf you meant something else, sorry. I have no idea what you want from me. :-(
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Tue Dec 27, 2016 22:16
by rubenwardy
Very nice! This should be quite good to make a replacement for unified inventory's button bar
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Tue Dec 27, 2016 22:18
by hajo
cHyper wrote:How can i execute a command?
Wuzzy wrote:If you meant something else, sorry. I have no idea what you want from me. :-(
Maybe he wants a button that executes a chat-command, like "/privs".
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Wed Dec 28, 2016 09:23
by cx384
Nice mod!
It would be great to have a fake unified inventory mod which automatically converts the unified inventory buttons into simple fast inventory buttons.
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Wed Dec 28, 2016 11:56
by cHyper
hajo wrote:cHyper wrote:How can i execute a command?
Wuzzy wrote:If you meant something else, sorry. I have no idea what you want from me. :-(
Maybe he wants a button that executes a chat-command, like "/privs".
yes.
i mean chat-commands!
but how can i do that?
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Wed Dec 28, 2016 12:38
by Wuzzy
It would be great to have a fake unified inventory mod which automatically converts the unified inventory buttons into simple fast inventory buttons.
Or just convince modders to support both mods. The APIs are both relatively simple, so the overhead should be rather small. It's a pity that Unified Inventory has no API documentation whatsoever.
yes.
i mean chat-commands!
but how can i do that?
I fear this is not directly possible as Minetest does not expose a list of registered chat commands.
But what you could do instead is write a mod which adds a button which does the same action of the chat command. If you don't know how to do it, you should either learn how to mod or ask a modder to do it for you.
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Wed Dec 28, 2016 12:45
by rubenwardy
Wuzzy wrote:yes.
i mean chat-commands!
but how can i do that?
I fear this is not directly possible as Minetest does not expose a list of registered chat commands.
But what you could do instead is write a mod which adds a button which does the same action of the chat command. If you don't know how to do it, you should either learn how to mod or ask a modder to do it for you.
minetest.chatcommands
See irc commands:
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
function(user, args)
if args == "" then
return false, "You need a command."
end
if not irc_users[user.nick] then
return false, "You are not logged in."
end
local found, _, commandname, params = args:find("^([^%s]+)%s(.+)$")
if not found then
commandname = args
end
local command = minetest.chatcommands[commandname]
if not command then
return false, "Not a valid command."
end
if not minetest.check_player_privs(irc_users[user.nick], command.privs) then
return false, "Your privileges are insufficient."
end
minetest.log("action", user.nick.."@IRC runs "
..args.." as "..irc_users[user.nick])
return command.func(irc_users[user.nick], (params or ""))
end
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Wed Dec 28, 2016 13:25
by Wuzzy
Oh, sorry, rubenwardy, for not knowing about the completely undocumented minetest.chatcommands table. :P
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Sat Dec 31, 2016 00:27
by rubenwardy
Here! Have a PR:
Add icon bar mode - adds an icon bar to every page
Put sfinv_buttons_use_icon_bar = true in minetest.conf to enable
Really I need to make a sfinv.register_on_player_submit_fields function, would make this a lot easier
Also, I made a mod which uses this mod:
viewtopic.php?f=9&t=16290
Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

Posted:
Sat Dec 31, 2016 01:36
by Wuzzy
And as soon as the 10th or 11th button is added, this mod breaks.
Version 1.0.0 released!

Posted:
Sun Mar 19, 2017 20:27
by Wuzzy
Version 1.0.0 released!
This mod has been long enough in version 0.1.0, is finished and no bugs have been found. It's about time for an official release. :-)
Not much changed, I just fixed some typos.
Re: [Mod] Simple Fast Inventory Buttons [1.0.0] [sfinv_butto

Posted:
Tue Mar 21, 2017 19:03
by azekill_DIABLO

Woohoo!