Skip to content

Commit

Permalink
Remove lite mode and vanilla mode buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
TheStachelfisch committed May 20, 2021
1 parent fdd4dc7 commit ba487a8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
Main.menuMode = Interface.developerModeHelpID;
};
+ // Change download name from ModCompile to ModCompile64
DownloadFileFromUrl("ModCompile64", url, file, () => {
DownloadFileFromUrl("ModCompile", url, file, () => {
try {
Extract(file);
33 changes: 14 additions & 19 deletions patches/64bit/Terraria.ModLoader.x64bit/Core64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class Core64
/// <summary>
/// Boolean that will allow you to switch between vanilla and 64bit mode, so you can play with vanilla friends!
/// </summary>
internal static bool vanillaMode;
internal static bool liteMode = false;
// internal static bool vanillaMode;
// internal static bool liteMode = false;

internal static readonly string vanillaVersion = "Terraria" + 194;

internal static bool betaMode => false && !liteMode;
// internal static bool betaMode => false && !liteMode;

internal const int vanillaChestLimit = 1000;
internal static readonly int maxChest = 2000;
Expand Down Expand Up @@ -57,17 +57,12 @@ internal static void LoadModdedPath() {

internal static void DrawPatreon(SpriteBatch sb, int loopNum, int offsetX, int offsetY, bool hasFocus, Color color12) {
// TODO: Localization for vanilla, tml, and lite modes when they're actually used
string patreonShortURL = !vanillaMode ? Language.GetTextValue("tModLoader.VanillaMode") : Language.GetTextValue("tModLoader.tModMode");
string tmlModeString = liteMode ? Language.GetTextValue("tModLoader.DisableLite") : Language.GetTextValue("tModLoader.EnableLite");
bool showPatreon = Main.menuMode == 0;
string architecture = Language.GetTextValue("tModLoader.RunningBitMode", Environment.Is64BitProcess ? 64.ToString() : 32.ToString());
string GoG = InstallVerifier.IsGoG ? Language.GetTextValue("tModLoader.GoG") : Language.GetTextValue("tModLoader.Steam");
string drawVersion;

if (vanillaMode)
drawVersion = Main.versionNumber;
else
drawVersion = Main.versionNumber + Environment.NewLine + ModLoader.versionedName + $" - {architecture} {GoG} {PlatformUtilities.RunningPlatform()}";

drawVersion = Main.versionNumber + Environment.NewLine + ModLoader.versionedName + $" - {architecture} {GoG} {PlatformUtilities.RunningPlatform()}";

Vector2 origin3 = Main.fontMouseText.MeasureString(drawVersion);
origin3.X *= 0.5f;
Expand All @@ -78,22 +73,22 @@ internal static void DrawPatreon(SpriteBatch sb, int loopNum, int offsetX, int o
if (loopNum == 4)
color12 = new Color(127, 191, 191, 76);

if (Main.menuMode == 10002 && vanillaMode)
if (Main.menuMode == 10002)
Main.menuMode = 0;

if (showPatreon) {
Vector2 urlSize = Main.fontMouseText.MeasureString(patreonShortURL);
Main.spriteBatch.DrawString(Main.fontMouseText, patreonShortURL, new Vector2(offsetX + 10f, Main.screenHeight - origin3.Y - 50f - offsetY + 2f), color12, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
// Vector2 urlSize = Main.fontMouseText.MeasureString(patreonShortURL);
// Main.spriteBatch.DrawString(Main.fontMouseText, patreonShortURL, new Vector2(offsetX + 10f, Main.screenHeight - origin3.Y - 50f - offsetY + 2f), color12, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);

if (loopNum == 4 && Main.mouseLeftRelease && Main.mouseLeft && new Rectangle((int)(offsetX + 10f), (int)(Main.screenHeight - origin3.Y - 50f - offsetY + 2f), (int)urlSize.X, (int)origin3.Y).Contains(new Point(Main.mouseX, Main.mouseY)) && hasFocus) {
Main.PlaySound(SoundID.MenuOpen);
// if (loopNum == 4 && Main.mouseLeftRelease && Main.mouseLeft && new Rectangle((int)(offsetX + 10f), (int)(Main.screenHeight - origin3.Y - 50f - offsetY + 2f), (int)urlSize.X, (int)origin3.Y).Contains(new Point(Main.mouseX, Main.mouseY)) && hasFocus) {
// Main.PlaySound(SoundID.MenuOpen);
/*vanillaMode = !vanillaMode;
Main.SaveSettings();
Interface.infoMessage.Show("You'll need to restart the game so that the necessary change can apply.", 0, null, "Restart", () => Environment.Exit(0));*/
Interface.infoMessage.Show(Language.GetTextValue("tModLoader.UnfinishedFeature"), 0);
}
// Interface.infoMessage.Show(Language.GetTextValue("tModLoader.UnfinishedFeature"), 0);
// }

if (!vanillaMode) {
/*if (!vanillaMode) {
urlSize = Main.fontMouseText.MeasureString(tmlModeString);
Main.spriteBatch.DrawString(Main.fontMouseText, tmlModeString, new Vector2(offsetX + 10f, Main.screenHeight - origin3.Y - 72f - offsetY + 2f), color12, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
if (loopNum == 4 && Main.mouseLeftRelease && Main.mouseLeft && new Microsoft.Xna.Framework.Rectangle((int)(offsetX + 10f), (int)(Main.screenHeight - origin3.Y - 72f - offsetY + 2f), (int)urlSize.X, (int)origin3.Y).Contains(new Microsoft.Xna.Framework.Point(Main.mouseX, Main.mouseY)) && hasFocus) {
Expand All @@ -106,7 +101,7 @@ internal static void DrawPatreon(SpriteBatch sb, int loopNum, int offsetX, int o
Environment.Exit(0);
});
}
}
}*/
}
}

Expand Down
5 changes: 1 addition & 4 deletions patches/64bit/Terraria.ModLoader/ModLoader.cs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@

[Obsolete("Use CompressedPlatformRepresentation instead")]
public static readonly string compressedPlatformRepresentation = Platform.IsWindows ? "w" : (Platform.IsLinux ? "l" : "m");
@@ -376,7 +_,10 @@
Main.Configuration.Get("AvoidGithub", ref UI.ModBrowser.UIModBrowser.AvoidGithub);
@@ -377,6 +_,7 @@
Main.Configuration.Get("AvoidImgur", ref UI.ModBrowser.UIModBrowser.AvoidImgur);
Main.Configuration.Get(nameof(UI.ModBrowser.UIModBrowser.EarlyAutoUpdate), ref UI.ModBrowser.UIModBrowser.EarlyAutoUpdate);
LastLaunchedTModLoaderVersion = new Version(Main.Configuration.Get("LastLaunchedTModLoaderVersion", "0.0"));
+ Main.Configuration.Get("VanillaMode", ref Core64.vanillaMode);
+ Main.Configuration.Get("LiteMode", ref Core64.liteMode);
+ Main.Configuration.Get("Last64BitLaunched", ref Core64.last64bitVersionLaunched);
}

Expand Down
34 changes: 17 additions & 17 deletions patches/64bit/Terraria/Main.cs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@
string vanillaContentFolder = "../Terraria/Content"; // Side-by-Side Manual Install
if (!Directory.Exists(vanillaContentFolder)) {
vanillaContentFolder = "../Content"; // Nested Manual Install
@@ -6757,6 +_,7 @@
@@ -6765,6 +_,7 @@
});

base.Initialize();
+ base.Window.ClientSizeChanged += Core64.DoClientSizeChanged;
base.Window.AllowUserResizing = true;
OpenSettings();
if (screenWidth > GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width)
@@ -7296,7 +_,7 @@
@@ -7304,7 +_,7 @@
engine = new AudioEngine(Main.instance.Content.RootDirectory + Path.DirectorySeparatorChar + "TerrariaMusic.xgs");
soundBank = new SoundBank(engine, Main.instance.Content.RootDirectory + Path.DirectorySeparatorChar + "Sound Bank.xsb");
engine.Update();
Expand All @@ -182,7 +182,7 @@
engine.Update();
music = new Music[42];
while (!waveBank.IsPrepared) {
@@ -7479,7 +_,7 @@
@@ -7487,7 +_,7 @@
if (waveBank == null) //supress extra exceptions from audio engine failing to load
return;

Expand All @@ -191,7 +191,7 @@
if (Main.engine != null)
Main.engine.Update();

@@ -10261,7 +_,7 @@
@@ -10269,7 +_,7 @@
}

hasFocus = base.IsActive;
Expand All @@ -200,7 +200,7 @@
hasFocus = (Form.ActiveForm == Control.FromHandle(base.Window.Handle) as Form);
#endif
if (!gameMenu || netMode == 2) {
@@ -35792,9 +_,8 @@
@@ -35800,9 +_,8 @@
SocialAPI.Shutdown();
#endif
Exit();
Expand All @@ -212,7 +212,7 @@
}

protected Microsoft.Xna.Framework.Color randColor() {
@@ -36426,19 +_,19 @@
@@ -36434,19 +_,19 @@
}
else if (selectedMenu == 2 || inputTextEnter || autoPass) {
string str = "-autoshutdown -password \"" + Netplay.ServerPassword + "\" -lang " + Language.ActiveCulture.LegacyId;
Expand Down Expand Up @@ -240,7 +240,7 @@
tServer.StartInfo.Arguments = str;
if (libPath != "") {
ProcessStartInfo startInfo = tServer.StartInfo;
@@ -37718,7 +_,7 @@
@@ -37726,7 +_,7 @@
}

bool flag7 = false;
Expand All @@ -249,7 +249,7 @@
flag7 = true;
System.Drawing.Rectangle bounds = Screen.FromPoint(((Form)Control.FromHandle(instance.Window.Handle)).Location).Bounds;
if (bounds.Width > maxScreenW || bounds.Height > maxScreenH)
@@ -38373,36 +_,42 @@
@@ -38381,36 +_,42 @@
array4[1] = 30;
array4[2] = 30;
array4[3] = 30;
Expand Down Expand Up @@ -302,7 +302,7 @@
WorldGen.setWorldSize();
}
}
@@ -39186,26 +_,11 @@
@@ -39194,26 +_,11 @@
if (num108 == 3)
num110 = 2;

Expand Down Expand Up @@ -333,7 +333,7 @@
}

DrawCursor(DrawThickCursor());
@@ -41336,7 +_,7 @@
@@ -41344,7 +_,7 @@
base.GraphicsDevice.SetRenderTarget(backWaterTarget);
base.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent);
spriteBatch.Begin();
Expand All @@ -342,7 +342,7 @@
tileBatch.Begin();
#else
tileBatch.Begin(SpriteSortMode.Texture, BlendState.AlphaBlend);
@@ -50877,8 +_,9 @@
@@ -50885,8 +_,9 @@
graphics.ToggleFullScreen();

bool flag = false;
Expand All @@ -353,7 +353,7 @@
screenMaximized = (((Form)Control.FromHandle(instance.Window.Handle)).WindowState == FormWindowState.Maximized);
if (screenBorderless && screenMaximized && !graphics.IsFullScreen) {
screenMaximized = false;
@@ -50890,14 +_,11 @@
@@ -50898,14 +_,11 @@
#else
Main.screenMaximized = false;
#endif
Expand All @@ -369,7 +369,7 @@
form.MinimumSize = new Size(0, 0);
if (screenBorderless && !graphics.IsFullScreen && screenBorderlessPendingResizes > 0) {
screenBorderlessPendingResizes--;
@@ -50928,10 +_,11 @@
@@ -50936,10 +_,11 @@
else {
num3 = graphics.PreferredBackBufferWidth;
num4 = graphics.PreferredBackBufferHeight;
Expand All @@ -382,7 +382,7 @@
form.MinimumSize = new Size(minScreenW, minScreenH);
if (flag) {
width = displayWidth[0];
@@ -50946,7 +_,7 @@
@@ -50954,7 +_,7 @@
flag2 = (graphics.PreferredBackBufferWidth != graphics.GraphicsDevice.Viewport.Width || graphics.PreferredBackBufferHeight != graphics.GraphicsDevice.Viewport.Height);
}

Expand All @@ -391,7 +391,7 @@
// appears redundant. Just causes the window to fight the user when attempting to resize too small
// with this disabled, the window will just snap back to minimum size when released
/*if (!fullscreen && !flag2) {
@@ -50976,8 +_,7 @@
@@ -50984,8 +_,7 @@
screenHeight = height;
graphics.PreferredBackBufferWidth = screenWidth;
graphics.PreferredBackBufferHeight = screenHeight;
Expand All @@ -401,7 +401,7 @@

PlayerInput.CacheOriginalScreenDimensions();
FixUIScale();
@@ -50987,7 +_,7 @@
@@ -50995,7 +_,7 @@
PendingResolutionWidth = screenWidth;
PendingResolutionHeight = screenHeight;
PlayerInput.CacheOriginalScreenDimensions();
Expand All @@ -410,7 +410,7 @@
if (!fullscreen) {
form.SendToBack();
form.BringToFront();
@@ -51026,7 +_,6 @@
@@ -51034,7 +_,6 @@
}

public void UpdateDisplaySettings() {
Expand Down

0 comments on commit ba487a8

Please sign in to comment.