Skip to content

Add Library View to the launcher#2710

Open
NinjaPedroX wants to merge 20 commits into
SubnauticaNitrox:masterfrom
NinjaPedroX:library-view
Open

Add Library View to the launcher#2710
NinjaPedroX wants to merge 20 commits into
SubnauticaNitrox:masterfrom
NinjaPedroX:library-view

Conversation

@NinjaPedroX
Copy link
Copy Markdown
Contributor

@NinjaPedroX NinjaPedroX commented Apr 15, 2026

This PR adds a new tab to the launcher, named: Library

In this tab, you can:

  1. View all instances of the game installed on your computer, all of which are saved into the Nitrox long-term cache.
  2. Manually add/remove game installations to/from the launcher.
  3. Easily manage which instance of Subnautica you would like to use Nitrox with.
  4. View the status of any server you joined/added in the main menu (data such as online status and player counts/names).

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:

  • Add communication between the launcher and remote servers to allow for the retrieval of its online status, host server name, online player count, max player count, online player names, and server image (not anymore).

Images:
image
image
image
(no installations)
image
image

NinjaPedroX and others added 10 commits April 6, 2026 21:24
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
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Test Results

255 tests  ±0   252 ✅ ±0   9s ⏱️ ±0s
  1 suites ±0     3 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 12f2d61. ± Comparison against base commit 22cf75e.

♻️ This comment has been updated with latest results.


public string ServerName { get; set; } = string.Empty;
public string ServerIP { get; set; } = string.Empty;
public int ServerPort { get; set; } = 11000;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use constant value from SubnauticaServerConstants in Nitrox.Model

public partial int PlayerCount { get; set; } = 0;

[ObservableProperty]
public partial int MaxPlayers { get; set; } = 100;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@CherrieTheShifter

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
@NinjaPedroX NinjaPedroX requested a review from Measurity May 7, 2026 14:18
NinjaPedroX and others added 6 commits May 7, 2026 17:07
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>
@NinjaPedroX NinjaPedroX marked this pull request as ready for review May 8, 2026 02:42
@NinjaPedroX
Copy link
Copy Markdown
Contributor Author

This PR is now ready for testing/reviews.

@misterbubb misterbubb added the Area: user interface (launcher) Related to UI/UX in the launcher label May 8, 2026
@dartasen
Copy link
Copy Markdown
Member

dartasen commented May 9, 2026

Yay 🎶

When I saw the library design on Figma, I was thinking of doing a curse forge like experience. Where you can start the game with your profile (which would be game installation for our need)
i.e:
image
image

And I feel like it's missing UX from this feature. Currently the feature is +- the same as option page. I think we should be able to start the game from this view, but also be able to switch profile from the LaunchGame view as well, maybe something like that :

image

The question that remains for me is why we would keep the UI of the options page if the new “Library” section handles that aspect.
Maybe we should ask the team to test the feature and give some feedback, and that would be cool to double check with Rux as well

@NinjaPedroX
Copy link
Copy Markdown
Contributor Author

NinjaPedroX commented May 9, 2026

Yay 🎶

When I saw the library design on Figma, I was thinking of doing a curse forge like experience. Where you can start the game with your profile (which would be game installation for our need)
i.e:
image
image

And I feel like it's missing UX from this feature. Currently the feature is +- the same as option page. I think we should be able to start the game from this view, but also be able to switch profile from the LaunchGame view as well, maybe something like that :

image

The question that remains for me is why we would keep the UI of the options page if the new “Library” section handles that aspect.
Maybe we should ask the team to test the feature and give some feedback, and that would be cool to double check with Rux as well

Sounds good, I'm down to implement whatever the team/Rux recommends. I agree that having the game selection feature in two different views is a bit redundant.

If we decide to do it where we can start the game in Library View, would we need the start game buttons in Launch Game View anymore? I'm not sure how that would work.

@Measurity Measurity added the Status: Needs testing Pull Request is waiting for testing label May 19, 2026
@Measurity
Copy link
Copy Markdown
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: user interface (launcher) Related to UI/UX in the launcher Status: Needs testing Pull Request is waiting for testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants