Skip to content

Commit

Permalink
v0.11.7.5 release, 1.4 world/player warnings, showMemoryEstimates now…
Browse files Browse the repository at this point in the history
… true
  • Loading branch information
JavidPack committed Jun 7, 2020
1 parent c030352 commit e506ce4
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 23 deletions.
2 changes: 1 addition & 1 deletion ExampleMod/build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
author = TML Team
version = 0.11.7.4
version = 0.11.7.5
displayName = Example Mod
homepage = https://tmodloader.net/
hideCode = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,16 @@
_deleteButtonLabel.Top.Set(-3f, 0f);
Append(_deleteButtonLabel);
uIImageButton.SetSnapPoint("Play", snapPointIndex);
@@ -120,6 +_,14 @@
@@ -113,13 +_,22 @@
}

private void PlayMouseOver(UIMouseEvent evt, UIElement listeningElement) {
+ if(_data.Player.loadStatus == 0)
- _buttonLabel.SetText(Language.GetTextValue("UI.Play"));
+ _buttonLabel.SetText(Language.GetTextValue("UI.Play"));
}

private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement) {
_deleteButtonLabel.SetText(Language.GetTextValue("UI.Delete"));
}

Expand Down Expand Up @@ -149,7 +158,7 @@
float num = dimensions.X + dimensions.Width;
- Utils.DrawBorderString(spriteBatch, _data.Name, new Vector2(num + 6f, dimensions.Y - 2f), Color.White);
+ Color textColor = _data.Player.loadStatus == 0 ? Color.White : Color.Red;
+ Utils.DrawBorderString(spriteBatch, _data.Name + (_data.Player.loadStatus == 1 ? " (1.4 Player, won't load)": ""), new Vector2(num + 6f, dimensions.Y - 2f), textColor);
+ Utils.DrawBorderString(spriteBatch, _data.Name + (_data.Player.loadStatus == 1 ? " (1.4 Players are not supported)" : ""), new Vector2(num + 6f, dimensions.Y - 2f), textColor);
spriteBatch.Draw(_dividerTexture, new Vector2(num, innerDimensions.Y + 21f), null, Color.White, 0f, Vector2.Zero, new Vector2((GetDimensions().X + GetDimensions().Width - num) / 8f, 1f), SpriteEffects.None, 0f);
Vector2 vector = new Vector2(num + 6f, innerDimensions.Y + 29f);
float num2 = 200f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@
}

private void InitializeAppearance() {
@@ -149,6 +_,10 @@
@@ -142,13 +_,18 @@
}

private void PlayMouseOver(UIMouseEvent evt, UIElement listeningElement) {
+ if(_data.IsValid)
- _buttonLabel.SetText(Language.GetTextValue("UI.Play"));
+ _buttonLabel.SetText(Language.GetTextValue("UI.Play"));
}

private void SeedMouseOver(UIMouseEvent evt, UIElement listeningElement) {
_buttonLabel.SetText(Language.GetTextValue("UI.CopySeed", _data.SeedText));
}

Expand Down Expand Up @@ -113,7 +122,7 @@
float num = dimensions.X + dimensions.Width;
Color color = _data.IsValid ? Color.White : Color.Red;
- Utils.DrawBorderString(spriteBatch, _data.Name, new Vector2(num + 6f, dimensions.Y - 2f), color);
+ Utils.DrawBorderString(spriteBatch, _data.Name + (_data.FutureVersion ? " (1.4 World, won't load)" : "") , new Vector2(num + 6f, dimensions.Y - 2f), color);
+ Utils.DrawBorderString(spriteBatch, _data.Name + (_data.FutureVersion ? " (1.4 Worlds are not supported)" : "") , new Vector2(num + 6f, dimensions.Y - 2f), color);
spriteBatch.Draw(_dividerTexture, new Vector2(num, innerDimensions.Y + 21f), null, Color.White, 0f, Vector2.Zero, new Vector2((GetDimensions().X + GetDimensions().Width - num) / 8f, 1f), SpriteEffects.None, 0f);
Vector2 vector = new Vector2(num + 6f, innerDimensions.Y + 29f);
float num2 = 100f;
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
+ if ((world = TryParameter("-world")) != null) {
game.SetWorld(world, cloud: false);
+ if (!Main.ActiveWorldFileData.IsValid) {
+ System.Console.WriteLine($"The world {Main.ActiveWorldFileData.Name} is invalid." + (Main.ActiveWorldFileData.FutureVersion ? " (1.4 World, won't load)" : ""));
+ System.Console.WriteLine($"The world {Main.ActiveWorldFileData.Name} is invalid." + (Main.ActiveWorldFileData.FutureVersion ? " (1.4 Worlds are not supported)" : ""));
+ System.Environment.Exit(1);
+ }
+ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private static bool CheckGoG()
IsGoG = true;

const string DefaultExe = "Terraria.exe";
string CheckExe = $"Terraria_1.4.0.4.exe"; // {Main.versionNumber}
string CheckExe = $"Terraria_1.4.0.5.exe"; // {Main.versionNumber}
string vanillaPath = File.Exists(CheckExe) ? CheckExe : DefaultExe;

// If .exe not present, check Terraria directory (Side-by-Side Manual Install)
Expand Down
11 changes: 4 additions & 7 deletions patches/tModLoader/Terraria.ModLoader/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Terraria.ModLoader
/// </summary>
public static class ModLoader
{
public static readonly Version version = new Version(0, 11, 7, 4);
public static readonly Version version = new Version(0, 11, 7, 5);
// Stores the most recent version of tModLoader launched. Can be used for migration.
public static Version LastLaunchedTModLoaderVersion;
// public static bool ShowWhatsNew;
Expand Down Expand Up @@ -375,16 +375,13 @@ internal static void LoadConfiguration()
Main.Configuration.Get("AvoidGithub", ref UI.ModBrowser.UIModBrowser.AvoidGithub);
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"));
}

internal static void MigrateSettings()
{
if (LastLaunchedTModLoaderVersion != null) return;

LastLaunchedTModLoaderVersion = new Version(Main.Configuration.Get("LastLaunchedTModLoaderVersion", "0.0"));
if (LastLaunchedTModLoaderVersion <= new Version(0, 11, 4))
Main.Configuration.Put("Support4K", true); // This reverts a potentially bad setting change.
// Subsequent migrations here.
if (LastLaunchedTModLoaderVersion < new Version(0, 11, 7, 5))
showMemoryEstimates = true;
/*
if (LastLaunchedTModLoaderVersion < version)
ShowWhatsNew = true;
Expand Down
22 changes: 16 additions & 6 deletions patches/tModLoader/Terraria/Main.cs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -430,15 +430,18 @@
PlayerInput.Load();
if (currentValue7 < 165) {
try {
@@ -2960,7 +_,7 @@
@@ -2960,8 +_,10 @@
mouseColorSlider.SetHSL(mouseColor);
mouseBorderColorSlider.SetHSL(MouseBorderColor);
mouseBorderColorSlider.Alpha = (float)(int)MouseBorderColor.A / 255f;
- if (currentValue7 != 194)
+ if (currentValue7 != 194 || ModLoader.ModLoader.LastLaunchedTModLoaderVersion != ModLoader.ModLoader.version)
+ if (currentValue7 != 194 || ModLoader.ModLoader.LastLaunchedTModLoaderVersion != ModLoader.ModLoader.version) {
+ ModLoader.ModLoader.MigrateSettings();
SaveSettings();
+ }
}

protected void OpenLegacySettings() {
@@ -3090,9 +_,11 @@
FileUtilities.Delete(PlayerList[i].Path, PlayerList[i].IsCloudSave);
FileUtilities.Delete(PlayerList[i].Path + ".bak", PlayerList[i].IsCloudSave);
Expand Down Expand Up @@ -502,7 +505,7 @@
Console.WriteLine("");
for (int i = 0; i < WorldList.Count; i++) {
- Console.WriteLine(i + 1 + "\t\t" + WorldList[i].Name);
+ Console.WriteLine(i + 1 + "\t\t" + WorldList[i].Name + (WorldList[i].FutureVersion ? "\t(1.4 World, won't load)" : ""));
+ Console.WriteLine(i + 1 + "\t\t" + WorldList[i].Name + (WorldList[i].FutureVersion ? "\t(1.4 Worlds are not supported)" : ""));
}

string textValue = Language.GetTextValue("CLI.NewWorld_Command");
Expand Down Expand Up @@ -780,7 +783,7 @@
}

public static void Sundialing() {
@@ -4105,7 +_,37 @@
@@ -4105,7 +_,40 @@
instance = this;
#if CLIENT
graphics = new GraphicsDeviceManager(this);
Expand All @@ -795,6 +798,9 @@
+ if (!Directory.Exists(vanillaContentFolder)) {
+ vanillaContentFolder = "../Content"; // Nested Manual Install
+ }
+#if MAC
+ vanillaContentFolder = ../../../Terraria.app/Contents/MacOS/Content";
+#endif
+ if (SocialAPI.Mode == SocialMode.Steam && Steamworks.SteamAPI.Init()) {
+ var appID = ModLoader.Engine.Steam.TerrariaAppId_t;
+ bool appInstalled = Steamworks.SteamApps.BIsAppInstalled(appID);
Expand Down Expand Up @@ -861,7 +867,7 @@
}

private void ClientInitialize() {
@@ -6674,41 +_,48 @@
@@ -6674,41 +_,52 @@
}

if (autoJoin) {
Expand Down Expand Up @@ -895,7 +901,11 @@
protected override void LoadContent() {
+ HiDefGraphicsIssues.OnLoadContent();
Configuration.Load();
+ ModLoader.ModLoader.MigrateSettings();
+
+ // This reverts a potentially bad setting change. (Didn't work where it was before)
+ if (new System.Version(Configuration.Get("LastLaunchedTModLoaderVersion", "0.0")) <= new System.Version(0, 11, 7, 5))
+ Main.Configuration.Put("Support4K", true);
+
Configuration.Get("UseExperimentalFeatures", ref UseExperimentalFeatures);
if (UseExperimentalFeatures)
TexturePackSupport.Enabled = true;
Expand Down
2 changes: 1 addition & 1 deletion solutions/CompleteRelease.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@ECHO off
:: Compile/Build exe
echo "Building Release"
set tModLoaderVersion=v0.11.7.4
set tModLoaderVersion=v0.11.7.5
call buildRelease.bat

set destinationFolder=.\tModLoader %tModLoaderVersion% Release
Expand Down
2 changes: 1 addition & 1 deletion solutions/ReleaseExtras/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.11.7.4
v0.11.7.5
2 changes: 1 addition & 1 deletion solutions/documentation/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Terraria ModLoader"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 0.11.7.4
PROJECT_NUMBER = 0.11.7.5

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down

0 comments on commit e506ce4

Please sign in to comment.