Skip to content

Commit

Permalink
0.5.2 fix phantom ui problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Sep 13, 2018
1 parent 0b5267e commit e4b625d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
13 changes: 2 additions & 11 deletions ItemChecklist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ public override void UpdateUI(GameTime gameTime)
ItemChecklistInterface?.Update(gameTime);
}

int lastSeenScreenWidth;
int lastSeenScreenHeight;
public override void ModifyInterfaceLayers(List<GameInterfaceLayer> layers)
{
int MouseTextIndex = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));
Expand All @@ -124,16 +122,9 @@ public override void ModifyInterfaceLayers(List<GameInterfaceLayer> layers)
"ItemChecklist: Item Checklist",
delegate
{
if (ItemChecklistUI.visible)
if (ItemChecklistUI.Visible)
{
if (lastSeenScreenWidth != Main.screenWidth || lastSeenScreenHeight != Main.screenHeight)
{
ItemChecklistInterface.Recalculate();
lastSeenScreenWidth = Main.screenWidth;
lastSeenScreenHeight = Main.screenHeight;
}

ItemChecklistUI.Draw(Main.spriteBatch);
ItemChecklistInterface?.Draw(Main.spriteBatch, new GameTime());

if (ItemChecklistUI.hoverText != "")
{
Expand Down
6 changes: 3 additions & 3 deletions ItemChecklistPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public override void ProcessTriggers(TriggersSet triggersSet)
{
if (ItemChecklist.ToggleChecklistHotKey.JustPressed)
{
if (!ItemChecklistUI.visible)
if (!ItemChecklistUI.Visible)
{
ItemChecklist.instance.ItemChecklistUI.UpdateNeeded();
}
ItemChecklistUI.visible = !ItemChecklistUI.visible;
ItemChecklistUI.Visible = !ItemChecklistUI.Visible;
// Debug assistance, allows for reinitializing RecipeBrowserUI
//if (!ItemChecklistUI.visible)
//{
Expand All @@ -55,7 +55,7 @@ public override void ProcessTriggers(TriggersSet triggersSet)
public override void OnEnterWorld(Player player)
{
var itemChecklistPlayer = Main.LocalPlayer.GetModPlayer<ItemChecklistPlayer>(mod);
ItemChecklistUI.visible = false;
ItemChecklistUI.Visible = false;
ItemChecklistUI.announce = announcePreference;
ItemChecklistUI.collectChestItems = findChestItemsPreference;
//ItemChecklistUI.sortMode = sortModePreference;
Expand Down
6 changes: 5 additions & 1 deletion ItemChecklistUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class ItemChecklistUI : UIState
//public static SortModes sortMode = SortModes.TerrariaSort;

float spacing = 8f;
public static bool visible = false;
public static bool Visible
{
get { return ItemChecklist.ItemChecklistInterface.CurrentState == ItemChecklist.instance.ItemChecklistUI; }
set { ItemChecklist.ItemChecklistInterface.SetState(value ? ItemChecklist.instance.ItemChecklistUI : null); }
}
public static int showCompleted = 0; // 0: both, 1: unfound, 2: found
public static bool announce = true;
public static bool collectChestItems = 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.5.1
version = 0.5.2
displayName = Item Checklist
homepage = https://forums.terraria.org/index.php?threads/item-checklist-in-game-100-item-collection-checklist.52786/
hideCode = false
Expand Down

0 comments on commit e4b625d

Please sign in to comment.