Compare commits
71 Commits
v2.58.2
...
v2.61.0dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa67efd9cb | ||
|
|
38a345df93 | ||
|
|
b41ec8a5a9 | ||
|
|
4ba9bb7b99 | ||
|
|
f3c8f485b9 | ||
|
|
8d204dd173 | ||
|
|
f870d7e6d2 | ||
|
|
715997041a | ||
|
|
003191d9a4 | ||
|
|
9302d79e1d | ||
|
|
401fc671d4 | ||
|
|
fbadcf0af6 | ||
|
|
c7f600f88c | ||
|
|
229dd0ddae | ||
|
|
8883b18025 | ||
|
|
ea9b67cedd | ||
|
|
c4cf1d1ecb | ||
|
|
f76f7e85db | ||
|
|
b807e2a36b | ||
|
|
2bb35a15ce | ||
|
|
376bda7a94 | ||
|
|
a642bdc8c9 | ||
|
|
71f3e7b858 | ||
|
|
88f5ed2da5 | ||
|
|
3b9bbae0c3 | ||
|
|
6d474492ea | ||
|
|
ebc61efef8 | ||
|
|
7b5c95213f | ||
|
|
1312177e0e | ||
|
|
5b0df0a9c3 | ||
|
|
1ea6136cb2 | ||
|
|
da2b6bbb6d | ||
|
|
87007af5f8 | ||
|
|
dd5ab872b1 | ||
|
|
65fb46885a | ||
|
|
fad1e401b2 | ||
|
|
d59f8afd8a | ||
|
|
7c42d00219 | ||
|
|
777ba69ac4 | ||
|
|
9a3bde872b | ||
|
|
01354a0a83 | ||
|
|
8c3b8589d5 | ||
|
|
451b5d4312 | ||
|
|
d204e70afc | ||
|
|
ce9ce17ad2 | ||
|
|
6a7cdda91a | ||
|
|
f38c61da51 | ||
|
|
735827a25b | ||
|
|
d3fcdcbe47 | ||
|
|
a3dce73663 | ||
|
|
594b58388f | ||
|
|
fa6be2edfb | ||
|
|
1177968b02 | ||
|
|
c04b370410 | ||
|
|
038b95531d | ||
|
|
56bc5c3376 | ||
|
|
f5d8be7861 | ||
|
|
5366c23db2 | ||
|
|
d147db22f1 | ||
|
|
28ebcd2739 | ||
|
|
2f57eb6ea6 | ||
|
|
3a7ee4699e | ||
|
|
fa7f991fae | ||
|
|
0be8b429aa | ||
|
|
7d94e2de7d | ||
|
|
6d32db5827 | ||
|
|
0fbb318d8a | ||
|
|
cd013e8287 | ||
|
|
e667453c1e | ||
|
|
24e2db0f88 | ||
|
|
3c47f8c6bb |
@@ -17,7 +17,7 @@ for:
|
||||
# init:
|
||||
# - sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
|
||||
install:
|
||||
- sh: sudo DEBIAN_FRONTEND=noninteractive apt-get -y update
|
||||
- sh: sudo DEBIAN_FRONTEND=noninteractive apt-get -y update --allow-releaseinfo-change
|
||||
# AppImage dependencies
|
||||
- sh: sudo DEBIAN_FRONTEND=noninteractive apt-get -y install libfuse2
|
||||
# Preparation script dependencies
|
||||
|
||||
@@ -544,7 +544,7 @@ def update_db():
|
||||
continue
|
||||
typeName = row.get('typeName_en-us', '')
|
||||
# Regular sets matching
|
||||
m = re.match('(?P<grade>(High|Mid|Low)-grade) (?P<set>\w+) (?P<implant>(Alpha|Beta|Gamma|Delta|Epsilon|Omega))', typeName, re.IGNORECASE)
|
||||
m = re.match(r'(?P<grade>(High|Mid|Low)-grade) (?P<set>\w+) (?P<implant>(Alpha|Beta|Gamma|Delta|Epsilon|Omega))', typeName, re.IGNORECASE)
|
||||
if m:
|
||||
implantSets.setdefault((m.group('grade'), m.group('set')), set()).add(row['typeID'])
|
||||
# Special set matching
|
||||
|
||||
@@ -10,10 +10,15 @@
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- Windows Vista -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!-- Windows 10 and Windows 11 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
15
eos/db/migrations/upgrade48.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
Migration 48
|
||||
|
||||
- added pilot security column (CONCORD ships)
|
||||
"""
|
||||
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
try:
|
||||
saveddata_engine.execute("SELECT pilotSecurity FROM fits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN pilotSecurity FLOAT")
|
||||
@@ -63,7 +63,8 @@ fits_table = Table("fits", saveddata_meta,
|
||||
Column("ignoreRestrictions", Boolean, default=0),
|
||||
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
|
||||
Column("modified", DateTime, nullable=True, default=datetime.datetime.now, onupdate=datetime.datetime.now),
|
||||
Column("systemSecurity", Integer, nullable=True)
|
||||
Column("systemSecurity", Integer, nullable=True),
|
||||
Column("pilotSecurity", Float, nullable=True),
|
||||
)
|
||||
|
||||
projectedFits_table = Table("projectedFits", saveddata_meta,
|
||||
|
||||
1166
eos/effects.py
@@ -343,7 +343,9 @@ class Item(EqBase):
|
||||
500018: "mordu",
|
||||
500019: "sansha",
|
||||
500020: "serpentis",
|
||||
500026: "triglavian"
|
||||
500026: "triglavian",
|
||||
500027: "upwell",
|
||||
500029: "deathless",
|
||||
}
|
||||
|
||||
@property
|
||||
@@ -351,11 +353,7 @@ class Item(EqBase):
|
||||
if self.__race is None:
|
||||
|
||||
try:
|
||||
if (
|
||||
self.category.name == 'Structure' or
|
||||
# Here until CCP puts their shit together
|
||||
self.name in ("Thunderchild", "Stormbringer", "Skybreaker")
|
||||
):
|
||||
if self.category.name == 'Structure':
|
||||
self.__race = "upwell"
|
||||
else:
|
||||
self.__race = self.factionMap[self.factionID]
|
||||
@@ -377,7 +375,8 @@ class Item(EqBase):
|
||||
16 : "jove",
|
||||
32 : "sansha", # Incrusion Sansha
|
||||
128: "ore",
|
||||
135: "triglavian"
|
||||
135: "triglavian",
|
||||
168: "upwell",
|
||||
}
|
||||
# Race is None by default
|
||||
race = None
|
||||
@@ -571,13 +570,18 @@ class DynamicItem(EqBase):
|
||||
@property
|
||||
def shortName(self):
|
||||
name = self.item.customName
|
||||
keywords = ('Decayed', 'Gravid', 'Unstable', 'Radical')
|
||||
keywords = (
|
||||
'Decayed', 'Glorified Decayed',
|
||||
'Gravid', 'Glorified Gravid',
|
||||
'Unstable', 'Glorified Unstable',
|
||||
'Radical', 'Glorified Radical')
|
||||
for kw in keywords:
|
||||
if name.startswith(f'{kw} '):
|
||||
name = kw
|
||||
m = re.match('(?P<mutagrade>\S+) (?P<dronetype>\S+) Drone (?P<mutatype>\S+) Mutaplasmid', name)
|
||||
m = re.match(r'(?P<mutagrade>(Glorified )?\S+) (?P<dronetype>\S+) Drone (?P<mutatype>\S+) Mutaplasmid', name)
|
||||
if m:
|
||||
name = '{} {}'.format(m.group('mutagrade'), m.group('mutatype'))
|
||||
name = name.replace('Glorified ', 'Gl. ')
|
||||
return name
|
||||
|
||||
|
||||
|
||||
@@ -1743,6 +1743,18 @@ class Fit:
|
||||
secstatus = FitSystemSecurity.NULLSEC
|
||||
return secstatus
|
||||
|
||||
def getPilotSecurity(self, low_limit=-10, high_limit=5):
|
||||
secstatus = self.pilotSecurity
|
||||
# Not defined -> use character SS, with 0.0 fallback if it fails
|
||||
if secstatus is None:
|
||||
try:
|
||||
secstatus = self.character.secStatus
|
||||
except (SystemExit, KeyboardInterrupt):
|
||||
raise
|
||||
except:
|
||||
secstatus = 0
|
||||
return max(low_limit, min(high_limit, secstatus))
|
||||
|
||||
def activeModulesIter(self):
|
||||
for mod in self.modules:
|
||||
if mod.state >= FittingModuleState.ACTIVE:
|
||||
@@ -1824,6 +1836,7 @@ class Fit:
|
||||
fitCopy.targetProfile = self.targetProfile
|
||||
fitCopy.implantLocation = self.implantLocation
|
||||
fitCopy.systemSecurity = self.systemSecurity
|
||||
fitCopy.pilotSecurity = self.pilotSecurity
|
||||
fitCopy.notes = self.notes
|
||||
|
||||
for i in self.modules:
|
||||
|
||||
@@ -34,7 +34,10 @@ from service.fit import Fit
|
||||
from service.market import Market
|
||||
|
||||
|
||||
FIGHTER_ORDER = ('Light Fighter', 'Heavy Fighter', 'Support Fighter')
|
||||
FIGHTER_ORDER = (
|
||||
'Light Fighter', 'Structure Light Fighter',
|
||||
'Heavy Fighter', 'Structure Heavy Fighter',
|
||||
'Support Fighter', 'Structure Support Fighter')
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ from gui.builtinContextMenus.targetProfile import editor
|
||||
from gui.builtinContextMenus import itemStats
|
||||
from gui.builtinContextMenus import itemMarketJump
|
||||
from gui.builtinContextMenus import fitSystemSecurity # Not really an item info but want to keep it here
|
||||
from gui.builtinContextMenus import fitPilotSecurity # Not really an item info but want to keep it here
|
||||
from gui.builtinContextMenus import shipJump
|
||||
# Generic item manipulations
|
||||
from gui.builtinContextMenus import itemRemove
|
||||
|
||||
@@ -25,7 +25,7 @@ class AddToCargoAmmo(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
if mainItem.marketGroup.name == "Scan Probes":
|
||||
if mainItem.marketGroup and mainItem.marketGroup.name == "Scan Probes":
|
||||
return _t("Add {0} to Cargo (x8)").format(itmContext)
|
||||
|
||||
return _t("Add {0} to Cargo (x1000)").format(itmContext)
|
||||
@@ -34,7 +34,7 @@ class AddToCargoAmmo(ContextMenuSingle):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
typeID = int(mainItem.ID)
|
||||
|
||||
if mainItem.marketGroup.name == "Scan Probes":
|
||||
if mainItem.marketGroup and mainItem.marketGroup.name == "Scan Probes":
|
||||
command = cmd.GuiAddCargoCommand(fitID=fitID, itemID=typeID, amount=8)
|
||||
else:
|
||||
command = cmd.GuiAddCargoCommand(fitID=fitID, itemID=typeID, amount=1000)
|
||||
|
||||
157
gui/builtinContextMenus/fitPilotSecurity.py
Normal file
@@ -0,0 +1,157 @@
|
||||
import re
|
||||
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class FitPilotSecurityMenu(ContextMenuUnconditional):
|
||||
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
def display(self, callingWindow, srcContext):
|
||||
if srcContext != "fittingShip":
|
||||
return False
|
||||
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
fit = Fit.getInstance().getFit(fitID)
|
||||
|
||||
if fit.ship.name not in ('Pacifier', 'Enforcer', 'Marshal', 'Sidewinder', 'Cobra', 'Python'):
|
||||
return
|
||||
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return _t("Pilot Security Status")
|
||||
|
||||
def addOption(self, menu, optionLabel, optionValue):
|
||||
id = ContextMenuUnconditional.nextID()
|
||||
self.optionIds[id] = optionValue
|
||||
menuItem = wx.MenuItem(menu, id, optionLabel, kind=wx.ITEM_CHECK)
|
||||
menu.Bind(wx.EVT_MENU, self.handleMode, menuItem)
|
||||
return menuItem
|
||||
|
||||
def addOptionCustom(self, menu, optionLabel):
|
||||
id = ContextMenuUnconditional.nextID()
|
||||
menuItem = wx.MenuItem(menu, id, optionLabel, kind=wx.ITEM_CHECK)
|
||||
menu.Bind(wx.EVT_MENU, self.handleModeCustom, menuItem)
|
||||
return menuItem
|
||||
|
||||
def getSubMenu(self, callingWindow, context, rootMenu, i, pitem):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
fit = Fit.getInstance().getFit(fitID)
|
||||
msw = True if "wxMSW" in wx.PlatformInfo else False
|
||||
self.optionIds = {}
|
||||
sub = wx.Menu()
|
||||
presets = (-10, -8, -6, -4, -2, 0, 1, 2, 3, 4, 5)
|
||||
# Inherit
|
||||
char_sec_status = round(fit.character.secStatus, 2)
|
||||
menuItem = self.addOption(rootMenu if msw else sub, _t('Character') + f' ({char_sec_status})', None)
|
||||
sub.Append(menuItem)
|
||||
menuItem.Check(fit.pilotSecurity is None)
|
||||
# Custom
|
||||
label = _t('Custom')
|
||||
is_checked = False
|
||||
if fit.pilotSecurity is not None and fit.pilotSecurity not in presets:
|
||||
sec_status = round(fit.getPilotSecurity(), 2)
|
||||
label += f' ({sec_status})'
|
||||
is_checked = True
|
||||
menuItem = self.addOptionCustom(rootMenu if msw else sub, label)
|
||||
sub.Append(menuItem)
|
||||
menuItem.Check(is_checked)
|
||||
sub.AppendSeparator()
|
||||
# Predefined options
|
||||
for sec_status in presets:
|
||||
menuItem = self.addOption(rootMenu if msw else sub, str(sec_status), sec_status)
|
||||
sub.Append(menuItem)
|
||||
menuItem.Check(fit.pilotSecurity == sec_status)
|
||||
return sub
|
||||
|
||||
def handleMode(self, event):
|
||||
optionValue = self.optionIds[event.Id]
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeFitPilotSecurityCommand(
|
||||
fitID=self.mainFrame.getActiveFit(),
|
||||
secStatus=optionValue))
|
||||
|
||||
def handleModeCustom(self, event):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
fit = Fit.getInstance().getFit(fitID)
|
||||
sec_status = fit.getPilotSecurity()
|
||||
|
||||
with SecStatusChanger(self.mainFrame, value=sec_status) as dlg:
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
cleanInput = re.sub(r'[^0-9.\-+]', '', dlg.input.GetLineText(0).strip())
|
||||
if cleanInput:
|
||||
try:
|
||||
cleanInputFloat = float(cleanInput)
|
||||
except ValueError:
|
||||
return
|
||||
else:
|
||||
return
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeFitPilotSecurityCommand(
|
||||
fitID=fitID, secStatus=max(-10.0, min(5.0, cleanInputFloat))))
|
||||
|
||||
|
||||
FitPilotSecurityMenu.register()
|
||||
|
||||
|
||||
class SecStatusChanger(wx.Dialog):
|
||||
|
||||
def __init__(self, parent, value):
|
||||
super().__init__(parent, title=_t('Change Security Status'), style=wx.DEFAULT_DIALOG_STYLE)
|
||||
self.SetMinSize((346, 156))
|
||||
|
||||
bSizer1 = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
bSizer2 = wx.BoxSizer(wx.VERTICAL)
|
||||
text = wx.StaticText(self, wx.ID_ANY, _t('Security Status (min -10.0, max 5.0):'))
|
||||
bSizer2.Add(text, 0)
|
||||
|
||||
bSizer1.Add(bSizer2, 0, wx.ALL, 10)
|
||||
|
||||
self.input = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER)
|
||||
if value is None:
|
||||
value = '0.0'
|
||||
else:
|
||||
if value == int(value):
|
||||
value = int(value)
|
||||
value = str(value)
|
||||
self.input.SetValue(value)
|
||||
|
||||
bSizer1.Add(self.input, 0, wx.LEFT | wx.RIGHT | wx.EXPAND, 15)
|
||||
|
||||
bSizer3 = wx.BoxSizer(wx.VERTICAL)
|
||||
bSizer3.Add(wx.StaticLine(self, wx.ID_ANY), 0, wx.BOTTOM | wx.EXPAND, 15)
|
||||
|
||||
bSizer3.Add(self.CreateStdDialogButtonSizer(wx.OK | wx.CANCEL), 0, wx.EXPAND)
|
||||
bSizer1.Add(bSizer3, 0, wx.ALL | wx.EXPAND, 10)
|
||||
|
||||
self.input.Bind(wx.EVT_CHAR, self.onChar)
|
||||
self.input.Bind(wx.EVT_TEXT_ENTER, self.processEnter)
|
||||
self.SetSizer(bSizer1)
|
||||
self.Fit()
|
||||
self.CenterOnParent()
|
||||
self.input.SetFocus()
|
||||
self.input.SelectAll()
|
||||
|
||||
def processEnter(self, evt):
|
||||
self.EndModal(wx.ID_OK)
|
||||
|
||||
# checks to make sure it's valid number
|
||||
@staticmethod
|
||||
def onChar(event):
|
||||
key = event.GetKeyCode()
|
||||
|
||||
acceptable_characters = '1234567890.-+'
|
||||
acceptable_keycode = [3, 22, 13, 8, 127] # modifiers like delete, copy, paste
|
||||
if key in acceptable_keycode or key >= 255 or (key < 255 and chr(key) in acceptable_characters):
|
||||
event.Skip()
|
||||
return
|
||||
else:
|
||||
return False
|
||||
@@ -13,6 +13,16 @@ from service.fit import Fit
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
GLORIFIED_PREFIX = 'Gl. '
|
||||
|
||||
|
||||
def nameSorter(mutaplasmid):
|
||||
name = mutaplasmid.shortName
|
||||
if name.startswith(GLORIFIED_PREFIX):
|
||||
return name[len(GLORIFIED_PREFIX):], True
|
||||
return name, False
|
||||
|
||||
|
||||
class ChangeItemMutation(ContextMenuSingle):
|
||||
|
||||
def __init__(self):
|
||||
@@ -45,7 +55,7 @@ class ChangeItemMutation(ContextMenuSingle):
|
||||
|
||||
menu = rootMenu if msw else sub
|
||||
|
||||
for mutaplasmid in mainItem.item.mutaplasmids:
|
||||
for mutaplasmid in sorted(mainItem.item.mutaplasmids, key=nameSorter):
|
||||
id = ContextMenuSingle.nextID()
|
||||
self.eventIDs[id] = (mutaplasmid, mainItem)
|
||||
mItem = wx.MenuItem(menu, id, mutaplasmid.shortName)
|
||||
|
||||
@@ -72,6 +72,7 @@ AttrGroupDict = {
|
||||
"specialAmmoHoldCapacity",
|
||||
"specialCommandCenterHoldCapacity",
|
||||
"specialPlanetaryCommoditiesHoldCapacity",
|
||||
"specialColonyResourcesHoldCapacity",
|
||||
"structureDamageLimit",
|
||||
"specialSubsystemHoldCapacity",
|
||||
"emDamageResonance",
|
||||
|
||||
@@ -5,3 +5,5 @@ import wx.lib.newevent
|
||||
ItemSelected, ITEM_SELECTED = wx.lib.newevent.NewEvent()
|
||||
|
||||
RECENTLY_USED_MODULES = -2
|
||||
|
||||
CHARGES_FOR_FIT = -3
|
||||
|
||||
@@ -2,15 +2,17 @@ import wx
|
||||
from logbook import Logger
|
||||
|
||||
import gui.builtinMarketBrowser.pfSearchBox as SBox
|
||||
import gui.globalEvents as GE
|
||||
from config import slotColourMap, slotColourMapDark
|
||||
from eos.saveddata.module import Module
|
||||
from gui.builtinMarketBrowser.events import ItemSelected, RECENTLY_USED_MODULES
|
||||
from gui.builtinMarketBrowser.events import ItemSelected, RECENTLY_USED_MODULES, CHARGES_FOR_FIT
|
||||
from gui.contextMenu import ContextMenu
|
||||
from gui.display import Display
|
||||
from gui.utils.staticHelpers import DragDropHelper
|
||||
from gui.utils.dark import isDark
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
from service.ammo import Ammo
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
@@ -32,6 +34,7 @@ class ItemView(Display):
|
||||
self.filteredStore = set()
|
||||
self.sMkt = marketBrowser.sMkt
|
||||
self.sFit = Fit.getInstance()
|
||||
self.sAmmo = Ammo.getInstance()
|
||||
|
||||
self.marketBrowser = marketBrowser
|
||||
self.marketView = marketBrowser.marketView
|
||||
@@ -51,6 +54,9 @@ class ItemView(Display):
|
||||
self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.itemActivated)
|
||||
self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.startDrag)
|
||||
|
||||
# the "charges for active fitting" needs to listen to fitting changes
|
||||
self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
|
||||
|
||||
self.active = []
|
||||
|
||||
def delaySearch(self, evt):
|
||||
@@ -91,7 +97,11 @@ class ItemView(Display):
|
||||
if sel.IsOk():
|
||||
# Get data field of the selected item (which is a marketGroup ID if anything was selected)
|
||||
seldata = self.marketView.GetItemData(sel)
|
||||
if seldata is not None and seldata != RECENTLY_USED_MODULES:
|
||||
if seldata == RECENTLY_USED_MODULES:
|
||||
items = self.sMkt.getRecentlyUsed()
|
||||
elif seldata == CHARGES_FOR_FIT:
|
||||
items = self.getChargesForActiveFit()
|
||||
elif seldata is not None:
|
||||
# If market group treeview item doesn't have children (other market groups or dummies),
|
||||
# then it should have items in it and we want to request them
|
||||
if self.marketView.ItemHasChildren(sel) is False:
|
||||
@@ -103,11 +113,7 @@ class ItemView(Display):
|
||||
else:
|
||||
items = set()
|
||||
else:
|
||||
# If method was called but selection wasn't actually made or we have a hit on recently used modules
|
||||
if seldata == RECENTLY_USED_MODULES:
|
||||
items = self.sMkt.getRecentlyUsed()
|
||||
else:
|
||||
items = set()
|
||||
items = set()
|
||||
|
||||
# Fill store
|
||||
self.updateItemStore(items)
|
||||
@@ -115,6 +121,9 @@ class ItemView(Display):
|
||||
# Set toggle buttons / use search mode flag if recently used modules category is selected (in order to have all modules listed and not filtered)
|
||||
if seldata == RECENTLY_USED_MODULES:
|
||||
self.marketBrowser.mode = 'recent'
|
||||
|
||||
if seldata == CHARGES_FOR_FIT:
|
||||
self.marketBrowser.mode = 'charges'
|
||||
|
||||
self.setToggles()
|
||||
if context == 'tree' and self.marketBrowser.settings.get('marketMGMarketSelectMode') == 1:
|
||||
@@ -123,6 +132,41 @@ class ItemView(Display):
|
||||
btn.setUserSelection(True)
|
||||
self.filterItemStore()
|
||||
|
||||
def getChargesForActiveFit(self):
|
||||
fitId = self.mainFrame.getActiveFit()
|
||||
|
||||
# no active fit => no charges
|
||||
if fitId is None:
|
||||
return set()
|
||||
|
||||
fit = self.sFit.getFit(fitId)
|
||||
|
||||
# use a set so we only add one entry for each charge
|
||||
items = set()
|
||||
for mod in fit.modules:
|
||||
charges = self.sAmmo.getModuleFlatAmmo(mod)
|
||||
for charge in charges:
|
||||
items.add(charge)
|
||||
return items
|
||||
|
||||
def fitChanged(self, event):
|
||||
# skip the event so the other handlers also get called
|
||||
event.Skip()
|
||||
|
||||
if self.marketBrowser.mode != 'charges':
|
||||
return
|
||||
|
||||
activeFitID = self.mainFrame.getActiveFit()
|
||||
# if it was not the active fitting that was changed, do not do anything
|
||||
if activeFitID is not None and activeFitID not in event.fitIDs:
|
||||
return
|
||||
|
||||
items = self.getChargesForActiveFit()
|
||||
|
||||
# update the UI
|
||||
self.updateItemStore(items)
|
||||
self.filterItemStore()
|
||||
|
||||
def updateItemStore(self, items):
|
||||
self.unfilteredStore = items
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import wx
|
||||
|
||||
from gui.cachingImageList import CachingImageList
|
||||
from gui.builtinMarketBrowser.events import RECENTLY_USED_MODULES
|
||||
from gui.builtinMarketBrowser.events import RECENTLY_USED_MODULES, CHARGES_FOR_FIT
|
||||
|
||||
from logbook import Logger
|
||||
|
||||
@@ -35,6 +35,9 @@ class MarketTree(wx.TreeCtrl):
|
||||
# Add recently used modules node
|
||||
rumIconId = self.addImage("market_small", "gui")
|
||||
self.AppendItem(self.root, _t("Recently Used Items"), rumIconId, data=RECENTLY_USED_MODULES)
|
||||
# Add charges for active fitting node
|
||||
cffIconId = self.addImage("damagePattern_small", "gui")
|
||||
self.AppendItem(self.root, _t("Charges For Active Fit"), cffIconId, data=CHARGES_FOR_FIT)
|
||||
|
||||
# Bind our lookup method to when the tree gets expanded
|
||||
self.Bind(wx.EVT_TREE_ITEM_EXPANDING, self.expandLookup)
|
||||
|
||||
@@ -112,6 +112,7 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
cargoNamesOrder = OrderedDict((
|
||||
("fleetHangarCapacity", _t("Fleet hangar")),
|
||||
("shipMaintenanceBayCapacity", _t("Maintenance bay")),
|
||||
("specialColonyResourcesHoldCapacity", _t("Infrastructure hold")),
|
||||
("specialAmmoHoldCapacity", _t("Ammo hold")),
|
||||
("specialFuelBayCapacity", _t("Fuel bay")),
|
||||
("specialShipHoldCapacity", _t("Ship hold")),
|
||||
@@ -134,6 +135,7 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
cargoValues = {
|
||||
"main": lambda: fit.ship.getModifiedItemAttr("capacity"),
|
||||
"fleetHangarCapacity": lambda: fit.ship.getModifiedItemAttr("fleetHangarCapacity"),
|
||||
"specialColonyResourcesHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialColonyResourcesHoldCapacity"),
|
||||
"shipMaintenanceBayCapacity": lambda: fit.ship.getModifiedItemAttr("shipMaintenanceBayCapacity"),
|
||||
"specialAmmoHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialAmmoHoldCapacity"),
|
||||
"specialFuelBayCapacity": lambda: fit.ship.getModifiedItemAttr("specialFuelBayCapacity"),
|
||||
|
||||
@@ -93,8 +93,6 @@ class Miscellanea(ViewColumn):
|
||||
text = "{} dmg".format(formatAmount(dmg, 3, 0, 6))
|
||||
tooltip = "Raw damage done"
|
||||
return text, tooltip
|
||||
|
||||
pass
|
||||
elif itemGroup in ("Energy Weapon", "Hybrid Weapon", "Projectile Weapon", "Combat Drone", "Fighter Drone"):
|
||||
trackingSpeed = stuff.getModifiedItemAttr("trackingSpeed")
|
||||
optimalSig = stuff.getModifiedItemAttr("optimalSigRadius")
|
||||
@@ -590,7 +588,7 @@ class Miscellanea(ViewColumn):
|
||||
text = "{0}/s".format(formatAmount(capPerSec, 3, 0, 3))
|
||||
tooltip = "Energy neutralization per second"
|
||||
return text, tooltip
|
||||
elif itemGroup in ("Micro Jump Drive", "Micro Jump Field Generators"):
|
||||
elif itemGroup in ("Micro Jump Drive", "Micro Jump Field Generators", "Capital Mobility Modules"):
|
||||
cycleTime = stuff.getModifiedItemAttr("duration") / 1000
|
||||
text = "{0}s".format(formatAmount(cycleTime, 3, 0, 3))
|
||||
tooltip = "Spoolup time"
|
||||
@@ -810,6 +808,16 @@ class Miscellanea(ViewColumn):
|
||||
text = "{}".format(formatAmount(scanStr, 4, 0, 3))
|
||||
tooltip = "Scan strength at {} AU scan range".format(formatAmount(baseRange, 3, 0, 0))
|
||||
return text, tooltip
|
||||
elif chargeGroup in ("SCARAB Breacher Pods",):
|
||||
duration = stuff.getModifiedChargeAttr("dotDuration") / 1000
|
||||
dmgAbs = stuff.getModifiedChargeAttr("dotMaxDamagePerTick") * duration
|
||||
dmgRel = stuff.getModifiedChargeAttr("dotMaxHPPercentagePerTick") * duration
|
||||
text = "{}/{}% over {}s".format(
|
||||
formatAmount(dmgAbs, 3, 0, 6),
|
||||
formatAmount(dmgRel, 3, 0, 6),
|
||||
formatAmount(duration, 0, 0, 0))
|
||||
tooltip = "Pure damage done over time, minimum of absolute / relative"
|
||||
return text, tooltip
|
||||
else:
|
||||
return "", None
|
||||
else:
|
||||
|
||||
@@ -115,7 +115,7 @@ class CharacterEntityEditor(EntityEditor):
|
||||
sChar = Character.getInstance()
|
||||
|
||||
if entity.alphaCloneID:
|
||||
trimmed_name = re.sub('[ \(\u03B1\)]+$', '', name)
|
||||
trimmed_name = re.sub('[ \\(\u03B1\\)]+$', '', name)
|
||||
sChar.rename(entity, trimmed_name)
|
||||
else:
|
||||
sChar.rename(entity, name)
|
||||
@@ -918,7 +918,7 @@ class SecStatusDialog(wx.Dialog):
|
||||
self.m_staticText1.Wrap(-1)
|
||||
bSizer1.Add(self.m_staticText1, 1, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.floatSpin = FloatSpin(self, value=sec, min_val=-5.0, max_val=5.0, increment=0.1, digits=2, size=(-1, -1))
|
||||
self.floatSpin = FloatSpin(self, value=sec, min_val=-10.0, max_val=5.0, increment=0.1, digits=2, size=(-1, -1))
|
||||
bSizer1.Add(self.floatSpin, 0, wx.ALIGN_CENTER | wx.ALL, 5)
|
||||
|
||||
btnOk = wx.Button(self, wx.ID_OK)
|
||||
|
||||
@@ -112,7 +112,7 @@ class FitBrowserLiteDialog(wx.Dialog):
|
||||
return True
|
||||
|
||||
matches = []
|
||||
searchTokens = [t.lower() for t in re.split('\s+', searchPattern)]
|
||||
searchTokens = [t.lower() for t in re.split(r'\s+', searchPattern)]
|
||||
for fit in self.allFits:
|
||||
if isMatch(fit, searchTokens):
|
||||
matches.append(fit)
|
||||
|
||||
@@ -12,6 +12,7 @@ from .gui.cargo.remove import GuiRemoveCargosCommand
|
||||
from .gui.commandFit.add import GuiAddCommandFitsCommand
|
||||
from .gui.commandFit.remove import GuiRemoveCommandFitsCommand
|
||||
from .gui.commandFit.toggleStates import GuiToggleCommandFitStatesCommand
|
||||
from .gui.fitPilotSecurity import GuiChangeFitPilotSecurityCommand
|
||||
from .gui.fitRename import GuiRenameFitCommand
|
||||
from .gui.fitRestrictionToggle import GuiToggleFittingRestrictionsCommand
|
||||
from .gui.fitSystemSecurity import GuiChangeFitSystemSecurityCommand
|
||||
|
||||
32
gui/fitCommands/calc/fitPilotSecurity.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import wx
|
||||
from logbook import Logger
|
||||
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class CalcChangeFitPilotSecurityCommand(wx.Command):
|
||||
|
||||
def __init__(self, fitID, secStatus):
|
||||
wx.Command.__init__(self, True, 'Change Fit Pilot Security')
|
||||
self.fitID = fitID
|
||||
self.secStatus = secStatus
|
||||
self.savedSecStatus = None
|
||||
|
||||
def Do(self):
|
||||
pyfalog.debug('Doing changing pilot security status of fit {} to {}'.format(self.fitID, self.secStatus))
|
||||
fit = Fit.getInstance().getFit(self.fitID, basic=True)
|
||||
# Fetching status via getter and then saving 'raw' security status
|
||||
# is intentional, to restore pre-change state properly
|
||||
if fit.pilotSecurity == self.secStatus:
|
||||
return False
|
||||
self.savedSecStatus = fit.pilotSecurity
|
||||
fit.pilotSecurity = self.secStatus
|
||||
return True
|
||||
|
||||
def Undo(self):
|
||||
pyfalog.debug('Undoing changing pilot security status of fit {} to {}'.format(self.fitID, self.secStatus))
|
||||
cmd = CalcChangeFitPilotSecurityCommand(fitID=self.fitID, secStatus=self.savedSecStatus)
|
||||
return cmd.Do()
|
||||
36
gui/fitCommands/gui/fitPilotSecurity.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import wx
|
||||
from service.fit import Fit
|
||||
|
||||
import eos.db
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from gui.fitCommands.helpers import InternalCommandHistory
|
||||
from gui.fitCommands.calc.fitPilotSecurity import CalcChangeFitPilotSecurityCommand
|
||||
|
||||
|
||||
class GuiChangeFitPilotSecurityCommand(wx.Command):
|
||||
|
||||
def __init__(self, fitID, secStatus):
|
||||
wx.Command.__init__(self, True, 'Change Fit Pilot Security')
|
||||
self.internalHistory = InternalCommandHistory()
|
||||
self.fitID = fitID
|
||||
self.secStatus = secStatus
|
||||
|
||||
def Do(self):
|
||||
cmd = CalcChangeFitPilotSecurityCommand(fitID=self.fitID, secStatus=self.secStatus)
|
||||
success = self.internalHistory.submit(cmd)
|
||||
eos.db.flush()
|
||||
sFit = Fit.getInstance()
|
||||
sFit.recalc(self.fitID)
|
||||
eos.db.commit()
|
||||
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitIDs=(self.fitID,)))
|
||||
return success
|
||||
|
||||
def Undo(self):
|
||||
success = self.internalHistory.undoAll()
|
||||
eos.db.flush()
|
||||
sFit = Fit.getInstance()
|
||||
sFit.recalc(self.fitID)
|
||||
eos.db.commit()
|
||||
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitIDs=(self.fitID,)))
|
||||
return success
|
||||
@@ -146,7 +146,7 @@ class MarketBrowser(wx.Panel):
|
||||
setting = self.settings.get('marketMGSearchMode')
|
||||
# We turn on all meta buttons for the duration of search/recents
|
||||
if setting == 1:
|
||||
if newMode in ('search', 'recent'):
|
||||
if newMode in ('search', 'recent', 'charges'):
|
||||
for btn in self.metaButtons:
|
||||
btn.setUserSelection(True)
|
||||
if newMode == 'normal':
|
||||
|
||||
@@ -191,7 +191,7 @@ class ShipBrowser(wx.Panel):
|
||||
"amarr", "caldari", "gallente", "minmatar",
|
||||
"sisters", "ore", "concord",
|
||||
"serpentis", "angel", "blood", "sansha", "guristas", "mordu",
|
||||
"jove", "triglavian", "upwell", None
|
||||
"deathless", "jove", "triglavian", "upwell", None
|
||||
]
|
||||
|
||||
def raceNameKey(self, ship):
|
||||
|
||||
BIN
imgs/gui/race_deathless_small.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
imgs/icons/10155@1x.png
Normal file
|
After Width: | Height: | Size: 828 B |
BIN
imgs/icons/10155@2x.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
imgs/icons/10848@1x.png
Normal file
|
After Width: | Height: | Size: 673 B |
BIN
imgs/icons/10848@2x.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 645 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 836 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 645 B After Width: | Height: | Size: 878 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 634 B After Width: | Height: | Size: 805 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 730 B |
|
Before Width: | Height: | Size: 1.9 KiB |
BIN
imgs/icons/25240@1x.png
Normal file
|
After Width: | Height: | Size: 784 B |
BIN
imgs/icons/25240@2x.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
imgs/icons/25241@1x.png
Normal file
|
After Width: | Height: | Size: 808 B |
BIN
imgs/icons/25241@2x.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
imgs/icons/25242@1x.png
Normal file
|
After Width: | Height: | Size: 829 B |
BIN
imgs/icons/25242@2x.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
imgs/icons/25243@1x.png
Normal file
|
After Width: | Height: | Size: 833 B |
BIN
imgs/icons/25243@2x.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
imgs/icons/25250@1x.png
Normal file
|
After Width: | Height: | Size: 782 B |
BIN
imgs/icons/25250@2x.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
imgs/icons/25251@1x.png
Normal file
|
After Width: | Height: | Size: 816 B |
BIN
imgs/icons/25251@2x.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
imgs/icons/25252@1x.png
Normal file
|
After Width: | Height: | Size: 823 B |
BIN
imgs/icons/25252@2x.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
imgs/icons/25253@1x.png
Normal file
|
After Width: | Height: | Size: 814 B |
BIN
imgs/icons/25253@2x.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 605 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 625 B |
|
Before Width: | Height: | Size: 1.5 KiB |
BIN
imgs/icons/26004@1x.png
Normal file
|
After Width: | Height: | Size: 761 B |
BIN
imgs/icons/26004@2x.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
imgs/icons/26005@1x.png
Normal file
|
After Width: | Height: | Size: 767 B |
BIN
imgs/icons/26005@2x.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
imgs/icons/26016@1x.png
Normal file
|
After Width: | Height: | Size: 821 B |
BIN
imgs/icons/26016@2x.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
imgs/icons/26017@1x.png
Normal file
|
After Width: | Height: | Size: 832 B |
BIN
imgs/icons/26017@2x.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
imgs/icons/26018@1x.png
Normal file
|
After Width: | Height: | Size: 822 B |
BIN
imgs/icons/26018@2x.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
imgs/icons/26019@1x.png
Normal file
|
After Width: | Height: | Size: 832 B |
BIN
imgs/icons/26019@2x.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
imgs/icons/26038@1x.png
Normal file
|
After Width: | Height: | Size: 980 B |
BIN
imgs/icons/26038@2x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
imgs/icons/26039@1x.png
Normal file
|
After Width: | Height: | Size: 945 B |
BIN
imgs/icons/26039@2x.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
imgs/icons/26040@1x.png
Normal file
|
After Width: | Height: | Size: 947 B |
BIN
imgs/icons/26040@2x.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
imgs/icons/26041@1x.png
Normal file
|
After Width: | Height: | Size: 951 B |
BIN
imgs/icons/26041@2x.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
imgs/icons/26042@1x.png
Normal file
|
After Width: | Height: | Size: 983 B |
BIN
imgs/icons/26042@2x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
imgs/icons/26043@1x.png
Normal file
|
After Width: | Height: | Size: 961 B |
BIN
imgs/icons/26043@2x.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
imgs/icons/26044@1x.png
Normal file
|
After Width: | Height: | Size: 988 B |
BIN
imgs/icons/26044@2x.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
imgs/icons/26051@1x.png
Normal file
|
After Width: | Height: | Size: 725 B |
BIN
imgs/icons/26051@2x.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
imgs/icons/26052@1x.png
Normal file
|
After Width: | Height: | Size: 805 B |
BIN
imgs/icons/26052@2x.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
imgs/icons/26053@1x.png
Normal file
|
After Width: | Height: | Size: 832 B |
BIN
imgs/icons/26053@2x.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
imgs/icons/26054@1x.png
Normal file
|
After Width: | Height: | Size: 772 B |
BIN
imgs/icons/26054@2x.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
imgs/icons/26055@1x.png
Normal file
|
After Width: | Height: | Size: 725 B |
BIN
imgs/icons/26055@2x.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
imgs/icons/26056@1x.png
Normal file
|
After Width: | Height: | Size: 692 B |
BIN
imgs/icons/26056@2x.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
imgs/icons/26062@1x.png
Normal file
|
After Width: | Height: | Size: 315 B |