Ticket #1209 (closed enhancement: fixed)

Opened 14 months ago

Last modified 14 months ago

[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

ticket-1209-1.patch (2.2 KB) - added by Spahbod 14 months ago.
Patch for ticket 1209
input.js.patch (3.3 KB) - added by Spahbod 14 months ago.
Commands.js.patch (1.8 KB) - added by Spahbod 14 months ago.
unit_commands.js.patch (1.6 KB) - added by Spahbod 14 months ago.

Change History

comment:1 Changed 14 months ago by michael

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

comment:2 Changed 14 months ago by k776

  • Keywords Trading trader goods multiple selection removed
  • Component changed from Game engine to Simulation

Changed 14 months ago by Spahbod

Patch for ticket 1209

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.

Last edited 14 months ago by Spahbod (previous) (diff)

comment:4 Changed 14 months ago by k776

  • Keywords patch, added
  • Owner set to Spahbod

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.

Changed 14 months ago by Spahbod

Changed 14 months ago by Spahbod

Changed 14 months ago by Spahbod

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.

comment:8 Changed 14 months ago by leper

  • Status changed from new to closed
  • Resolution set to fixed

In 11442:

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

comment:9 Changed 14 months ago by leper

  • Keywords patch added; patch, 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.