Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Knossos.NET/Classes/Knossos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,40 @@ public static async void PlayMod(Mod mod, FsoExecType fsoExecType, bool standalo

Log.Add(Log.LogSeverity.Information, "Knossos.PlayMod()", "Used cmdLine : " + cmdline);

if (MainWindow.instance != null && globalSettings.warnNewSettingsSystem)
{
try
{
var fsoVersion = new SemanticVersion(fsoBuild.version);
var newSettingsVersion = new SemanticVersion("24.2.0-RC");
if(fsoVersion >= newSettingsVersion)
{
await Dispatcher.UIThread.InvokeAsync(async () => {
try
{
var res = await MessageBox.Show(MainWindow.instance, "Starting from FSO version 24.2.0 a new in-game settings system was implemented.\n" +
"Launcher settings, such as video, audio or input, and Command Line arguments of those categories no longer have an effect by default.\n" +
"Settings for most mods using FSO version 24.2.0 or higher must be now changed in-game by going to the 'Options' menu, where you will see additional methods for accessing and setting these new in-game options.", "New FSO settings system", MessageBox.MessageBoxButtons.DontWarnAgainOK);

if (res == MessageBox.MessageBoxResult.DontWarnAgain)
{
globalSettings.warnNewSettingsSystem = false;
globalSettings.Save();
}
}
catch
{
//fail silently, this is not important
}
});
}
}
catch
{
//fail silently, this is not important
}
}

//Launch FSO!!!
var fsoResult = await fsoBuild.RunFSO(fsoExecType, cmdline, rootPath, false);

Expand Down
3 changes: 3 additions & 0 deletions Knossos.NET/Models/GlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public AutoUpdateFsoBuilds(bool stable = false, bool rc = false, bool nightly =
public int devModSort { get; set; } = 0;
[JsonPropertyName("auto_update_fso_builds")]
public AutoUpdateFsoBuilds autoUpdateBuilds { get; set; } = new AutoUpdateFsoBuilds();
[JsonPropertyName("warn_new_settings_system")]
public bool warnNewSettingsSystem { get; set; } = true;

/* FSO Settings that use the fs2_open.ini are json ignored */

Expand Down Expand Up @@ -608,6 +610,7 @@ public void Load()
prefixCMD = tempSettings.prefixCMD;
envVars = tempSettings.envVars;
showDevOptions = tempSettings.showDevOptions;
warnNewSettingsSystem = tempSettings.warnNewSettingsSystem;

if (MainWindowViewModel.Instance != null)
MainWindowViewModel.Instance.sharedSortType = tempSettings.sortType;
Expand Down
3 changes: 3 additions & 0 deletions Knossos.NET/Views/GlobalSettingsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
</Border>
<!--VIDEO SETTINGS-->
<Label Margin="5,15,0,0" FontWeight="Bold" FontSize="18" ToolTip.Tip="Video settings the FSO engine will use in-game.">Video</Label>
<TextBox BorderBrush="Transparent" IsReadOnly="True" TextWrapping="Wrap" Margin="5,0,5,0" Foreground="Yellow">Note, video settings for most mods using FSO version 24.2.0 or higher will need to be changed in-game by default. You can change in-game settings by going to "Options" menu of the mod you are playing.</TextBox>
<Border Margin="0,5,0,0" BorderBrush="Black" BorderThickness="5" CornerRadius="2">
<StackPanel Margin="5">
<!-- Resolution -->
Expand Down Expand Up @@ -243,6 +244,7 @@

<!--Audio SETTINGS-->
<Label Margin="5,15,0,0" FontWeight="Bold" FontSize="18" ToolTip.Tip="Audio settings the FSO engine will use in-game.">Audio</Label>
<TextBox BorderBrush="Transparent" IsReadOnly="True" TextWrapping="Wrap" Margin="5,0,5,0" Foreground="Yellow">Note, audio settings for most mods using FSO version 24.2.0 or higher will need to be changed in-game by default. You can change in-game settings by going to "Options" menu of the mod you are playing..</TextBox>
<Border Margin="0,5,0,0" BorderBrush="Black" BorderThickness="5" CornerRadius="2">
<StackPanel Margin="5">
<!-- Playback -->
Expand Down Expand Up @@ -314,6 +316,7 @@

<!--INPUT SETTINGS-->
<Label Margin="5,15,0,0" FontWeight="Bold" FontSize="18" ToolTip.Tip="Input settings where you can specify which of your plugged-in devices FSO can use in-game.">Input</Label>
<TextBox BorderBrush="Transparent" IsReadOnly="True" TextWrapping="Wrap" Margin="5,0,5,0" Foreground="Yellow">Note, input settings for most mods using FSO version 24.2.0 or higher will need to be changed in-game by default. You can change in-game settings by going to "Options" menu of the mod you are playing.</TextBox>
<Border Margin="0,5,0,0" BorderBrush="Black" BorderThickness="5" CornerRadius="2">
<StackPanel Margin="5">
<?ignore
Expand Down
18 changes: 15 additions & 3 deletions Knossos.NET/Views/Windows/MessageBox.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public enum MessageBoxButtons
ContinueCancel,
Details,
DetailsOKCancel,
DetailsContinueCancel
DetailsContinueCancel,
DontWarnAgainOK
}

public enum MessageBoxResult
Expand All @@ -27,7 +28,8 @@ public enum MessageBoxResult
Yes,
No,
Continue,
Details
Details,
DontWarnAgain
}

public MessageBox()
Expand All @@ -49,7 +51,7 @@ public static Task<MessageBoxResult> Show(Window? parent, string text, string ti

var result = MessageBoxResult.OK;

void AddButton(string caption, MessageBoxResult r, bool def = false, string classes = "")
void AddButton(string caption, MessageBoxResult r, bool def = false, string classes = "", int buttonWidth = -1)
{
var button = new Button { Content = caption, Width = 100};
button.Click += (_, __) => {
Expand All @@ -60,6 +62,10 @@ void AddButton(string caption, MessageBoxResult r, bool def = false, string clas
{
button.Classes.Add(classes);
}
if (buttonWidth != -1)
{
button.Width = buttonWidth;
}
buttonPanel.Children.Add(button);
if (def)
{
Expand Down Expand Up @@ -93,6 +99,12 @@ void AddButton(string caption, MessageBoxResult r, bool def = false, string clas
AddButton("Details", MessageBoxResult.Details, false, "Option");
}

if (buttons == MessageBoxButtons.DontWarnAgainOK)
{
AddButton("OK", MessageBoxResult.OK, true, "Accept");
AddButton("Don't warn again", MessageBoxResult.DontWarnAgain, false, "Option", 150);
}

var tcs = new TaskCompletionSource<MessageBoxResult>();
msgbox.Closed += delegate { tcs.TrySetResult(result); };

Expand Down