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

PagingButtons can't find the pagingPane on XML loading #1943

Open
Sorax5 opened this issue Jan 22, 2025 · 0 comments
Open

PagingButtons can't find the pagingPane on XML loading #1943

Sorax5 opened this issue Jan 22, 2025 · 0 comments
Labels

Comments

@Sorax5
Copy link

Sorax5 commented Jan 22, 2025

Hello, I recently wanted to test the XML feature of the plugin, but I think I found a problem with the loading of Paging.

For reference here is my XML:

<chestgui title="Dressing Room" rows="6">
    <patternpane x="0" y="0" length="9" height="6">
        <pattern>
            <row>100000001</row>
            <row>111111111</row>
            <row>100000001</row>
            <row>100000001</row>
            <row>100000001</row>
            <row>111111111</row>
        </pattern>
        <binding char="1">
            <item id="BLACK_STAINED_GLASS_PANE" field="backgroundItem" />
        </binding>
    </patternpane>

    <paginatedpane x="1" y="0" length="7" height="1" populate="populatePartEnum" id="partenum"/>
    <paginatedpane x="1" y="2" length="7" height="3" id="clothproduct" populate="populateClothProduct"/>

    <pagingbuttons x="0" y="0" length="9" pages="partenum" />
    <pagingbuttons x="0" y="3" length="9" pages="clothproduct" />

</chestgui>

As you can see, I did what the wiki asked me to do, i.e. to put an Identifier to the PagingPane and to put this reference in PagingButtons.
Except that I got this error on loading:
Paging buttons pages reference is invalid

Which, after reading the source code, comes from the fact that PagingButtons can't find the identifier of the associated PagingPane.

After a number of tests, I came to the conclusion that the problem was with “populate”. In fact, if I remove these attributes, I get no errors (and no items, since I can't hydrate my GUI).

I think that populate blocks the recording of the pane identifier (or does so after the buttons are loaded), which means that the buttons can't find the associated Paginated Pane.

Is the error mine or is it a problem with the library?

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

No branches or pull requests

2 participants