Merge branch 'master' of evefit.org:pyfa
Conflicts: eos
This commit is contained in:
@@ -10,14 +10,16 @@ class ItemStats(ContextMenu):
|
||||
def display(self, context, selection):
|
||||
return context in ("item", "ship", "module", "ammo", "skill",
|
||||
"itemSearch", "drone", "implant", "booster",
|
||||
"projectedModule", "projectedDrone")
|
||||
"projectedModule", "projectedDrone", "projectedAmmo")
|
||||
|
||||
def getText(self, context, selection):
|
||||
return "%s stats" % (context.capitalize() if context not in self.REPLACES else self.REPLACES[context])
|
||||
|
||||
REPLACES = {"itemSearch": "Item",
|
||||
"projectedModule": "Module",
|
||||
"projectedDrone": "Drone"}
|
||||
"projectedDrone": "Drone",
|
||||
"projectedAmmo": "Ammo"}
|
||||
|
||||
def activate(self, context, selection, i):
|
||||
if context == "ship":
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
|
||||
@@ -8,16 +8,20 @@ class MarketJump(ContextMenu):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
def display(self, context, selection):
|
||||
return context in ("module", "ammo", "itemSearch", "drone", "implant", "booster") \
|
||||
return context in ("module", "ammo", "itemSearch", "drone", "implant", "booster", "projectedModule", "projectedDrone") \
|
||||
and (not selection[0].isEmpty if context == "module" else True)
|
||||
|
||||
REPLACES = {"itemSearch": "Item",
|
||||
"projectedModule": "Module",
|
||||
"projectedDrone": "Drone"}
|
||||
|
||||
def getText(self, context, selection):
|
||||
return "Jump to %s Market Group" % (context.capitalize() if context != "itemSearch" else "Item")
|
||||
return "Jump to %s Market Group" % (context.capitalize() if context not in self.REPLACES else self.REPLACES[context])
|
||||
|
||||
def activate(self, context, selection, i):
|
||||
if context in ("module", "drone", "implant", "booster"):
|
||||
if context in ("module", "drone", "implant", "booster", "projectedModule", "projectedDrone"):
|
||||
item = selection[0].item
|
||||
elif context == "ammo":
|
||||
elif context in ("ammo", "projectedAmmo"):
|
||||
item = selection[0].charge
|
||||
else:
|
||||
item = selection[0]
|
||||
|
||||
@@ -43,7 +43,7 @@ class ItemStatsDialog(wx.Dialog):
|
||||
self.Destroy()
|
||||
return
|
||||
|
||||
item = getattr(victim, "item", None) if context != "ammo" else getattr(victim, "charge", None)
|
||||
item = getattr(victim, "item", None) if context.lower() not in ("projectedammo", "ammo") else getattr(victim, "charge", None)
|
||||
if item is None:
|
||||
sMarket = service.Market.getInstance()
|
||||
item = sMarket.getItem(victim.ID)
|
||||
|
||||
@@ -98,13 +98,18 @@ class ProjectedView(d.Display):
|
||||
wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
|
||||
elif event.Button == 3:
|
||||
if isinstance(item, eos.types.Drone):
|
||||
context = "projectedDrone"
|
||||
context = ("projectedDrone",)
|
||||
elif isinstance(item, eos.types.Module):
|
||||
context = "projectedModule"
|
||||
if item.charge is not None:
|
||||
context = ("projectedModule", "projectedAmmo")
|
||||
else:
|
||||
context = ("projectedModule",)
|
||||
else:
|
||||
context = "projectedFit"
|
||||
context = ("projectedFit",)
|
||||
|
||||
menu = ContextMenu.getMenu((item,), context)
|
||||
print context
|
||||
menu = ContextMenu.getMenu((item,), *context)
|
||||
print menu
|
||||
self.PopupMenu(menu)
|
||||
|
||||
def remove(self, event):
|
||||
|
||||
@@ -819,9 +819,9 @@ class CategoryItem(wx.Window):
|
||||
r.left = 0
|
||||
r.height = r.height / 2
|
||||
if self.highlighted:
|
||||
mdc.SetBackground(wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT)))
|
||||
mdc.Clear()
|
||||
mdc.SetTextForeground(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT))
|
||||
# mdc.SetBackground(wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT)))
|
||||
# mdc.Clear()
|
||||
# mdc.SetTextForeground(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT))
|
||||
|
||||
sr = 221
|
||||
sg = 221
|
||||
@@ -832,7 +832,7 @@ class CategoryItem(wx.Window):
|
||||
mdc.GradientFillLinear(r,startColor,wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW),wx.SOUTH)
|
||||
r.top = r.height
|
||||
mdc.GradientFillLinear(r,startColor,wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW),wx.NORTH)
|
||||
mdc.SetTextForeground(wx.BLACK)
|
||||
mdc.SetTextForeground(wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ))
|
||||
|
||||
else:
|
||||
mdc.SetBackground(wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)))
|
||||
@@ -1064,9 +1064,9 @@ class ShipItem(wx.Window):
|
||||
r.left = 0
|
||||
r.height = r.height / 2
|
||||
if self.highlighted:
|
||||
mdc.SetBackground(wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT)))
|
||||
mdc.Clear()
|
||||
mdc.SetTextForeground(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT))
|
||||
# mdc.SetBackground(wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT)))
|
||||
# mdc.Clear()
|
||||
# mdc.SetTextForeground(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT))
|
||||
|
||||
sr = 221
|
||||
sg = 221
|
||||
@@ -1077,7 +1077,7 @@ class ShipItem(wx.Window):
|
||||
mdc.GradientFillLinear(r,startColor,wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW),wx.SOUTH)
|
||||
r.top = r.height
|
||||
mdc.GradientFillLinear(r,startColor,wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW),wx.NORTH)
|
||||
mdc.SetTextForeground(wx.BLACK)
|
||||
mdc.SetTextForeground(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT))
|
||||
|
||||
else:
|
||||
mdc.SetBackground(wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)))
|
||||
@@ -1371,7 +1371,7 @@ class FitItem(wx.Window):
|
||||
if self.highlighted:
|
||||
mdc.SetBackground(wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT)))
|
||||
mdc.Clear()
|
||||
mdc.SetTextForeground(wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT))
|
||||
mdc.SetTextForeground(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT))
|
||||
|
||||
sr = 221
|
||||
sg = 221
|
||||
@@ -1382,19 +1382,17 @@ class FitItem(wx.Window):
|
||||
mdc.GradientFillLinear(r,startColor,wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW),wx.SOUTH)
|
||||
r.top = r.height
|
||||
mdc.GradientFillLinear(r,startColor,wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW),wx.NORTH)
|
||||
mdc.SetTextForeground(wx.BLACK)
|
||||
|
||||
else:
|
||||
activeFitID = self.mainFrame.getActiveFit()
|
||||
if activeFitID == self.fitID:
|
||||
bkR,bkG,bkB = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
|
||||
if (bkR+bkG+bkB) >(127+127+127):
|
||||
scale = 0.90
|
||||
scale = -0x33
|
||||
else:
|
||||
scale = 1.1
|
||||
bkR *= scale
|
||||
bkG *= scale
|
||||
bkB *= scale
|
||||
scale = 0x33
|
||||
bkR += scale
|
||||
bkG += scale
|
||||
bkB += scale
|
||||
mdc.SetBackground(wx.Brush((bkR,bkG,bkB)))
|
||||
else:
|
||||
mdc.SetBackground(wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)))
|
||||
|
||||
Reference in New Issue
Block a user