Skip to content

Commit

Permalink
Re-introduce Command Fit State (pyfa-org#1074)
Browse files Browse the repository at this point in the history
Reintroduce command view state

Squashes `blitzmann/command-fit-state`:

* Reintroduces command view state, allowing users to toggle command fits on and off.
* Remove type() function call and use __class__ instead
  • Loading branch information
blitzmann committed Apr 2, 2017
1 parent 878d9d7 commit f08a669
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions gui/builtinViewColumns/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,17 @@ def getImageId(self, stuff):
"gui")
elif isinstance(stuff, Fit):
fitID = self.mainFrame.getActiveFit()
projectionInfo = stuff.getProjectionInfo(fitID)

if projectionInfo is None:
# Can't use isinstance here due to being prevented from importing CommandView.
# So we do the next best thing and compare Name of class.
if self.fittingView.__class__.__name__ == "CommandView":
info = stuff.getCommandInfo(fitID)
else:
info = stuff.getProjectionInfo(fitID)

if info is None:
return -1
if projectionInfo.active:
if info.active:
return generic_active
return generic_inactive
elif isinstance(stuff, Implant) and stuff.character:
Expand Down
2 changes: 1 addition & 1 deletion gui/commandView.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def OnData(self, x, y, t):


class CommandView(d.Display):
DEFAULT_COLS = ["Base Name"]
DEFAULT_COLS = ["State", "Base Name"]

def __init__(self, parent):
d.Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)
Expand Down

0 comments on commit f08a669

Please sign in to comment.