openplanet-nl / plugin-manager

In-game plugin manager, installer, and updater.
6 stars 5 forks source link

pages (for PluginListTab) #15

Closed XertroV closed 1 year ago

XertroV commented 2 years ago

plugin manager doesn't support pages atm. this hasn't been that big of a problem, but it's going to become more of a problem as more plugins are created.

e.g., currently, the featured tab omits better loading screens and menu background chooser b/c they're on the 2nd page.

I see that there is some code for pages already (particularly: m_total, m_page, and m_pageCount are set in HandleResponse) and I've manged to implement a simple 'keep-requesting-all-pages-and-append-them-one-at-a-time' feature.

@codecat, if you're cool with it, I'm happy to implement support for pages. If so, then I have some questions about UI preferences:

Do you have any prior ideas about the UI/UX around pages?

If not, I have 3 ideas:

  1. v simple 'request all the pages' -- this would call the API N times for N pages and would load all the images, too. (I guess this isn't ideal, but maybe the bandwidth load is negligible?)
  2. 'infinite scroll' type thing -- when the user scrolls to the bottom, a message is shown and the next page is requested. if there are no more pages then the message says that instead.
  3. page tabs -- basically just enumerate the pages in a tab bar at the top (always defaults to page=0 (shown as "Page 1")), and load each page when the respective tab is clicked (results cleared between tab clicks).

Any preference between those 3 or other ideas?

XertroV commented 2 years ago

To clarify, option 1 above is basically what I've implemented atm. The changes are minimal:

the new StartRequest is just:

void StartRequest()
{
    Clear();
    StartRequestForPage(0);
}

edit: I had to make a few changes to other parts of the code (like the name of the mainmenu etc) so don't want to commit that up and pollute the source tree

codecat commented 2 years ago

Yes, this would be great to have a PR for! Infinite scroll I think makes the most sense to me, as that would be what people expect from other programs.

The first option of requesting all pages immediately would be wasteful when they are not needed. If we were to go this route, then it would be better for the server to just return all items instead of implementing paging at all.

XertroV commented 2 years ago

Yes, this would be great to have a PR for! Infinite scroll I think makes the most sense to me, as that would be what people expect from other programs.

Cool, I'll whip something up and post a vid to discord for feedback.