alekslt / DSPPlugins_ALT

My Dyson Sphere Program Plugins (BepinEx, Harmony..)
MIT License
6 stars 4 forks source link

Feature request: Filter by item type. #4

Open Hokinrazi opened 3 years ago

Hokinrazi commented 3 years ago

Would it be possible to add an option to filter the list by either selecting an item type from a popup or via text string?

Thanks

CageStooge commented 3 years ago

Or at least sort the list of resources in alphabetical order?

CageStooge commented 3 years ago

Let me clarify, because the Vein miner resources are alphabetical, What I mean is can it be set so that if you select Logic Stations and Resource, then those items are alphabetized? Right now I have to scroll up and down trying to find what I"m looking for. In the current window I have open it groups by Steel, then Iron ingot, then copper ore, then refined oil, etc. As I'm scrolling it can be easy to miss the resource name, so if they were in alphabetical order it would be way easier.

Great mod by the way. It was the reason I decided to use a mod before Steam workshop support was implemented. :)

alekslt commented 3 years ago

Yep, I have plans on adding more filters including free-text search, will review the ordering code for the logistic station resource view and change the default to alphabetical on resource name, or perhaps introduce selectable from menu.

Will probably include this in the performance quality of life-upgrade where I will add collapsing for parts of the tree, so that I don't show everything at once. Meaning that for resource view I will initially only show the resource on a line, and then allow you to click on a part of it to expand. This initial collapsing bit will be adjustable of course, but this should greatly improve performance for large amounts of miners and stations.

I have in the mean time fixed this in the build below. Sorting on item name. Regret not reading this more before I pushed out 0.5.1 fixing some scaling issues. The link below can be seen as a 0.5.2-dev build.

MineralExhaustionNotifier.zip

CageStooge commented 3 years ago

Oh man. You rock. Did you ehar that noise? That was the sound of me finally able to kill off the excel spreadsheet I've been wrestling with. It's too easy in the game to switch around a few items in a logistic station and then forget to update the spreadsheet. Plus it really isn't fun to have to use an external system to track all of this.

I tried making the change last night myself, but for some reason I could not get the code to compile with the 3.5 .net framework, as the unity and BepInEx references all had a requirement for the 4.0+ .net framework. I am not sure if you are using different versions of the unity and BepInex dll's or what the issue was. It was really odd.

I switched it to a .net 4 and that let me compile it, but then the code would not work. it would not throw an error it just would not do anything. Again, without me modifying any of the actual code.

Anyway, I appreciate you given me the quick build. The mod is great, by the way.

CageStooge commented 3 years ago

PS -- as for this "Will probably include this in the performance quality of life-upgrade where I will add collapsing for parts of the tree, so that I don't show everything at once. This initial collapsing bit will be adjustable of course, but this should greatly improve performance for large amounts of miners and stations."

That would be awesome, just from the view of making it even faster to scroll to exactly what I want and then clicking expand, a performance improvement is always nice, but so far your mod is not having any impact. I also have a rather beefy system, so there is that. Again, performance testing and tuning is always a good goal. :)

alekslt commented 3 years ago

This is a 24 hour valid invite code for the DSP Modding discord. YGyWHeSQ So with regards to compilation, this game is weird. The games assembly is 3.5, while the unity parts are .net 4. So to make visual studio not complain we need to not refer to the unityengine.dll you have in your game folder, but a refstubbed or downconverted one. This is a stubbed unityengine.dll https://cdn.discordapp.com/attachments/806556447885623336/809242933433598002/UnityEngine.refstub.dll

while this https://cdn.discordapp.com/attachments/806556447885623336/806679546258391040/UnityEngineDowngrader.dll is a patcher you can place in BepInEx/patchers with will automatically create a downgraded version (in a subfolder). You need to build with .NET 3.5 for things to work.

Btw. Will probably release a 0.5.2 tomorrow with some additional scaling options (using the built-in game ui reference height, scaling buttons on the window). That will also include the sorting fix.

If you're intersted in playing around with the mod, creating new filters is fairly easy. I'm using a linq-based filter for the most part. Take a look at https://github.com/alekslt/DSPPlugins_ALT/blob/master/MineralExhaustionNotifier/GUI/MinerNotificationUI.cs#L589

CageStooge commented 3 years ago

Thank you for the explaination. I am not the best at C#, but I do know how to compile code, or so I thought, and I began to doubt if I had any idea what I was doing. :D

You almost tempted me to delve into the mod scene again, but I'm going to hold off. I like your mod, and I will wait for you to add features as you have time. Once upon a time I delved into the world of modding, and at the end the experience was not the best. People became ... demanding ... for something I was providing for free on my own time. There can be a great deal of people who become very unappreciative and it left me with a bad experience.

Do you have a donation page of some sort? I looked but did not see anything, and I'd be happy to provide you with a monetary thank you. Do not worry, I will not consider it to be an obligation on you to provide anything more than you have already done. It is a reward for the work you have done, and not giving with the idea that you have to continue working further on it. I just want to be clear on that, so you did not get the impression I was paying you for future work. :)

If you don't want a donation directly to you, if you have a charity that can accept donations, I'll be happy to donate on your behalf to that. It is up to you.

enriquein commented 2 years ago

I just recently got into DSP modding and was thinking of adding the free-text filtering logic and also updating the code (if possible) to use the user-defined names for systems and planets instead of the default ones. I hadn't noticed this GitHub issue though, so I'm wondering if you already started working on this or if it's OK for me to take a stab at it and submit a pull request. I'm mostly trying to avoid duplicating work and effort.

Also, thanks for making my favorite DSP mod! Amazing work on this!