Ticket #1209 (closed enhancement: fixed)
[PATCH] Set the traded goods for every Trader in a selected group of Traders
| Reported by: | michael | Owned by: | Spahbod |
|---|---|---|---|
| Priority: | Should Have | Milestone: | Alpha 10 |
| Component: | UI & Simulation | Keywords: | trade, patch |
| Cc: |
Description
Set the traded goods for every Trader in a selected group of Traders. Eliminates having to do it one at a time.
Currently, you can only set the trade goods on one trader at a time. It would be best if this could be done with multiple selected traders at once.
Attachments
Change History
comment:2 Changed 14 months ago by k776
- Keywords Trading trader goods multiple selection removed
- Component changed from Game engine to Simulation
comment:3 Changed 14 months ago by Spahbod
- Keywords trade, review added; trade removed
- Summary changed from Set the traded goods for every Trader in a selected group of Traders to [PATCH] Set the traded goods for every Trader in a selected group of Traders
Patch submitted. Works for land traders, ships and a combination of both.
comment:5 Changed 14 months ago by Philip
GetEntityState(selection[j]).id is equivalent to selection[j] (since the argument to GetEntityState is the ID), so you can simplify that. Then you can simplify the entire loop to "selectionUnitIDs = selection". And then you can just pass selection directly into selectTradingPreferredGoodsData instead of adding any new variables at all :-)
The "trader" in the command data (and in the command in selectTradingPreferredGoods and in Commands.js) should be renamed to "traders" since it's now an array of IDs. But actually it should probably be renamed to "entities" instead, for consistency with all the other commands.
comment:6 Changed 14 months ago by Spahbod
Sorry input.js is not related to this. Updated the patch with Philip's instructions.
comment:7 Changed 14 months ago by k776
Hey Spahbod. Thanks for your work. To help the patch reviewers, can you please combine patches into a single file, and timestamp them. Something like "1209_2012-03-22.patch". This helps find exactly which patches are the newest ones to review, and how old they are. Thanks.

Currently, if you attempt to do this for multiple traders, it will only happen to one of them.