Fix item stats for skills and move some stuff around
This commit is contained in:
@@ -1 +1 @@
|
||||
__all__ = ["itemStats", "damagePatternMenu"]
|
||||
__all__ = ["itemStats", "damagePattern"]
|
||||
19
gui/builtinContextMenus/damagePattern.py
Executable file
19
gui/builtinContextMenus/damagePattern.py
Executable file
@@ -0,0 +1,19 @@
|
||||
from gui.contextMenu import ContextMenu
|
||||
from gui.itemStats import ItemStatsDialog
|
||||
import gui.mainFrame
|
||||
import service
|
||||
|
||||
class DamagePattern(ContextMenu):
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
def display(self, context, selection):
|
||||
return context in ("resistancesViewFull",)
|
||||
|
||||
def getText(self, context, selection):
|
||||
return "%s stats" % context.capitalize()
|
||||
|
||||
def activate(self, context, selection, i):
|
||||
pass
|
||||
|
||||
DamagePattern.register()
|
||||
@@ -1,31 +0,0 @@
|
||||
from gui.contextMenu import ContextMenu
|
||||
from gui.itemStats import ItemStatsDialog
|
||||
import gui.mainFrame
|
||||
import service
|
||||
|
||||
class DamagePattern(ContextMenu):
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
def display(self, context, selection):
|
||||
return context in ("resistancesViewFull",)
|
||||
|
||||
def getText(self, context, selection):
|
||||
return "%s stats" % context.capitalize()
|
||||
|
||||
def activate(self, context, selection):
|
||||
if context == "ship":
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
cFit = service.Fit.getInstance()
|
||||
stuff = cFit.getFit(fitID).ship
|
||||
elif context == "ammo":
|
||||
stuff = selection[0].charge
|
||||
else:
|
||||
stuff = selection[0]
|
||||
|
||||
if context == "module" and stuff.isEmpty:
|
||||
return
|
||||
|
||||
dlg=ItemStatsDialog(stuff)
|
||||
|
||||
DamagePattern.register()
|
||||
Reference in New Issue
Block a user