Closed janxious closed 6 years ago
Additional info: it seems like the way the enter key is connected to the UI precludes using modifier keys with it. I've tried all kinds of stuff and can't succeed without probably overriding the primary Unity UI Update call, which seems like a bad idea for a Mod patch. I'm saying this more as a thing to make sure you check if you implement something like this just so modifier+enter and modifier+click work the same.
I did some work to try to get this to happen as a patch here: https://github.com/janxious/ShopSeller/commit/6a3ff6640651ce212dbe2824eadbc03490167b0e#diff-b241942323a140b062ba8f1d4b79adfeR37
It didn't work because it seems like the click invoke or something else is removing modifiers.
A major refactor of lists is incoming for the 1.1 update that should remove the performance concern. Selling more than one item at a time is on our QoL radar, perhaps for 1.2. It would be implemented as a new UI, removing the modifier complications that can also impact ease of access concerns.
Awesome. Thanks for the update!
Closed until the next few updates, can be reopened if relevant again.
Describe the location in the code your suggestion is about
SG_Shop_Screen
andShop
are the where. The what is that as one collects more and more items, the game slows down substantially. Right now there is not a good way to deal with lots of items, other than clicking 'Sell' a lot or hitting the Enter key a lot and hoping you didn't miscount how many times you hit it. So that's bad. One way to make that better is to allow for selling multiple items at once so at least players can manage their item count over time.What is your suggestion for this code Like in other games with item inventories that grow over time, allow for key combinations to sell more than one thing. You can see a proof of concept that modifies the
ReceiveButtonPress
method ofSG_Shop_Screen
in a mod I made here. The basics are listening to keys being held down when sell clicks occur in order to modify the amount being sold.Leave any additional comments here One thing that would be great is actually modifying the button to say "Sell N", but I think that there may not be any way to do that with a mod reasonably, since it would require new listeners to be setup on the screen. I intend to find out for certain, but color changes/text changes to indicate more when keypresses happen is nice.
Another bit that is good for removing slowdowns currently is selling mech parts. It's not part of this directly, but getting rid of mech parts helps keep various parts of the UI more manageable. You can see an implementation of that here, which is patching
Shop
'sGetAllInventoryShopItems
to allow mech parts to show up in the shop for selling. The latter part is overridingSellInventoryItem
to allow the part to actually sell.