Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4129 closed defect (fixed)

[PATCH] Fishing and merchant ships should be filtered when selecting military units only

Reported by: elexis Owned by: fatherbushido
Priority: Should Have Milestone: Alpha 21
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

When using the military-only-selection modifier and selecting a bunch of units, fishing ships will be added to the selection too, despite clearly not being military units.

Hotkey from default.cfg:

milonly = Alt                ; Add only military units to selection

Relevant code is in input.js:

	"isNotSupport": entity => {

The easy part is writing the code. The harder part is deciding whether there should be some !hasClass(entState, "FishingBoat") check added to input.js or whether the ships should receive a new class like to be filtered.

Attachments (2)

4129.diff (2.8 KB ) - added by fatherbushido 8 years ago.
use sessions global as suggested by elexis
4129.2.diff (2.7 KB ) - added by fatherbushido 8 years ago.
skips the Hero Elephant or the Hero Healer case

Download all attachments as: .zip

Change History (8)

comment:1 by fatherbushido, 8 years ago

isNotSupport is use only here in the code.

  • The more coherent stuff would be to add Support class to Fishing boat and to Merchant ship. But then we will have to check all garrison stuff to avoid weird things (like boat garrisonning on boats).
  • We can add also a SupportShip class to those two ship and adding it in the isNotSupport filter.
  • Or rename the isNotSupport filter into isMil filter and
    • add FishingBoat and Trader to the isMil filter
    • add all military class (Infantry, Cavalry, ...) to this filter
    • add a Military class for each military unit

I think 2. and 3.1. are the easiest solution. (but 1. would be a nice cleanup, see support elephant stuff...)

comment:2 by fatherbushido, 8 years ago

Attached patch:

  • fixes the issue
  • uses a more coherent name (milOnly -> isMil instead of isNotSupport).
  • is coherent with the todo idlewarrior hotkey

comment:3 by fatherbushido, 8 years ago

Keywords: patch review added
Summary: Fishing and merchant ships should be filtered when selecting military units only[PATCH] Fishing and merchant ships should be filtered when selecting military units only

by fatherbushido, 8 years ago

Attachment: 4129.diff added

use sessions global as suggested by elexis

by fatherbushido, 8 years ago

Attachment: 4129.2.diff added

skips the Hero Elephant or the Hero Healer case

comment:4 by fatherbushido, 8 years ago

Owner: set to fatherbushido
Resolution: fixed
Status: newclosed

In 18644:

Improves military-only-selection modifier, now filters fishing boat and merchant ship. Uses the same classes filter for find-idle-warrior. Reviewed by elexis. Fixes #4129.

comment:5 by fatherbushido, 8 years ago

Keywords: review removed
Milestone: BacklogAlpha 21

comment:6 by elexis, 8 years ago

Keywords: simple removed
Note: See TracTickets for help on using tickets.