Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement Needed - Lookups in Inventory Response #166

Open
AardWolf opened this issue Mar 4, 2022 · 0 comments
Open

Enhancement Needed - Lookups in Inventory Response #166

AardWolf opened this issue Mar 4, 2022 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed idea/enhancement New feature or request

Comments

@AardWolf
Copy link
Contributor

AardWolf commented Mar 4, 2022

We have a few times when the server response doesn't quite contain all the information we need. An example from now is that the vending machine response with cheese names and quantities but we also need the identifier for convertible_intake. Currently we've hardcoded cheese names with their IDs

const cheeses = {
but the data we need is returned, it's just part of the inventory area of the response.

In this case we'd have to look up the inventory entry by cheese name and we can get the id that way. Below is a snippet for an entry in the inventory part of the response. We have the name from the vending response, we need the item_id. This would let us dynamically get the cheeses so future changes would be picked up automatically.

"glutter_cheese": {
            "item_id": 96,
            "name": "Glutter Cheese",
            "type": "glutter_cheese",
            "classification": "bait",
            "description": "This cheese is the result of the careful art of fusing a seemingly infinite quantity of flavours into a single cube of cheese. This decadent bait seems to be the only cheese capable of breaking the will power of the Masters of Cheese Belt.",
            "quantity": 340,
            "thumbnail": "https:\/\/www.mousehuntgame.com\/images\/items\/bait\/6ffad0e0918ecfa293eb91a94797bd6e.gif?cv=2",
            "display_order": 420,
            "status": null,
            "is_removable": true,
            "category": false,
            "has_stats": null,
            "thumbnail_gray": "",
            "thumbnail_transparent": null,
            "large": null,
            "limited_edition": null,
            "is_givable": null,
            "is_tradable": null,
            "is_trade_frozen": null,
            "is_hidden": null,
            "is_unknown": null,
            "is_new": null,
            "max_inventory_quantity": null,
            "min_points": 0,
            "min_title": null,
            "weapon_image_large": false,
            "tags": [
                {
                    "name": "Furoma",
                    "type": "furoma",
                    "priority": "m",
                    "display_order": 0
                }
            ],
            "thumbnail_large": "https:\/\/www.mousehuntgame.com\/images\/items\/bait\/7937548e372e610498bf5eedc2ebffae.jpg?cv=2",
            "min_title_wisdom": false
        }

The enhancement is to add two library functions - one to get item details by name and one to get item details by code. A third to get item details by id would also be welcome. There are other areas in the extension this functionality is used.

@AardWolf AardWolf added good first issue Good for newcomers idea/enhancement New feature or request help wanted Extra attention is needed labels Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed idea/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant