Add Library View to the launcher#2710
Conversation
Will be working on the design next
Laid some of the groundwork for LibraryView and completed most of its design. Also added the BZ game card in case its use is required in the future 👀
Game installations, after being automatically detected, will be saved into the Nitrox long-term cache, along with any manually added game installations not detected by the automatic game detection code. Any game installations that the user wants removed will not show up in the launcher any more unless the user manually adds that installation again.
This make it more clear that the Nitrox launcher isn't deleting the game itself from the computer :)
This makes it easier for users to see each server's IP and Port
Also added backup card/text for when no installations are being shown and transferred some path icons into Svgs.
Now, any game installation that does not exist on the PC anymore will be removed automatically. Also fixed another small issue.
Now, the game installation lists will keep the same order even after selecting a different installation in LibraryView and OptionsView
|
|
||
| public string ServerName { get; set; } = string.Empty; | ||
| public string ServerIP { get; set; } = string.Empty; | ||
| public int ServerPort { get; set; } = 11000; |
There was a problem hiding this comment.
Use constant value from SubnauticaServerConstants in Nitrox.Model
| public partial int PlayerCount { get; set; } = 0; | ||
|
|
||
| [ObservableProperty] | ||
| public partial int MaxPlayers { get; set; } = 100; |
There was a problem hiding this comment.
Time to add this as a constant to SubnauticaServerConstants. And then use this constant in SubnauticaServerOptions too.
|
|
||
| public AvaloniaList<KnownGame> InstalledGames { get; } = []; | ||
|
|
||
| public List<KnownGame> RefreshInstalledGames(GameInfo gameInfo) |
There was a problem hiding this comment.
All code that's accessing files should be async so that they don't cause UI hangs / stutter.
|
|
||
| public AvaloniaList<KnownGame> InstalledGames { get; } = []; | ||
|
|
||
| public List<KnownGame> RefreshInstalledGames(GameInfo gameInfo) |
There was a problem hiding this comment.
This method is getting chunky. Move logic into private methods that do one "thing". For example, logging should be moved into a method call. And savedGames code can be a separate method as well which also allowed use of IEnumerable and yield return to simplify processing.
This comment was marked as spam.
This comment was marked as spam.
- Moved MaxPlayers default value into SubnauticaServerConstants - Used those constants as required - Refactored any code that accessed files to be async - Refactored GameInstallationService
LibraryView will now display the host server name, online player count, online player names, max player count, and online status count of the remote servers listed in that view. Then, it'll refresh them periodically following this logic: 1. When first loading the view, it'll refresh all RecentServerEntries 2. After that, it'll start a 15 second refresh loop where it only refreshes online servers 3. Every 4th refresh, it'll refresh all listings 4. When navigating away from the view and back, it'll only refresh the online servers and then continue the refresh cycle I was not able to figure out how to transfer server image data without the icon looking very low quality (or failing to send), so I left it as a TODO for the future.
Seems a bit of a hacky way to do this, but I can't figure out a better way to make the RadioButton icon be equally spaced on both sides (or have a controllable width between the icon and the button content)
Found out a better way to do it :)
From SubnauticaNitrox#2721 Co-Authored-By: Meas <1107063+Measurity@users.noreply.github.com> Co-Authored-By: Jannify <23176718+Jannify@users.noreply.github.com>
|
This PR is now ready for testing/reviews. |
|
This PR and master should be connection tested as we had trouble connecting over WAN. As for the design, game installations are now configurable in both "Library View" and "Options View". I think it would be best to merge these two into the "Play game" view as a combobox instead of the simple "Play Multiplayer" button there's now. As for "recent servers", I think we should add this to "Servers" view with a new tab "Recently Visited" and a "Self host" tab. Then we can remove the "Library" view and simplify launcher navigation in my opinion. Thoughts? |



This PR adds a new tab to the launcher, named: Library
In this tab, you can:
Also, Options view was changed to support multiple game installations instead of only one, featuring the same game installation management features as Library View.
TODO:
Images:





(no installations)