From add06f427038e8b939e200068ea707e268c3be67 Mon Sep 17 00:00:00 2001 From: Richard Wilkes Date: Sat, 28 Oct 2023 17:01:20 -0700 Subject: [PATCH] Closes #756: Equipment with a quantity of 0 should dim --- model/gurps/equipment.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/model/gurps/equipment.go b/model/gurps/equipment.go index a6f4efdd2..09d43c8bb 100644 --- a/model/gurps/equipment.go +++ b/model/gurps/equipment.go @@ -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