Enable/disable edit menu options, and add color to character editor to show which skills are edited

This commit is contained in:
blitzmann
2015-09-24 22:11:31 -04:00
parent b844bdf986
commit a0f9fb6ad6
4 changed files with 49 additions and 11 deletions

View File

@@ -23,6 +23,7 @@ import bitmapLoader
import gui.mainFrame
import gui.graphFrame
import gui.globalEvents as GE
import service
class MainMenuBar(wx.MenuBar):
def __init__(self):
@@ -119,5 +120,14 @@ class MainMenuBar(wx.MenuBar):
self.Enable(wx.ID_SAVEAS, enable)
self.Enable(wx.ID_COPY, enable)
self.Enable(self.exportSkillsNeededId, enable)
event.Skip()
sChar = service.Character.getInstance()
charID = self.mainFrame.charSelection.getActiveCharacter()
char = sChar.getCharacter(charID)
# enable/disable character saving stuff
self.Enable(self.saveCharId, not char.ro and char.isDirty)
self.Enable(self.saveCharAsId, char.isDirty)
self.Enable(self.revertCharId, char.isDirty)
event.Skip()