RimWorld

RimWorld

647 arvostelua
Dynamic Trade Interface
4
3
2
2
2
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Mod, 1.4, 1.5, 1.6
Tiedostokoko
Julkaistu
Päivitetty
870.450 KB
15.8.2023 klo 10.12
18.6. klo 13.34
55 muutosilmoitusta ( näytä )

Tilaa ladataksesi
Dynamic Trade Interface

Kuvaus
A high-performance and customizable trade interface originally inspired by Trade UI Revised.
Written from scratch to not only avoid the biggest performance hits of the vanilla UI but to also allow for other mods to easily extend it with additional columns.

Can be safely added or removed at any time during a playthrough, since it doesn't add any game content.
Does not replace the vanilla trade window. Instead you can choose in the mod options whether to open this or vanilla one by default, the other one can be accessed by holding down ctrl as the window opens.

The changelog can be found under the Change Notes tab.

Features:
  • Performance friendly.
  • Resizable window.
  • Search and filter with RegEx
  • Selectable and resizable columns.
  • Click columns to sort. (Multiple by holding shift)
  • Buy or Sell max affordable using double arrow buttons.
  • Hide everything trader is unwilling to buy.
  • Open vanilla trade interface by holding ctrl as the window opens.
  • Option to only show trade buttons near the cursor for better performance.
  • Xenotype support.
  • Togglable and resizable summary section similar to TradeHelper.

Added columns:
  • Durability.
  • Price per weight.
  • Label variant of counter column.
  • Category.

Integrations & Compatibilities:

Limitations:
  • Due to how Rimworld's UI system works, controls will lose focus if any other control is made visible or invisible ahead of it. Generally to the left and up.
    This means that for example, putting the buttons to the left of the input counter boxes will cause them to unfocus when buttons change.
    There is now an option that can be enabled in the mod settings that attempts to compensate for this, by automatically refocusing the control whenever the focus is lost from changing interface. Often the escape button can be used to close windows that appear unreponsive.

Extendability (For modders):
XSD files are bundled with the mod describing how to define a TradeColumnDef.
Based on a number of method handlers, column behaviour can be easily referenced in C#.
Because it doesn't use any custom typings, it can all be defined without any need for assembly references or otherwise.

The following C# handlers can be defined:
  • static void PostOpen(IEnumerable<Tradeable> rows, Transactor transactor)
    Called twice after the window is opened initially, for Colony and Trader respectively. Useful for preparing cache.
  • static void PostClosed(IEnumerable<Tradeable> rows, Transactor transactor)
    Called twice after the window is closed, for Colony and Trader respectively. Useful for cleaning up cache.
  • static void Draw(ref Rect cell, Tradeable row, Transactor transactor, ref bool refresh)
    Called every frame for each row to draw column cells.
  • static Func<Tradeable, IComparable> OrderbyValue(Transactor transactor)
    Called once when the table is prepared to provide a sorting value selection function.

All source code can be found on Github[github.com]


Troubleshooting
Experiencing an issue?
  1. First check that it is actually caused by this mod; Either remove it temporarily, (can be added or removed any time!) or hold ctrl while trade opens to open the original vanilla trade window and check if isssue is also present there.
  2. If the issue is still there, then it isn't related to this mod and should be reported somewhere else.
  3. If you don't experience the issue with or in vanilla, then do provide a description of what you are trying to do, and what the problem you are experiencing is. The more details the better!
  4. If the issue causes an error in the log, then use Hugslib log publisher to provide the log in your report.


Previous versions[github.com]

Credits
Joseasoler for helping sanity checking code and ideas.
Ryan for the initial implementation of DragSelect and Gene Assistant support
Madman666 for the preview and icons.
Timmy for permission to implement features of TradeHelper
Spanish translation by Ferchu
Suositut keskustelut Näytä kaikki (3)
10
17.3.2024 klo 11.48
Error offering gifts to hostile settlement
Tom Jackal
4
14.3.2024 klo 17.23
Error when trying to trade.
Tandy1000Synth
0
31.5. klo 21.37
Price unpredictability when paired with Everything has Quality Silver
Scarlet
222 kommenttia
Bogatir 7 tuntia sitten 
Thats fixed the issue, thank you
Zeracronius  [tekijä] 8 tuntia sitten 
I have pushed an update that should fix it.
It now doesn't show faction goodwill if target faction is Player.
Bogatir 10 tuntia sitten 
log*
Bogatir 10 tuntia sitten 
Window just does not pop up when you try to trade with your own sity, vanila works perfectly fine tho. Sity has the same faction so you are trading with yourself ig. Heres link [gist.github.com] to that issue
Zeracronius  [tekijä] 11 tuntia sitten 
@Bogatir
I do not understand what the incompatibility is, or the issue at hand.
The goodwill calculation uses the same vanilla function in the same way as the default trade window.
I assume that if RIMMSqol has a situation in which you are trading with yourself, then they have patched the vanilla trade window to support that?
Bogatir 20 tuntia sitten 
found an compactability issue with RIMMSqol sitys. Thats what author of RIMMSqol said:
The mod tries to calculate the goodwill with the player faction from the trader faction. However they fail to safeguard that call against trade with the player faction itself.
ajejebrazorf 14.6. klo 11.56 
No worries, it happens. :)
Thanks for the super quick fix, it's working again now!
Zeracronius  [tekijä] 12.6. klo 14.30 
It should now be fixed, however steam does not like updating multiple times in a day, so you may need to resubscribe.

And as a reminder, all previous versions are available from the link in the description!
Zeracronius  [tekijä] 12.6. klo 14.15 
I have found the issue. I am very sorry about the inconvenience.
Turns out there was a previous typo in a file that caused it to load the 1.6 assembly in 1.5.
And i even double checked this multiple times. :steamfacepalm:

The fix should be up in a moment
ajejebrazorf 12.6. klo 13.08 
With today fix it's not working anymore with 1.5 :( I'm getting the default trading window.