Skip to content

Commit

Permalink
Code cleanup and new version in anticipation for update.
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Aug 26, 2017
1 parent f83c062 commit 8542903
Show file tree
Hide file tree
Showing 38 changed files with 128 additions and 122 deletions.
37 changes: 30 additions & 7 deletions HEROsMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,20 @@ public override void Load()
{
instance = this;
// AddGlobalItem("HEROsModGlobalItem", new HEROsModGlobalItem());
AddPlayer("HEROsModModPlayer", new HEROsModModPlayer());
// AddPlayer("HEROsModModPlayer", new HEROsModModPlayer());
//if (ModUtils.NetworkMode != NetworkMode.Server)

UIKit.UIButton.buttonBackground = HEROsMod.instance.GetTexture("Images/UIKit/buttonEdge");
UIKit.UIView.closeTexture = HEROsMod.instance.GetTexture("Images/closeButton");
UIKit.UITextbox.textboxBackground = HEROsMod.instance.GetTexture("Images/UIKit/textboxEdge");
UIKit.UISlider.barTexture = HEROsMod.instance.GetTexture("Images/UIKit/barEdge");
UIKit.UIScrollView.ScrollbgTexture = GetTexture("Images/UIKit/scrollbgEdge");
UIKit.UIScrollBar.ScrollbarTexture = HEROsMod.instance.GetTexture("Images/UIKit/scrollbarEdge");
UIKit.UIDropdown.capUp = HEROsMod.instance.GetTexture("Images/UIKit/dropdownCapUp");
UIKit.UIDropdown.capDown = HEROsMod.instance.GetTexture("Images/UIKit/dropdownCapDown");
UIKit.UICheckbox.checkboxTexture = HEROsMod.instance.GetTexture("Images/UIKit/checkBox");
UIKit.UICheckbox.checkmarkTexture = HEROsMod.instance.GetTexture("Images/UIKit/checkMark");

Init();
}
catch (Exception e)
Expand All @@ -48,6 +59,18 @@ public override void Load()
// Clear EVERYthing, mod is unloaded.
public override void Unload()
{
UIKit.UIComponents.ItemBrowser.Filters = null;
UIKit.UIComponents.ItemBrowser.DefaultSorts = null;
UIKit.UIButton.buttonBackground = null;
UIKit.UIView.closeTexture = null;
UIKit.UITextbox.textboxBackground = null;
UIKit.UISlider.barTexture = null;
UIKit.UIScrollView.ScrollbgTexture = null;
UIKit.UIScrollBar.ScrollbarTexture = null;
UIKit.UIDropdown.capUp = null;
UIKit.UIDropdown.capDown = null;
UIKit.UICheckbox.checkboxTexture = null;
UIKit.UICheckbox.checkmarkTexture = null;
try
{
KeybindController.bindings.Clear();
Expand All @@ -71,6 +94,12 @@ public override void Unload()
{
ModUtils.DebugText("Unload:\n" + e.Message + "\n" + e.StackTrace + "\n");
}
extensionMenuService = null;
miscOptions = null;
_hotbar = null;
ServiceController = null;
TimeWeatherControlHotbar.Unload();
instance = null;
}

public override void PostSetupContent()
Expand Down Expand Up @@ -168,15 +197,9 @@ public override bool HijackGetData(ref byte messageType, ref BinaryReader reader
// Holds all the loaded services.
public static ServiceController ServiceController;

/// <summary>
/// A reference to teh instance of the Graphics Device.
/// </summary>
public static GraphicsDevice GraphicsDeviceReference;

public static RenderTarget2D RenderTarget { get; set; }

private static ServiceHotbar _hotbar;

public static ServiceHotbar ServiceHotbar
{
get { return _hotbar; }
Expand Down
2 changes: 2 additions & 0 deletions HEROsModModPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace HEROsMod
{
public class HEROsModModPlayer : ModPlayer
{
public override bool Autoload(ref string name) => true;

public override void SetControls()
{
if (FlyCam.Enabled)
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/BuffService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal class BuffService : HEROsModService

public BuffService()
{
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/buffs")/*Main.buffTexture[2]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/buffs")/*Main.buffTexture[2]*/);
this.HotbarIcon.Tooltip = "Open Buff Window";
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;

Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/CheckTileModificationTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class CheckTileModificationTool : HEROsModService
public CheckTileModificationTool()
{
MultiplayerOnly = true;
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/tileModification")/*Main.itemTexture[1999]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/tileModification")/*Main.itemTexture[1999]*/);
this.HotbarIcon.Tooltip = "Check Tile for last modification";
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;
this.HasPermissionToUse = true;
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/EnemyToggler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal class EnemyToggler : HEROsModService
public EnemyToggler()
{
this._name = "Enemy Toggler";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/npcIcon"));
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/npcIcon"));
this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
this.HotbarIcon.Tooltip = "Disable Enemy Spawns";
this._hotbarIcon.Opacity = 1f;
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/ExtensionMenuService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public ExtensionMenuService()

IsHotbar = true;

this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/extensions"));
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/extensions"));
this.HotbarIcon.Tooltip = "Extension Tools";
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;

Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/GenericExtensionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal class GenericExtensionService : HEROsModService
// _name = "Undefined";
// IsInHotbar = true;
// HotbarParent = hotbar;
// _hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/spawn")/*Main.itemTexture[69]*/);
// _hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/spawn")/*Main.itemTexture[69]*/);
// _hotbarIcon.Tooltip = "Set Spawn Point";
// HotbarIcon.onLeftClick += new EventHandler(button_onLeftClick);
// HotbarIcon.onHover += new EventHandler(button_onHover);
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/GodModeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static bool Enabled

public GodModeService()
{
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/godMode")/*Main.itemTexture[1990]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/godMode")/*Main.itemTexture[1990]*/);
this.HotbarIcon.Tooltip = "Toggle God Mode";
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;
GodModeToggled += GodModeService_GodModeToggled;
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/GroupInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public GroupInspector(UIHotbar hotbar)
HotbarParent = hotbar;
MultiplayerOnly = true;
this._name = "Group Inspector";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/manageGroups"));
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/manageGroups"));
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;
this.HotbarIcon.Tooltip = "Open Group Management";
HEROsModNetwork.LoginService.GroupChanged += LoginService_GroupChanged;
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/InfiniteReach.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public InfiniteReach()
{
Enabled = false;
this._name = "Infinite Reach";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/infiniteReach")/*Main.itemTexture[407]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/infiniteReach")/*Main.itemTexture[407]*/);
this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
this.HotbarIcon.Tooltip = "Enable Infinite Reach";
Disable();
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/InvasionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class InvasionService : HEROsModService

public InvasionService()
{
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/event")/*Main.itemTexture[14]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/event")/*Main.itemTexture[14]*/);
this._hotbarIcon.Tooltip = "Open Event Starter";
this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;

Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/ItemBanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ItemBanner(UIHotbar hotbar)
HotbarParent = hotbar;
MultiplayerOnly = true;
this._name = "Item Banner";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/explosives")/*Main.itemTexture[888]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/explosives")/*Main.itemTexture[888]*/);
this._hotbarIcon.Tooltip = "Ban Destructive Explosives";
this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
HEROsModNetwork.GeneralMessages.ItemBannerToggleByServer += GeneralMessages_BannedItemsToggleByServer;
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/ItemBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class ItemBrowser : HEROsModService
public ItemBrowser()
{
this._name = "Item Browser";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/items")/*Main.itemTexture[10]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/items")/*Main.itemTexture[10]*/);
this.HotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
this.HotbarIcon.Tooltip = "Item Browser";

Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/ItemClearer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class ItemClearer : HEROsModService
public ItemClearer()
{
this._name = "Item Clearer";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/canIcon"));
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/canIcon"));
this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
this.HotbarIcon.Tooltip = "Clear Items on Ground";
}
Expand Down
4 changes: 2 additions & 2 deletions HEROsModServices/Login.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public Login()
MultiplayerOnly = true;
if (_loginTexture == null)
{
_loginTexture = UIView.GetEmbeddedTexture("Images/login");
_loginTexture = HEROsMod.instance.GetTexture("Images/login");
}
if (_logoutTexture == null)
{
_logoutTexture = UIView.GetEmbeddedTexture("Images/logout");
_logoutTexture = HEROsMod.instance.GetTexture("Images/logout");
}
this._name = "Login";
this._hotbarIcon = new UIImage(_loginTexture);
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/MapRevealer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public MapRevealer(UIHotbar hotbar)
IsInHotbar = true;
HotbarParent = hotbar;
this._name = "Map Revealer";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/map")/*ModUtils.RevealMapTexture*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/map")/*ModUtils.RevealMapTexture*/);
this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
this.HotbarIcon.Tooltip = "Reveal Map";
instance = this;
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/MiscOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public MiscOptions()
{
IsHotbar = true;

this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/settings")/*Main.buffTexture[BuffID.Confused]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/settings")/*Main.buffTexture[BuffID.Confused]*/);
this.HotbarIcon.Tooltip = "Misc. Options";
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;

Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/MobSpawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class MobSpawner : HEROsModService

public MobSpawner()
{
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/npcs")/*Main.itemTexture[666]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/npcs")/*Main.itemTexture[666]*/);
this.HotbarIcon.Tooltip = "Open Mob Spawn Window";
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;

Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/PlayerList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public PlayerList()
{
MultiplayerOnly = true;
this._name = "Player List";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/connectedPlayers"));
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/connectedPlayers"));
this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
this.HotbarIcon.Tooltip = "View Connected Players";
}
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/PrefixEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal class PrefixEditor : HEROsModService

public PrefixEditor()
{
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/reforge")/*Main.itemTexture[24]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/reforge")/*Main.itemTexture[24]*/);
this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
this.HotbarIcon.Tooltip = "Prefix Editor";

Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/RegionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public RegionService()
canEdit = false;
canView = false;
this._name = "Region Service";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/region")/*Main.itemTexture[1337]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/region")/*Main.itemTexture[1337]*/);
this.HotbarIcon.Tooltip = "Open regions window";
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;
this.HasPermissionToUse = true;
Expand Down
4 changes: 2 additions & 2 deletions HEROsModServices/ServiceHotbar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ private void InitUI()
_iconView.Height = this.Height;
this.AddChild(_iconView);

collapseButton = new UIImage(UIView.GetEmbeddedTexture("Images/CollapseBar/CollapseButtonHorizontal"));
collapseButton = new UIImage(HEROsMod.instance.GetTexture("Images/CollapseBar/CollapseButtonHorizontal"));
collapseButton.UpdateWhenOutOfBounds = true;
collapseArrow = new UIImage(UIView.GetEmbeddedTexture("Images/CollapseBar/CollapseArrowHorizontal"));
collapseArrow = new UIImage(HEROsMod.instance.GetTexture("Images/CollapseBar/CollapseArrowHorizontal"));
collapseArrow.UpdateWhenOutOfBounds = true;
collapseButton.Anchor = AnchorPosition.Top;
collapseArrow.Anchor = AnchorPosition.Top;
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/SpawnPointSetter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public SpawnPointSetter(UIHotbar hotbar)
IsInHotbar = true;
HotbarParent = hotbar;
this._name = "Spawn Point Setter";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/spawn")/*Main.itemTexture[69]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/spawn")/*Main.itemTexture[69]*/);
this._hotbarIcon.Tooltip = "Set Spawn Point";
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;
}
Expand Down
34 changes: 20 additions & 14 deletions HEROsModServices/TimeWeatherChanger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public TimeWeatherChanger()

TimePaused = false;
this._name = "Time Weather Control";
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/timeRain"));
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/timeRain"));
this.HotbarIcon.Tooltip = "Change Time/Rain";
this.HotbarIcon.onLeftClick += HotbarIcon_onLeftClick;

Expand Down Expand Up @@ -124,15 +124,15 @@ internal class TimeWeatherControlHotbar : UIHotbar
//{
// get
// {
// if (_rainTexture == null) _rainTexture = GetEmbeddedTexture("Images/rainIcon");
// if (_rainTexture == null) _rainTexture = HEROsMod.instance.GetTexture("Images/rainIcon");
// return _rainTexture;
// }
//}
public static Texture2D playTexture
{
get
{
if (_playTexture == null) _playTexture = GetEmbeddedTexture("Images/speed1");
if (_playTexture == null) _playTexture = HEROsMod.instance.GetTexture("Images/speed1");
return _playTexture;
}
}
Expand All @@ -141,7 +141,7 @@ public static Texture2D pauseTexture
{
get
{
if (_pauseTexture == null) _pauseTexture = GetEmbeddedTexture("Images/speed0");
if (_pauseTexture == null) _pauseTexture = HEROsMod.instance.GetTexture("Images/speed0");
return _pauseTexture;
}
}
Expand All @@ -157,7 +157,7 @@ public TimeWeatherControlHotbar()
base.Anchor = AnchorPosition.Top;
this.AddChild(this.buttonView);

//UIImage bStopRain = new UIImage(GetEmbeddedTexture("Images/sunIcon"));
//UIImage bStopRain = new UIImage(HEROsMod.instance.GetTexture("Images/sunIcon"));
//UIImage bStartRain = new UIImage(rainTexture);
//bStartRain.Tooltip = "Start Rain";
//bStopRain.Tooltip = "Stop Rain";
Expand All @@ -166,10 +166,10 @@ public TimeWeatherControlHotbar()
//AddChild(bStopRain);
//AddChild(bStartRain);

//UIImage nightButton = new UIImage(GetEmbeddedTexture("Images/moonIcon"));
//UIImage nightButton = new UIImage(HEROsMod.instance.GetTexture("Images/moonIcon"));
//nightButton.Tooltip = "Night";
//nightButton.onLeftClick += nightButton_onLeftClick;
//UIImage noonButton = new UIImage(GetEmbeddedTexture("Images/sunIcon"));
//UIImage noonButton = new UIImage(HEROsMod.instance.GetTexture("Images/sunIcon"));
//noonButton.Tooltip = "Noon";
//noonButton.onLeftClick += noonButton_onLeftClick;
//bPause = new UIImage(pauseTexture);
Expand Down Expand Up @@ -198,28 +198,28 @@ public override void test()
Height = 54;
UpdateWhenOutOfBounds = true;

UIImage bStopRain = new UIImage(GetEmbeddedTexture("Images/rainStop"));
UIImage bStartRain = new UIImage(GetEmbeddedTexture("Images/rainIcon"));
UIImage bStopRain = new UIImage(HEROsMod.instance.GetTexture("Images/rainStop"));
UIImage bStartRain = new UIImage(HEROsMod.instance.GetTexture("Images/rainIcon"));
bStartRain.Tooltip = "Start Rain";
bStopRain.Tooltip = "Stop Rain";
bStartRain.onLeftClick += bStartRain_onLeftClick;
bStopRain.onLeftClick += bStopRain_onLeftClick;
buttonView.AddChild(bStopRain);
buttonView.AddChild(bStartRain);

UIImage bStopSandstorm = new UIImage(GetEmbeddedTexture("Images/rainStop"));
UIImage bStartSandstorm = new UIImage(GetEmbeddedTexture("Images/rainIcon"));
UIImage bStopSandstorm = new UIImage(HEROsMod.instance.GetTexture("Images/rainStop"));
UIImage bStartSandstorm = new UIImage(HEROsMod.instance.GetTexture("Images/rainIcon"));
bStartSandstorm.Tooltip = "Start Sandstorm";
bStopSandstorm.Tooltip = "Stop Sandstorm";
bStartSandstorm.onLeftClick += bStartSandstorm_onLeftClick;
bStopSandstorm.onLeftClick += bStopSandstorm_onLeftClick;
buttonView.AddChild(bStopSandstorm);
buttonView.AddChild(bStartSandstorm);

UIImage nightButton = new UIImage(GetEmbeddedTexture("Images/moonIcon"));
UIImage nightButton = new UIImage(HEROsMod.instance.GetTexture("Images/moonIcon"));
nightButton.Tooltip = "Night";
nightButton.onLeftClick += nightButton_onLeftClick;
UIImage noonButton = new UIImage(GetEmbeddedTexture("Images/sunIcon"));
UIImage noonButton = new UIImage(HEROsMod.instance.GetTexture("Images/sunIcon"));
noonButton.Tooltip = "Noon";
noonButton.onLeftClick += noonButton_onLeftClick;
bPause = new UIImage(TimeWeatherChanger.TimePaused ? playTexture : pauseTexture);
Expand All @@ -230,7 +230,7 @@ public override void test()
buttonView.AddChild(noonButton);
buttonView.AddChild(bPause);

UIImage sundialButton = new UIImage(GetEmbeddedTexture("Images/timeRain"));
UIImage sundialButton = new UIImage(HEROsMod.instance.GetTexture("Images/timeRain"));
sundialButton.Tooltip = "Force Enchanted Sundial";
sundialButton.onLeftClick += sundialButton_onLeftClick;
buttonView.AddChild(sundialButton);
Expand Down Expand Up @@ -430,6 +430,12 @@ private void TimeControlWindow_onLeftClick(object sender, EventArgs e)
}
}

internal static void Unload()
{
_playTexture = null;
_pauseTexture = null;
}

//public override void Update()
//{
// if (this.Visible)
Expand Down
2 changes: 1 addition & 1 deletion HEROsModServices/ToggleGravestones.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public ToggleGravestones(UIHotbar hotbar)
//MultiplayerOnly = true;
this._name = "Gravestones Toggler";
ModUtils.LoadProjectile(43);
this._hotbarIcon = new UIImage(UIView.GetEmbeddedTexture("Images/gravestone")/*Main.projectileTexture[43]*/);
this._hotbarIcon = new UIImage(HEROsMod.instance.GetTexture("Images/gravestone")/*Main.projectileTexture[43]*/);
this._hotbarIcon.onLeftClick += _hotbarIcon_onLeftClick;
this.HotbarIcon.Tooltip = "Disable Gravestones";
this._hotbarIcon.Opacity = 1f;
Expand Down
Loading

0 comments on commit 8542903

Please sign in to comment.