Fix attr tab original value column fetching module attributes for charges
This commit is contained in:
@@ -266,12 +266,16 @@ class ItemParams(wx.Panel):
|
||||
info = self.attrInfo.get(attr)
|
||||
att = self.attrValues[attr]
|
||||
|
||||
# If we're working with a stuff object, we should get the original value from our getBaseAttrValue function,
|
||||
# If we're working with a stuff object, we should get the original value from our getItemBaseAttrValue function,
|
||||
# which will return the value with respect to the effective base (with mutators / overrides in place)
|
||||
valDefault = getattr(info, "value", None) # Get default value from attribute
|
||||
if self.stuff is not None:
|
||||
# if it's a stuff, overwrite default (with fallback to current value)
|
||||
valDefault = self.stuff.getBaseAttrValue(attr, valDefault)
|
||||
if self.stuff.item == self.item:
|
||||
valDefault = self.stuff.getItemBaseAttrValue(attr, valDefault)
|
||||
elif self.stuff.charge == self.item:
|
||||
valDefault = self.stuff.getChargeBaseAttrValue(attr, valDefault)
|
||||
|
||||
valueDefault = valDefault if valDefault is not None else att
|
||||
|
||||
val = getattr(att, "value", None)
|
||||
|
||||
Reference in New Issue
Block a user