Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Update 3.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Athlon007 committed Nov 15, 2022
1 parent 7d4f262 commit cf77ad5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 3.10.1 (TBA)
## 3.10.1 (15.11.2022)

### Added

Expand Down
74 changes: 37 additions & 37 deletions MOP/src/MOP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
using MOP.Helpers;
using MOP.Rules;
using System.Text;
using System.Diagnostics;

using System.Diagnostics;

namespace MOP
{
public class MOP : Mod
Expand All @@ -36,7 +36,7 @@ public class MOP : Mod
public override string Name => "MODERN OPTIMIZATION PLUGIN";
public override string Author => "Athlon"; //Your Username
public override string Version => "3.10.1"; //Version
public const string SubVersion = "BETA_2"; // NIGHTLY-yyyymmdd | BETA_x | RC_
public const string SubVersion = ""; // NIGHTLY-yyyymmdd | BETA_x | RC_
#if PRO
public const string Edition = "Mod Loader Pro";
#else
Expand All @@ -46,7 +46,7 @@ public class MOP : Mod
#endif
public override byte[] Icon => Properties.Resources.icon;

#region Settings & Configuration
#region Settings & Configuration
// Stores the config path of mod.
static string modConfigPath;
public static string ModConfigPath { get => modConfigPath; }
Expand Down Expand Up @@ -82,14 +82,14 @@ public class MOP : Mod
const string WarningMode = "Some changes will be applied after the game restart.";
readonly string[] activeDistanceText = { "Very Close (0.5x)", "Close (0.75x)", "Default (1x)", "Far (2x)", "Very Far (4x)" };
readonly string[] rulesAutoUpdateFrequencyText = { "Every launch", "Daily", "Every 2 days", "Weekly" };

const string WelcomeMessage = "Welcome to Modern Optimization Plugin {0}!\n" +
"Consider supporting the project using PayPal, or NexusMods.\n\n" +
"<b>BACKUP YOUR SAVE FILES!</b>";
const string WelcomeMessageFestive = "Merry Christmas and Happy New Year {1}!\n\n" +
"Welcome to Modern Optimization Plugin{0}!\n" +
"Consider supporting the project using PayPal, or on NexusMods.";

private const string FaqLink = "http://kfigura.nl/mop/wiki/#/faq";
private const string DonateLink = "https://www.paypal.com/donate/?hosted_button_id=8VASR9RLLS76Y";
private const string KofiLink = "https://ko-fi.com/athlon";
Expand Down Expand Up @@ -251,7 +251,7 @@ public override void ModSettings()
Settings.AddText(this, "If unchecked, the game will be paused when the game's window looses focus.");
DynamicDrawDistance = Settings.AddCheckBox(this, "dynamicDrawDistance", "DYNAMIC DRAW DISTANCE", true);
Settings.AddText(this, "MOP will adjust the draw distance, according to the current situation\n(ex. lower it while inside of a building).");

GameResolution = Settings.AddDropDownList(this, "", "RESOLUTION", resolutions.ToArray(), selected, () =>
{
// Can't use resolution.GetSelectedItemName(), as the selected item name gets updated AFTER the OnSelectionChanged is called.
Expand Down Expand Up @@ -301,10 +301,10 @@ public override void ModSettings()

// Info
Settings.AddHeader(this, "INFO");
Settings.AddText(this, GetFooter());
Settings.AddText(this, GetFooter());
#endif
}
#endregion
#endregion

public override void MenuOnLoad()
{
Expand All @@ -326,26 +326,26 @@ public override void MenuOnLoad()
prompt.Title = "MOP";
prompt.AddButton("OK", () => { GameObject.Destroy(prompt.gameObject); });
var btnDonate = prompt.AddButton("<color=#169BD7>DONATE</color>", () => { OnWelcomeDonateClick(); GameObject.Destroy(prompt.gameObject); });
var btnChangelog = prompt.AddButton("CHANGELOG", () => {
ModPrompt.CreatePrompt(GetChangelog(true), $"MOP {ModVersion.Replace("_", " ")} - Changelog", () => { prompt.gameObject.SetActive(true); });
});
var btnChangelog = prompt.AddButton("CHANGELOG", () => {
ModPrompt.CreatePrompt(GetChangelog(true), $"MOP {ModVersion.Replace("_", " ")} - Changelog", () => { prompt.gameObject.SetActive(true); });
});
#else
ModUI.ShowCustomMessage(message, "MOP",
ModUI.ShowCustomMessage(message, "MOP",
new MsgBoxBtn[] {
ModUI.CreateMessageBoxBtn("OK"),
ModUI.CreateMessageBoxBtn(
"DONATE",
OnWelcomeDonateClick,
new Color32(37, 59, 128, 255),
new Color32(37, 59, 128, 255),
new Color(1, 1, 1)),
ModUI.CreateMessageBoxBtn("CHANGELOG", () =>
{
ModUI.ShowMessage(GetChangelog(true), $"MOP {ModVersion.Replace("_", " ")} - Changelog ");
}, true) },
new MsgBoxBtn[] { });
new MsgBoxBtn[] { });
// We must add an extra empty MsgBoxBtn array,
// as the MSCLoader's ShowCustomMessage is so shit,
// the buttons won't work otherwise.
// the buttons won't work otherwise.
#endif
}

Expand All @@ -369,7 +369,7 @@ public override void MenuOnLoad()
BugReporter.Instance.RestartGame();
return;
}

MopSettings.GameFixStatus = GameFixStatus.None;

modeWarningText.SetValue("");
Expand Down Expand Up @@ -585,7 +585,7 @@ void UpdateSettingsUI()

string GetFooter()
{
return $"<color=yellow>MOP</color> {ModVersion.Replace("_", " ")}\n" +
return $"<color=yellow>MOP</color> {ModVersion.Replace("_", " ")}\n" +
#if PRO
$"<color=yellow>Mod Loader Pro</color> {ModLoader.Version}\n" +
#else
Expand Down Expand Up @@ -640,25 +640,25 @@ private void OnWelcomeDonateClick()
OnDonateButtonClick();
}

private void OnDonateButtonClick()
{
#if PRO
ModPrompt prompt = ModPrompt.CreateCustomPrompt();
prompt.Title = "DONATE";
prompt.Text = "Choose your donation method:";
prompt.AddButton("PAYPAL", () => Process.Start(DonateLink));
prompt.AddButton("KO-FI", () => Process.Start(KofiLink));
prompt.AddButton("CANCEL", null);
#else
ModUI.ShowCustomMessage("Choose your donation method:", "DONATE", new MsgBoxBtn[]
{
ModUI.CreateMessageBoxBtn("PAYPAL", () => Process.Start(DonateLink)),
ModUI.CreateMessageBoxBtn("KO-FI", () => Process.Start(KofiLink))
}, new MsgBoxBtn[]
{
ModUI.CreateMessageBoxBtn("CANCEL")
});
#endif
private void OnDonateButtonClick()
{
#if PRO
ModPrompt prompt = ModPrompt.CreateCustomPrompt();
prompt.Title = "DONATE";
prompt.Text = "Choose your donation method:";
prompt.AddButton("PAYPAL", () => Process.Start(DonateLink));
prompt.AddButton("KO-FI", () => Process.Start(KofiLink));
prompt.AddButton("CANCEL", null);
#else
ModUI.ShowCustomMessage("Choose your donation method:", "DONATE", new MsgBoxBtn[]
{
ModUI.CreateMessageBoxBtn("PAYPAL", () => Process.Start(DonateLink)),
ModUI.CreateMessageBoxBtn("KO-FI", () => Process.Start(KofiLink))
}, new MsgBoxBtn[]
{
ModUI.CreateMessageBoxBtn("CANCEL")
});
#endif
}
}
}

0 comments on commit cf77ad5

Please sign in to comment.