Skip to content

Commit

Permalink
v1.3.b13.a
Browse files Browse the repository at this point in the history
Fix MissingResourceException bug
  • Loading branch information
PlexusDuMenton committed Jun 24, 2019
1 parent f5e4747 commit bedbf67
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ConfigFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public override void OnChanged()
AnotherRpgMod.visualConfig = this;
if (AnotherRpgMod.Instance!= null) {
AnotherRpgMod.Instance.healthBar.Reset();
AnotherRpgMod.Instance.OpenST.OnInitialize();
AnotherRpgMod.Instance.openStatMenu.OnInitialize();
AnotherRpgMod.Instance.OpenST.Reset();
AnotherRpgMod.Instance.openStatMenu.Reset();
}
}
}
Expand Down
27 changes: 24 additions & 3 deletions UI/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class OpenSTButton : UIState
public float scale = Config.vConfig.HealthBarScale;
public float yOffSet = Config.vConfig.HealthBarYoffSet;
public bool hiden = false;
Texture2D Button;

public void Erase()
{
Expand All @@ -48,6 +49,17 @@ public override void Update(GameTime gameTime)
}

public override void OnInitialize()
{
LoadTexture();
Reset();
}

public void LoadTexture()
{
Button = ModContent.GetTexture("AnotherRpgMod/Textures/UI/skill_tree");
}

public void Reset()
{
Erase();
yOffSet = Config.vConfig.HealthBarYoffSet;
Expand All @@ -62,7 +74,7 @@ public override void OnInitialize()
OpenSTPanel.HAlign = 0;
OpenSTPanel.VAlign = 0;

Texture2D Button = ModContent.GetTexture("AnotherRpgMod/Textures/UI/skill_tree");

OpenStatButton OpenButton = new OpenStatButton(Button);
OpenButton.Left.Set(0, 0f);
OpenButton.Top.Set(0, 0f);
Expand Down Expand Up @@ -94,7 +106,7 @@ class OpenStatsButton : UIState
public UIElement OpenStatsPanel;
public float scale = Config.vConfig.HealthBarScale;
public float yOffSet = Config.vConfig.HealthBarYoffSet;

Texture2D Button;
public bool hiden = false;


Expand Down Expand Up @@ -123,7 +135,17 @@ public override void Update(GameTime gameTime)

public override void OnInitialize()
{
LoadTexture();
Reset();
}

public void LoadTexture()
{
Button = ModContent.GetTexture("AnotherRpgMod/Textures/UI/character");
}

public void Reset()
{
Erase();
yOffSet = Config.vConfig.HealthBarYoffSet;
scale = Config.vConfig.HealthBarScale;
Expand All @@ -137,7 +159,6 @@ public override void OnInitialize()
OpenStatsPanel.HAlign = 0;
OpenStatsPanel.VAlign = 0;

Texture2D Button = ModContent.GetTexture("AnotherRpgMod/Textures/UI/character");
OpenStatButton OpenButton = new OpenStatButton(Button);
OpenButton.Left.Set(0, 0f);
OpenButton.Top.Set(0, 0f);
Expand Down

0 comments on commit bedbf67

Please sign in to comment.