Skip to content

Commit

Permalink
0.4.0.2, fix for users still on <0.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Oct 3, 2017
1 parent c7cba8b commit 135bdc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions LootCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,15 @@ private static void Reflect()

MethodInfo setTextMethod = assembly.GetType("Terraria.ModLoader.UI.UILoadProgress").GetMethod("SetText", BindingFlags.Instance | BindingFlags.NonPublic);
MethodInfo setProgressMethod = assembly.GetType("Terraria.ModLoader.UI.UILoadProgress").GetMethod("SetProgress", BindingFlags.Instance | BindingFlags.NonPublic);
MethodInfo setSubTextMethod = assembly.GetType("Terraria.ModLoader.UI.UILoadMods").GetMethod("SetSubProgressInit", BindingFlags.Instance | BindingFlags.NonPublic);

setLoadProgressText = (string s) => setTextMethod.Invoke(loadProgressObject, new object[] { s });
setLoadProgressProgress = (float f) => setProgressMethod.Invoke(loadProgressObject, new object[] { f });
setLoadSubProgressText = (string s) => setSubTextMethod.Invoke(loadModsObject, new object[] { s });

if (ModLoader.version >= new Version(0, 10, 1))
{
MethodInfo setSubTextMethod = assembly.GetType("Terraria.ModLoader.UI.UILoadMods").GetMethod("SetSubProgressInit", BindingFlags.Instance | BindingFlags.NonPublic);
setLoadSubProgressText = (string s) => setSubTextMethod.Invoke(loadModsObject, new object[] { s });
}
}

static int[] ignoreItemIDS = { ItemID.Heart, 1734, 1867, 184, 1735, 1868, ItemID.CopperCoin, ItemID.CopperCoin, ItemID.SilverCoin, ItemID.GoldCoin, ItemID.PlatinumCoin };
Expand Down Expand Up @@ -441,7 +445,7 @@ public class RecipeBrowserGlobalNPC : GlobalNPC
{
public override bool PreNPCLoot(NPC npc)
{
if(LootCacheManager.LootCacheManagerActive)
if (LootCacheManager.LootCacheManagerActive)
((List<int>)(NPCLoader.blockLoot)).AddRange(LootCacheManager.loots);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
author = jopojelly
version = 0.4.0.1
version = 0.4.0.2
displayName = Recipe Browser
homepage = https://forums.terraria.org/index.php?threads/recipe-browser.62462/
buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, unused\*, .git\*,
Expand Down

0 comments on commit 135bdc3

Please sign in to comment.