Closed bell07 closed 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?
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.
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:
All items: Builtin/Default mode - I use it in creative worlds most time
Crafteable by items in inventory (=progressive) - I do not use this because if I move an item to a chest the recipes gets lost.
Crafteable by already revealed items - depends on "doc_items" and uses the reveal database (huge file) from this mod. I use this mode most time in survival. A side effect is the items with recipe, but not crafteable because of not obtaineable items in recipe, stay always hidden.
Crafting proposals - The helper for "Crafteable by already revealed items" mode. Uses the doc_items reveal database too. In short: Show recipes that does have not revealed items as output, but all input items are already revealed, with ranking which item is more useful. See ui_tools.filter_by_top_reveal(list, playername)
"Crafting grid pattern match" -I'm unsure about its utility too. I do not really use it, since it is not enabled automatically by placing items to crafting grid. The feature can die.
OK, this will be accepted if:
/cg progressive_{inv,track,rank}
) to switch between modes are implemented. All modes but "pattern match".doc_items
whatsoever.:-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]).
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.
@bell07 I added API functions for customizing progressive mode to #46. See the README.md. Does that work?
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 ;-)
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