Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1209 closed enhancement (fixed)

[PATCH] Set the traded goods for every Trader in a selected group of Traders

Reported by: michael Owned by: O.Davoodi
Priority: Should Have Milestone: Alpha 10
Component: UI & Simulation Keywords: trade, patch
Cc: Patch:

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 (4)

ticket-1209-1.patch (2.2 KB ) - added by O.Davoodi 12 years ago.
Patch for ticket 1209
input.js.patch (3.3 KB ) - added by O.Davoodi 12 years ago.
Commands.js.patch (1.8 KB ) - added by O.Davoodi 12 years ago.
unit_commands.js.patch (1.6 KB ) - added by O.Davoodi 12 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by michael, 12 years ago

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

comment:2 by Kieran P, 12 years ago

Component: Game engineSimulation
Keywords: Trading trader goods multiple selection removed

by O.Davoodi, 12 years ago

Attachment: ticket-1209-1.patch added

Patch for ticket 1209

comment:3 by O.Davoodi, 12 years ago

Keywords: review added
Summary: Set the traded goods for every Trader in a selected group of Traders[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.

Last edited 12 years ago by O.Davoodi (previous) (diff)

comment:4 by Kieran P, 12 years ago

Keywords: patch added
Owner: set to O.Davoodi

comment:5 by Philip Taylor, 12 years ago

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.

by O.Davoodi, 12 years ago

Attachment: input.js.patch added

by O.Davoodi, 12 years ago

Attachment: Commands.js.patch added

by O.Davoodi, 12 years ago

Attachment: unit_commands.js.patch added

comment:6 by O.Davoodi, 12 years ago

Sorry input.js is not related to this. Updated the patch with Philip's instructions.

comment:7 by Kieran P, 12 years ago

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.

comment:8 by leper, 12 years ago

Resolution: fixed
Status: newclosed

In 11442:

Set goods for every selected trader. Based on patch by Spahbod, fixes #1209.

comment:9 by leper, 12 years ago

Keywords: review removed

Thanks for the patch. As k776 said it would be great if you could provide a single patch file instead of multiple files.

Note: See TracTickets for help on using tickets.