Giter Club home page Giter Club logo

Comments (9)

kilbith avatar kilbith commented on May 26, 2024

Since 92cf230 the inv_items table is used for all progressive implementations that is not always right.

No, wrong: a076e10. Though I'm not satisfied with this patch, I'm waiting @pauloue to take a look.

from craftguide.

bell07 avatar bell07 commented on May 26, 2024

Line 263 is still item_in_inv(item, data.inv_items)). The data.inv_items is used by the default progressive implementation and managed by poll_new_items chain.
Hm, there is no way to disable the poll_new_items chain for custom implementation.

from craftguide.

kilbith avatar kilbith commented on May 26, 2024

If you read the code correctly you'd see this is not used by all progressive implementations but the default one.

from craftguide.

bell07 avatar bell07 commented on May 26, 2024

The function get_filtered_items is used for all progressive implementations. Therefore since 92cf230 the data.inv_items is used partially (check if item revealed to be shown with usages) for all implementations.

from craftguide.

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

data.inv_items and poll_new_items are used only for the default filter. They are not used if you disable progressive mode. The use of data.inv_items in get_filtered_items was to fix #68 and the proposed API would be necessary to make this fix apply to other recipe filters, but I'm not sure if #68 is really a big enough issue to add a new API.

from craftguide.

bell07 avatar bell07 commented on May 26, 2024

I am about the case the progressive mode is enabled, but the default implementation is replaced trough craftguide.set_recipe_filter().
The Use-case is my craftguide_reveal mod. The mod does the same as the default one, but uses the reveal-tracking table from doc_items mod instead of data.inv_items. I search for a way to replace the data.inv_items in line 262 by the doc_items table. And the way to disable the poll_new_items chain since the polling is done in doc_items.

from craftguide.

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

If you don't want to use the default progressive mode you should disable it and use craftguide.add_recipe_filter so that poll_new_items doesn't get called and data.inv_items doesn't get saved. Progressive mode doesn't have to be enabled to use recipe filters.

from craftguide.

bell07 avatar bell07 commented on May 26, 2024

You are rigt, I see there are a lot of changes in code since I get the deeper look last time. If I disable the progressive mode I get the issue #68 with my implementation. In #74 is my proposal to finally fix the issue. Just pass all needed informations to the filter function, the filter function can handle the crafting/usage difference.

from craftguide.

bell07 avatar bell07 commented on May 26, 2024

The reason for this issue is solved in #75.
Therefore this issue can be closed if the #75 is merged.

The initially proposed "Item filter" would be still useful, but not a must-have.

If interessted I can implement the "Item filter" API functions, I just don't want to start coding in assumption it will be rejected from the beginning.

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.