Skip to content

Commit

Permalink
Alert user when defaulting compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Sep 22, 2024
1 parent f318885 commit 76c8316
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 26 deletions.
60 changes: 45 additions & 15 deletions GUI/Dialogs/CompatibleGameVersionsDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 40 additions & 10 deletions GUI/Dialogs/CompatibleGameVersionsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,51 @@ protected override void OnHelpButtonClicked(CancelEventArgs evt)
evt.Cancel = Util.TryOpenWebPage(HelpURLs.CompatibleGameVersions);
}

private void ShowMessage(string msg)
{
if (string.IsNullOrEmpty(msg))
{
MessageLabel.Text = "";
MessageLabel.Visible = false;
}
else
{
MessageLabel.Text = msg;
MessageLabel.Visible = true;
MessageLabel.Height = Util.LabelStringHeight(CreateGraphics(),
MessageLabel);
Height += MessageLabel.Height;
}
}

protected override void OnResize(EventArgs e)
{
base.OnResize(e);
if (MessageLabel.Visible)
{
MessageLabel.Height = Util.LabelStringHeight(CreateGraphics(),
MessageLabel);
}
}

private void CompatibleGameVersionsDialog_Shown(object? sender, EventArgs? e)
{
if (_inst.CompatibleVersionsAreFromDifferentGameVersion)
{
CancelChooseCompatibleVersionsButton.Visible = false;
ActualGameVersionLabel.Text = string.Format(
Properties.Resources.CompatibleGameVersionsDialogVersionDetails,
_inst.Version(),
_inst.GameVersionWhenCompatibleVersionsWereStored);
ActualGameVersionLabel.ForeColor = Color.Red;
MessageBox.Show(this,
Properties.Resources.CompatibleGameVersionsDialogGameUpdatedDetails,
Properties.Resources.CompatibleGameVersionsDialogGameUpdatedTitle,
MessageBoxButtons.OK,
MessageBoxIcon.Information);
if (_inst.GameVersionWhenCompatibleVersionsWereStored == null)
{
ShowMessage(Properties.Resources.CompatibleGameVersionsDialogDefaultedDetails);
}
else
{
ActualGameVersionLabel.Text = string.Format(
Properties.Resources.CompatibleGameVersionsDialogVersionDetails,
_inst.Version(),
_inst.GameVersionWhenCompatibleVersionsWereStored);
ActualGameVersionLabel.ForeColor = Color.Red;
ShowMessage(Properties.Resources.CompatibleGameVersionsDialogGameUpdatedDetails);
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion GUI/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@
<data name="CloneGameInstanceToolTipShareStock" xml:space="preserve"><value>Create junction points (Windows) or symbolic links (Unix) to stock directories instead of copying them.
If you choose this option, DO NOT move or delete the old instance!!</value></data>
<data name="CompatibleGameVersionsDialogNone" xml:space="preserve"><value>&lt;NONE&gt;</value></data>
<data name="CompatibleGameVersionsDialogGameUpdatedTitle" xml:space="preserve"><value>Game Version Updated</value></data>
<data name="CompatibleGameVersionsDialogDefaultedDetails" xml:space="preserve"><value>Default compatibility has been set based on your installed game version. These settings should bring the greatest number of working mods to the most users, but it's still possible that some older mods might misbehave.

If you want to be cautious, click "Clear selection" to uncheck all the boxes.</value></data>
<data name="CompatibleGameVersionsDialogGameUpdatedDetails" xml:space="preserve"><value>The game has been updated since you last reviewed your compatible game versions. Please make sure that settings are correct.</value></data>
<data name="CompatibleGameVersionsDialogVersionDetails" xml:space="preserve"><value>{0} (previous game version: {1})</value></data>
<data name="CompatibleGameVersionsDialogInvalidFormat" xml:space="preserve"><value>Version has invalid format</value></data>
Expand Down

0 comments on commit 76c8316

Please sign in to comment.