MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / OnClick

Method OnClick

gui/builtinItemStatsViews/itemEffects.py:82–100  ·  view source on GitHub ↗

Debug use: toggle effects on/off. Affects *ALL* items that use that effect. Is not stateful. Will reset if Pyfa is closed and reopened.

(self, event)

Source from the content-addressed store, hash-verified

80 self.Layout()
81
82 def OnClick(self, event):
83 """
84 Debug use: toggle effects on/off.
85 Affects *ALL* items that use that effect.
86 Is not stateful. Will reset if Pyfa is closed and reopened.
87 """
88
89 try:
90 activeByDefault = getattr(self.item.effects[event.GetText()], "activeByDefault")
91 if activeByDefault:
92 setattr(self.item.effects[event.GetText()], "activeByDefault", False)
93 else:
94 setattr(self.item.effects[event.GetText()], "activeByDefault", True)
95
96 except AttributeError:
97 # Attribute doesn't exist, do nothing
98 pass
99
100 self.RefreshValues(event)
101
102 def RefreshValues(self, event):
103 self.Freeze()

Callers

nothing calls this directly

Calls 1

RefreshValuesMethod · 0.95

Tested by

no test coverage detected