-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Reimplement trading UI #52572
Reimplement trading UI #52572
Conversation
bd7e0cf
to
7d08e1c
Compare
If it's easy to do, I'd suggest placing worn items at the bottom of the list, since those items are the ones you're least likely to want to trade away. |
This comment has been minimized.
This comment has been minimized.
e136402
to
5da6f9f
Compare
a8e0a71
to
52b9af6
Compare
split input processing from the main loop so it can be reused
and also use it to replace force_max_window_size
use constructor character instead of player char
I have not looked at the trade ui side of this, but I did test out the impact on inventory_examiner. Unfortunately, while your implementation of forcing the window size is a lot tidier than my (admittedly hackish setup) was, it results in things getting a bit cramped in the header and item list of inventory_examiner: I think the header does need to be full-width, and there needs to be something forcing the first column to use the available space. I'd recommend changes along these lines: |
The column in patchdiff --git a/src/inventory_ui.cpp b/src/inventory_ui.cpp
index 3f2396b1fc..b945e60ebd 100644
--- a/src/inventory_ui.cpp
+++ b/src/inventory_ui.cpp
@@ -1694,7 +1694,7 @@ void inventory_selector::prepare_layout( size_t client_width, size_t client_heig
// If we have a single column and it occupies more than a half of
// the available with -> expand it
auto visible_columns = get_visible_columns();
- if( visible_columns.size() == 1 && are_columns_centered( client_width ) ) {
+ if( visible_columns.size() == 1 ) {
visible_columns.front()->set_width( client_width, columns );
} For the |
Thanks for merging! |
There are a number of open bugs related to the previous trading UI that may be resolved or obsoleted by this as well. A few I found are #41393, #43239, #45436, #46081, #46879, and there are surely others. I’ll try to retest a few tomorrow and close them if I can - I’m really looking forward to trying this feature out! |
If anyone out there is like me and kept tab for 'toggle category selection mode' and thus get confused about how to switch over to sell (your inventory) instead of buy (their inventory, default)... Check your keybindings ("?") for "Switch lists" and rebind that to something other than tab... or rebind category selection mode (which will probably change the key in other inventory screens). I've opted to rebind "Switch lists" to numpad plus (nice big target not far from arrow keys). Don't know if it will bite me in some way later. I was going to bind it to left arrow but that conflicted with "switch columns" which is also an old hold over I kept. Also thanks for the new interface! |
Summary
Interface "reimplement trading UI"
Purpose of change
The trade UI is cumbersome and lacks many features compared to other item UIs
Fixes: #42363
Describe the solution
Reimplement the trading UI using two instances of
inventory_drop_selector
held together by a thin event queue.Partially revert #51704 since the container issue is now handled differently and directly from the selection UI with the same behaviour as in the drop UI.
Describe alternatives you've considered
Using the AIM or parts of it: this approach was rejected twice
Testing
Trade with a neutral NPC. Trade with an NPC shopkeeper. Trade with an allied NPC while player items are on the floor. There should not be any surprises either when selecting items or after trading.
Trade for item stacks. Trade for items with charges. Trade for items from the floor and vehicles. Select a lot of items from the floor, then cancel the trade, then trade again for fewer items. This is to ensure that the changes to
npctrade
did not affect functionality.Insert an unwanted item in a container (ex:
vac_oven_small_full
) and trade away the container. The balance and prices should not include the unwanted item. The unwanted item should spill before the container is traded.Additional context
screenshot
screenshot smallest screen
If you're reviewing by commit
please note that
838b281
trade_ui: reimplement trading ui
duplicates some code that's later removed in
e5135ae
npctrade: nuke trading_window
68fd32b
inventory_ui: add support for fixed window sizes
slightly changed the aspect ofinventory_examiner
(#51252), but the layout should be the same