Skip to content

Commit 2286395

Browse files
committed
Added specific message for each platform
1 parent ae5d8d9 commit 2286395

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

NitroxLauncher/Pages/LaunchGamePage.xaml.cs

+47
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.ComponentModel;
33
using System.Windows;
4+
using System.Windows.Controls;
5+
using System.Windows.Media;
46
using NitroxLauncher.Models;
57
using NitroxModel;
68
using NitroxModel.Discovery;
@@ -32,9 +34,12 @@ public LaunchGamePage()
3234

3335
private async void SinglePlayerButton_Click(object sender, RoutedEventArgs e)
3436
{
37+
LauncherNotifier.Info("Launching singleplayer Subnautica ...");
38+
3539
try
3640
{
3741
await LauncherLogic.Instance.StartSingleplayerAsync();
42+
3843
}
3944
catch (Exception ex)
4045
{
@@ -44,6 +49,48 @@ private async void SinglePlayerButton_Click(object sender, RoutedEventArgs e)
4449

4550
private async void MultiplayerButton_Click(object sender, RoutedEventArgs e)
4651
{
52+
if (sender is not Button button)
53+
{
54+
return;
55+
}
56+
57+
switch (GamePlatform)
58+
{
59+
case Platform.MICROSOFT:
60+
button.Background = new SolidColorBrush(Colors.Red);
61+
MessageBox.Show("Sorry, due to technical problems Nitrox isn't yet compatible with Subnautica on Microsoft Store\n\nWe're doing our best to give you the opportunity to be able to play again soon.", "Error while starting in multiplayer mode", MessageBoxButton.OK, MessageBoxImage.Error);
62+
return;
63+
64+
case Platform.STEAM:
65+
66+
if (!NitroxUser.IsNewestSubnautica.GetValueOrDefault(false))
67+
{
68+
break;
69+
}
70+
71+
button.Background = new SolidColorBrush(Colors.Red);
72+
MessageBox.Show(
73+
"Due to Subnautica's recent update \"Living Large\", Nitrox is currently not compatible.\nHowever you can still use older version of Subnautica in order to play Nitrox. You can do so by following these steps.\n\nENSURE NITROX AND SUBNAUTICA ARE CLOSED BEFORE PROCEEDING!\n\nChanging Subnautica to Legacy Build on STEAM:\n\n1. Right click Subnautica in Steam\n2. Click Properties\n3. Click Betas\n4. Select Legacy - Public legacy builds\n5. Close it out and let Steam download and install the Legacy version of Subnautica\n6. Run Subnautica through Steam (It will say \"Subnautica [legacy]\" in your library if you did it right)\n7. Launch Subnautica through Nitrox to play.",
74+
"Nitrox requires your attention",
75+
MessageBoxButton.OK,
76+
MessageBoxImage.Information
77+
);
78+
return;
79+
80+
case Platform.EPIC:
81+
82+
if (!NitroxUser.IsNewestSubnautica.GetValueOrDefault(false))
83+
{
84+
break;
85+
}
86+
87+
button.Background = new SolidColorBrush(Colors.Red);
88+
MessageBox.Show("Due to Subnautica's recent update \"Living Large\", Epic Games is currently not compatible with Nitrox.\n\nWe are working on an update we do not have an estimate as to when it is done.", "Error while starting in multiplayer mode", MessageBoxButton.OK, MessageBoxImage.Error);
89+
return;
90+
}
91+
92+
LauncherNotifier.Info("Launching Subnautica ...");
93+
4794
try
4895
{
4996
await LauncherLogic.Instance.StartMultiplayerAsync();

NitroxModel/Helper/NitroxUser.cs

+26
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,31 @@ public static string GamePath
100100
GamePlatform = GamePlatforms.GetPlatformByGameDir(gamePath);
101101
}
102102
}
103+
104+
public static bool? IsNewestSubnautica
105+
{
106+
get
107+
{
108+
if (string.IsNullOrWhiteSpace(GamePath))
109+
{
110+
return null;
111+
}
112+
113+
string streamingAssetsFolder = Path.Combine(GamePath, "Subnautica_Data", "StreamingAssets");
114+
string aaFolder = Path.Combine(streamingAssetsFolder, "aa");
115+
116+
if (!Directory.Exists(streamingAssetsFolder)) {
117+
// Probably authorization exception
118+
return null;
119+
}
120+
121+
if (File.Exists(Path.Combine(aaFolder, "catalog.json")) && File.Exists(Path.Combine(aaFolder, "settings.json")))
122+
{
123+
return true;
124+
}
125+
126+
return false;
127+
}
128+
}
103129
}
104130
}

0 commit comments

Comments
 (0)