-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit more latest changes (Git is being derpy).
- Loading branch information
1 parent
63642e8
commit b711b4e
Showing
4 changed files
with
86 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
| ||
using System; | ||
using Terraria; | ||
using Terraria.ModLoader; | ||
|
||
namespace BossExpertise | ||
{ | ||
public class ExpertPlayer : ModPlayer | ||
{ | ||
public override void ResetEffects() | ||
{ | ||
if(Config.DemonHeartHack && player.extraAccessory && !(Main.expertMode || Main.gameMenu)) | ||
player.extraAccessorySlots++; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
| ||
using System; | ||
using System.IO; | ||
using Terraria; | ||
|
||
namespace BossExpertise | ||
{ | ||
public static class OldConfig | ||
{ | ||
static string ConfigFolderPath = Path.Combine(Main.SavePath, "Mod Configs", "BossExpertise"); | ||
static string ConfigPath = Path.Combine(ConfigFolderPath, "config.txt"); | ||
static string ConfigVersionPath = Path.Combine(ConfigFolderPath, "configVersion.txt"); | ||
|
||
public static void Load() | ||
{ | ||
if(!Directory.Exists(ConfigFolderPath)) | ||
return; | ||
|
||
if(File.Exists(ConfigPath)) | ||
{ | ||
BossExpertise.Log("Found config file with old format! Reading outdated config..."); | ||
var file = new StreamReader(ConfigPath); | ||
try | ||
{ | ||
file.ReadLine(); | ||
bool.TryParse(file.ReadLine().Split(':')[1], out Config.DropBags); | ||
|
||
file.ReadLine(); | ||
bool.TryParse(file.ReadLine().Split(':')[1], out Config.ChangeBossAI); | ||
|
||
file.ReadLine(); | ||
bool.TryParse(file.ReadLine().Split(':')[1], out Config.AddCheatSheetButton); | ||
|
||
file.ReadLine(); | ||
bool.TryParse(file.ReadLine().Split(':')[1], out Config.AddExpertCommand); | ||
} | ||
catch(Exception e) | ||
{ | ||
BossExpertise.Log("Unable to read old config file!"); | ||
BossExpertise.Log(e.ToString()); | ||
} | ||
finally | ||
{ | ||
file.Dispose(); | ||
} | ||
} | ||
|
||
BossExpertise.Log("Deleting outdated config..."); | ||
try | ||
{ | ||
File.Delete(ConfigPath); | ||
File.Delete(ConfigVersionPath); | ||
if(Directory.GetFiles(ConfigFolderPath).Length == 0 && Directory.GetDirectories(ConfigFolderPath).Length == 0) | ||
Directory.Delete(ConfigFolderPath); | ||
else | ||
BossExpertise.Log("Outdated config folder still cotains some files/directories. They will not get deleted."); | ||
} | ||
catch(Exception e) | ||
{ | ||
BossExpertise.Log("Unable to delete old config!"); | ||
BossExpertise.Log(e.ToString()); | ||
} | ||
} | ||
} | ||
} |