Skip to content

Commit 60222dd

Browse files
author
hamstar0
committed
v5.0.0.3 - Fixed again
1 parent d99bdb9 commit 60222dd

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

HUDElementsLib/API.cs

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,29 @@ private static void MessageAboutHUD_If() {
1616
void AddUsageMessage() {
1717
string id = "HUDElementsLibUsage";
1818

19-
bool isUnread = (bool)msgMod.Call( "IsUnread", id );
20-
21-
object rawParentMsg = msgMod.Call( "GetMessage", "Messages - Mod Info" ); //MessagesAPI.ModInfoCategoryMsg
22-
23-
//
24-
25-
msgMod.Call(
26-
"AddMessage",
27-
"Reposition HUD elements via. hotkey", //title:
28-
"Bind a key to activate Edit Mode to reposition custom HUD elements freely to your liking.", //description:
29-
HUDElementsLibMod.Instance, //modOfOrigin:
30-
id, //id:
31-
isUnread, //alertPlayer:
32-
false, //isImportant:
33-
rawParentMsg //parentMessage:
34-
);
19+
try {
20+
msgMod = ModLoader.GetMod( "Messages" );
21+
22+
bool isUnread = (bool)msgMod.Call( "IsUnread", id );
23+
24+
object rawParentMsg = msgMod.Call( "GetMessage", "Messages - Mod Info" ); //MessagesAPI.ModInfoCategoryMsg
25+
26+
//
27+
28+
msgMod.Call(
29+
"AddMessage",
30+
"Reposition HUD elements via. hotkey", //title:
31+
"Bind a key to activate Edit Mode to reposition custom HUD elements freely to your liking.", //description:
32+
HUDElementsLibMod.Instance, //modOfOrigin:
33+
isUnread, //alertPlayer:
34+
false, //isImportant:
35+
rawParentMsg, //parentMessage:
36+
id, //id:
37+
0 //weight:
38+
);
39+
} catch( Exception e ) {
40+
HUDElementsLibMod.Instance.Logger.Error( "", e );
41+
}
3542
}
3643

3744
Action usageMessageAdder = AddUsageMessage;

HUDElementsLib/MyMod.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public override void Load() {
5252
this.MyUIMngr.SetState( this.MyUI );
5353

5454
this.HUDManager = new HUDManager( this.MyUI );
55+
}
56+
}
57+
58+
public override void PostSetupContent() {
59+
if( !Main.dedServ && Main.netMode != NetmodeID.Server ) {
5560
VanillaHUDElement.LoadVanillaElements();
5661
}
5762
}

HUDElementsLib/build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
displayName = HUD Elements Lib
22
author = hamstar
3-
version = 5.0.0.2
3+
version = 5.0.0.3
44
buildIgnore = *.csproj, *.user, *.bat, obj\*, bin\*, .vs\*, .git\*
55
homepage = https://forums.terraria.org/index.php?threads/hud-elements-lib.103890/

0 commit comments

Comments
 (0)