mirror of
https://github.com/OMGeeky/ItemChecklist.git
synced 2025-12-26 16:07:43 +01:00
0.2.2 release, updated to tModLoader 0.10
This commit is contained in:
@@ -23,7 +23,7 @@ script:
|
||||
- echo "Mod Browser version is $version"
|
||||
- export gitVersion=`git describe --abbrev=0 --tags`
|
||||
- echo "git version is $gitVersion"
|
||||
- if [[ "$version" = "$gitVersion" ]]; then echo "Version does match, no need to push release"; Deploy=no; else echo "Version does not match, need to push release"; git config --global user.email "builds@travis-ci.com"; git config --global user.name "Travis CI"; git tag $version -a -m "TravisCI Autogenerated Release"; git push --quiet https://$GH_REPO_TOKEN@github.com/JavidPack/BossChecklist $version > /dev/null 2>&1; Deploy=yes; fi
|
||||
- if [[ "$version" = "$gitVersion" ]]; then echo "Version does match, no need to push release"; Deploy=no; else echo "Version does not match, need to push release"; git config --global user.email "builds@travis-ci.com"; git config --global user.name "Travis CI"; git tag $version -a -m "TravisCI Autogenerated Release"; Deploy=yes; fi
|
||||
- echo $Deploy
|
||||
|
||||
before_deploy:
|
||||
|
||||
@@ -80,12 +80,12 @@ namespace ItemChecklist
|
||||
|
||||
int lastSeenScreenWidth;
|
||||
int lastSeenScreenHeight;
|
||||
public override void ModifyInterfaceLayers(List<MethodSequenceListItem> layers)
|
||||
public override void ModifyInterfaceLayers(List<GameInterfaceLayer> layers)
|
||||
{
|
||||
int MouseTextIndex = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));
|
||||
if (MouseTextIndex != -1)
|
||||
{
|
||||
layers.Insert(MouseTextIndex, new MethodSequenceListItem(
|
||||
layers.Insert(MouseTextIndex, new LegacyGameInterfaceLayer(
|
||||
"ItemChecklist: Item Checklist",
|
||||
delegate
|
||||
{
|
||||
@@ -119,7 +119,7 @@ namespace ItemChecklist
|
||||
}
|
||||
return true;
|
||||
},
|
||||
null)
|
||||
InterfaceScaleType.UI)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
<Reference Include="Microsoft.Xna.Framework.Xact">
|
||||
<HintPath>..\..\solutiondlls\Microsoft.Xna.Framework.Xact.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ReLogic">
|
||||
<HintPath>..\..\..\Modding\tModLoader\references\ReLogic.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -59,9 +62,6 @@
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="tModLoader">
|
||||
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Terraria\tModLoader.exe</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ItemChecklist.cs" />
|
||||
@@ -81,9 +81,15 @@
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Modding\tModLoader\src\tModLoader\Terraria.csproj">
|
||||
<Project>{3996d5fa-6e59-4fe4-9f2b-40eeef9645d5}</Project>
|
||||
<Name>Terraria</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>"C:\Program Files (x86)\Steam\steamapps\common\terraria\tModLoaderDebug.exe" -build "$(ProjectDir)\" -eac "$(TargetPath)"</PostBuildEvent>
|
||||
<PostBuildEvent>"C:\Program Files (x86)\Steam\steamapps\common\Terraria\tModLoaderDebug.exe" -build "$(ProjectDir)\" -eac "$(TargetPath)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ItemChecklist
|
||||
ItemChecklist.instance.ItemChecklistUI.UpdateNeeded(item.type);
|
||||
if (ItemChecklistUI.announce)
|
||||
{
|
||||
Main.NewText($"You found your first {item.name}. {itemChecklistPlayer.totalItemsFound}/{itemChecklistPlayer.totalItemsToFind} {(100f*itemChecklistPlayer.totalItemsFound/itemChecklistPlayer.totalItemsToFind).ToString("0.00")}%");
|
||||
Main.NewText($"You found your first {item.Name}. {itemChecklistPlayer.totalItemsFound}/{itemChecklistPlayer.totalItemsToFind} {(100f*itemChecklistPlayer.totalItemsFound/itemChecklistPlayer.totalItemsToFind).ToString("0.00")}%");
|
||||
}
|
||||
ItemChecklist.instance.NewItem(item.type);
|
||||
}
|
||||
|
||||
@@ -60,9 +60,9 @@ namespace ItemChecklist
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
foundItems = new List<Item>();
|
||||
foundItem = new bool[Main.itemName.Length];
|
||||
findableItems = new bool[Main.itemName.Length];
|
||||
for (int i = 0; i < Main.itemName.Length; i++)
|
||||
foundItem = new bool[ItemLoader.ItemCount];
|
||||
findableItems = new bool[ItemLoader.ItemCount];
|
||||
for (int i = 0; i < ItemLoader.ItemCount; i++)
|
||||
{
|
||||
if (i > 0 && !ItemID.Sets.Deprecated[i] && i != ItemID.Count && ItemChecklistUI.vanillaIDsInSortOrder[i] != -1) // TODO, is this guaranteed?
|
||||
{
|
||||
@@ -71,7 +71,7 @@ namespace ItemChecklist
|
||||
}
|
||||
}
|
||||
|
||||
announcePreference = true;
|
||||
announcePreference = false;
|
||||
sortModePreference = SortModes.TerrariaSort;
|
||||
showCompletedPreference = 0;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace ItemChecklist
|
||||
|
||||
foreach (var item in foundItems)
|
||||
{
|
||||
if (item.name != "Unloaded Item")
|
||||
if (item.Name != "Unloaded Item")
|
||||
{
|
||||
foundItem[item.type] = true;
|
||||
totalItemsFound++;
|
||||
|
||||
@@ -52,7 +52,8 @@ namespace ItemChecklist.UI
|
||||
checklistPanel.BackgroundColor = new Color(73, 94, 171);
|
||||
|
||||
foundFilterButton = new UIHoverImageButton(Main.itemTexture[ItemID.Book], "Cycle Found Filter: ??");
|
||||
foundFilterButton.OnClick += ToggleFoundFilterButtonClicked;
|
||||
foundFilterButton.OnClick += (a, b) => ToggleFoundFilterButtonClicked(a, b, true);
|
||||
foundFilterButton.OnRightClick += (a, b) => ToggleFoundFilterButtonClicked(a, b, false);
|
||||
checklistPanel.Append(foundFilterButton);
|
||||
|
||||
muteButton = new UIToggleHoverImageButton(Main.itemTexture[ItemID.Megaphone], ItemChecklist.instance.GetTexture("closeButton"), "Toggle Messages", announce);
|
||||
@@ -62,13 +63,15 @@ namespace ItemChecklist.UI
|
||||
checklistPanel.Append(muteButton);
|
||||
|
||||
sortButton = new UIHoverImageButton(Main.itemTexture[ItemID.ToxicFlask], "Cycle Sort Method: ??");
|
||||
sortButton.OnClick += ToggleSortButtonClicked;
|
||||
sortButton.OnClick += (a, b) => ToggleSortButtonClicked(a, b, true);
|
||||
sortButton.OnRightClick += (a, b) => ToggleSortButtonClicked(a, b, false);
|
||||
sortButton.Left.Pixels = spacing * 4 + 28 * 2;
|
||||
sortButton.Top.Pixels = 4;
|
||||
checklistPanel.Append(sortButton);
|
||||
|
||||
modFilterButton = new UIHoverImageButton(ItemChecklist.instance.GetTexture("filterMod"), "Cycle Mod Filter: ??");
|
||||
modFilterButton.OnClick += ToggleModFilterButtonClicked;
|
||||
modFilterButton.OnClick += (a, b) => ToggleModFilterButtonClicked(a, b, true);
|
||||
modFilterButton.OnRightClick += (a, b) => ToggleModFilterButtonClicked(a, b, false);
|
||||
modFilterButton.Left.Pixels = spacing * 6 + 28 * 3;
|
||||
modFilterButton.Top.Pixels = 4;
|
||||
checklistPanel.Append(modFilterButton);
|
||||
@@ -93,9 +96,9 @@ namespace ItemChecklist.UI
|
||||
Append(checklistPanel);
|
||||
|
||||
// load time impact, do this on first show?
|
||||
itemSlots = new ItemSlot[Main.itemName.Length];
|
||||
Item[] itemSlotItems = new Item[Main.itemName.Length];
|
||||
for (int i = 0; i < Main.itemName.Length; i++)
|
||||
itemSlots = new ItemSlot[ItemLoader.ItemCount];
|
||||
Item[] itemSlotItems = new Item[ItemLoader.ItemCount];
|
||||
for (int i = 0; i < ItemLoader.ItemCount; i++)
|
||||
{
|
||||
itemSlots[i] = new ItemSlot(i);
|
||||
itemSlotItems[i] = itemSlots[i].item;
|
||||
@@ -107,15 +110,15 @@ namespace ItemChecklist.UI
|
||||
MethodInfo SortMethod = typeof(ItemSorting).GetMethod("Sort", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
object[] parametersArray = new object[] { itemSlotItems, new int[0] };
|
||||
|
||||
inventoryGlowHue.SetValue(null, new float[Main.itemName.Length]);
|
||||
inventoryGlowTime.SetValue(null, new int[Main.itemName.Length]);
|
||||
inventoryGlowHue.SetValue(null, new float[ItemLoader.ItemCount]);
|
||||
inventoryGlowTime.SetValue(null, new int[ItemLoader.ItemCount]);
|
||||
SortMethod.Invoke(null, parametersArray);
|
||||
inventoryGlowHue.SetValue(null, new float[58]);
|
||||
inventoryGlowTime.SetValue(null, new int[58]);
|
||||
|
||||
int[] vanillaIDsInSortOrderTemp = itemSlotItems.Select((x) => x.type).ToArray();
|
||||
vanillaIDsInSortOrder = new int[Main.itemName.Length];
|
||||
for (int i = 0; i < Main.itemName.Length; i++)
|
||||
vanillaIDsInSortOrder = new int[ItemLoader.ItemCount];
|
||||
for (int i = 0; i < ItemLoader.ItemCount; i++)
|
||||
{
|
||||
vanillaIDsInSortOrder[i] = Array.FindIndex(vanillaIDsInSortOrderTemp, x => x == i);
|
||||
}
|
||||
@@ -126,10 +129,10 @@ namespace ItemChecklist.UI
|
||||
updateneeded = true;
|
||||
}
|
||||
|
||||
private void ToggleFoundFilterButtonClicked(UIMouseEvent evt, UIElement listeningElement)
|
||||
private void ToggleFoundFilterButtonClicked(UIMouseEvent evt, UIElement listeningElement, bool left)
|
||||
{
|
||||
Main.PlaySound(SoundID.MenuTick);
|
||||
showCompleted = ++showCompleted % 3;
|
||||
showCompleted = (3 + showCompleted + (left ? 1 : -1)) % 3;
|
||||
foundFilterButton.hoverText = "Cycle Found Filter: " + foundFilterStrings[showCompleted];
|
||||
UpdateNeeded();
|
||||
}
|
||||
@@ -141,18 +144,18 @@ namespace ItemChecklist.UI
|
||||
muteButton.SetEnabled(announce);
|
||||
}
|
||||
|
||||
private void ToggleSortButtonClicked(UIMouseEvent evt, UIElement listeningElement)
|
||||
private void ToggleSortButtonClicked(UIMouseEvent evt, UIElement listeningElement, bool left)
|
||||
{
|
||||
Main.PlaySound(SoundID.MenuTick);
|
||||
sortMode = sortMode.Next();
|
||||
sortMode = left ? sortMode.NextEnum() : sortMode.PreviousEnum();
|
||||
sortButton.hoverText = "Cycle Sort Method: " + sortMode.ToFriendlyString();
|
||||
UpdateNeeded();
|
||||
}
|
||||
|
||||
private void ToggleModFilterButtonClicked(UIMouseEvent evt, UIElement listeningElement)
|
||||
private void ToggleModFilterButtonClicked(UIMouseEvent evt, UIElement listeningElement, bool left)
|
||||
{
|
||||
Main.PlaySound(SoundID.MenuTick);
|
||||
currentMod = (currentMod + 1) % modnames.Count;
|
||||
currentMod = (modnames.Count + currentMod + (left ? 1 : -1)) % modnames.Count;
|
||||
modFilterButton.hoverText = "Cycle Mod Filter: " + modnames[currentMod];
|
||||
UpdateNeeded();
|
||||
}
|
||||
@@ -185,7 +188,7 @@ namespace ItemChecklist.UI
|
||||
checklistGrid.Clear();
|
||||
|
||||
var itemChecklistPlayer = Main.LocalPlayer.GetModPlayer<ItemChecklistPlayer>(ItemChecklist.instance);
|
||||
|
||||
var temp = new List<ItemSlot>();
|
||||
for (int i = 0; i < itemChecklistPlayer.findableItems.Length; i++)
|
||||
{
|
||||
if (itemChecklistPlayer.findableItems[i])
|
||||
@@ -196,24 +199,24 @@ namespace ItemChecklist.UI
|
||||
if (PassModFilter(itemSlots[i]))
|
||||
{
|
||||
ItemSlot box = itemSlots[i];
|
||||
|
||||
checklistGrid._items.Add(box);
|
||||
checklistGrid._innerList.Append(box);
|
||||
temp.Add(box);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
checklistGrid.UpdateOrder();
|
||||
checklistGrid._innerList.Recalculate();
|
||||
checklistGrid.AddRange(temp);
|
||||
|
||||
if (lastfoundID > 0)
|
||||
{
|
||||
checklistGrid.Recalculate();
|
||||
checklistGrid.Goto(delegate (UIElement element)
|
||||
if (showCompleted != 1) // Don't Goto when unfound is the display mode.
|
||||
{
|
||||
ItemSlot itemSlot = element as ItemSlot;
|
||||
return itemSlot != null && itemSlot.id == lastfoundID;
|
||||
}, true);
|
||||
checklistGrid.Goto(delegate (UIElement element)
|
||||
{
|
||||
ItemSlot itemSlot = element as ItemSlot;
|
||||
return itemSlot != null && itemSlot.id == lastfoundID;
|
||||
}, true);
|
||||
}
|
||||
lastfoundID = -1;
|
||||
}
|
||||
}
|
||||
@@ -277,15 +280,6 @@ namespace ItemChecklist.UI
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static T Next<T>(this T src) where T : struct
|
||||
{
|
||||
if (!typeof(T).IsEnum) throw new ArgumentException(String.Format("Argumnent {0} is not an Enum", typeof(T).FullName));
|
||||
|
||||
T[] Arr = (T[])Enum.GetValues(src.GetType());
|
||||
int j = Array.IndexOf<T>(Arr, src) + 1;
|
||||
return (Arr.Length == j) ? Arr[0] : Arr[j];
|
||||
}
|
||||
|
||||
public static string ToFriendlyString(this SortModes sortmode)
|
||||
{
|
||||
switch (sortmode)
|
||||
|
||||
@@ -38,16 +38,16 @@ namespace ItemChecklist
|
||||
case SortModes.ID:
|
||||
return id.CompareTo(other.id);
|
||||
case SortModes.AZ:
|
||||
return item.name.CompareTo(other.item.name);
|
||||
return item.Name.CompareTo(other.item.Name);
|
||||
case SortModes.Value:
|
||||
result = item.value.CompareTo(other.item.value);
|
||||
if (result == 0)
|
||||
result = item.name.CompareTo(other.item.name);
|
||||
result = item.Name.CompareTo(other.item.Name);
|
||||
return result;
|
||||
case SortModes.Rare:
|
||||
result = item.rare.CompareTo(other.item.rare);
|
||||
if (result == 0)
|
||||
result = item.name.CompareTo(other.item.name);
|
||||
result = item.Name.CompareTo(other.item.Name);
|
||||
return result;
|
||||
case SortModes.TerrariaSort:
|
||||
return ItemChecklistUI.vanillaIDsInSortOrder[id].CompareTo(ItemChecklistUI.vanillaIDsInSortOrder[other.id]);
|
||||
@@ -106,7 +106,7 @@ namespace ItemChecklist
|
||||
|
||||
if (IsMouseHovering)
|
||||
{
|
||||
ItemChecklistUI.hoverText = item.name + (item.modItem != null ? " [" + item.modItem.mod.Name + "]" : "");
|
||||
ItemChecklistUI.hoverText = item.Name + (item.modItem != null ? " [" + item.modItem.mod.Name + "]" : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,15 @@ namespace ItemChecklist
|
||||
this._innerList.Recalculate();
|
||||
}
|
||||
|
||||
public virtual void AddRange(IEnumerable<UIElement> items)
|
||||
{
|
||||
this._items.AddRange(items);
|
||||
foreach (var item in items)
|
||||
this._innerList.Append(item);
|
||||
this.UpdateOrder();
|
||||
this._innerList.Recalculate();
|
||||
}
|
||||
|
||||
public virtual bool Remove(UIElement item)
|
||||
{
|
||||
this._innerList.RemoveChild(item);
|
||||
|
||||
Reference in New Issue
Block a user