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

Debug Cheat Tools on desktop app #403

Open
GammaRex opened this issue Jul 2, 2024 · 3 comments
Open

Debug Cheat Tools on desktop app #403

GammaRex opened this issue Jul 2, 2024 · 3 comments

Comments

@GammaRex
Copy link

GammaRex commented Jul 2, 2024

in the desktop app, when using the scripts app.asar file, the debug cheat tool crashes when its on and you cant use the pokedex or held items inside the cheat tools.

image_2024-07-12_193939003

@ajthompson
Copy link
Contributor

This is reproducible in browser as well.

The held items crash seems to be because the return value of HeldItem().getSortedHeldItems() was changed to be a structure splitting the items into several dictionaries.

The snipped loading the held items at line 437 can be replaced with this to make the held items functionality work.

    // heldItems
    HeldItem.getSortedHeldItems().attack.items.forEach((itm, idx) => {
        const itmPretty = itm.name.replaceAll('_', ' ');
        modalBody.querySelector('#heldItems').innerHTML += `
            <div class="btn btn-primary col-2 item-bag-item" onclick="HeldItem.getSortedHeldItems().attack.items[${idx}].gain(parseInt(document.getElementById('inputAddHeldItems').value || 0))">
                <img title="${itmPretty}" src="assets/images/items/heldItems/${itm.name}.png" height="25px">
                <div>${itmPretty}</div>
            </div>
        `;
    });
    HeldItem.getSortedHeldItems().typeRestricted.items.forEach((itm, idx) => {
        const itmPretty = itm.name.replaceAll('_', ' ');
        modalBody.querySelector('#heldItems').innerHTML += `
            <div class="btn btn-primary col-2 item-bag-item" onclick="HeldItem.getSortedHeldItems().typeRestricted.items[${idx}].gain(parseInt(document.getElementById('inputAddHeldItems').value || 0))">
                <img title="${itmPretty}" src="assets/images/items/heldItems/${itm.name}.png" height="25px">
                <div>${itmPretty}</div>
            </div>
        `;
    });
    HeldItem.getSortedHeldItems().ev.items.forEach((itm, idx) => {
        const itmPretty = itm.name.replaceAll('_', ' ');
        modalBody.querySelector('#heldItems').innerHTML += `
            <div class="btn btn-primary col-2 item-bag-item" onclick="HeldItem.getSortedHeldItems().ev.items[${idx}].gain(parseInt(document.getElementById('inputAddHeldItems').value || 0))">
                <img title="${itmPretty}" src="assets/images/items/heldItems/${itm.name}.png" height="25px">
                <div>${itmPretty}</div>
            </div>
        `;
    });
    HeldItem.getSortedHeldItems().exp.items.forEach((itm, idx) => {
        const itmPretty = itm.name.replaceAll('_', ' ');
        modalBody.querySelector('#heldItems').innerHTML += `
            <div class="btn btn-primary col-2 item-bag-item" onclick="HeldItem.getSortedHeldItems().exp.items[${idx}].gain(parseInt(document.getElementById('inputAddHeldItems').value || 0))">
                <img title="${itmPretty}" src="assets/images/items/heldItems/${itm.name}.png" height="25px">
                <div>${itmPretty}</div>
            </div>
        `;
    });
    HeldItem.getSortedHeldItems().other.items.forEach((itm, idx) => {
        const itmPretty = itm.name.replaceAll('_', ' ');
        modalBody.querySelector('#heldItems').innerHTML += `
            <div class="btn btn-primary col-2 item-bag-item" onclick="HeldItem.getSortedHeldItems().other.items[${idx}].gain(parseInt(document.getElementById('inputAddHeldItems').value || 0))">
                <img title="${itmPretty}" src="assets/images/items/heldItems/${itm.name}.png" height="25px">
                <div>${itmPretty}</div>
            </div>
        `;
    });

There's also some issues with the onclick() functions showing up as undefined for loading or filtering quests or pokemon in those tabs, but that gets into front-end web dev stuff and I'm clueless about how that works.

@GammaRex
Copy link
Author

GammaRex commented Sep 2, 2024

Do you know if the issue with the pokedex setting can be fixed? Thank you for the help on this :)

@Xantriix
Copy link

i have changes the Script and it dosnt help.. any other options to fix this Script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants