Skip to content

Commit

Permalink
Closes #756: Equipment with a quantity of 0 should dim
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwilkes committed Oct 29, 2023
1 parent 700a6a7 commit add06f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions model/gurps/equipment.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ func (e *Equipment) UnmarshalJSON(data []byte) error {

// CellData returns the cell data information for the given column.
func (e *Equipment) CellData(columnID int, data *CellData) {
data.Dim = e.Quantity == 0
e1 := e
for !data.Dim && e1.Parent() != nil {
e1 = e1.Parent()
data.Dim = e1.Quantity == 0
}
switch columnID {
case EquipmentEquippedColumn:
data.Type = ToggleCellType
Expand Down

0 comments on commit add06f4

Please sign in to comment.