Working commit for adding / removing projected modules / environments

This commit is contained in:
Ryan Holmes
2018-08-09 15:52:34 -04:00
parent 56ebb2926d
commit d6b280d3cc
6 changed files with 19 additions and 15 deletions

View File

@@ -323,5 +323,4 @@ class ProjectedView(d.Display):
sFit = Fit.getInstance()
thing = self.get(row)
if thing: # thing doesn't exist if it's the dummy value
sFit.removeProjected(fitID, thing)
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedCommand(fitID, thing))

View File

@@ -54,10 +54,11 @@ class ItemRemove(ContextMenu):
self.mainFrame.command.Submit(cmd.GuiRemoveCargoCommand(fitID, selection[0].itemID))
return # the command takes care of the PostEvent
elif srcContext in ("projectedFit", "projectedModule", "projectedDrone", "projectedFighter"):
sFit.removeProjected(fitID, selection[0])
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedCommand(fitID, selection[0]))
return # the command takes care of the PostEvent
elif srcContext == "commandFit":
self.mainFrame.command.Submit(cmd.GuiRemoveCommandCommand(fitID, selection[0].ID))
return
return # the command takes care of the PostEvent
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))

View File

@@ -13,4 +13,5 @@ from .guiAddCommand import GuiAddCommandCommand
from .guiRemoveCommand import GuiRemoveCommandCommand
from .guiSetMode import GuiSetModeCommand
from .guiToggleCommand import GuiToggleCommandCommand
from .guiAddProjected import GuiAddProjectedCommand
from .guiAddProjected import GuiAddProjectedCommand
from .guiRemoveProjected import GuiRemoveProjectedCommand

View File

@@ -5,6 +5,7 @@ import gui.mainFrame
from gui import globalEvents as GE
from eos.saveddata.module import Module
from .calc.fitAddProjectedModule import FitAddProjectedModuleCommand
from .calc.fitAddProjectedEnv import FitAddProjectedEnvCommand
from logbook import Logger
import eos.db
pyfalog = Logger(__name__)
@@ -46,10 +47,7 @@ class GuiAddProjectedCommand(wx.Command):
# fighter = Fighter(item)
# fit.projectedFighters.append(fighter)
elif item.group.name in Module.SYSTEM_GROUPS:
pyfalog.warn("WH PROJECTION NOT IMPLEMENTED")
# module = Module(item)
# module.state = State.ONLINE
# fit.projectedModules.append(module)
result = self.internal_history.Submit(FitAddProjectedEnvCommand(self.fitID, self.id))
else:
# attempt a regular module projection
result = self.internal_history.Submit(FitAddProjectedModuleCommand(self.fitID, self.id))