Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
1d0aab9
vs
AqlaSolutions Aug 11, 2018
17fa944
lower prices
AqlaSolutions Aug 11, 2018
cb84aa8
build obj
AqlaSolutions Aug 11, 2018
358e4c1
2 crafting list modes - new or all items, but only from known compone…
AqlaSolutions Aug 11, 2018
79230f2
button to show blacklist and right click to remove from it
AqlaSolutions Aug 11, 2018
6d53e34
sorting by value
AqlaSolutions Aug 11, 2018
7be47a0
reversed Value sort order - from small to big now
AqlaSolutions Aug 11, 2018
6a63358
30 crafting stations instead of 10
AqlaSolutions Aug 11, 2018
e80d323
hidden items are considered known
AqlaSolutions Aug 11, 2018
51123e4
added recursive search for items that can be non-directly crafted fro…
AqlaSolutions Aug 11, 2018
a04800b
potion filter fix
AqlaSolutions Aug 11, 2018
86c421c
more filters
AqlaSolutions Aug 11, 2018
185160c
sorting by dps
AqlaSolutions Aug 11, 2018
91cc835
clearing text box on right click,
AqlaSolutions Aug 11, 2018
59c332b
filtering new 30 items
AqlaSolutions Aug 11, 2018
db6464b
hopely fixed filter icon size
AqlaSolutions Aug 11, 2018
4c23f7e
fixes to make it all work, added DPS counter in craft menu
AqlaSolutions Aug 11, 2018
d98f39e
dps fix
AqlaSolutions Aug 12, 2018
7a326fb
C# 6, mods are selected with left-right click instead of typing, reci…
AqlaSolutions Aug 12, 2018
bafd8f9
authors and version
AqlaSolutions Aug 12, 2018
fa08288
more fixes
AqlaSolutions Aug 12, 2018
9f80d29
and more filtering and search box input fixes
AqlaSolutions Aug 12, 2018
121cebd
support for accepted groups when searching for known recipes, 30 rece…
AqlaSolutions Aug 12, 2018
2384e65
magic filter fix
AqlaSolutions Aug 12, 2018
266e0e3
fixed disabling filters when searching with no results
AqlaSolutions Aug 12, 2018
be0ea92
item types set more compact save
AqlaSolutions Aug 12, 2018
8da56a0
Restock button, favorites in storage (alt+click), toggle to show only…
AqlaSolutions Aug 12, 2018
10559fe
amend
AqlaSolutions Aug 13, 2018
a7b4c8d
favorites in recipes
AqlaSolutions Aug 13, 2018
a46e96a
Restock fix
AqlaSolutions Aug 13, 2018
136b8aa
1. use Ctrl+Left Click for black listing items instead of Right Click…
AqlaSolutions Aug 13, 2018
c9e0a47
search bar fix
AqlaSolutions Aug 13, 2018
f08df70
right click to mark item as not new
AqlaSolutions Aug 13, 2018
1013c61
newAndShiny recipes
AqlaSolutions Aug 15, 2018
e8e1935
known but not crafted recipes can be unmarked - back to new - with ri…
AqlaSolutions Aug 15, 2018
19b3e68
improved strategy to determine known recipes now will not show all ot…
AqlaSolutions Aug 15, 2018
5c98044
for weapons and accesory rarity comparison replaced by dps and value …
AqlaSolutions Aug 15, 2018
2d35cff
fixed sorting of recent items
AqlaSolutions Aug 16, 2018
a262380
favorites first
AqlaSolutions Aug 16, 2018
37e77aa
searching may disable filtering when no results, favorites choice is …
AqlaSolutions Aug 16, 2018
dbd6a30
Transfer button now uses Quick Stack, hold Ctrl to Deposit All
AqlaSolutions Aug 16, 2018
2c0b6da
favorites first - fix
AqlaSolutions Aug 16, 2018
538426f
dps is now calculated according with respect to defence according to …
AqlaSolutions Aug 17, 2018
4a75dcb
crit chance is also taken into account
AqlaSolutions Aug 17, 2018
e5bc693
quick stack improvement to ignore prefixes
AqlaSolutions Aug 21, 2018
280eb6b
path for when can't retrieve items from item check list
AqlaSolutions Aug 21, 2018
484dc6b
don't reset search settings when closing
AqlaSolutions Aug 21, 2018
5f91687
and again more crafting station as I already reached limit :)...
AqlaSolutions Aug 21, 2018
0ad1fb5
version
AqlaSolutions Aug 21, 2018
b1e5db2
recipes that require unknown crafting stations are considered unknown…
AqlaSolutions Aug 22, 2018
f197a30
removed mirror from summon category
AqlaSolutions Aug 22, 2018
642cec4
added hot key to check whether hovered item is known or new (I want t…
AqlaSolutions Aug 23, 2018
e77025b
don't reset selected recipe on close
AqlaSolutions Aug 23, 2018
768d1b3
don't reset scroll bar in storage
AqlaSolutions Aug 23, 2018
57069b4
multiplayer fix
AqlaSolutions Aug 23, 2018
4d9c297
Fixes #53 (#58)
AqlaSolutions Aug 23, 2018
f7a0435
Merge branch 'master' into wvlad-master
AqlaSolutions Aug 23, 2018
a4f5aa5
showing stored count when quering for known item
AqlaSolutions Aug 23, 2018
8e999c6
0.4.100.2
AqlaSolutions Aug 23, 2018
567a607
converting line endings to LF
AqlaSolutions Aug 26, 2018
9594cee
next attempts
AqlaSolutions Aug 26, 2018
971bffb
next attempt
AqlaSolutions Aug 26, 2018
9cc10ed
reverting TestItem mode. if you want to keep it stick to the wvlad-fo…
AqlaSolutions Aug 26, 2018
298a33d
reverting prices change, if you want to keep it stick to the wvlad-fo…
AqlaSolutions Aug 26, 2018
723e688
reverted more crafting stations - use different crafting interfaces f…
AqlaSolutions Aug 26, 2018
8a35283
reverted isItemKnown hotkey, if you want to keep it stick to the wvla…
AqlaSolutions Aug 26, 2018
33e457a
reverted mod search button, if you want to keep it stick to the wvlad…
AqlaSolutions Aug 26, 2018
a2a5224
reverted adding visual studio project
AqlaSolutions Aug 26, 2018
0bf47fb
amend
AqlaSolutions Aug 26, 2018
1e618d6
reverted build.txt changes
AqlaSolutions Aug 26, 2018
dd0ce5e
gitignore
AqlaSolutions Aug 26, 2018
433e4b4
no changes
AqlaSolutions Aug 26, 2018
2a312f6
C#6
AqlaSolutions Aug 26, 2018
6486122
reverted DPS tooltips, if you want to keep it stick to the wvlad-fork…
AqlaSolutions Aug 26, 2018
a2590c7
added back sort by quantity
AqlaSolutions Aug 26, 2018
9fc1a45
Merge branch 'wvlad-master-working' into wvlad-master
AqlaSolutions Aug 26, 2018
5b0f03e
amend
AqlaSolutions Aug 26, 2018
f0bd3a1
Merge branch 'wvlad-master-working' into wvlad-master
AqlaSolutions Aug 26, 2018
577cfa0
reverted empty changes
AqlaSolutions Aug 27, 2018
877b0ff
revert favorites
AqlaSolutions Aug 27, 2018
e4972d7
Merge branch 'wvlad-master-working' into wvlad-master
AqlaSolutions Aug 27, 2018
31ecb78
reverted (not real changes)
AqlaSolutions Aug 27, 2018
8049054
small fix for search bar
AqlaSolutions Aug 27, 2018
4725ffb
Merge branch 'wvlad-fork' into wvlad-master-working
AqlaSolutions Aug 27, 2018
fad5cf4
reverted empty changes
AqlaSolutions Aug 27, 2018
93274e8
Merge branch 'wvlad-master-working' into wvlad-master
AqlaSolutions Aug 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[code]
* text=auto
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.csproj
*.sln
*.user
obj/
bin/
.vs/
4 changes: 2 additions & 2 deletions Components/TEAbstractStorageUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public TEStorageHeart GetHeart()

public abstract bool HasSpaceInStackFor(Item check, bool locked = false);

public abstract bool HasItem(Item check, bool locked = false);
public abstract bool HasItem(Item check, bool locked = false, bool ignorePrefix = false);

public abstract IEnumerable<Item> GetItems();

Expand Down Expand Up @@ -95,4 +95,4 @@ public override void NetReceive(BinaryReader reader, bool lightReceive)
center = new Point16(reader.ReadInt16(), reader.ReadInt16());
}
}
}
}
4 changes: 2 additions & 2 deletions Components/TECreativeStorageUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public override bool HasSpaceInStackFor(Item check, bool locked = false)
return false;
}

public override bool HasItem(Item check, bool locked = false)
public override bool HasItem(Item check, bool locked = false, bool ignorePrefix = false)
{
return !Inactive;
}
Expand Down Expand Up @@ -125,4 +125,4 @@ public void Dispose()
{
}
}
}
}
51 changes: 46 additions & 5 deletions Components/TEStorageHeart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ public class TEStorageHeart : TEStorageCenter
private int updateTimer = 60;
private int compactStage = 0;

public override bool ValidTile(Tile tile)
public bool IsAlive { get; private set; } = true;

public override void OnKill()
{
IsAlive = false;
}

public override bool ValidTile(Tile tile)
{
return tile.type == mod.TileType("StorageHeart") && tile.frameX == 0 && tile.frameY == 0;
}
Expand Down Expand Up @@ -256,7 +263,10 @@ public void ResetCompactStage(int stage = 0)
}
}

public void DepositItem(Item toDeposit)
ItemTypeOrderedSet _uniqueItemsPutHistory = new ItemTypeOrderedSet("UniqueItemsPutHistory");
public IEnumerable<Item> UniqueItemsPutHistory { get { return _uniqueItemsPutHistory.Items; } }

public void DepositItem(Item toDeposit)
{
if (Main.netMode == 2)
{
Expand All @@ -265,6 +275,7 @@ public void DepositItem(Item toDeposit)
int oldStack = toDeposit.stack;
try
{
var remember = toDeposit.type;
foreach (TEAbstractStorageUnit storageUnit in GetStorageUnits())
{
if (!storageUnit.Inactive && storageUnit.HasSpaceInStackFor(toDeposit, true))
Expand All @@ -276,17 +287,21 @@ public void DepositItem(Item toDeposit)
}
}
}
foreach (TEAbstractStorageUnit storageUnit in GetStorageUnits())
var prevNewAndShiny = toDeposit.newAndShiny;
toDeposit.newAndShiny = !_uniqueItemsPutHistory.Contains(toDeposit);
foreach (TEAbstractStorageUnit storageUnit in GetStorageUnits())
{
if (!storageUnit.Inactive && !storageUnit.IsFull)
{
storageUnit.DepositItem(toDeposit, true);
if (toDeposit.IsAir)
{
return;
_uniqueItemsPutHistory.Add(remember);
return;
}
}
}
toDeposit.newAndShiny = prevNewAndShiny;
}
finally
{
Expand Down Expand Up @@ -352,6 +367,30 @@ public Item TryWithdraw(Item lookFor)
}
}

public bool HasItem(Item lookFor, bool ignorePrefix = false)
{
if (Main.netMode == 2)
{
EnterReadLock();
}
try
{
foreach (TEAbstractStorageUnit storageUnit in GetStorageUnits())
{
if (storageUnit.HasItem(lookFor, true, ignorePrefix))
return true;
}
return false;
}
finally
{
if (Main.netMode == 2)
{
ExitReadLock();
}
}
}

public override TagCompound Save()
{
TagCompound tag = base.Save();
Expand All @@ -364,6 +403,7 @@ public override TagCompound Save()
tagRemotes.Add(tagRemote);
}
tag.Set("RemoteAccesses", tagRemotes);
_uniqueItemsPutHistory.Save(tag);
return tag;
}

Expand All @@ -374,6 +414,7 @@ public override void Load(TagCompound tag)
{
remoteAccesses.Add(new Point16(tagRemote.GetShort("X"), tagRemote.GetShort("Y")));
}
_uniqueItemsPutHistory.Load(tag);
}

public override void NetSend(BinaryWriter writer, bool lightSend)
Expand All @@ -397,4 +438,4 @@ public override void NetReceive(BinaryReader reader, bool lightReceive)
}
}
}
}
}
23 changes: 18 additions & 5 deletions Components/TEStorageUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class TEStorageUnit : TEAbstractStorageUnit
//metadata
private HashSet<ItemData> hasSpaceInStack = new HashSet<ItemData>();
private HashSet<ItemData> hasItem = new HashSet<ItemData>();
private HashSet<int> hasItemNoPrefix = new HashSet<int>();

public int Capacity
{
Expand Down Expand Up @@ -106,16 +107,17 @@ public bool HasSpaceFor(Item check, bool locked = false)
return !IsFull || HasSpaceInStackFor(check, locked);
}

public override bool HasItem(Item check, bool locked = false)
public override bool HasItem(Item check, bool locked = false, bool ignorePrefix = false)
{
if (Main.netMode == 2 && !locked)
{
GetHeart().EnterReadLock();
}
try
{
if (ignorePrefix) return hasItemNoPrefix.Contains(check.type);
ItemData data = new ItemData(check);
return hasItem.Contains(data);
return hasItem.Contains(data);
}
finally
{
Expand Down Expand Up @@ -143,7 +145,7 @@ public override void DepositItem(Item toDeposit, bool locked = false)
}
try
{
Item original = toDeposit.Clone();
Item original = toDeposit.Clone();
bool finished = false;
bool hasChange = false;
foreach (Item item in items)
Expand All @@ -157,6 +159,7 @@ public override void DepositItem(Item toDeposit, bool locked = false)
newStack = item.maxStack;
}
item.stack = newStack;
if (toDeposit.newAndShiny) item.newAndShiny = true;
hasChange = true;
toDeposit.stack = total - newStack;
if (toDeposit.stack <= 0)
Expand Down Expand Up @@ -316,8 +319,11 @@ internal static void SwapItems(TEStorageUnit unit1, TEStorageUnit unit2)
unit1.hasSpaceInStack = unit2.hasSpaceInStack;
unit2.hasSpaceInStack = dict;
dict = unit1.hasItem;
unit1.hasItem = unit2.hasItem;
unit2.hasItem = dict;
unit1.hasItem = unit2.hasItem;
unit2.hasItem = dict;
var temp = unit1.hasItemNoPrefix;
unit1.hasItemNoPrefix = unit2.hasItemNoPrefix;
unit2.hasItemNoPrefix = temp;
if (Main.netMode == 2)
{
unit1.netQueue.Clear();
Expand Down Expand Up @@ -375,6 +381,7 @@ public override void Load(TagCompound tag)
hasSpaceInStack.Add(data);
}
hasItem.Add(data);
hasItemNoPrefix.Add(data.Type);
}
if (Main.netMode == 2)
{
Expand Down Expand Up @@ -447,6 +454,7 @@ public override void NetReceive(BinaryReader trueReader, bool lightReceive)
items = other.items;
hasSpaceInStack = other.hasSpaceInStack;
hasItem = other.hasItem;
hasItemNoPrefix = other.hasItemNoPrefix;
}
receiving = true;
int count = reader.ReadUInt16();
Expand All @@ -473,12 +481,14 @@ private void ClearItemsData()
items.Clear();
hasSpaceInStack.Clear();
hasItem.Clear();
hasItemNoPrefix.Clear();
}

private void RepairMetadata()
{
hasSpaceInStack.Clear();
hasItem.Clear();
hasItemNoPrefix.Clear();
foreach (Item item in items)
{
ItemData data = new ItemData(item);
Expand All @@ -487,6 +497,7 @@ private void RepairMetadata()
hasSpaceInStack.Add(data);
}
hasItem.Add(data);
hasItemNoPrefix.Add(data.Type);
}
}

Expand Down Expand Up @@ -578,6 +589,7 @@ protected override bool ReceiveData(BinaryReader reader, TEStorageUnit unit)
unit.hasSpaceInStack.Add(data);
}
unit.hasItem.Add(data);
unit.hasItemNoPrefix.Add(data.Type);
}
return false;
}
Expand Down Expand Up @@ -625,3 +637,4 @@ protected override bool ReceiveData(BinaryReader reader, TEStorageUnit unit)
}
}
}

Loading