Giter Club home page Giter Club logo

Comments (5)

Wuzzy2 avatar Wuzzy2 commented on May 23, 2024 1

Maybe also check on certain events, like actually crafting the item. ;-)

I think polling the inventory all the time is not a pretty solution, I suppose there are still ways for the mod to β€œmiss” items. But it might be OK for a workaround.

Will test later.

What we would actually need would be an engine call to detect when the contents of the player inventory changed. This would make things much simpler.

from craftguide.

kilbith avatar kilbith commented on May 23, 2024 1

Maybe also check on certain events, like actually crafting the item

0956e86

from craftguide.

p-ouellette avatar p-ouellette commented on May 23, 2024

Progressive mode currently only updates the "discovered" recipes whenever the filter is applied (when the craftguide is opened). It does this by adding undiscovered items in the player's inventory to the discovered list. The planks are never discovered because you don't open the craftguide with them in your inventory.

It would be better to "discover" an item the moment it appears in a player's inventory, but there is no Minetest callback for this. The current system could be improved by discovering items on_dignode, but this won't cover all cases so it would still be necessary to periodically check the player's inventory for undiscovered items. Doing this check when the guide is opened makes no sense because a player could find all the items in the game and put them in a chest, then open the guide with an empty inv, and they will have discovered nothing.

from craftguide.

kilbith avatar kilbith commented on May 23, 2024

We could check the current player inventory inside minetest.register_globalstep, and if an item is not inside data.inv_items: update the progressive items list according to that.

from craftguide.

kilbith avatar kilbith commented on May 23, 2024

96c3047
Can you test please?

from craftguide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.