[Mod] Simple Fast Inventory Buttons [1.1.2] [sfinv_buttons]

Post Reply
User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

[Mod] Simple Fast Inventory Buttons [1.1.2] [sfinv_buttons]

by Wuzzy » Post

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:
sfinv_buttons.png
sfinv_buttons.png (13.54 KiB) Viewed 1221 times
(Your inventory menu might look different because of different mods.)
Spoiler
This list may be incomplete.
Download (and stuff)
Download: 1.1.2
Last edited by Wuzzy on Sat May 20, 2023 19:20, edited 14 times in total.

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

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by mahmutelmas06 » Post

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
My Mods:

Beverage

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by Wuzzy » Post

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.

u34

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by u34 » Post

How can i execute a command?
What are the lines of code therefore?

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by Wuzzy » Post

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.md

If you meant something else, sorry. I have no idea what you want from me. :-(

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

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by rubenwardy » Post

Very nice! This should be quite good to make a replacement for unified inventory's button bar
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

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

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by hajo » Post

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".

User avatar
cx384
Member
Posts: 653
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by cx384 » Post

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.
Can your read this?

u34

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by u34 » Post

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?

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by Wuzzy » Post

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.

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

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by rubenwardy » Post

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:

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by Wuzzy » Post

Oh, sorry, rubenwardy, for not knowing about the completely undocumented minetest.chatcommands table. :P

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

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by rubenwardy » Post

Here! Have a PR: Add icon bar mode - adds an icon bar to every page

Image

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Simple Fast Inventory Buttons [0.1.0] [sfinv_butto

by Wuzzy » Post

And as soon as the 10th or 11th button is added, this mod breaks.

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Version 1.0.0 released!

by Wuzzy » Post

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.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Simple Fast Inventory Buttons [1.0.0] [sfinv_butto

by azekill_DIABLO » Post

Image

Woohoo!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

Re: [Mod] Simple Fast Inventory Buttons [1.0.0] [sfinv_butto

by KCoombes » Post

Fabulous work, and any chance of making two columns of buttons, instead of one?

Not necro, just wondering if it's possible (best to ask the expert)

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Simple Fast Inventory Buttons [1.0.0] [sfinv_butto

by Hamlet » Post

Updated version: https://git.minetest.land/Hamlet/mevo/s ... nv_buttons

Added:
mod.conf
i18n support (MT engine)
My repositories: Codeberg.org | My ContentDB's page

u34

Re: [Mod] Simple Fast Inventory Buttons [1.0.0] [sfinv_butto

by u34 » Post

Hamlet wrote:
Sat Sep 28, 2019 19:20
Updated version: https://git.minetest.land/Hamlet/mevo/s ... nv_buttons

Added:
mod.conf
i18n support (MT engine)
404 .. i wanna port this mod to Unified_Inventory with GUI integration...
i wanna try this out?

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

I just released version 1.1.0

by Wuzzy » Post

I just released version 1.1.0, changing the locale system from intllib to Minetest's.

Minetest version 5.0.0 or later is now required.

u34

Re: [Mod] Simple Fast Inventory Buttons [1.1.0] [sfinv_buttons]

by u34 » Post

how can I add bags-support to sfinv_button?
is this possible?
which version of minetest do I need for this?

u34

Re: [Mod] Simple Fast Inventory Buttons [1.1.0] [sfinv_buttons]

by u34 » Post

cHyper wrote:
Mon Jan 18, 2021 15:48
how can I add bags-support to sfinv_button?
is this possible?
which version of minetest do I need for this?
more info at:
viewtopic.php?p=389021#p389021

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Simple Fast Inventory Buttons [1.1.2] [sfinv_buttons]

by Wuzzy » Post

This mod has been migrated to Codeberg.org.

Also, version 1.1.2 is released, updating the mod metadata and fixing a typo.

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests