Skip to content

Conversation

@nicopop
Copy link
Contributor

@nicopop nicopop commented Feb 20, 2025

Alternate continuation of #115

old description it didnt feel polite to continue on their branch/pr so I made mine and merged from theirs if silasary wants to continue their own version of this then I can close this PR

The important bit:

This PR let Devs set a recommended sorting order for both items and locations
BUT it let the users override that ordering via command (for now) so that from then on the user will use that selected sorting
I made it so that override get saved to Hosts.yaml currently to the "manual_settings" key
The default sorting is alphabetical ID based on comments but it can be changed easily

The part im less sure:

Host.yaml key

the one thing im not sure about that is the setting key, or in the host.yaml should every manual's setting use a single "manual_settings" key of have one for each manual

  • on the singular key side:
    • Pro:
    • any manual share the same saved sorting
    • Con:
      • if in the future or via hook someone create settings this might do something weird
  • on the Key per manual side:
    • Pro:
      • a player can choose to only override the setting for X manual instead of all of them
      • if someone make some custom settings for their Manual apworld it stays compatible and wont get overriden with ours
    • con:
      • they have to do /location_sorting (or future buttons) each time they play a new manual
        (currently going for singular but im leaving the code commented out for multiple)

Maybe add buttons?

Also I dont know how to make buttons so commands is what you'll get for now
AP ClientSide is something I barely know, I can work with what's already there or get inspired from other apworlds if required (minecraft fabric client was a big source of info on how to use and save settings)

If anyone wants to participate in the PR to add those or find a better way to refresh the locations on change of sorting then feel free to do so

Currently using this to implement stuff that can be pulled back to 115 when ready

@nicopop nicopop self-assigned this Feb 20, 2025
@FuzzyGamesOn
Copy link
Collaborator

FuzzyGamesOn commented Feb 20, 2025

I feel like this PR is missing the point of what was discussed in #115. To be completely honest, a sort preference that the world dev sets is the lowest importance thing that was discussed in that PR.

#115 didn't progress further because it left the default sort order up to the world dev, which fails to give Manual players a consistent, world-independent default sort order, which is what the current alphabetical sorting provides. It doesn't matter what the default sort order is, but it has to be consistent across all worlds as a default. When players ask "how are these sorted by default", our answer should be clear.

So, if players are unhappy with the default sort order in the unstable, then we have to change the default sort order. Then we can add on as many sort modifiers as we want after. But first step is "change alphabetical to something else". Axx suggested doing it by id instead in https://discord.com/channels/1097532591650910289/1097891385190928504/1315877764083220500, and I think that's a viable idea. 😃


To add a bit of context, this prior feedback on #115 is important:

World devs can have a preference -- if they would find that useful -- but shouldn't be allowed to provide a default that overrides a player's choice or default.

@silasary
Copy link
Collaborator

I've only glanced at the code briefly, but my impression is that the author defined sort order only applies if the user configures it to "recommended".

The moment they preference always sorting by name/id, the apworld preference goes out the window.

(If I'm wrong and that's not the behaviour, it probably should be)

@nicopop
Copy link
Contributor Author

nicopop commented Feb 20, 2025

@FuzzyGamesOn 2 things,

  1. I updated the description so its more clear what this pr do
  2. This pr let devs set a recommended sorting yes, but it let the user override the default by doing /items/locations_sorting to anything other than recommended and that saves to hosts.yaml so next time the user loads a manual it use their saved setting

@nicopop
Copy link
Contributor Author

nicopop commented Feb 20, 2025

also if we want preference to go back to id then I literaly just need to change 8 SortingOrder.alphabetical -> SortingOrder.id in different spots

@nicopop nicopop changed the title Dev recommended item/loc sorting Dev recommended item/loc sorting but player can override it Feb 20, 2025
@silasary
Copy link
Collaborator

I think in absence or user or author preferences, we should do Alphabetical by default. It's usually a better experience, and is what the current Unstable is doing.

@FuzzyGamesOn FuzzyGamesOn added the paused for client updates Until further notice, only bugfixes will get merged for the client label Apr 17, 2025
@silasary
Copy link
Collaborator

oooh, I like those

@FuzzyGamesOn FuzzyGamesOn removed the paused for client updates Until further notice, only bugfixes will get merged for the client label Sep 10, 2025
@FuzzyGamesOn
Copy link
Collaborator

Removed the client update paused label from this one. I like the natural sorting addition! Almost feels like it should be the default now that it's an option, since it's just alpha + good number sorting. Will circle back to code review soon.

@nicopop
Copy link
Contributor Author

nicopop commented Sep 18, 2025

I intend to work on this again soonish (potentially this week if im not too busy)
I plan to set natural sort as default and maybe revisit the apworld recommended sorting part idk

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

Successfully merging this pull request may close these issues.

4 participants