Small improvements in gang UI

This commit is contained in:
HomeWorld
2011-11-23 19:25:10 +02:00
parent 3f0f6a6689
commit 163f9f6f78
2 changed files with 17 additions and 2 deletions

View File

@@ -54,6 +54,7 @@ class AdditionsPane(TogglePanel):
implantImg = bitmapLoader.getImage("implant_small", "icons")
boosterImg = bitmapLoader.getImage("booster_small", "icons")
projectedImg = bitmapLoader.getImage("projected_small", "icons")
gangImg = bitmapLoader.getImage("fleet_fc_small", "icons")
self.notebook.AddPage(DroneView(self.notebook), "Drones", tabImage = droneImg, showClose = False)
self.notebook.AddPage(ImplantView(self.notebook), "Implants", tabImage = implantImg, showClose = False)
@@ -63,10 +64,10 @@ class AdditionsPane(TogglePanel):
self.notebook.AddPage(self.projectedPage, "Projected", tabImage = projectedImg, showClose = False)
self.gangPage = GangView(self.notebook)
self.notebook.AddPage(self.gangPage, "Gang", showClose = False)
self.notebook.AddPage(self.gangPage, "Gang", tabImage = gangImg, showClose = False)
self.notebook.SetSelection(0)
PANES = ["Drones", "Implants", "Boosters"]
PANES = ["Drones", "Implants", "Boosters", "Projected", "Gang"]
def select(self, name):
self.notebook.SetSelection(self.PANES.index(name))

View File

@@ -144,11 +144,24 @@ class GangView ( ScrolledPanel ):
for stBooster in self.stBoosters:
stBooster.Bind(wx.EVT_LEFT_DCLICK, self.RemoveBooster)
stBooster.Bind(wx.EVT_ENTER_WINDOW, self.OnEnterWindow)
stBooster.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
for chCharacter in self.chCharacters:
chCharacter.Bind(wx.EVT_CHOICE, self.CharChanged)
self.RefreshCharacterList()
def OnEnterWindow(self, event):
obj = event.GetEventObject()
obj.SetCursor(wx.StockCursor(wx.CURSOR_HAND))
event.Skip()
def OnLeaveWindow(self, event):
obj = event.GetEventObject()
obj.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
event.Skip()
def CharChanged(self, event):
chBooster = event.GetEventObject()
type = -1
@@ -384,4 +397,5 @@ class GangView ( ScrolledPanel ):
# self.Layout()
self.AddCommander(draggedFit.ID, booster)
self.mainFrame.additionsPane.select("Gang")