Merge branch 'master' into price_optimize

This commit is contained in:
DarkPhoenix
2019-03-15 01:41:28 +03:00
5 changed files with 21 additions and 4 deletions

View File

@@ -43,8 +43,12 @@ class ItemMutator(wx.Panel):
self.badColor = wx.Colour(255, 64, 0)
self.event_mapping = {}
higOverrides = {
('Stasis Web', 'speedFactor'): False,
}
for m in sorted(stuff.mutators.values(), key=lambda x: x.attribute.displayName):
highIsGood = higOverrides.get((stuff.item.group.name, m.attribute.name), m.highIsGood)
# Format: [raw value, modifier applied to base raw value, display value]
range1 = (m.minValue, m.attribute.unit.SimplifyValue(m.minValue))
range2 = (m.maxValue, m.attribute.unit.SimplifyValue(m.maxValue))
@@ -59,7 +63,7 @@ class ItemMutator(wx.Panel):
minRange = range2
maxRange = range1
if (m.highIsGood and minRange[0] >= maxRange[0]) or (not m.highIsGood and minRange[0] <= maxRange[0]):
if (highIsGood and minRange[0] >= maxRange[0]) or (not highIsGood and minRange[0] <= maxRange[0]):
betterRange = minRange
worseRange = maxRange
else:

View File

@@ -164,11 +164,12 @@ class ShipBrowser(wx.Panel):
self.categoryList = list(sMkt.getShipRoot())
self.categoryList.sort(key=lambda _ship: _ship.name)
counts = sFit.countAllFitsGroupedByShip()
# set map & cache of fittings per category
for cat in self.categoryList:
itemIDs = [x.ID for x in cat.items]
num = sFit.countFitsWithShip(itemIDs)
self.categoryFitCache[cat.ID] = num > 0
self.categoryFitCache[cat.ID] = sum([count for shipID, count in counts if shipID in itemIDs]) > 0
for ship in self.categoryList:
if self.filterShipsWithNoFits and not self.categoryFitCache[ship.ID]: