Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New filters, sorting and organization, ItemCheckList integration, item testdrive, restock and other QoL improvements #59

Open
wants to merge 86 commits into
base: master
Choose a base branch
from

Conversation

AqlaSolutions
Copy link
Contributor

@AqlaSolutions AqlaSolutions commented Aug 11, 2018

  1. Sorting by Quantity replaced by sorting by item Value,
  2. Only recipes from known ingredients are shown (if ItemCheckList is installed), non-directly available recipes (through intermediate crafting) are also considered in this check, you can mark items as not new with right click on currently selected recipe when in the "Only new items" mode.
  3. Instead of "Available recipes" and "All recipes" buttons there are 3 new buttons: "New recipes" (showing never crafted recipes), "All known recipes" and "Hidden recipes"
  4. You can (un)hide recipes with ctrl+left click,
  5. Gem cost is 2 times lowered,
  6. 30 crafting stations instead of 10,
  7. Added sorting by DPS,
  8. Added DPS calculator to the crafting menu and to weapons tooltip (based on damage, defence and use time though it's not enough for accurate values),
  9. Search text can be canceled with right click on text field,
  10. Arrow keys, home, end, delete work in search field,
  11. Added more filters for weapons and equipment,
  12. Added "Recent items" filter that shows last 100 deposited items which were not deposited in this heart before, they are shown with "shinyAndNew" decoration too,
  13. Mods are selected with left-right click instead of searchbox typing,
  14. Recipe item icon is displayed on top instead of "Selected recipe",
  15. You can open ingredient crafting by right clicking it into recipe,
  16. Right click on Deposit button (now named "Transfer All") to Restock,
  17. And Left Click to Quick Stack (with Alt to Deposit All),
  18. Favorites support in storage and recipes (alt+click),
  19. A toggle to show only favorited items,
  20. You can freely take new weapons, tools, armor and equipment "for demo" but only once (it's not in the "new" list afterwise). Those items are removed on death and while you have them with you incoming damage is 5x multipled. Also they cost 0 coins if you try to sell them. Use right click on "Craft" button. The last feature is available only in single player.
  21. There is a hot key to check whether you've already seen (if ItemCheckList is installed) an item and how much of it you have in latest opened storage,

I don't expect you to accept this whole pull request but please feel free to use any parts of it to enhance your great mod. In my branch I changed author and version info, feel free to edit it before merging.

@AqlaSolutions
Copy link
Contributor Author

Please see commits instead of diff, it looks like line endings broke things.

@GregariousJB
Copy link

@AqlaSolutions Rather than list the things that are removed, which forces us to read the first list you wrote and then compare it to the new list repeatedly, just updating the current list would be a little nicer. A new screenshot would be cool, too.

I went ahead and did it manually. Is this the updated list of features, then?

  1. Only recipes from known ingredients are shown (if ItemCheckList is installed), non-directly available recipes (through intermediate crafting) are also considered in this check, you can mark items as not new with right click on currently selected recipe when in the "Only new items" mode.
  2. Instead of "Available recipes" and "All recipes" buttons there are 3 new buttons: "New recipes" (showing never crafted recipes), "All known recipes" and "Hidden recipes"
  3. You can (un)hide recipes with ctrl+left click,
  4. Added sorting by DPS,
  5. Search text can be canceled with right click on text field,
  6. Arrow keys, home, end, delete work in search field,
  7. Added more filters for weapons and equipment,
  8. Added "Recent items" filter that shows last 100 deposited items which were not deposited in this heart before, they are shown with "shinyAndNew" decoration too,
  9. Recipe item icon is displayed on top along with "Selected recipe", (did I understand this right? -G)
  10. You can open ingredient crafting by right clicking it into recipe,
  11. Right click on Deposit button (now named "Transfer All") to Restock,
  12. And Left Click to Quick Stack (with Alt to Deposit All),
  13. Favorites support in storage and recipes (alt+click),
  14. A toggle to show only favorited items,

@AqlaSolutions
Copy link
Contributor Author

AqlaSolutions commented Aug 26, 2018

@GregariousJB, @blushiemagic , I'll add the screenshot as soon as we agree with the list of changes. Yes, the list above is correct.

Also after checking the diffs there are some not previously mentioned small changes:

  1. Disabled shift+click to put crafting stations. It's easy to put it by one if there are only 10 of them. I often mistakenly shift+click inventory items trying to put them into a storage while the crafting window is opened.
  2. Changed default sort order to avoid using CompareRarity. Because Rarity is dependent on an item prefix and in a storage similar items become separate which looks not sorted. So for weapons the default is DPS sorting, for summons and ammo it's price.
  3. Closing storage and crafting window doesn't reset search and filters. When you have the way to quickly reset search text if you don't need it it's much better to by default see the last viewed thing when you open the window instead of searching same again and again.
  4. General code improvements: using LINQ OrderBy instead of including BTree class, some duplicated code is extracted, some switch-case were replaced with enum casting, some strong dependencies were replaced with delegate passing, enabled C# 6 compiler (because I used its features).

@GregariousJB
Copy link

GregariousJB commented Aug 26, 2018

Disabled shift+click to put crafting stations.

I'm not sure how this works so I might be wrong, but does doing this mean Shift+clicking crafting stations with Magic Storage open will now trash the crafting station? Shift+Click is the "send to trash" hotkey. Blushie might have added this intentionally to prevent players from accidentally deleting their crafting stations and other items.

@AqlaSolutions
Copy link
Contributor Author

AqlaSolutions commented Aug 26, 2018

@GregariousJB , no, shift+clicking inventory items with opened crafting ui now does nothing. Trash hot key is overriden but no action is performed.

@GregariousJB
Copy link

Oh I see. Yeah I'll occasionally find random items where the crafting stations go because I've shift+clicked them in there and didn't realize it.

Just two things I wanted to mention:

Closing storage and crafting window doesn't reset search and filters. When you have the way to quickly reset search text if you don't need it it's much better to by default see the last viewed thing when you open the window instead of searching same again and again.

  1. I'd like to reinforce my previous idea of having a clickable "X" button in the search window like Item Browser has. It's a very easy visual UI indication to the user that the field can be cleared. Having a "right-click to clear search box" feature without any indication will leave a lot of players clueless that it even exists until some accidentally stumble upon it, read it somewhere, or a friend tells them. And I think we all know how many Terraria players read and have friends.
  2. I think Item Browser handles filters expertly. Along with options to filter weapons, tools, etc. There's also a "filter by tooltip" search box that enables us to specify exact filters of our own design. This is especially useful when several big mods are being used. In my example, I found that typing "empowers" would perfectly show me all Bard weapons and nothing else.. This allows it to be almost future-proof for any existing or upcoming mod when trying to find items, and I'd recommend looking into it in addition to normal button filters, even as a replacement for some button filters because it's potentially more powerful than any button - especially if the search field is being saved after closing now.

@blushiemagic
Copy link
Owner

It's still way too many changes for me to be able to review and understand everything, which is why each thing still needs a separate pull request.

@AqlaSolutions
Copy link
Contributor Author

AqlaSolutions commented Aug 27, 2018

@blushiemagic ok, I also reverted favorites in storage, as they change many files they will come in a separate pull request and will be dependent on this one. I did my best to make this PR as readable as possible and removed all changes which you were strictly against. I'm not going to put any more effort in splitting it. If you and your community need these changes please take your time to check the diffs.
I suggest to use this diff view.
I'm sorry for providing this not very qualitative pull request but I remind you that I just share to the community the features I did for myself and I'm not interested in investing here too much.

@GregariousJB
Copy link

Thanks for the work on this, @AqlaSolutions, no matter what is or isn't used.

@blushiemagic
Copy link
Owner

That diff view is actually what I always use for everything.

The main problem's still that I don't have much time or energy to look all the changes at once and how they interact with each other. But still, thanks for all the work you've put into this! I can tell that a lot of effort's been put in here.

@pikaro
Copy link

pikaro commented Jun 20, 2019

So this PR is refused? It has a lot of things that would make a modded game more manageable. (Save for making crafting stations available across all connected ones.)

2 similar comments
@pikaro
Copy link

pikaro commented Jun 20, 2019

So this PR is refused? It has a lot of things that would make a modded game more manageable. (Save for making crafting stations available across all connected ones.)

@pikaro
Copy link

pikaro commented Jun 20, 2019

So this PR is refused? It has a lot of things that would make a modded game more manageable. (Save for making crafting stations available across all connected ones.)

@nezw
Copy link

nezw commented Jul 23, 2019

@blushiemagic I would try to separate those features further to make it easier for you to review, if you are interested.
Are there any features you will not merge (no matter the reason, just asking so I don't prepare something you wouldn't use anyhow)? Or any that are interesting to you in particular?

@vvdavided
Copy link

Has there been any further work? All these features are great and I'd love to see them in the mod

@robertmapes
Copy link

I am interested in this PR.... would be nice to add in pieces if one commit seems too large to handle at once.

@AqlaSolutions
Copy link
Contributor Author

AqlaSolutions commented Mar 24, 2020

Hi guys, I've just updated my wvlad-fork branch for the latest TModLoader, feel free to download https://github.com/AqlaSolutions/MagicStorage/releases/latest

@MarcoHiruma
Copy link

Can you put a sorting that only shows the craftings for the ingredients i have on the storage. I love this mod, i love that you seperated the Armor Equipments and the Cobalt Shield kinda Equipments, but i hate this thing where i see every item that i cant craft becauese i either don't have the ingredients or the crafting station. I don't want to see a Cobalt Pickaxe when i have only Iron Ore on the storage man.

If you can't do it can you show me how to do it myself?

@AqlaSolutions
Copy link
Contributor Author

Can you put a sorting that only shows the craftings for the ingredients i have on the storage. I love this mod, i love that you seperated the Armor Equipments and the Cobalt Shield kinda Equipments, but i hate this thing where i see every item that i cant craft becauese i either don't have the ingredients or the crafting station. I don't want to see a Cobalt Pickaxe when i have only Iron Ore on the storage man.

If you can't do it can you show me how to do it myself?

I already thought about it and came up with a bit different solution. Instead of showing things you can craft right now it shows things you possible can craft from items you have obtained before. If you have never seen a cobalt ore the Cobalt Pickaxe won't be shown. But if you already obtained cobalt and all other Pickaxe ingredients (or ingredients required to craft them) then Cobalt Pickaxe is shown regardless of you having enough amount of cobalt right at the moment. To use this feature you must have ItemCheckList installed and use this Pull Request code or my fork repository release.

@ghost
Copy link

ghost commented May 27, 2020

I can't use item checklist because it causes lag and out of memory crashes for me. Without it I also can't filter everything I can craft. I basically have all recipes available in my magic storage, and what is even worse, they are all blue color because they are considered new and I can't even differentiate between the ones I can craft and the ones I can't craft. To remove them from new I have to right click on them, but I have insane amount of recipes it will take ages

@Mythilily
Copy link

Mythilily commented Oct 8, 2020

@AqlaSolutions
I know it has been months since last comments but in case you're still interested:

  • Recipes which have no ingredients don't show up (minor)
  • There's some lag when mass crafting, see below for details:
    https://streamable.com/c6webx
    When I do that it also gives an error:

[23:51:40] [15/WARN] [tML]: Silently Caught Exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.KeyCollection.Enumerator.MoveNext() at MagicStorage.CraftingGUI.IsAvailable(Recipe recipe) in MagicStorage\CraftingGUI.cs:line 1281 at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()
at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection)
at MagicStorage.CraftingGUI.<>c__DisplayClass129_1.b__0() in MagicStorage\CraftingGUI.cs:line 1086
at MagicStorage.CraftingGUI.RefreshRecipes(HashSet1 hiddenRecipes, HashSet1 craftedRecipes, HashSet`1 favorited) in MagicStorage\CraftingGUI.cs:line 1099
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)

I'm more interested in this PR, I don't really like all the changes you made. However, with the lack of knowledge I'm not able to make it work properly (has it been updated?).

@PimTournaye
Copy link

PimTournaye commented Feb 25, 2021

No idea of Aqla still feels like working on his fork but, I'd be really nice to have a filter again for all currently craftable recipes. Crafting is a mess right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.