Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#111 closed defect (released)

"Replace Weapon" button doesn't always enable

Reported by: ibboard Owned by: ibboard
Priority: critical Milestone: WarFoundry 0.1
Component: WarFoundry-GUI-WinForms Version:
Keywords: button enabled debug Cc:
Blocked By: Blocking:

Description

In the WinForms "FrmUnit" (the form for showing unit details) there are two boxes for equipment: Required and optional. If a required item is in the same mutex group as something else then the "replace" button should enable when it is selected.

Currently the button remains disabled for the default "Empire" army and the Swordsmen unit when selecting the sword unless you are in debug mode and breakpoint the adding of equipment to unit types, at which point it knows that there is also a broadsword that they can swap to.

The breakpoints shouldn't be affecting anything as the data is loaded sequentially, but it seems to fix the behavious.

Attachments (2)

Empire.race (634 bytes) - added by ibboard 11 years ago.
Simpe "Empire" army with swordsmen with weapon choices
Warhammer5th.system (502 bytes) - added by ibboard 11 years ago.
Basic game system that matches Warhammer 5th edition

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by ibboard

Attachment: Empire.race added

Simpe "Empire" army with swordsmen with weapon choices

Changed 11 years ago by ibboard

Attachment: Warhammer5th.system added

Basic game system that matches Warhammer 5th edition

comment:1 Changed 11 years ago by ibboard

Owner: set to ibboard
Status: newaccepted

Simple debugging output shows the case to be true - somehow, even though there should be one mutex group (group 1) with two items in it (sword and broadsword) there is one mutex group with one item in it. Further investigation is needed as to why.

comment:2 Changed 11 years ago by ibboard

Problem is caused by auto-generated IDs being the same between different items, so "does it already exist" check says "yes" for Broadsword when Sword was added first.

comment:3 Changed 11 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

(In r166) Fixes #111: "Replace Weapon" button doesn't always enable

  • Change default ID to use name plus timestamp rather than fixed string plus timestamp - should hopefully be more unique

Also:

  • Code cleanup (line endings) in XML race factory

comment:4 Changed 11 years ago by ibboard

(In r167) Re #111: "Replace" button doesn't always enable

  • Implement better fix:
    • Make UnitEquipmentItem ID based on unit type ID and equipment item ID
    • Make UnitEquipmentItem require UnitType at construction again
    • Remove setter from EquipmentItemForUnit
    • Make AddEquipmentItem method internal so that the UnitEquipmentItem and not the factory is responsible for setting up the reverse link

no-open-ticket

comment:5 Changed 10 years ago by ibboard

released: 1

Mark released changes as released

comment:6 Changed 10 years ago by ibboard

released: 1yes

Mark released fixes as released using radio values

comment:7 Changed 10 years ago by ibboard

Resolution: fixedreleased

Mark fix as released under a previous version

Note: See TracTickets for help on using tickets.