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

Show list of favorite maps in "create game" window #2238

Open
Marc-Spector opened this issue May 9, 2021 · 3 comments
Open

Show list of favorite maps in "create game" window #2238

Marc-Spector opened this issue May 9, 2021 · 3 comments

Comments

@Marc-Spector
Copy link
Collaborator

Sometimes players don't always remember the names of their favorite maps.
Add the ability to see a list of favorite maps.
Add favorite maps using the context menu in the list of all maps.
Delete favorite maps using the context menu in the list of favorite maps.
What do you think about this?

@1-alex98
Copy link
Member

Hmm I think thats to complicated. If at all I would determine the favourite maps automatically and not set them.

@Veritania
Copy link

I'm diving into this one. I've added some UI elements for now, but I could use some guidance on how you'd like the players Favourite maps data to be stored.

In the Create Game window, there's now a checkbox in the Filter to only search/show maps that has previously been marked as Favourite. Then on a maps preview there's another checkbox added for marking that specific map as Favourite. Perhaps it's taking up too much valuable space here?

faf-favmap

What I'm thinking is that we can get away with only storing a list of MapIDs that has been marked as a Favourite by the player. I'm assuming that a MapID is unique to a map.
Then during the filtering here:

public void runFilter() {
filteredMaps.setPredicate((map) ->
isEqualToNumberOfPlayers(map) && isEqualToMapWidth(map) && isEqualToMapHeight(map) && containsMapName(map));

we'll include a filter for "only show favourites", and compare MapIDs to the IDs stored in the players fav map list; as long as the Filter Checkbox is selected.

I've forked the project and I'm tinkering with the issue here https://github.com/Veritania/downlords-faf-client/pull/1 if you'd like to see the changes.

Whats the preferred way of storing and accessing this kind of data? I'm new to this project, so feel free to give me some pointers.

@Sheikah45
Copy link
Member

Sheikah45 commented Jun 25, 2022

The best way to store it would be a list of map folder names in the VaultPrefs which are then stored in the client.prefs file. But if you just add them there then they will be automatically included in the serialization process. They have to be the map foldernames because not every map has an ID.

Additionally it would probably be useful to implement that if a map generator map is favorited then it isn't deleted when the client is closed.

Also selection of favorites maps could be added to the installed maps window in the vault, I don't know if the best place is the create game window as it is already pretty crowded.

Also I would probably replace the check with an icon for favorite.

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

4 participants