minetest-mods / craftguide

:book: The most comprehensive Crafting Guide on Minetest
Other
43 stars 20 forks source link

Idea: Button instead of setting for progressive_mode #45

Closed bell07 closed 5 years ago

bell07 commented 5 years ago

The craftguide does support currently 2x modes for items selection: "All items" and "Crafteable by items in inventory", managed by game setting "craftguide_progressive_mode".

My proposal is to allow the player to the switch between the modes using a new button/toggle. Maybe with interface like (pseudocode) craftuide.register_selection("progressive", {recipe_in_inv = function() } to allow to add additional selection views by other mods.

the smart_inventory builtin crafting guide know the next selection modes

I am interested to port some of them to new craftguide-addon mods if possible

kilbith commented 5 years ago

I'm very conservative about adding new buttons. We'd then slip slowly to a cluttered interface and that sucks. craftguide is successful somehow because even a retarded can use it without headache (is this just as true for smart_inventory?).

However, regarding the proposed selection modes:

You can port your work onto a new branch if you want.

@Wuzzy2 Whatcha think?

Wuzzy2 commented 5 years ago

would require to write on a file.

No, we have player metadata now. But still would be quite some data per-player to save.

I don't think a button should be added. The mode should be fixed throughout the game session.

bell07 commented 5 years ago

The smart_inventory development was driven by trying out some ideas I had and by playing with smartfs framework. It is overloaded with features I never use. Now I consolidate which implemented features I really use and try to port them in any way to sfinv-enhancements. See my new smart_sfinv modpack.

Back to topic: I really like the idea to be able to swich between the views on demand. How it can be done is secondary for me. In smart_inventory there is a button for each mode. Now I propose to use Toggle-Button with name of the mode on it. Or dropdown-list with modes? Maybe the button is disabled/hidden if the minetest.conf setting is set?

New idea is to have only the "All" mode in the craftguide by default. If only 1 mode is available, the toggling can be hidden. Other modes are implemented in secondary enhancement mods (for example called craftguide_progrssive). If mods are active the selection appears.

About the Modes:

kilbith commented 5 years ago

OK, this will be accepted if:

p-ouellette commented 5 years ago

:-1: progressive mode is a server setting, players should not be allowed to toggle it.

Admin can already toggle it with /set craftguide_progressive_mode true/false (although this does not update properly because we cache the setting at load time [easy fix]).

bell07 commented 5 years ago

Nex step in Brainstorming, I checked all my use-cases again and found out it is ok for me if the mode is not switcheable oO. I just need a way to replace the current progressive by doc_items revealed logic (3) if I find time to port it. The crafting proposals should be maybe own mod/sfinv tab. The setting craftguide_progressive_mode is fine for me now, I need just a way to replace the current "Crafteable by inventory items" implementation by my logic trough defined API. My proposal is to implement any function like craftuide.set_progressive_filter(function(player, item, ???) to be able to replace the implementation from "enhancement" mod.

p-ouellette commented 5 years ago

@bell07 I added API functions for customizing progressive mode to #46. See the README.md. Does that work?

bell07 commented 5 years ago

This issue can be closed. The API is what I search for. Thank you!

If I like to be able to switch between the modes, I just can implement using API function one progressive mode that contains all modes and is able to switch them ;-)