示例#1
0
    def OnClose(self, event):
        self.UpdateMainFrameAttribs()

        # save open fits
        self.prevOpenFits['pyfaOpenFits'] = []  # clear old list
        for page in self.fitMultiSwitch._pages:
            m = getattr(page, "getActiveFit", None)
            if m is not None:
                self.prevOpenFits['pyfaOpenFits'].append(m())

        # save all teh settingz
        SettingsProvider.getInstance().saveAll()
        event.Skip()
示例#2
0
文件: mainFrame.py 项目: potatoi/Pyfa
    def OnClose(self, event):
        self.UpdateMainFrameAttribs()

        # save open fits
        self.prevOpenFits['pyfaOpenFits'] = []  # clear old list
        for page in self.fitMultiSwitch.pages:
            m = getattr(page, "getActiveFit", None)
            if m is not None:
                self.prevOpenFits['pyfaOpenFits'].append(m())

        # save all teh settingz
        SettingsProvider.getInstance().saveAll()
        event.Skip()
示例#3
0
    def __init__(self):
        self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
        self.targetResists = None
        self.character = Character.getInstance().all5()
        self.booster = False
        self.dirtyFitIDs = set()

        serviceFittingDefaultOptions = {
            "useGlobalCharacter": False,
            "useGlobalDamagePattern": False,
            "defaultCharacter": self.character.ID,
            "useGlobalForceReload": False,
            "colorFitBySlot": False,
            "rackSlots": True,
            "rackLabels": True,
            "compactSkills": True,
            "showTooltip": True,
            "showMarketShortcuts": False,
            "enableGaugeAnimation": True,
            "exportCharges": True,
            "openFitInNew":False
            }

        self.serviceFittingOptions = SettingsProvider.getInstance().getSettings(
            "pyfaServiceFittingOptions", serviceFittingDefaultOptions)
示例#4
0
    def exportToClipboard(self, event):
        CopySelectDict = {
            CopySelectDialog.copyFormatEft:
            self.clipboardEft,
            # CopySelectDialog.copyFormatEftImps: self.clipboardEftImps,
            CopySelectDialog.copyFormatXml:
            self.clipboardXml,
            CopySelectDialog.copyFormatDna:
            self.clipboardDna,
            CopySelectDialog.copyFormatEsi:
            self.clipboardEsi,
            CopySelectDialog.copyFormatMultiBuy:
            self.clipboardMultiBuy,
            CopySelectDialog.copyFormatEfs:
            self.clipboardEfs
        }
        dlg = CopySelectDialog(self)
        dlg.ShowModal()
        selected = dlg.GetSelected()
        options = dlg.GetOptions()

        settings = SettingsProvider.getInstance().getSettings("pyfaExport")
        settings["format"] = selected
        settings["options"] = options

        CopySelectDict[selected](options)

        try:
            dlg.Destroy()
        except RuntimeError:
            pyfalog.error(
                "Tried to destroy an object that doesn't exist in <exportToClipboard>."
            )
示例#5
0
文件: fit.py 项目: MiserereM/pyfa_zh
    def __init__(self):
        pyfalog.debug("Initialize Fit class")
        self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
        self.targetProfile = None
        self.character = saveddata_Character.getAll5()
        self.booster = False
        self._loadedFits = WeakSet()

        serviceFittingDefaultOptions = {
            "useGlobalCharacter": False,
            "useCharacterImplantsByDefault": True,
            "useGlobalDamagePattern": False,
            "defaultCharacter": self.character.ID,
            "useGlobalForceReload": False,
            "colorFitBySlot": False,
            "rackSlots": True,
            "rackLabels": True,
            "compactSkills": True,
            "showTooltip": True,
            "showMarketShortcuts": False,
            "enableGaugeAnimation": True,
            "openFitInNew": False,
            "priceSystem": "Jita",
            "priceSource": "evemarketer",
            "showShipBrowserTooltip": True,
            "marketSearchDelay": 250,
            "ammoChangeAll": False,
            "additionsLabels": 1,
        }

        self.serviceFittingOptions = SettingsProvider.getInstance(
        ).getSettings("pyfaServiceFittingOptions",
                      serviceFittingDefaultOptions)
    def Validate(self):
        # Since this dialog is shown through aa ShowModal(), we hook into the Validate function to veto the closing of the dialog until we're ready.
        # This always returns False, and when we're ready will EndModal()
        selected = self.GetSelected()
        options = self.GetOptions()

        settings = SettingsProvider.getInstance().getSettings("pyfaExport")
        settings["format"] = selected
        settings["options"] = options
        self.waitDialog = None

        def cb(text):
            if self.waitDialog:
                del self.waitDialog
            toClipboard(text)
            self.EndModal(wx.ID_OK)

        export_options = options.get(selected)
        if selected == CopySelectDialog.copyFormatMultiBuy and export_options.get(
                PortMultiBuyOptions.OPTIMIZE_PRICES, False):
            self.waitDialog = wx.BusyInfo("Optimizing Prices", parent=self)

        self.CopySelectDict[selected](export_options, callback=cb)

        return False
示例#7
0
    def LoadPreviousOpenFits(self):
        sFit = Fit.getInstance()

        self.prevOpenFits = SettingsProvider.getInstance().getSettings(
            "pyfaPrevOpenFits", {
                "enabled": False,
                "pyfaOpenFits": []
            })
        fits = self.prevOpenFits['pyfaOpenFits']

        # Remove any fits that cause exception when fetching (non-existent fits)
        for id in fits[:]:
            try:
                fit = sFit.getFit(id, basic=True)
                if fit is None:
                    fits.remove(id)
            except:
                fits.remove(id)

        if not self.prevOpenFits['enabled'] or len(fits) is 0:
            # add blank page if there are no fits to be loaded
            self.fitMultiSwitch.AddPage()
            return

        self.waitDialog = wx.BusyInfo("Loading previous fits...")
        OpenFitsThread(fits, self.closeWaitDialog)
示例#8
0
    def LoadMainFrameAttribs(self):
        mainFrameDefaultAttribs = {
            "wnd_width": 1000,
            "wnd_height": 700,
            "wnd_maximized": False,
            "browser_width": 300,
            "market_height": 0,
            "fitting_height": -200
        }
        self.mainFrameAttribs = SettingsProvider.getInstance().getSettings(
            "pyfaMainWindowAttribs", mainFrameDefaultAttribs)

        if self.mainFrameAttribs["wnd_maximized"]:
            width = mainFrameDefaultAttribs["wnd_width"]
            height = mainFrameDefaultAttribs["wnd_height"]
            self.Maximize()
        else:
            width = self.mainFrameAttribs["wnd_width"]
            height = self.mainFrameAttribs["wnd_height"]

        self.SetSize((width, height))
        self.SetMinSize((mainFrameDefaultAttribs["wnd_width"],
                         mainFrameDefaultAttribs["wnd_height"]))

        self.browserWidth = self.mainFrameAttribs["browser_width"]
        self.marketHeight = self.mainFrameAttribs["market_height"]
        self.fittingHeight = self.mainFrameAttribs["fitting_height"]
示例#9
0
文件: fit.py 项目: carterjl2/Pyfa
    def __init__(self):
        self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
        self.targetResists = None
        self.character = Character.getInstance().all5()
        self.booster = False
        self.dirtyFitIDs = set()

        serviceFittingDefaultOptions = {
            "useGlobalCharacter": False,
            "useGlobalDamagePattern": False,
            "defaultCharacter": self.character.ID,
            "useGlobalForceReload": False,
            "colorFitBySlot": False,
            "rackSlots": True,
            "rackLabels": True,
            "compactSkills": True,
            "showTooltip": True,
            "showMarketShortcuts": False,
            "enableGaugeAnimation": True,
            "exportCharges": True
        }

        self.serviceFittingOptions = SettingsProvider.getInstance(
        ).getSettings("pyfaServiceFittingOptions",
                      serviceFittingDefaultOptions)
示例#10
0
文件: fit.py 项目: Sectoid/Pyfa
    def __init__(self):
        pyfalog.debug("Initialize Fit class")
        self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
        self.targetResists = None
        self.character = saveddata_Character.getAll5()
        self.booster = False
        self.dirtyFitIDs = set()

        serviceFittingDefaultOptions = {
            "useGlobalCharacter": False,
            "useGlobalDamagePattern": False,
            "defaultCharacter": self.character.ID,
            "useGlobalForceReload": False,
            "colorFitBySlot": False,
            "rackSlots": True,
            "rackLabels": True,
            "compactSkills": True,
            "showTooltip": True,
            "showMarketShortcuts": False,
            "enableGaugeAnimation": True,
            "exportCharges": True,
            "openFitInNew": False,
            "priceSystem": "Jita",
            "priceSource": "eve-marketdata.com",
            "showShipBrowserTooltip": True,
            "marketSearchDelay": 250
        }

        self.serviceFittingOptions = SettingsProvider.getInstance().getSettings(
            "pyfaServiceFittingOptions", serviceFittingDefaultOptions)
示例#11
0
文件: fit.py 项目: taleden/Pyfa
    def __init__(self):
        pyfalog.debug("Initialize Fit class")
        self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
        self.targetResists = None
        self.character = saveddata_Character.getAll5()
        self.booster = False
        self.dirtyFitIDs = set()

        serviceFittingDefaultOptions = {
            "useGlobalCharacter": False,
            "useGlobalDamagePattern": False,
            "defaultCharacter": self.character.ID,
            "useGlobalForceReload": False,
            "colorFitBySlot": False,
            "rackSlots": True,
            "rackLabels": True,
            "compactSkills": True,
            "showTooltip": True,
            "showMarketShortcuts": False,
            "enableGaugeAnimation": True,
            "exportCharges": True,
            "openFitInNew": False,
            "priceSystem": "Jita",
            "priceSource": "eve-central.com",
            "showShipBrowserTooltip": True,
            "marketSearchDelay": 250
        }

        self.serviceFittingOptions = SettingsProvider.getInstance(
        ).getSettings("pyfaServiceFittingOptions",
                      serviceFittingDefaultOptions)
示例#12
0
    def LoadMainFrameAttribs(self):
        mainFrameDefaultAttribs = {
            "wnd_display": 0, "wnd_x": 0, "wnd_y": 0, "wnd_width": 1000, "wnd_height": 700, "wnd_maximized": False,
            "browser_width": 300, "market_height": 0, "fitting_height": -200}
        self.mainFrameAttribs = SettingsProvider.getInstance().getSettings(
            "pyfaMainWindowAttribs", mainFrameDefaultAttribs)

        wndDisplay = self.mainFrameAttribs["wnd_display"]
        displayData = self._getDisplayData()
        try:
            selectedDisplayData = displayData[wndDisplay]
        except IndexError:
            selectedDisplayData = displayData[0]
        dspX, dspY, dspW, dspH = selectedDisplayData

        if self.mainFrameAttribs["wnd_maximized"]:
            wndW = mainFrameDefaultAttribs["wnd_width"]
            wndH = mainFrameDefaultAttribs["wnd_height"]
            wndX = min(mainFrameDefaultAttribs["wnd_x"], dspW * 0.75)
            wndY = min(mainFrameDefaultAttribs["wnd_y"], dspH * 0.75)
            self.Maximize()
        else:
            wndW = self.mainFrameAttribs["wnd_width"]
            wndH = self.mainFrameAttribs["wnd_height"]
            wndX = min(self.mainFrameAttribs["wnd_x"], dspW * 0.75)
            wndY = min(self.mainFrameAttribs["wnd_y"], dspH * 0.75)

        self.SetPosition((dspX + wndX, dspY + wndY))
        self.SetSize((wndW, wndH))
        self.SetMinSize((mainFrameDefaultAttribs["wnd_width"], mainFrameDefaultAttribs["wnd_height"]))

        self.browserWidth = self.mainFrameAttribs["browser_width"]
        self.marketHeight = self.mainFrameAttribs["market_height"]
        self.fittingHeight = self.mainFrameAttribs["fitting_height"]
示例#13
0
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           id=wx.ID_ANY,
                           title="Select a format",
                           size=(-1, -1),
                           style=wx.DEFAULT_DIALOG_STYLE)
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.settings = SettingsProvider.getInstance().getSettings(
            "pyfaExport", {
                "format": 0,
                "options": 0
            })

        self.copyFormats = {
            "EFT": CopySelectDialog.copyFormatEft,
            "XML": CopySelectDialog.copyFormatXml,
            "DNA": CopySelectDialog.copyFormatDna,
            "ESI": CopySelectDialog.copyFormatEsi,
            "MultiBuy": CopySelectDialog.copyFormatMultiBuy,
            "EFS": CopySelectDialog.copyFormatEfs
        }

        self.options = {}

        for i, format in enumerate(self.copyFormats.keys()):
            if i == 0:
                rdo = wx.RadioButton(self,
                                     wx.ID_ANY,
                                     format,
                                     style=wx.RB_GROUP)
            else:
                rdo = wx.RadioButton(self, wx.ID_ANY, format)
            rdo.Bind(wx.EVT_RADIOBUTTON, self.Selected)
            if self.settings['format'] == self.copyFormats[format]:
                rdo.SetValue(True)
                self.copyFormat = self.copyFormats[format]
            mainSizer.Add(rdo, 0, wx.EXPAND | wx.ALL, 5)

            if format == "EFT":
                bsizer = wx.BoxSizer(wx.VERTICAL)

                for x, v in EFT_OPTIONS.items():
                    ch = wx.CheckBox(self, -1, v['name'])
                    self.options[x] = ch
                    if self.settings['options'] & x:
                        ch.SetValue(True)
                    bsizer.Add(ch, 1, wx.EXPAND | wx.TOP | wx.BOTTOM, 3)
                mainSizer.Add(bsizer, 1, wx.EXPAND | wx.LEFT, 20)

        buttonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        if buttonSizer:
            mainSizer.Add(buttonSizer, 0, wx.EXPAND | wx.ALL, 5)

        self.toggleOptions()
        self.SetSizer(mainSizer)
        self.Fit()
        self.Center()
示例#14
0
    def __init__(self):
        self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
        self.character = Character.getInstance().all5()
        self.dirtyFitIDs = set()

        serviceFittingDefaultOptions = {"useGlobalCharacter": False, "useGlobalDamagePattern": False, "defaultCharacter": self.character.ID, "useGlobalForceReload": False}

        self.serviceFittingOptions = SettingsProvider.getInstance().getSettings("pyfaServiceFittingOptions", serviceFittingDefaultOptions)
示例#15
0
    def __init__(self, parent):
        wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Select a format", size=(-1, -1),
                           style=wx.DEFAULT_DIALOG_STYLE)
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.settings = SettingsProvider.getInstance().getSettings("pyfaExport", {"format": 0, "options": 0})

        self.copyFormats = {
            "EFT": CopySelectDialog.copyFormatEft,
            "XML": CopySelectDialog.copyFormatXml,
            "DNA": CopySelectDialog.copyFormatDna,
            "ESI": CopySelectDialog.copyFormatEsi,
            "MultiBuy": CopySelectDialog.copyFormatMultiBuy,
            "EFS": CopySelectDialog.copyFormatEfs
        }

        self.options = {}

        for i, format in enumerate(self.copyFormats.keys()):
            if i == 0:
                rdo = wx.RadioButton(self, wx.ID_ANY, format, style=wx.RB_GROUP)
            else:
                rdo = wx.RadioButton(self, wx.ID_ANY, format)
            rdo.Bind(wx.EVT_RADIOBUTTON, self.Selected)
            if self.settings['format'] == self.copyFormats[format]:
                rdo.SetValue(True)
                self.copyFormat = self.copyFormats[format]
            mainSizer.Add(rdo, 0, wx.EXPAND | wx.ALL, 5)

            if format == "EFT":
                bsizer = wx.BoxSizer(wx.VERTICAL)

                for x, v in EFT_OPTIONS.items():
                    ch = wx.CheckBox(self, -1, v['name'])
                    self.options[x] = ch
                    if self.settings['options'] & x:
                        ch.SetValue(True)
                    bsizer.Add(ch, 1, wx.EXPAND | wx.TOP | wx.BOTTOM, 3)
                mainSizer.Add(bsizer, 1, wx.EXPAND | wx.LEFT, 20)

        buttonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        if buttonSizer:
            mainSizer.Add(buttonSizer, 0, wx.EXPAND | wx.ALL, 5)

        self.toggleOptions()
        self.SetSizer(mainSizer)
        self.Fit()
        self.Center()
示例#16
0
文件: setup.py 项目: m-sasha/PyfaAT
class StoredSetups:

    _settings = SettingsProvider.getInstance().getSettings("pyfaSetups", {
        "setups": []
    })

    @staticmethod
    def loadSetups() -> List[Setup]:
        setups = StoredSetups._settings["setups"]
        return setups

    @staticmethod
    def addSetup(setup: Setup) -> None:
        setups = StoredSetups.loadSetups()
        setups.append(setup)
        StoredSetups._settings["setups"] = setups
示例#17
0
文件: fit.py 项目: SpeakerJunk/Pyfa
    def __init__(self):
        self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
        self.character = Character.getInstance().all5()
        self.booster = False
        self.dirtyFitIDs = set()

        serviceFittingDefaultOptions = {
            "useGlobalCharacter": False,
            "useGlobalDamagePattern": False,
            "defaultCharacter": self.character.ID,
            "useGlobalForceReload": False,
            "colorFitBySlot": False,
            "rackSlots": True,
            "rackLabels": True,
            "compactSkills": True}

        self.serviceFittingOptions = SettingsProvider.getInstance().getSettings(
            "pyfaServiceFittingOptions", serviceFittingDefaultOptions)
示例#18
0
    def LoadMainFrameAttribs(self):
        mainFrameDefaultAttribs = {"wnd_width": 1000, "wnd_height": 700, "wnd_maximized": False, "browser_width": 300,
                                   "market_height": 0, "fitting_height": -200}
        self.mainFrameAttribs = SettingsProvider.getInstance().getSettings("pyfaMainWindowAttribs",
                                                                           mainFrameDefaultAttribs)

        if self.mainFrameAttribs["wnd_maximized"]:
            width = mainFrameDefaultAttribs["wnd_width"]
            height = mainFrameDefaultAttribs["wnd_height"]
            self.Maximize()
        else:
            width = self.mainFrameAttribs["wnd_width"]
            height = self.mainFrameAttribs["wnd_height"]

        self.SetSize((width, height))
        self.SetMinSize((mainFrameDefaultAttribs["wnd_width"], mainFrameDefaultAttribs["wnd_height"]))

        self.browserWidth = self.mainFrameAttribs["browser_width"]
        self.marketHeight = self.mainFrameAttribs["market_height"]
        self.fittingHeight = self.mainFrameAttribs["fitting_height"]
示例#19
0
    def __init__(self):
        self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
        self.character = Character.getInstance().all5()
        self.booster = False
        self.dirtyFitIDs = set()

        serviceFittingDefaultOptions = {
            "useGlobalCharacter": False,
            "useGlobalDamagePattern": False,
            "defaultCharacter": self.character.ID,
            "useGlobalForceReload": False,
            "colorFitBySlot": False,
            "rackSlots": True,
            "rackLabels": True,
            "compactSkills": True
        }

        self.serviceFittingOptions = SettingsProvider.getInstance(
        ).getSettings("pyfaServiceFittingOptions",
                      serviceFittingDefaultOptions)
示例#20
0
    def LoadPreviousOpenFits(self):
        sFit = Fit.getInstance()

        self.prevOpenFits = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
                                                                       {"enabled": False, "pyfaOpenFits": []})
        fits = self.prevOpenFits['pyfaOpenFits']

        # Remove any fits that cause exception when fetching (non-existent fits)
        for id in fits[:]:
            try:
                fit = sFit.getFit(id, basic=True)
                if fit is None:
                    fits.remove(id)
            except:
                fits.remove(id)

        if not self.prevOpenFits['enabled'] or len(fits) is 0:
            # add blank page if there are no fits to be loaded
            self.fitMultiSwitch.AddPage()
            return

        self.waitDialog = wx.BusyInfo("Loading previous fits...")
        OpenFitsThread(fits, self.closeWaitDialog)
示例#21
0
    def exportToClipboard(self, event):
        CopySelectDict = {CopySelectDialog.copyFormatEft: self.clipboardEft,
                          # CopySelectDialog.copyFormatEftImps: self.clipboardEftImps,
                          CopySelectDialog.copyFormatXml: self.clipboardXml,
                          CopySelectDialog.copyFormatDna: self.clipboardDna,
                          CopySelectDialog.copyFormatEsi: self.clipboardEsi,
                          CopySelectDialog.copyFormatMultiBuy: self.clipboardMultiBuy,
                          CopySelectDialog.copyFormatEfs: self.clipboardEfs}
        dlg = CopySelectDialog(self)
        dlg.ShowModal()
        selected = dlg.GetSelected()
        options = dlg.GetOptions()

        settings = SettingsProvider.getInstance().getSettings("pyfaExport")
        settings["format"] = selected
        settings["options"] = options

        CopySelectDict[selected](options)

        try:
            dlg.Destroy()
        except RuntimeError:
            pyfalog.error("Tried to destroy an object that doesn't exist in <exportToClipboard>.")
示例#22
0
    def LoadFrameAttribs(self):
        defaultAttribs = {
            "wnd_size": (1000, 700),
            "wnd_position": None,
            "wnd_maximized": False
        }
        self._frameAttribs = SettingsProvider.getInstance().getSettings(
            "pyfaSetupsWindowAttribs", defaultAttribs)

        isMaximized = self._frameAttribs["wnd_maximized"]
        if isMaximized:
            size = defaultAttribs["wnd_size"]
        else:
            size = self._frameAttribs["wnd_size"]

        self.SetSize(size)

        pos = self._frameAttribs["wnd_position"]
        if pos is not None:
            self.SetPosition(pos)

        if isMaximized:
            self.Maximize()
示例#23
0
    def Validate(self):
        # Since this dialog is shown through aa ShowModal(), we hook into the Validate function to veto the closing of the dialog until we're ready.
        # This always returns False, and when we're ready will EndModal()
        selected = self.GetSelected()
        options = self.GetOptions()

        settings = SettingsProvider.getInstance().getSettings("pyfaExport")
        settings["format"] = selected
        settings["options"] = options
        self.waitDialog = None

        def cb(text):
            if self.waitDialog:
                del self.waitDialog
            toClipboard(text)
            self.EndModal(wx.ID_OK)

        export_options = options.get(selected)
        if selected == CopySelectDialog.copyFormatMultiBuy and export_options.get(PortMultiBuyOptions.OPTIMIZE_PRICES, False):
            self.waitDialog = wx.BusyInfo("Optimizing Prices", parent=self)

        self.CopySelectDict[selected](export_options, callback=cb)

        return False
示例#24
0
    def __init__(self):
        self.priceCache = {}

        #Init recently used module storage
        serviceMarketRecentlyUsedModules = {
            "pyfaMarketRecentlyUsedModules": []
        }

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance(
        ).getSettings("pyfaMarketRecentlyUsedModules",
                      serviceMarketRecentlyUsedModules)

        # Start price fetcher
        self.priceWorkerThread = PriceWorkerThread()
        self.priceWorkerThread.daemon = True
        self.priceWorkerThread.start()

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = eos.types.Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Opux Luxury Yacht": self.
            les_grp,  # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate": self.les_grp,  # Amarr Championship prize
            "Gold Magnate": self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Guardian-Vexor": self.
            les_grp,  # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue":
            self.les_grp,  # Reward during Crielere event
            "Raven State Issue": self.les_grp,  # AT4 prize
            "Tempest Tribal Issue": self.les_grp,  # AT4 prize
            "Apotheosis": self.les_grp,  # 5th EVE anniversary present
            "Zephyr": self.les_grp,  # 2010 new year gift
            "Primae": self.les_grp,  # Promotion of planetary interaction
            "Freki": self.les_grp,  # AT7 prize
            "Mimir": self.les_grp,  # AT7 prize
            "Utu": self.les_grp,  # AT8 prize
            "Adrestia": self.les_grp,  # AT8 prize
            "Echelon": self.les_grp,  # 2011 new year gift
            "Malice": self.les_grp,  # AT9 prize
            "Vangel": self.les_grp,  # AT9 prize
            "Cambion": self.les_grp,  # AT10 prize
            "Etana": self.les_grp,  # AT10 prize
            "Chremoas": self.les_grp,  # AT11 prize :(
            "Moracha": self.les_grp,  # AT11 prize
            "Stratios Emergency Responder":
            self.les_grp,  # Issued for Somer Blink lottery
            "Scorpion Ishukone Watch": self.
            les_grp,  # Prize for offline events - fanfest PVP and poker tourneys
            "Miasmos Quafe Ultra Edition":
            self.les_grp,  # Gift to people who purchased FF HD stream
            "Interbus Shuttle": self.les_grp,
            "Leopard": self.les_grp,  # 2013 new year gift
            "Whiptail": self.les_grp,  # AT12 prize
            "Chameleon": self.les_grp
        }  # AT12 prize

        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        self.les_grp.addItems = list(
            self.getItem(itmn)
            for itmn in self.ITEMS_FORCEGROUP_R[self.les_grp])
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Data Subverter I":
            False,  # Not used in EVE, probably will appear with Dust link
            "QA Cross Protocol Analyzer":
            False,  # QA modules used by CCP internally
            "QA Damage Module": False,
            "QA ECCM": False,
            "QA Immunity Module": False,
            "QA Multiship Module - 10 Players": False,
            "QA Multiship Module - 20 Players": False,
            "QA Multiship Module - 40 Players": False,
            "QA Multiship Module - 5 Players": False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players": False,
            "Goru's Shuttle": False,
            "Guristas Shuttle": False,
            "Mobile Decoy Unit":
            False,  # Seems to be left over test mod for deployables
            "Tournament Micro Jump Unit":
            False,  # Normally seen only on tournament arenas
            u"\u4e07\u738b\u5b9d\u5ea7\u7ea7YC117\u5e74\u7279\u522b\u7248":
            False,  # Proteus added shitton of chinese-specific ships
            u"\u4e4c\u9e26\u7ea7YC117\u5e74\u7279\u522b\u7248": False,
            u"\u54cd\u5c3e\u86c7\u7ea7YC117\u5e74\u7279\u522b\u7248": False,
            u"\u5730\u72f1\u5929\u4f7f\u7ea7YC117\u5e74\u7279\u522b\u7248":
            False,
            u"\u591a\u7c73\u5c3c\u514b\u65af\u7ea7YC117\u5e74\u7279\u522b\u7248":
            False,
            u"\u672b\u65e5\u6c99\u573a\u7ea7YC117\u5e74\u7279\u522b\u7248":
            False,
            u"\u707e\u96be\u7ea7YC117\u5e74\u7279\u522b\u7248": False,
            u"\u9a6c\u514b\u745e\u7ea7YC117\u5e74\u7279\u522b\u7248": False,
            u"\u5e7c\u9f99\u7ea7YC117\u5e74\u7279\u522b\u7248": False,
            u"\u6bd2\u8725\u7ea7YC117\u5e74\u7279\u522b\u7248": False,
            u"\u4f0a\u4ec0\u5854\u7ea7YC117\u5e74\u7279\u522b\u7248": False,
            u"\u94f6\u9e70\u7ea7YC117\u5e74\u7279\u522b\u7248": False,
        }

        # do not publish ships that we convert
        for name in conversions.packs['skinnedShips']:
            self.ITEMS_FORCEPUBLISHED[name] = False

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False
        }  # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I": ("Storyline", "Miner I"),
            "'Wild' Miner I": ("Storyline", "Miner I"),
            "Medium Nano Armor Repair Unit I":
            ("Tech I", "Medium Armor Repairer I"),
            "Large 'Reprieve' Vestment Reconstructer I":
            ("Storyline", "Large Armor Repairer I"),
            "Khanid Navy Torpedo Launcher": ("Faction", "Torpedo Launcher I"),
            "Shadow Serpentis Remote Sensor Dampener":
            ("Faction", "Remote Sensor Dampener I")
        }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in self.ITEMS_FORCEDMETAGROUP.items():
            parent = value[1]
            if not parent in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "'Alpha' Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Codex' Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Daemon' Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Libram' Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Advanced Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Civilian Damage Control":
            760,  # Ship Equipment > Civilian Modules
            "Civilian EM Ward Field": 760,  # Ship Equipment > Civilian Modules
            "Civilian Explosive Deflection Field":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Hobgoblin":
            837,  # Drones > Combat Drones > Light Scout Drones
            "Civilian Kinetic Deflection Field":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Light Missile Launcher":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Scourge Light Missile":
            920,  # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Small Remote Armor Repairer":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Small Remote Shield Booster":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Stasis Webifier":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Thermic Dissipation Field":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Warp Disruptor":
            760,  # Ship Equipment > Civilian Modules
            "Hardwiring - Zainou 'Sharpshooter' ZMX10":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX11":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX110":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Nugoehuvi Synth Blue Pill Booster":
            977,  # Implants & Boosters > Booster
            "Prototype Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Prototype Iris Probe Launcher":
            712,  # Ship Equipment > Turrets & Bays > Scan Probe Launchers
            "Shadow": 1310,  # Drones > Combat Drones > Fighter Bombers
            "Sleeper Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Standard Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Talocan Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Terran Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Tetrimon Data Analyzer I": 714
        }  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(
            self.ITEMS_FORCEDMARKETGROUP)

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("normal", frozenset((0, 1, 2, 14))),
                                     ("faction", frozenset((4, 3))),
                                     ("complex", frozenset((6, ))),
                                     ("officer", frozenset((5, )))])
        self.SEARCH_CATEGORIES = ("Drone", "Module", "Subsystem", "Charge",
                                  "Implant", "Deployable")
        self.ROOT_MARKET_GROUPS = (
            9,  # Modules
            1111,  # Rigs
            157,  # Drones
            11,  # Ammo
            1112,  # Subsystems
            24,  # Implants & Boosters
            404)  # Deployables
        # Tell other threads that Market is at their service
        mktRdy.set()
示例#25
0
    def populatePanel(self, panel):
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.dirtySettings = False
        self.openFitsSettings = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
                                                                           {"enabled": False, "pyfaOpenFits": []})

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        mainSizer.Add(self.stTitle, 0, wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, u"Use global character", wx.DefaultPosition, wx.DefaultSize,
                                        0)
        mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, u"Use global damage pattern", wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalForceReload = wx.CheckBox(panel, wx.ID_ANY, u"Factor in reload time", wx.DefaultPosition,
                                               wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalForceReload, 0, wx.ALL | wx.EXPAND, 5)

        self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, u"Compact skills needed tooltip", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)

        self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, u"Color fitting view by slot", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, u"Reopen previous fits on startup", wx.DefaultPosition,
                                        wx.DefaultSize, 0)
        mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)

        self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, u"Separate Racks", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)

        labelSizer = wx.BoxSizer(wx.VERTICAL)
        self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, u"Show Rack Labels", wx.DefaultPosition, wx.DefaultSize, 0)
        labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)

        self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, u"Show tab tooltips", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY, u"Show market shortcuts", wx.DefaultPosition,
                                             wx.DefaultSize, 0)
        mainSizer.Add(self.cbMarketShortcuts, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, u"Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)

        self.cbExportCharges = wx.CheckBox(panel, wx.ID_ANY, u"Export loaded charges", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbExportCharges, 0, wx.ALL | wx.EXPAND, 5)

        self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, u"Open fittings in a new page by default",
                                          wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)

        wx.BoxSizer(wx.HORIZONTAL)

        self.sFit = Fit.getInstance()

        self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"])
        self.cbGlobalDmgPattern.SetValue(self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
        self.cbGlobalForceReload.SetValue(self.sFit.serviceFittingOptions["useGlobalForceReload"])
        self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
        self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"] or False)
        self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False)
        self.cbCompactSkills.SetValue(self.sFit.serviceFittingOptions["compactSkills"] or False)
        self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
        self.cbShowTooltip.SetValue(self.sFit.serviceFittingOptions["showTooltip"] or False)
        self.cbMarketShortcuts.SetValue(self.sFit.serviceFittingOptions["showMarketShortcuts"] or False)
        self.cbGaugeAnimation.SetValue(self.sFit.serviceFittingOptions["enableGaugeAnimation"])
        self.cbExportCharges.SetValue(self.sFit.serviceFittingOptions["exportCharges"])
        self.cbOpenFitInNew.SetValue(self.sFit.serviceFittingOptions["openFitInNew"])

        self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
        self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange)
        self.cbGlobalForceReload.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalForceReloadStateChange)
        self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
        self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
        self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
        self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
        self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
        self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
        self.cbMarketShortcuts.Bind(wx.EVT_CHECKBOX, self.onCBShowShortcuts)
        self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.onCBGaugeAnimation)
        self.cbExportCharges.Bind(wx.EVT_CHECKBOX, self.onCBExportCharges)
        self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)

        self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"] or False)

        panel.SetSizer(mainSizer)
        panel.Layout()
示例#26
0
    def populatePanel(self, panel):
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.dirtySettings = False
        self.openFitsSettings = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
                                                                           {"enabled": False, "pyfaOpenFits": []})

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        mainSizer.Add(self.stTitle, 0, wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, "Use global character", wx.DefaultPosition, wx.DefaultSize,
                                        0)
        mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)

        self.cbDefaultCharImplants = wx.CheckBox(panel, wx.ID_ANY, "Use character implants by default for new fits",
                                                 wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbDefaultCharImplants, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, "Use global damage pattern", wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)

        self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, "Compact skills needed tooltip", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)

        self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, "Color fitting view by slot", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, "Reopen previous fits on startup", wx.DefaultPosition,
                                        wx.DefaultSize, 0)
        mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)

        self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, "Separate Racks", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)

        labelSizer = wx.BoxSizer(wx.VERTICAL)
        self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, "Show Rack Labels", wx.DefaultPosition, wx.DefaultSize, 0)
        labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)

        self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show fitting tab tooltips", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, "Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)

        self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, "Open fittings in a new page by default",
                                          wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)

        self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show ship browser tooltip",
                                          wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.sFit = Fit.getInstance()

        self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"])
        self.cbDefaultCharImplants.SetValue(self.sFit.serviceFittingOptions["useCharacterImplantsByDefault"])
        self.cbGlobalDmgPattern.SetValue(self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
        self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
        self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"] or False)
        self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False)
        self.cbCompactSkills.SetValue(self.sFit.serviceFittingOptions["compactSkills"] or False)
        self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
        self.cbShowTooltip.SetValue(self.sFit.serviceFittingOptions["showTooltip"] or False)
        self.cbGaugeAnimation.SetValue(self.sFit.serviceFittingOptions["enableGaugeAnimation"])
        self.cbOpenFitInNew.SetValue(self.sFit.serviceFittingOptions["openFitInNew"])
        self.cbShowShipBrowserTooltip.SetValue(self.sFit.serviceFittingOptions["showShipBrowserTooltip"])

        self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
        self.cbDefaultCharImplants.Bind(wx.EVT_CHECKBOX, self.OnCBDefaultCharImplantsStateChange)
        self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange)
        self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
        self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
        self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
        self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
        self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
        self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
        self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.onCBGaugeAnimation)
        self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)
        self.cbShowShipBrowserTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowShipBrowserTooltip)

        self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"] or False)

        panel.SetSizer(mainSizer)
        panel.Layout()
示例#27
0
    def populatePanel(self, panel):
        self.title = _t("General")
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.dirtySettings = False
        self.openFitsSettings = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
                                                                           {"enabled": False, "pyfaOpenFits": []})
        self.localeSettings = LocaleSettings.getInstance()
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
        mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)

        helpCursor = wx.Cursor(wx.CURSOR_QUESTION_ARROW)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        langBox = wx.StaticBoxSizer(wx.VERTICAL, panel, _t("Language (requires restart)"))
        mainSizer.Add(langBox, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.BOTTOM, 10)

        langSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.langChoices = sorted([langInfo for lang, langInfo in LocaleSettings.supported_langauges().items()], key=lambda x: x.Description)
        pyfaLangsEnabled = bool(self.langChoices)

        if pyfaLangsEnabled:
            self.stLangLabel = wx.StaticText(panel, wx.ID_ANY, _t("pyfa:"), wx.DefaultPosition, wx.DefaultSize, 0)
            self.stLangLabel.Wrap(-1)
            langSizer.Add(self.stLangLabel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

            def langDisplay(langInfo):
                progress = self.localeSettings.get_progress(langInfo.CanonicalName)
                progress_display = (" ({}%)".format(progress['translated_progress']) if progress is not None else "")
                return langInfo.Description + progress_display

            self.chLang = wx.Choice(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, [langDisplay(x) for x in self.langChoices], 0)
            self.chLang.Bind(wx.EVT_CHOICE, self.onLangSelection)

            selectedIndex = self.langChoices.index(next((x for x in self.langChoices if x.CanonicalName == self.localeSettings.get('locale')), None))
            self.chLang.SetSelection(selectedIndex)

            langSizer.Add(self.chLang, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
            langBox.Add(langSizer)
            langBox.Add(hl.HyperLinkCtrl(panel, -1,
                                         _t("Interested in helping with translations?"),
                                         URL="https://github.com/pyfa-org/Pyfa/blob/master/locale/README.md"
                                         ), 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 15)
        else:
            self.stLangLabel = wx.StaticText(panel, wx.ID_ANY, _t("Pyfa language selection disabled. Please check if .mo files have been generated.\nRefer to locale/README.md for info."), wx.DefaultPosition, wx.DefaultSize, 0)
            self.stLangLabel.Wrap(-1)
            langSizer.Add(self.stLangLabel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
            langBox.Add(langSizer)

        eosLangSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.stEosLangLabel = wx.StaticText(panel, wx.ID_ANY, _t("EVE Data:"), wx.DefaultPosition, wx.DefaultSize, 0)
        self.stEosLangLabel.Wrap(-1)
        eosLangSizer.Add(self.stEosLangLabel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.eosLangChoices = [(LocaleSettings.defaults['eos_locale'], LocaleSettings.defaults['eos_locale'])] + \
                              sorted([(wx.Locale.FindLanguageInfo(x).Description, x) for x in eos.config.translation_mapping.keys()], key=lambda x: x[0])

        self.chEosLang = wx.Choice(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, [x[0] for x in self.eosLangChoices], 0)
        self.chEosLang.Bind(wx.EVT_CHOICE, self.onEosLangSelection)

        selectedIndex = self.eosLangChoices.index(
            next((x for x in self.eosLangChoices if x[1] == self.localeSettings.get('eos_locale')), None))
        self.chEosLang.SetSelection(selectedIndex)

        eosLangSizer.Add(self.chEosLang, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        langBox.Add(eosLangSizer)
        langBox.Add(wx.StaticText(panel, wx.ID_ANY,
                                  _t("Auto will use the same language pyfa uses if available, otherwise English"),
                                  wx.DefaultPosition,
                                  wx.DefaultSize, 0), 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 15)

        self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, _t("Use global character"), wx.DefaultPosition, wx.DefaultSize,
                                        0)
        mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)

        self.cbDefaultCharImplants = wx.CheckBox(panel, wx.ID_ANY, _t("Use character implants by default for new fits"),
                                                 wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbDefaultCharImplants, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, _t("Use global damage pattern"), wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)

        self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, _t("Compact skills needed tooltip"), wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)

        self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, _t("Color fitting view by slot"), wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, _t("Reopen previous fits on startup"), wx.DefaultPosition,
                                        wx.DefaultSize, 0)
        mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)

        self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, _t("Separate Racks"), wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)

        labelSizer = wx.BoxSizer(wx.VERTICAL)
        self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, _t("Show Rack Labels"), wx.DefaultPosition, wx.DefaultSize, 0)
        labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)

        self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, _t("Show fitting tab tooltips"), wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, _t("Animate gauges"), wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)

        self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, _t("Open fittings in a new page by default"),
                                          wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)

        self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, _t("Show ship browser tooltip"),
                                                    wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReloadAll = wx.CheckBox(panel, wx.ID_ANY, _t("Change charge in all modules of the same type"),
                                       wx.DefaultPosition, wx.DefaultSize, 0)
        if "wxGTK" not in wx.PlatformInfo:
            self.cbReloadAll.SetCursor(helpCursor)
        self.cbReloadAll.SetToolTip(wx.ToolTip(
                _t('When disabled, reloads charges just in selected modules. Action can be reversed by holding Ctrl or Alt key while changing charge.')))
        mainSizer.Add(self.cbReloadAll, 0, wx.ALL | wx.EXPAND, 5)

        self.rbAddLabels = wx.RadioBox(panel, -1, _t("Extra info in Additions panel tab names"), wx.DefaultPosition, wx.DefaultSize,
                                       [_t("None"), _t("Quantity of active items"), _t("Quantity of all items")], 1, wx.RA_SPECIFY_COLS)
        mainSizer.Add(self.rbAddLabels, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.BOTTOM, 10)
        self.rbAddLabels.Bind(wx.EVT_RADIOBOX, self.OnAddLabelsChange)

        self.sFit = Fit.getInstance()

        self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"])
        self.cbDefaultCharImplants.SetValue(self.sFit.serviceFittingOptions["useCharacterImplantsByDefault"])
        self.cbGlobalDmgPattern.SetValue(self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
        self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
        self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"] or False)
        self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False)
        self.cbCompactSkills.SetValue(self.sFit.serviceFittingOptions["compactSkills"] or False)
        self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
        self.cbShowTooltip.SetValue(self.sFit.serviceFittingOptions["showTooltip"] or False)
        self.cbGaugeAnimation.SetValue(self.sFit.serviceFittingOptions["enableGaugeAnimation"])
        self.cbOpenFitInNew.SetValue(self.sFit.serviceFittingOptions["openFitInNew"])
        self.cbShowShipBrowserTooltip.SetValue(self.sFit.serviceFittingOptions["showShipBrowserTooltip"])
        self.cbReloadAll.SetValue(self.sFit.serviceFittingOptions["ammoChangeAll"])
        self.rbAddLabels.SetSelection(self.sFit.serviceFittingOptions["additionsLabels"])

        self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
        self.cbDefaultCharImplants.Bind(wx.EVT_CHECKBOX, self.OnCBDefaultCharImplantsStateChange)
        self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange)
        self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
        self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
        self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
        self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
        self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
        self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
        self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.onCBGaugeAnimation)
        self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)
        self.cbShowShipBrowserTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowShipBrowserTooltip)
        self.cbReloadAll.Bind(wx.EVT_CHECKBOX, self.onCBReloadAll)

        self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"] or False)

        panel.SetSizer(mainSizer)
        panel.Layout()
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           id=wx.ID_ANY,
                           title="Select a format",
                           size=(-1, -1),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.CopySelectDict = {
            CopySelectDialog.copyFormatEft: self.exportEft,
            CopySelectDialog.copyFormatXml: self.exportXml,
            CopySelectDialog.copyFormatDna: self.exportDna,
            CopySelectDialog.copyFormatEsi: self.exportEsi,
            CopySelectDialog.copyFormatMultiBuy: self.exportMultiBuy,
            CopySelectDialog.copyFormatEfs: self.exportEfs
        }

        self.mainFrame = parent
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.copyFormats = OrderedDict((
            ("EFT", (CopySelectDialog.copyFormatEft, EFT_OPTIONS)),
            ("MultiBuy", (CopySelectDialog.copyFormatMultiBuy,
                          MULTIBUY_OPTIONS)),
            ("ESI", (CopySelectDialog.copyFormatEsi, None)),
            ("EFS", (CopySelectDialog.copyFormatEfs, None)),
            # ("XML", (CopySelectDialog.copyFormatXml, None)),
            # ("DNA", (CopySelectDialog.copyFormatDna, None)),
        ))

        defaultFormatOptions = {}
        for formatId, formatOptions in self.copyFormats.values():
            if formatOptions is None:
                continue
            defaultFormatOptions[formatId] = {
                opt[0]: opt[3]
                for opt in formatOptions
            }

        self.settings = SettingsProvider.getInstance().getSettings(
            "pyfaExport", {
                "format": 0,
                "options": defaultFormatOptions
            })
        # Options used to be stored as int (EFT export options only),
        # overwrite them with new format when needed
        if isinstance(self.settings["options"], int):
            self.settings["options"] = defaultFormatOptions

        self.options = {}

        initialized = False
        for formatName, formatData in self.copyFormats.items():
            formatId, formatOptions = formatData
            if not initialized:
                rdo = wx.RadioButton(self,
                                     wx.ID_ANY,
                                     formatName,
                                     style=wx.RB_GROUP)
                initialized = True
            else:
                rdo = wx.RadioButton(self, wx.ID_ANY, formatName)
            rdo.Bind(wx.EVT_RADIOBUTTON, self.Selected)
            if self.settings['format'] == formatId:
                rdo.SetValue(True)
                self.copyFormat = formatId
            mainSizer.Add(rdo, 0, wx.EXPAND | wx.ALL, 5)

            if formatOptions:
                bsizer = wx.BoxSizer(wx.VERTICAL)
                self.options[formatId] = {}

                for optId, optName, optDesc, _ in formatOptions:
                    checkbox = wx.CheckBox(self, -1, optName)
                    self.options[formatId][optId] = checkbox
                    if self.settings['options'].get(formatId, {}).get(
                            optId,
                            defaultFormatOptions.get(formatId, {}).get(optId)):
                        checkbox.SetValue(True)
                    bsizer.Add(checkbox, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 3)
                mainSizer.Add(bsizer, 0, wx.EXPAND | wx.LEFT, 20)

        buttonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        if buttonSizer:
            mainSizer.Add(buttonSizer, 0, wx.EXPAND | wx.ALL, 5)

        self.toggleOptions()
        self.SetSizer(mainSizer)
        self.Fit()
        self.Center()
示例#29
0
文件: market.py 项目: potatoi/Pyfa
    def __init__(self):

        # Init recently used module storage
        serviceMarketRecentlyUsedModules = {
            "pyfaMarketRecentlyUsedModules": []
        }

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance(
        ).getSettings("pyfaMarketRecentlyUsedModules",
                      serviceMarketRecentlyUsedModules)

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = types_Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Opux Luxury Yacht": self.les_grp,
            # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate": self.les_grp,  # Amarr Championship prize
            "Gold Magnate": self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Guardian-Vexor": self.
            les_grp,  # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue":
            self.les_grp,  # Reward during Crielere event
            "Raven State Issue": self.les_grp,  # AT4 prize
            "Tempest Tribal Issue": self.les_grp,  # AT4 prize
            "Apotheosis": self.les_grp,  # 5th EVE anniversary present
            "Zephyr": self.les_grp,  # 2010 new year gift
            "Primae": self.les_grp,  # Promotion of planetary interaction
            "Council Diplomatic Shuttle": self.les_grp,  # CSM X celebration
            "Freki": self.les_grp,  # AT7 prize
            "Mimir": self.les_grp,  # AT7 prize
            "Utu": self.les_grp,  # AT8 prize
            "Adrestia": self.les_grp,  # AT8 prize
            "Echelon": self.les_grp,  # 2011 new year gift
            "Malice": self.les_grp,  # AT9 prize
            "Vangel": self.les_grp,  # AT9 prize
            "Cambion": self.les_grp,  # AT10 prize
            "Etana": self.les_grp,  # AT10 prize
            "Chremoas": self.les_grp,  # AT11 prize :(
            "Moracha": self.les_grp,  # AT11 prize
            "Stratios Emergency Responder":
            self.les_grp,  # Issued for Somer Blink lottery
            "Miasmos Quafe Ultra Edition":
            self.les_grp,  # Gift to people who purchased FF HD stream
            "InterBus Shuttle": self.les_grp,
            "Leopard": self.les_grp,  # 2013 new year gift
            "Whiptail": self.les_grp,  # AT12 prize
            "Chameleon": self.les_grp,  # AT12 prize
            "Victorieux Luxury Yacht":
            self.les_grp,  # Worlds Collide prize \o/ chinese getting owned
            "Imp": self.les_grp,  # AT13 prize
            "Fiend": self.les_grp,  # AT13 prize
            "Caedes": self.les_grp,  # AT14 prize
            "Rabisu": self.les_grp,  # AT14 prize
        }

        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        self.les_grp.addItems = list(
            self.getItem(itmn)
            for itmn in self.ITEMS_FORCEGROUP_R[self.les_grp])
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Data Subverter I":
            False,  # Not used in EVE, probably will appear with Dust link
            "QA Cross Protocol Analyzer":
            False,  # QA modules used by CCP internally
            "QA Damage Module": False,
            "QA ECCM": False,
            "QA Immunity Module": False,
            "QA Multiship Module - 10 Players": False,
            "QA Multiship Module - 20 Players": False,
            "QA Multiship Module - 40 Players": False,
            "QA Multiship Module - 5 Players": False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players": False,
            "Goru's Shuttle": False,
            "Guristas Shuttle": False,
            "Mobile Decoy Unit":
            False,  # Seems to be left over test mod for deployables
            "Tournament Micro Jump Unit":
            False,  # Normally seen only on tournament arenas
            "Civilian Gatling Railgun": True,
            "Civilian Gatling Pulse Laser": True,
            "Civilian Gatling Autocannon": True,
            "Civilian Light Electron Blaster": True,
        }

        # do not publish ships that we convert
        for name in conversions.packs['skinnedShips']:
            self.ITEMS_FORCEPUBLISHED[name] = False

        if config.debug:
            # Publish Tactical Dessy Modes if in debug
            # Cannot use GROUPS_FORCEPUBLISHED as this does not force items
            # within group to be published, but rather for the group itself
            # to show up on ship list
            group = self.getGroup("Ship Modifiers", eager="items")
            for item in group.items:
                self.ITEMS_FORCEPUBLISHED[item.name] = True

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False
        }  # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I": ("Storyline", "Miner I"),
            "'Wild' Miner I": ("Storyline", "Miner I"),
            "Medium Nano Armor Repair Unit I":
            ("Tech I", "Medium Armor Repairer I"),
            "Large 'Reprieve' Vestment Reconstructer I":
            ("Storyline", "Large Armor Repairer I"),
            "Khanid Navy Torpedo Launcher": ("Faction", "Torpedo Launcher I"),
        }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in self.ITEMS_FORCEDMETAGROUP.items():
            parent = value[1]
            if parent not in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "'Alpha' Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Codex' Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Daemon' Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Libram' Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Advanced Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Civilian Damage Control":
            615,  # Ship Equipment > Hull & Armor > Damage Controls
            "Civilian EM Ward Field": 1695,
            # Ship Equipment > Shield > Shield Hardeners > EM Shield Hardeners
            "Civilian Explosive Deflection Field": 1694,
            # Ship Equipment > Shield > Shield Hardeners > Explosive Shield Hardeners
            "Civilian Hobgoblin":
            837,  # Drones > Combat Drones > Light Scout Drones
            "Civilian Kinetic Deflection Field": 1693,
            # Ship Equipment > Shield > Shield Hardeners > Kinetic Shield Hardeners
            "Civilian Light Missile Launcher": 640,
            # Ship Equipment > Turrets & Bays > Missile Launchers > Light Missile Launchers
            "Civilian Scourge Light Missile": 920,
            # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Small Remote Armor Repairer": 1059,
            # Ship Equipment > Hull & Armor > Remote Armor Repairers > Small
            "Civilian Small Remote Shield Booster":
            603,  # Ship Equipment > Shield > Remote Shield Boosters > Small
            "Civilian Stasis Webifier":
            683,  # Ship Equipment > Electronic Warfare > Stasis Webifiers
            "Civilian Thermic Dissipation Field": 1692,
            # Ship Equipment > Shield > Shield Hardeners > Thermal Shield Hardeners
            "Civilian Warp Disruptor":
            1935,  # Ship Equipment > Electronic Warfare > Warp Disruptors
            "Hardwiring - Zainou 'Sharpshooter' ZMX10": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX100": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX11": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX110": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Nugoehuvi Synth Blue Pill Booster":
            977,  # Implants & Boosters > Booster
            "Prototype Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Prototype Iris Probe Launcher":
            712,  # Ship Equipment > Turrets & Bays > Scan Probe Launchers
            "Shadow": 1310,  # Drones > Combat Drones > Fighter Bombers
            "Sleeper Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Standard Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Talocan Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Terran Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Tetrimon Data Analyzer I": 714
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
        }

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(
            self.ITEMS_FORCEDMARKETGROUP)

        self.FORCEDMARKETGROUP = {
            685: False,  # Ship Equipment > Electronic Warfare > ECCM
            681:
            False,  # Ship Equipment > Electronic Warfare > Sensor Backup Arrays
        }

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("normal", frozenset((0, 1, 2, 14))),
                                     ("faction", frozenset((4, 3))),
                                     ("complex", frozenset((6, ))),
                                     ("officer", frozenset((5, )))])
        self.SEARCH_CATEGORIES = (
            "Drone",
            "Module",
            "Subsystem",
            "Charge",
            "Implant",
            "Deployable",
            "Fighter",
            "Structure",
            "Structure Module",
        )
        self.SEARCH_GROUPS = ("Ice Product", )
        self.ROOT_MARKET_GROUPS = (
            9,  # Modules
            1111,  # Rigs
            157,  # Drones
            11,  # Ammo
            1112,  # Subsystems
            24,  # Implants & Boosters
            404,  # Deployables
            2202,  # Structure Equipment
            2203  # Structure Modifications
        )
        # Tell other threads that Market is at their service
        mktRdy.set()
示例#30
0
    def populatePanel(self, panel):
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.dirtySettings = False
        self.openFitsSettings = SettingsProvider.getInstance().getSettings(
            "pyfaPrevOpenFits", {
                "enabled": False,
                "pyfaOpenFits": []
            })

        helpCursor = wx.StockCursor(wx.CURSOR_QUESTION_ARROW)

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title,
                                     wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        mainSizer.Add(self.stTitle, 0, wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY,
                                           wx.DefaultPosition, wx.DefaultSize,
                                           wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY,
                                        u"Use global character",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY,
                                              u"Use global damage pattern",
                                              wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)

        self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY,
                                           u"Compact skills needed tooltip",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)

        self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY,
                                           u"Color fitting view by slot",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY,
                                        u"Reopen previous fits on startup",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)

        self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, u"Separate Racks",
                                       wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)

        labelSizer = wx.BoxSizer(wx.VERTICAL)
        self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, u"Show Rack Labels",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)

        self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY,
                                         u"Show tab tooltips",
                                         wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY,
                                             u"Show market shortcuts",
                                             wx.DefaultPosition,
                                             wx.DefaultSize, 0)
        mainSizer.Add(self.cbMarketShortcuts, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY,
                                            u"Animate gauges",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)

        self.cbExportCharges = wx.CheckBox(panel, wx.ID_ANY,
                                           u"Export loaded charges",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbExportCharges, 0, wx.ALL | wx.EXPAND, 5)

        self.cbOpenFitInNew = wx.CheckBox(
            panel, wx.ID_ANY, u"Open fittings in a new page by default",
            wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)

        self.cbShowShipBrowserTooltip = wx.CheckBox(
            panel, wx.ID_ANY, u"Show ship browser tooltip", wx.DefaultPosition,
            wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)

        priceSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY,
                                             u"Default Market Prices:",
                                             wx.DefaultPosition,
                                             wx.DefaultSize, 0)
        self.stDefaultSystem.Wrap(-1)
        priceSizer.Add(self.stDefaultSystem, 0,
                       wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.chPriceSource = wx.Choice(panel,
                                       choices=sorted(Price.sources.keys()))
        self.chPriceSystem = wx.Choice(panel, choices=Price.systemsList.keys())
        priceSizer.Add(self.chPriceSource, 1, wx.ALL | wx.EXPAND, 5)
        priceSizer.Add(self.chPriceSystem, 1, wx.ALL | wx.EXPAND, 5)

        mainSizer.Add(priceSizer, 0, wx.ALL | wx.EXPAND, 0)

        delayTimer = wx.BoxSizer(wx.HORIZONTAL)

        self.stMarketDelay = wx.StaticText(panel, wx.ID_ANY,
                                           u"Market Search Delay (ms):",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.stMarketDelay.Wrap(-1)
        self.stMarketDelay.SetCursor(helpCursor)
        self.stMarketDelay.SetToolTip(
            wx.ToolTip(
                'The delay between a keystroke and the market search. Can help reduce lag when typing fast in the market search box.'
            ))

        delayTimer.Add(self.stMarketDelay, 0,
                       wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.intDelay = IntCtrl(panel, max=1000, limited=True)
        delayTimer.Add(self.intDelay, 0, wx.ALL, 5)

        mainSizer.Add(delayTimer, 0, wx.ALL | wx.EXPAND, 0)

        self.sFit = Fit.getInstance()

        self.cbGlobalChar.SetValue(
            self.sFit.serviceFittingOptions["useGlobalCharacter"])
        self.cbGlobalDmgPattern.SetValue(
            self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
        self.cbFitColorSlots.SetValue(
            self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
        self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"]
                                  or False)
        self.cbRackLabels.SetValue(
            self.sFit.serviceFittingOptions["rackLabels"] or False)
        self.cbCompactSkills.SetValue(
            self.sFit.serviceFittingOptions["compactSkills"] or False)
        self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
        self.cbShowTooltip.SetValue(
            self.sFit.serviceFittingOptions["showTooltip"] or False)
        self.cbMarketShortcuts.SetValue(
            self.sFit.serviceFittingOptions["showMarketShortcuts"] or False)
        self.cbGaugeAnimation.SetValue(
            self.sFit.serviceFittingOptions["enableGaugeAnimation"])
        self.cbExportCharges.SetValue(
            self.sFit.serviceFittingOptions["exportCharges"])
        self.cbOpenFitInNew.SetValue(
            self.sFit.serviceFittingOptions["openFitInNew"])
        self.chPriceSource.SetStringSelection(
            self.sFit.serviceFittingOptions["priceSource"])
        self.chPriceSystem.SetStringSelection(
            self.sFit.serviceFittingOptions["priceSystem"])
        self.cbShowShipBrowserTooltip.SetValue(
            self.sFit.serviceFittingOptions["showShipBrowserTooltip"])
        self.intDelay.SetValue(
            self.sFit.serviceFittingOptions["marketSearchDelay"])

        self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
        self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX,
                                     self.OnCBGlobalDmgPatternStateChange)
        self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
        self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
        self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
        self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
        self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
        self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
        self.cbMarketShortcuts.Bind(wx.EVT_CHECKBOX, self.onCBShowShortcuts)
        self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.onCBGaugeAnimation)
        self.cbExportCharges.Bind(wx.EVT_CHECKBOX, self.onCBExportCharges)
        self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)
        self.chPriceSource.Bind(wx.EVT_CHOICE, self.onPricesSourceSelection)
        self.chPriceSystem.Bind(wx.EVT_CHOICE, self.onPriceSelection)
        self.cbShowShipBrowserTooltip.Bind(wx.EVT_CHECKBOX,
                                           self.onCBShowShipBrowserTooltip)
        self.intDelay.Bind(wx.lib.intctrl.EVT_INT, self.onMarketDelayChange)

        self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"]
                                 or False)

        panel.SetSizer(mainSizer)
        panel.Layout()
示例#31
0
    def __init__(self):
        self.priceCache = {}

        #Init recently used module storage
        serviceMarketRecentlyUsedModules = {
            "pyfaMarketRecentlyUsedModules": []
        }

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance(
        ).getSettings("pyfaMarketRecentlyUsedModules",
                      serviceMarketRecentlyUsedModules)

        # Start price fetcher
        self.priceWorkerThread = PriceWorkerThread()
        self.priceWorkerThread.daemon = True
        self.priceWorkerThread.start()

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = eos.types.Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Opux Luxury Yacht": self.
            les_grp,  # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate": self.les_grp,  # Amarr Championship prize
            "Gold Magnate": self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Guardian-Vexor": self.
            les_grp,  # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue":
            self.les_grp,  # Reward during Crielere event
            "Raven State Issue": self.les_grp,  # AT4 prize
            "Tempest Tribal Issue": self.les_grp,  # AT4 prize
            "Apotheosis": self.les_grp,  # 5th EVE anniversary present
            "Zephyr": self.les_grp,  # 2010 new year gift
            "Primae": self.les_grp,  # Promotion of planetary interaction
            "Freki": self.les_grp,  # AT7 prize
            "Mimir": self.les_grp,  # AT7 prize
            "Utu": self.les_grp,  # AT8 prize
            "Adrestia": self.les_grp,  # AT8 prize
            "Echelon": self.les_grp,  # 2011 new year gift
            "Malice": self.les_grp,  # AT9 prize
            "Vangel": self.les_grp,  # AT9 prize
            "Cambion": self.les_grp,  # AT10 prize
            "Etana": self.les_grp
        }  # AT10 prize
        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        self.les_grp.items += list(
            self.getItem(itmn)
            for itmn in self.ITEMS_FORCEGROUP_R[self.les_grp])
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Data Subverter I":
            False,  # Not used in EVE, probably will appear with Dust link
            "Ghost Heavy Missile": False,  # Missile used by Sansha
            "QA Damage Module": False,  # QA modules used by CCP internally
            "QA ECCM": False,
            "QA Immunity Module": False,
            "QA Multiship Module - 10 Players": False,
            "QA Multiship Module - 20 Players": False,
            "QA Multiship Module - 40 Players": False,
            "QA Multiship Module - 5 Players": False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players": False,
            "Aliastra Catalyst": False,  # Vanity
            "Inner Zone Shipping Catalyst": False,  # Vanity
            "Intaki Syndicate Catalyst": False,  # Vanity
            "InterBus Catalyst": False,  # Vanity
            "Quafe Catalyst": False,  # Vanity
            "Nefantar Thrasher": False,  # Vanity
            "Sarum Magnate": False,  # Vanity
            "Sukuuvestaa Heron": False,  # Vanity
            "Inner Zone Shipping Imicus": False,  # Vanity
            "Vherokior Probe": False,  # Vanity
            "Iteron Mark IV Quafe Ultra Edition": False,  # Vanity
            "Iteron Mark IV Quafe Ultramarine Edition": False,  # Vanity
            "Iteron Mark IV Amastris Edition": False,  # Vanity
            "Goru's Shuttle": False,  # Vanity
            "Guristas Shuttle": False,  # Vanity
            "Tash-Murkon Magnate": False,  # Vanity
            "Scorpion Ishukone Watch": False
        }  # Vanity

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False
        }  # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I": ("Storyline", "Miner I"),
            "'Wild' Miner I": ("Storyline", "Miner I"),
            "Medium Nano Armor Repair Unit I":
            ("Tech I", "Medium Armor Repairer I"),
            "Large 'Reprieve' Vestment Reconstructer I":
            ("Storyline", "Large Armor Repairer I"),
            "Khanid Navy Torpedo Launcher": ("Faction", "Torpedo Launcher I"),
            "Dark Blood Tracking Disruptor":
            ("Faction", "Tracking Disruptor I"),
            "True Sansha Tracking Disruptor": ("Faction",
                                               "Tracking Disruptor I"),
            "Shadow Serpentis Remote Sensor Dampener":
            ("Faction", "Remote Sensor Dampener I")
        }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in self.ITEMS_FORCEDMETAGROUP.items():
            parent = value[1]
            if not parent in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "'Alpha' Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Codex' Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Daemon' Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Libram' Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Advanced Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Civilian Damage Control":
            760,  # Ship Equipment > Civilian Modules
            "Civilian EM Ward Field": 760,  # Ship Equipment > Civilian Modules
            "Civilian Explosive Deflection Field":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Hobgoblin":
            837,  # Drones > Combat Drones > Light Scout Drones
            "Civilian Kinetic Deflection Field":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Light Missile Launcher":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Remote Armor Repair System":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Remote Shield Transporter":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Scourge Light Missile":
            920,  # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Stasis Webifier":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Thermic Dissipation Field":
            760,  # Ship Equipment > Civilian Modules
            "Civilian Warp Disruptor":
            760,  # Ship Equipment > Civilian Modules
            "Hardwiring - Zainou 'Sharpshooter' ZMX10":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX11":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX110":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Nugoehuvi Synth Blue Pill Booster":
            977,  # Implants & Boosters > Booster
            "Prototype Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Prototype Iris Probe Launcher":
            712,  # Ship Equipment > Turrets & Bays > Scan Probe Launchers
            "Shadow": 1310,  # Drones > Combat Drones > Fighter Bombers
            "Sleeper Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Standard Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Talocan Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Terran Data Analyzer I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Tetrimon Data Analyzer I": 714
        }  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(
            self.ITEMS_FORCEDMARKETGROUP)

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("normal", frozenset((0, 1, 2, 14))),
                                     ("faction", frozenset((4, 3))),
                                     ("complex", frozenset((6, ))),
                                     ("officer", frozenset((5, )))])
        self.SEARCH_CATEGORIES = ("Drone", "Module", "Subsystem", "Charge",
                                  "Implant")
        self.ROOT_MARKET_GROUPS = (
            9,  # Modules
            1111,  # Rigs
            157,  # Drones
            11,  # Ammo
            1112,  # Subsystems
            24)  # Implants & Boosters
        # Tell other threads that Market is at their service
        mktRdy.set()
示例#32
0
    def populatePanel(self, panel):
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.dirtySettings = False
        self.openFitsSettings = SettingsProvider.getInstance().getSettings(
            "pyfaPrevOpenFits", {
                "enabled": False,
                "pyfaOpenFits": []
            })

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title,
                                     wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
        mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)

        helpCursor = wx.Cursor(wx.CURSOR_QUESTION_ARROW)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY,
                                           wx.DefaultPosition, wx.DefaultSize,
                                           wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY,
                                        "Use global character",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)

        self.cbDefaultCharImplants = wx.CheckBox(
            panel, wx.ID_ANY, "Use character implants by default for new fits",
            wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbDefaultCharImplants, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY,
                                              "Use global damage pattern",
                                              wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)

        self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY,
                                           "Compact skills needed tooltip",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)

        self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY,
                                           "Color fitting view by slot",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY,
                                        "Reopen previous fits on startup",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)

        self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, "Separate Racks",
                                       wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)

        labelSizer = wx.BoxSizer(wx.VERTICAL)
        self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, "Show Rack Labels",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)

        self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY,
                                         "Show fitting tab tooltips",
                                         wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, "Animate gauges",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)

        self.cbOpenFitInNew = wx.CheckBox(
            panel, wx.ID_ANY, "Open fittings in a new page by default",
            wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)

        self.cbShowShipBrowserTooltip = wx.CheckBox(
            panel, wx.ID_ANY, "Show ship browser tooltip", wx.DefaultPosition,
            wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReloadAll = wx.CheckBox(
            panel, wx.ID_ANY, "Change charge in all modules of the same type",
            wx.DefaultPosition, wx.DefaultSize, 0)
        if "wxGTK" not in wx.PlatformInfo:
            self.cbReloadAll.SetCursor(helpCursor)
        self.cbReloadAll.SetToolTip(
            wx.ToolTip(
                'When disabled, reloads charges just in selected modules. Action can be reversed by holding Ctrl or Alt key while changing charge.'
            ))
        mainSizer.Add(self.cbReloadAll, 0, wx.ALL | wx.EXPAND, 5)

        self.rbAddLabels = wx.RadioBox(
            panel, -1, "Extra info in Additions panel tab names",
            wx.DefaultPosition, wx.DefaultSize,
            ["None", "Quantity of active items", "Quantity of all items"], 1,
            wx.RA_SPECIFY_COLS)
        mainSizer.Add(self.rbAddLabels, 0,
                      wx.EXPAND | wx.TOP | wx.RIGHT | wx.BOTTOM, 10)
        self.rbAddLabels.Bind(wx.EVT_RADIOBOX, self.OnAddLabelsChange)

        self.sFit = Fit.getInstance()

        self.cbGlobalChar.SetValue(
            self.sFit.serviceFittingOptions["useGlobalCharacter"])
        self.cbDefaultCharImplants.SetValue(
            self.sFit.serviceFittingOptions["useCharacterImplantsByDefault"])
        self.cbGlobalDmgPattern.SetValue(
            self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
        self.cbFitColorSlots.SetValue(
            self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
        self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"]
                                  or False)
        self.cbRackLabels.SetValue(
            self.sFit.serviceFittingOptions["rackLabels"] or False)
        self.cbCompactSkills.SetValue(
            self.sFit.serviceFittingOptions["compactSkills"] or False)
        self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
        self.cbShowTooltip.SetValue(
            self.sFit.serviceFittingOptions["showTooltip"] or False)
        self.cbGaugeAnimation.SetValue(
            self.sFit.serviceFittingOptions["enableGaugeAnimation"])
        self.cbOpenFitInNew.SetValue(
            self.sFit.serviceFittingOptions["openFitInNew"])
        self.cbShowShipBrowserTooltip.SetValue(
            self.sFit.serviceFittingOptions["showShipBrowserTooltip"])
        self.cbReloadAll.SetValue(
            self.sFit.serviceFittingOptions["ammoChangeAll"])
        self.rbAddLabels.SetSelection(
            self.sFit.serviceFittingOptions["additionsLabels"])

        self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
        self.cbDefaultCharImplants.Bind(
            wx.EVT_CHECKBOX, self.OnCBDefaultCharImplantsStateChange)
        self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX,
                                     self.OnCBGlobalDmgPatternStateChange)
        self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
        self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
        self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
        self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
        self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
        self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
        self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.onCBGaugeAnimation)
        self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)
        self.cbShowShipBrowserTooltip.Bind(wx.EVT_CHECKBOX,
                                           self.onCBShowShipBrowserTooltip)
        self.cbReloadAll.Bind(wx.EVT_CHECKBOX, self.onCBReloadAll)

        self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"]
                                 or False)

        panel.SetSizer(mainSizer)
        panel.Layout()
示例#33
0
    def populatePanel(self, panel):
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.dirtySettings = False
        self.openFitsSettings = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
                                                                           {"enabled": False, "pyfaOpenFits": []})

        helpCursor = wx.Cursor(wx.CURSOR_QUESTION_ARROW)

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        mainSizer.Add(self.stTitle, 0, wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, "Use global character", wx.DefaultPosition, wx.DefaultSize,
                                        0)
        mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, "Use global damage pattern", wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)

        self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, "Compact skills needed tooltip", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)

        self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, "Color fitting view by slot", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, "Reopen previous fits on startup", wx.DefaultPosition,
                                        wx.DefaultSize, 0)
        mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)

        self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, "Separate Racks", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)

        labelSizer = wx.BoxSizer(wx.VERTICAL)
        self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, "Show Rack Labels", wx.DefaultPosition, wx.DefaultSize, 0)
        labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)

        self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show tab tooltips", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY, "Show market shortcuts", wx.DefaultPosition,
                                             wx.DefaultSize, 0)
        mainSizer.Add(self.cbMarketShortcuts, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, "Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)

        self.cbExportCharges = wx.CheckBox(panel, wx.ID_ANY, "Export loaded charges", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbExportCharges, 0, wx.ALL | wx.EXPAND, 5)

        self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, "Open fittings in a new page by default",
                                          wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)

        self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show ship browser tooltip",
                                          wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)

        priceSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY, "Default Market Prices:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.stDefaultSystem.Wrap(-1)
        priceSizer.Add(self.stDefaultSystem, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        self.stDefaultSystem.SetCursor(helpCursor)
        self.stDefaultSystem.SetToolTip(
            wx.ToolTip('The source you choose will be tried first, but subsequent sources will be used if the preferred '
                       'source fails. The system you choose is absolute and requests will not be made against other systems.'))

        self.chPriceSource = wx.Choice(panel, choices=sorted(Price.sources.keys()))
        self.chPriceSystem = wx.Choice(panel, choices=list(Price.systemsList.keys()))
        priceSizer.Add(self.chPriceSource, 1, wx.ALL | wx.EXPAND, 5)
        priceSizer.Add(self.chPriceSystem, 1, wx.ALL | wx.EXPAND, 5)

        mainSizer.Add(priceSizer, 0, wx.ALL | wx.EXPAND, 0)

        delayTimer = wx.BoxSizer(wx.HORIZONTAL)

        self.stMarketDelay = wx.StaticText(panel, wx.ID_ANY, "Market Search Delay (ms):", wx.DefaultPosition, wx.DefaultSize, 0)
        self.stMarketDelay.Wrap(-1)
        self.stMarketDelay.SetCursor(helpCursor)
        self.stMarketDelay.SetToolTip(
            wx.ToolTip('The delay between a keystroke and the market search. Can help reduce lag when typing fast in the market search box.'))

        delayTimer.Add(self.stMarketDelay, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.intDelay = IntCtrl(panel, max=1000, limited=True)
        delayTimer.Add(self.intDelay, 0, wx.ALL, 5)

        mainSizer.Add(delayTimer, 0, wx.ALL | wx.EXPAND, 0)

        self.sFit = Fit.getInstance()

        self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"])
        self.cbGlobalDmgPattern.SetValue(self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
        self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
        self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"] or False)
        self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False)
        self.cbCompactSkills.SetValue(self.sFit.serviceFittingOptions["compactSkills"] or False)
        self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
        self.cbShowTooltip.SetValue(self.sFit.serviceFittingOptions["showTooltip"] or False)
        self.cbMarketShortcuts.SetValue(self.sFit.serviceFittingOptions["showMarketShortcuts"] or False)
        self.cbGaugeAnimation.SetValue(self.sFit.serviceFittingOptions["enableGaugeAnimation"])
        self.cbExportCharges.SetValue(self.sFit.serviceFittingOptions["exportCharges"])
        self.cbOpenFitInNew.SetValue(self.sFit.serviceFittingOptions["openFitInNew"])
        self.chPriceSource.SetStringSelection(self.sFit.serviceFittingOptions["priceSource"])
        self.chPriceSystem.SetStringSelection(self.sFit.serviceFittingOptions["priceSystem"])
        self.cbShowShipBrowserTooltip.SetValue(self.sFit.serviceFittingOptions["showShipBrowserTooltip"])
        self.intDelay.SetValue(self.sFit.serviceFittingOptions["marketSearchDelay"])

        self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
        self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange)
        self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
        self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
        self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
        self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
        self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
        self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
        self.cbMarketShortcuts.Bind(wx.EVT_CHECKBOX, self.onCBShowShortcuts)
        self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.onCBGaugeAnimation)
        self.cbExportCharges.Bind(wx.EVT_CHECKBOX, self.onCBExportCharges)
        self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)
        self.chPriceSource.Bind(wx.EVT_CHOICE, self.onPricesSourceSelection)
        self.chPriceSystem.Bind(wx.EVT_CHOICE, self.onPriceSelection)
        self.cbShowShipBrowserTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowShipBrowserTooltip)
        self.intDelay.Bind(wx.lib.intctrl.EVT_INT, self.onMarketDelayChange)

        self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"] or False)

        panel.SetSizer(mainSizer)
        panel.Layout()
示例#34
0
    def __init__(self, parent):
        wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Select a format", size=(-1, -1),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.CopySelectDict = {
            CopySelectDialog.copyFormatEft     : self.exportEft,
            CopySelectDialog.copyFormatXml     : self.exportXml,
            CopySelectDialog.copyFormatDna     : self.exportDna,
            CopySelectDialog.copyFormatEsi     : self.exportEsi,
            CopySelectDialog.copyFormatMultiBuy: self.exportMultiBuy,
            CopySelectDialog.copyFormatEfs     : self.exportEfs
        }

        self.mainFrame = parent
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.copyFormats = OrderedDict((
            ("EFT", (CopySelectDialog.copyFormatEft, EFT_OPTIONS)),
            ("MultiBuy", (CopySelectDialog.copyFormatMultiBuy, MULTIBUY_OPTIONS)),
            ("ESI", (CopySelectDialog.copyFormatEsi, None)),
            ("DNA", (CopySelectDialog.copyFormatDna, DNA_OPTIONS)),
            ("EFS", (CopySelectDialog.copyFormatEfs, None)),
            # ("XML", (CopySelectDialog.copyFormatXml, None)),
        ))

        defaultFormatOptions = {}
        for formatId, formatOptions in self.copyFormats.values():
            if formatOptions is None:
                continue
            defaultFormatOptions[formatId] = {opt[0]: opt[3] for opt in formatOptions}

        self.settings = SettingsProvider.getInstance().getSettings("pyfaExport", {"format": 0, "options": defaultFormatOptions})
        # Options used to be stored as int (EFT export options only),
        # overwrite them with new format when needed
        if isinstance(self.settings["options"], int):
            self.settings["options"] = defaultFormatOptions

        self.options = {}

        initialized = False
        for formatName, formatData in self.copyFormats.items():
            formatId, formatOptions = formatData
            if not initialized:
                rdo = wx.RadioButton(self, wx.ID_ANY, formatName, style=wx.RB_GROUP)
                initialized = True
            else:
                rdo = wx.RadioButton(self, wx.ID_ANY, formatName)
            rdo.Bind(wx.EVT_RADIOBUTTON, self.Selected)
            if self.settings['format'] == formatId:
                rdo.SetValue(True)
                self.copyFormat = formatId
            mainSizer.Add(rdo, 0, wx.EXPAND | wx.ALL, 5)

            if formatOptions:
                bsizer = wx.BoxSizer(wx.VERTICAL)
                self.options[formatId] = {}

                for optId, optName, optDesc, _ in formatOptions:
                    checkbox = wx.CheckBox(self, -1, optName)
                    if optDesc:
                        checkbox.SetToolTip(wx.ToolTip(optDesc))
                    self.options[formatId][optId] = checkbox
                    if self.settings['options'].get(formatId, {}).get(optId, defaultFormatOptions.get(formatId, {}).get(optId)):
                        checkbox.SetValue(True)
                    bsizer.Add(checkbox, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 3)
                mainSizer.Add(bsizer, 0, wx.EXPAND | wx.LEFT, 20)

        buttonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        if buttonSizer:
            mainSizer.Add(buttonSizer, 0, wx.EXPAND | wx.ALL, 5)

        self.toggleOptions()
        self.SetSizer(mainSizer)
        self.Fit()
        self.Center()
示例#35
0
    def populatePanel(self, panel):
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.dirtySettings = False
        self.openFitsSettings = SettingsProvider.getInstance().getSettings(
            "pyfaPrevOpenFits", {
                "enabled": False,
                "pyfaOpenFits": []
            })

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title,
                                     wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        mainSizer.Add(self.stTitle, 0, wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY,
                                           wx.DefaultPosition, wx.DefaultSize,
                                           wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY,
                                        u"Use global character",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY,
                                              u"Use global damage pattern",
                                              wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)

        self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY,
                                           u"Compact skills needed tooltip",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)

        self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY,
                                           u"Color fitting view by slot",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY,
                                        u"Reopen previous fits on startup",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)

        self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, u"Separate Racks",
                                       wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)

        labelSizer = wx.BoxSizer(wx.VERTICAL)
        self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, u"Show Rack Labels",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)

        self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY,
                                         u"Show tab tooltips",
                                         wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY,
                                             u"Show market shortcuts",
                                             wx.DefaultPosition,
                                             wx.DefaultSize, 0)
        mainSizer.Add(self.cbMarketShortcuts, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY,
                                            u"Animate gauges",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)

        self.cbExportCharges = wx.CheckBox(panel, wx.ID_ANY,
                                           u"Export loaded charges",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbExportCharges, 0, wx.ALL | wx.EXPAND, 5)

        self.cbOpenFitInNew = wx.CheckBox(
            panel, wx.ID_ANY, u"Open fittings in a new page by default",
            wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)

        priceSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY,
                                             u"Default Market Prices:",
                                             wx.DefaultPosition,
                                             wx.DefaultSize, 0)
        self.stDefaultSystem.Wrap(-1)
        priceSizer.Add(self.stDefaultSystem, 0,
                       wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.chPriceSystem = wx.Choice(panel, choices=Price.systemsList.keys())
        priceSizer.Add(self.chPriceSystem, 1, wx.ALL | wx.EXPAND, 5)

        mainSizer.Add(priceSizer, 0, wx.ALL | wx.EXPAND, 0)

        self.sFit = Fit.getInstance()

        self.cbGlobalChar.SetValue(
            self.sFit.serviceFittingOptions["useGlobalCharacter"])
        self.cbGlobalDmgPattern.SetValue(
            self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
        self.cbFitColorSlots.SetValue(
            self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
        self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"]
                                  or False)
        self.cbRackLabels.SetValue(
            self.sFit.serviceFittingOptions["rackLabels"] or False)
        self.cbCompactSkills.SetValue(
            self.sFit.serviceFittingOptions["compactSkills"] or False)
        self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
        self.cbShowTooltip.SetValue(
            self.sFit.serviceFittingOptions["showTooltip"] or False)
        self.cbMarketShortcuts.SetValue(
            self.sFit.serviceFittingOptions["showMarketShortcuts"] or False)
        self.cbGaugeAnimation.SetValue(
            self.sFit.serviceFittingOptions["enableGaugeAnimation"])
        self.cbExportCharges.SetValue(
            self.sFit.serviceFittingOptions["exportCharges"])
        self.cbOpenFitInNew.SetValue(
            self.sFit.serviceFittingOptions["openFitInNew"])
        self.chPriceSystem.SetStringSelection(
            self.sFit.serviceFittingOptions["priceSystem"])

        self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
        self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX,
                                     self.OnCBGlobalDmgPatternStateChange)
        self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
        self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
        self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
        self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
        self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
        self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
        self.cbMarketShortcuts.Bind(wx.EVT_CHECKBOX, self.onCBShowShortcuts)
        self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.onCBGaugeAnimation)
        self.cbExportCharges.Bind(wx.EVT_CHECKBOX, self.onCBExportCharges)
        self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)
        self.chPriceSystem.Bind(wx.EVT_CHOICE, self.onPriceSelection)

        self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"]
                                 or False)

        panel.SetSizer(mainSizer)
        panel.Layout()
示例#36
0
文件: market.py 项目: DaManDOH/Pyfa
    def __init__(self):
        self.priceCache = {}

        #Init recently used module storage
        serviceMarketRecentlyUsedModules = {"pyfaMarketRecentlyUsedModules": []}

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance().getSettings("pyfaMarketRecentlyUsedModules", serviceMarketRecentlyUsedModules)

        # Start price fetcher
        self.priceWorkerThread = PriceWorkerThread()
        self.priceWorkerThread.daemon = True
        self.priceWorkerThread.start()

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = eos.types.Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Opux Luxury Yacht": self.les_grp, # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate": self.les_grp,  # Amarr Championship prize
            "Gold Magnate": self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue": self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue": self.les_grp, # Amarr Championship prize
            "Guardian-Vexor": self.les_grp, # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue": self.les_grp, # Reward during Crielere event
            "Raven State Issue": self.les_grp,  # AT4 prize
            "Tempest Tribal Issue": self.les_grp, # AT4 prize
            "Apotheosis": self.les_grp, # 5th EVE anniversary present
            "Zephyr": self.les_grp, # 2010 new year gift
            "Primae": self.les_grp, # Promotion of planetary interaction
            "Freki": self.les_grp, # AT7 prize
            "Mimir": self.les_grp, # AT7 prize
            "Utu": self.les_grp, # AT8 prize
            "Adrestia": self.les_grp, # AT8 prize
            "Echelon": self.les_grp, # 2011 new year gift
            "Malice": self.les_grp, # AT9 prize
            "Vangel": self.les_grp, # AT9 prize
            "Cambion": self.les_grp, # AT10 prize
            "Etana": self.les_grp, # AT10 prize
            "Chremoas": self.les_grp, # AT11 prize :(
            "Moracha": self.les_grp, # AT11 prize
            "Interbus Shuttle": self.les_grp,
            "Leopard": self.les_grp,
            "Stratios Emergency Responder": self.les_grp }
        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        self.les_grp.addItems = list(self.getItem(itmn) for itmn in self.ITEMS_FORCEGROUP_R[self.les_grp])
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Data Subverter I": False, # Not used in EVE, probably will appear with Dust link
            "Ghost Heavy Missile": False, # Missile used by Sansha
            "QA Cross Protocol Analyzer": False, # QA modules used by CCP internally
            "QA Damage Module": False,
            "QA ECCM": False,
            "QA Immunity Module": False,
            "QA Multiship Module - 10 Players": False,
            "QA Multiship Module - 20 Players": False,
            "QA Multiship Module - 40 Players": False,
            "QA Multiship Module - 5 Players": False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players": False,
            "Aliastra Catalyst": False, # Vanity
            "Inner Zone Shipping Catalyst": False, # Vanity
            "Intaki Syndicate Catalyst": False, # Vanity
            "InterBus Catalyst": False, # Vanity
            "Quafe Catalyst": False, # Vanity
            "Nefantar Thrasher": False, # Vanity
            "Sarum Magnate": False, # Vanity
            "Sukuuvestaa Heron": False, # Vanity
            "Inner Zone Shipping Imicus": False, # Vanity
            "Vherokior Probe": False, # Vanity
            "Miasmos Quafe Ultra Edition": False, # Vanity
            "Miasmos Quafe Ultramarine Edition": False, # Vanity
            "Miasmos Amastris Edition": False, # Vanity
            "Goru's Shuttle": False, # Vanity
            "Guristas Shuttle": False, # Vanity
            "Tash-Murkon Magnate": False, # Vanity
            "Scorpion Ishukone Watch": False, # Vanity
            "Incursus Aliastra Edition": False, # Vanity
            "Merlin Nugoeihuvi Edition": False, # Vanity
            "Police Pursuit Comet": False, # Vanity
            "Punisher Kador Edition": False, # Vanity
            "Rifter Krusual Edition": False, # Vanity
            "Abaddon Kador Edition": False, # Vanity
            "Hyperion Aliastra Edition": False, # Vanity
            "Maelstrom Krusual Edition": False, # Vanity
            "Rokh Nugoeihuvi Edition": False, # Vanity
            "Mammoth Nefantar Edition": False } # Vanity

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False } # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I": ("Storyline", "Miner I"),
            "'Wild' Miner I": ("Storyline", "Miner I"),
            "Medium Nano Armor Repair Unit I": ("Tech I", "Medium Armor Repairer I"),
            "Large 'Reprieve' Vestment Reconstructer I": ("Storyline", "Large Armor Repairer I"),
            "Khanid Navy Torpedo Launcher": ("Faction", "Torpedo Launcher I"),
            "Dark Blood Tracking Disruptor": ("Faction", "Tracking Disruptor I"),
            "True Sansha Tracking Disruptor": ("Faction", "Tracking Disruptor I"),
            "Shadow Serpentis Remote Sensor Dampener": ("Faction", "Remote Sensor Dampener I") }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in self.ITEMS_FORCEDMETAGROUP.items():
            parent = value[1]
            if not parent in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "'Alpha' Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Codex' Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Daemon' Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Libram' Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Advanced Cerebral Accelerator": 977, # Implants & Boosters > Booster
            "Civilian Damage Control": 760, # Ship Equipment > Civilian Modules
            "Civilian EM Ward Field": 760, # Ship Equipment > Civilian Modules
            "Civilian Explosive Deflection Field": 760, # Ship Equipment > Civilian Modules
            "Civilian Hobgoblin": 837, # Drones > Combat Drones > Light Scout Drones
            "Civilian Kinetic Deflection Field": 760, # Ship Equipment > Civilian Modules
            "Civilian Light Missile Launcher": 760, # Ship Equipment > Civilian Modules
            "Civilian Scourge Light Missile": 920, # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Small Remote Armor Repairer": 760, # Ship Equipment > Civilian Modules
            "Civilian Small Remote Shield Booster": 760, # Ship Equipment > Civilian Modules
            "Civilian Stasis Webifier": 760, # Ship Equipment > Civilian Modules
            "Civilian Thermic Dissipation Field": 760, # Ship Equipment > Civilian Modules
            "Civilian Warp Disruptor": 760, # Ship Equipment > Civilian Modules
            "Hardwiring - Zainou 'Sharpshooter' ZMX10": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX100": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX11": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX110": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Nugoehuvi Synth Blue Pill Booster": 977, # Implants & Boosters > Booster
            "Prototype Cerebral Accelerator": 977, # Implants & Boosters > Booster
            "Prototype Iris Probe Launcher": 712, # Ship Equipment > Turrets & Bays > Scan Probe Launchers
            "Shadow": 1310, # Drones > Combat Drones > Fighter Bombers
            "Sleeper Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Standard Cerebral Accelerator": 977, # Implants & Boosters > Booster
            "Talocan Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Terran Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Tetrimon Data Analyzer I": 714 } # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(self.ITEMS_FORCEDMARKETGROUP)

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("normal",  frozenset((0, 1, 2, 14))),
                                     ("faction", frozenset((4, 3))),
                                     ("complex", frozenset((6,))),
                                     ("officer", frozenset((5,)))])
        self.SEARCH_CATEGORIES = ("Drone", "Module", "Subsystem", "Charge", "Implant")
        self.ROOT_MARKET_GROUPS = (9,     # Modules
                                   1111,  # Rigs
                                   157,   # Drones
                                   11,    # Ammo
                                   1112,  # Subsystems
                                   24)    # Implants & Boosters
        # Tell other threads that Market is at their service
        mktRdy.set()
示例#37
0
    def __init__(self):
        self.priceCache = {}

        #Init recently used module storage
        serviceMarketRecentlyUsedModules = {"pyfaMarketRecentlyUsedModules": []}

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance().getSettings("pyfaMarketRecentlyUsedModules", serviceMarketRecentlyUsedModules)

        # Start price fetcher
        self.priceWorkerThread = PriceWorkerThread()
        self.priceWorkerThread.daemon = True
        self.priceWorkerThread.start()

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = eos.types.Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Opux Luxury Yacht": self.les_grp, # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate": self.les_grp,  # Amarr Championship prize
            "Gold Magnate": self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue": self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue": self.les_grp, # Amarr Championship prize
            "Guardian-Vexor": self.les_grp, # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue": self.les_grp, # Reward during Crielere event
            "Raven State Issue": self.les_grp,  # AT4 prize
            "Tempest Tribal Issue": self.les_grp, # AT4 prize
            "Apotheosis": self.les_grp, # 5th EVE anniversary present
            "Zephyr": self.les_grp, # 2010 new year gift
            "Primae": self.les_grp, # Promotion of planetary interaction
            "Freki": self.les_grp, # AT7 prize
            "Mimir": self.les_grp, # AT7 prize
            "Utu": self.les_grp, # AT8 prize
            "Adrestia": self.les_grp, # AT8 prize
            "Echelon": self.les_grp, # 2011 new year gift
            "Malice": self.les_grp, # AT9 prize
            "Vangel": self.les_grp, # AT9 prize
            "Cambion": self.les_grp, # AT10 prize
            "Etana": self.les_grp, # AT10 prize
            "Chremoas": self.les_grp, # AT11 prize :(
            "Moracha": self.les_grp, # AT11 prize
            "Stratios Emergency Responder": self.les_grp, # Issued for Somer Blink lottery
            "Miasmos Quafe Ultra Edition": self.les_grp, # Gift to people who purchased FF HD stream
            "InterBus Shuttle": self.les_grp,
            "Leopard": self.les_grp, # 2013 new year gift
            "Whiptail": self.les_grp, # AT12 prize
            "Chameleon": self.les_grp, # AT12 prize
            "Victorieux Luxury Yacht":  self.les_grp  # Worlds Collide prize \o/ chinese getting owned
        }

        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        self.les_grp.addItems = list(self.getItem(itmn) for itmn in self.ITEMS_FORCEGROUP_R[self.les_grp])
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Data Subverter I": False, # Not used in EVE, probably will appear with Dust link
            "QA Cross Protocol Analyzer": False, # QA modules used by CCP internally
            "QA Damage Module": False,
            "QA ECCM": False,
            "QA Immunity Module": False,
            "QA Multiship Module - 10 Players": False,
            "QA Multiship Module - 20 Players": False,
            "QA Multiship Module - 40 Players": False,
            "QA Multiship Module - 5 Players": False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players": False,
            "Goru's Shuttle": False,
            "Guristas Shuttle": False,
            "Mobile Decoy Unit": False,  # Seems to be left over test mod for deployables
            "Tournament Micro Jump Unit": False,  # Normally seen only on tournament arenas
            "Council Diplomatic Shuttle": False,  # CSM X celebration
            "Imp": False,  # AT13 prize, not a real ship yet
            "Fiend": False,  # AT13 prize, not a real ship yet
        }

        # do not publish ships that we convert
        for name in conversions.packs['skinnedShips']:
            self.ITEMS_FORCEPUBLISHED[name] = False

        if config.debug:
            # Publish Tactical Dessy Modes if in debug
            # Cannot use GROUPS_FORCEPUBLISHED as this does not force items
            # within group to be published, but rather for the group itself
            # to show up on ship list
            group = self.getGroup("Ship Modifiers", eager="items")
            for item in group.items:
                self.ITEMS_FORCEPUBLISHED[item.name] = True

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False } # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I": ("Storyline", "Miner I"),
            "'Wild' Miner I": ("Storyline", "Miner I"),
            "Medium Nano Armor Repair Unit I": ("Tech I", "Medium Armor Repairer I"),
            "Large 'Reprieve' Vestment Reconstructer I": ("Storyline", "Large Armor Repairer I"),
            "Khanid Navy Torpedo Launcher": ("Faction", "Torpedo Launcher I"),
            "Shadow Serpentis Remote Sensor Dampener": ("Faction", "Remote Sensor Dampener I") }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in self.ITEMS_FORCEDMETAGROUP.items():
            parent = value[1]
            if not parent in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "'Alpha' Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Codex' Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Daemon' Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Libram' Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Advanced Cerebral Accelerator": 977, # Implants & Boosters > Booster
            "Civilian Damage Control": 615, # Ship Equipment > Hull & Armor > Damage Controls
            "Civilian EM Ward Field": 1695, # Ship Equipment > Shield > Shield Hardeners > EM Shield Hardeners
            "Civilian Explosive Deflection Field": 1694, # Ship Equipment > Shield > Shield Hardeners > Explosive Shield Hardeners
            "Civilian Hobgoblin": 837, # Drones > Combat Drones > Light Scout Drones
            "Civilian Kinetic Deflection Field": 1693, # Ship Equipment > Shield > Shield Hardeners > Kinetic Shield Hardeners
            "Civilian Light Missile Launcher": 640, # Ship Equipment > Turrets & Bays > Missile Launchers > Light Missile Launchers
            "Civilian Scourge Light Missile": 920, # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Small Remote Armor Repairer": 1059, # Ship Equipment > Hull & Armor > Remote Armor Repairers > Small
            "Civilian Small Remote Shield Booster": 603, # Ship Equipment > Shield > Remote Shield Boosters > Small
            "Civilian Stasis Webifier": 683, # Ship Equipment > Electronic Warfare > Stasis Webifiers
            "Civilian Thermic Dissipation Field": 1692, # Ship Equipment > Shield > Shield Hardeners > Thermal Shield Hardeners
            "Civilian Warp Disruptor": 1935, # Ship Equipment > Electronic Warfare > Warp Disruptors
            "Hardwiring - Zainou 'Sharpshooter' ZMX10": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX100": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX11": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX110": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100": 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Nugoehuvi Synth Blue Pill Booster": 977, # Implants & Boosters > Booster
            "Prototype Cerebral Accelerator": 977, # Implants & Boosters > Booster
            "Prototype Iris Probe Launcher": 712, # Ship Equipment > Turrets & Bays > Scan Probe Launchers
            "Shadow": 1310, # Drones > Combat Drones > Fighter Bombers
            "Sleeper Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Standard Cerebral Accelerator": 977, # Implants & Boosters > Booster
            "Talocan Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Terran Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Tetrimon Data Analyzer I": 714 } # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(self.ITEMS_FORCEDMARKETGROUP)

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("normal",  frozenset((0, 1, 2, 14))),
                                     ("faction", frozenset((4, 3))),
                                     ("complex", frozenset((6,))),
                                     ("officer", frozenset((5,)))])
        self.SEARCH_CATEGORIES = ("Drone", "Module", "Subsystem", "Charge", "Implant", "Deployable")
        self.ROOT_MARKET_GROUPS = (9,     # Modules
                                   1111,  # Rigs
                                   157,   # Drones
                                   11,    # Ammo
                                   1112,  # Subsystems
                                   24,    # Implants & Boosters
                                   404)   # Deployables
        # Tell other threads that Market is at their service
        mktRdy.set()
示例#38
0
    def populatePanel(self, panel):
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.dirtySettings = False
        self.openFitsSettings = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
                                                                           {"enabled": False, "pyfaOpenFits": []})

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        helpCursor = wx.Cursor(wx.CURSOR_QUESTION_ARROW)
        mainSizer.Add(self.stTitle, 0, wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, "Use global character", wx.DefaultPosition, wx.DefaultSize,
                                        0)
        mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)

        self.cbDefaultCharImplants = wx.CheckBox(panel, wx.ID_ANY, "Use character implants by default for new fits",
                                                 wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbDefaultCharImplants, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, "Use global damage pattern", wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)

        self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, "Compact skills needed tooltip", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)

        self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, "Color fitting view by slot", wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, "Reopen previous fits on startup", wx.DefaultPosition,
                                        wx.DefaultSize, 0)
        mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)

        self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, "Separate Racks", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)

        labelSizer = wx.BoxSizer(wx.VERTICAL)
        self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, "Show Rack Labels", wx.DefaultPosition, wx.DefaultSize, 0)
        labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)

        self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show fitting tab tooltips", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, "Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)

        self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, "Open fittings in a new page by default",
                                          wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)

        self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show ship browser tooltip",
                                          wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)


        self.cbReloadAll = wx.CheckBox(panel, wx.ID_ANY, "Change charge in all modules of the same type",
                                       wx.DefaultPosition, wx.DefaultSize, 0)
        if "wxGTK" not in wx.PlatformInfo:
            self.cbReloadAll.SetCursor(helpCursor)
        self.cbReloadAll.SetToolTip(wx.ToolTip(
            'When disabled, reloads charges just in selected modules. Action can be reversed by holding Ctrl or Alt key while changing charge.'))
        mainSizer.Add(self.cbReloadAll, 0, wx.ALL | wx.EXPAND, 5)

        self.sFit = Fit.getInstance()

        self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"])
        self.cbDefaultCharImplants.SetValue(self.sFit.serviceFittingOptions["useCharacterImplantsByDefault"])
        self.cbGlobalDmgPattern.SetValue(self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
        self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
        self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"] or False)
        self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False)
        self.cbCompactSkills.SetValue(self.sFit.serviceFittingOptions["compactSkills"] or False)
        self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
        self.cbShowTooltip.SetValue(self.sFit.serviceFittingOptions["showTooltip"] or False)
        self.cbGaugeAnimation.SetValue(self.sFit.serviceFittingOptions["enableGaugeAnimation"])
        self.cbOpenFitInNew.SetValue(self.sFit.serviceFittingOptions["openFitInNew"])
        self.cbShowShipBrowserTooltip.SetValue(self.sFit.serviceFittingOptions["showShipBrowserTooltip"])
        self.cbReloadAll.SetValue(self.sFit.serviceFittingOptions["ammoChangeAll"])

        self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
        self.cbDefaultCharImplants.Bind(wx.EVT_CHECKBOX, self.OnCBDefaultCharImplantsStateChange)
        self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange)
        self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
        self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
        self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
        self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
        self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
        self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
        self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.onCBGaugeAnimation)
        self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)
        self.cbShowShipBrowserTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowShipBrowserTooltip)
        self.cbReloadAll.Bind(wx.EVT_CHECKBOX, self.onCBReloadAll)

        self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"] or False)

        panel.SetSizer(mainSizer)
        panel.Layout()
示例#39
0
    def __init__(self):
        self.priceCache = {}

        #Init recently used module storage
        serviceMarketRecentlyUsedModules = {
            "pyfaMarketRecentlyUsedModules": []
        }

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance(
        ).getSettings("pyfaMarketRecentlyUsedModules",
                      serviceMarketRecentlyUsedModules)

        # Start price fetcher
        self.priceWorkerThread = PriceWorkerThread()
        self.priceWorkerThread.daemon = True
        self.priceWorkerThread.start()

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = eos.types.Group()
        self.les_grp.ID = -1
        self.les_grp.name = "特别版舰船"
        self.les_grp.published = True
        ships = self.getCategory("舰船")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "奥普克斯级豪华游轮": self.
            les_grp,  # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "白银富豪级": self.les_grp,  # Amarr Championship prize
            "黄金富豪级": self.les_grp,  # Amarr Championship prize
            "末日沙场级帝国型": self.les_grp,  # Amarr Championship prize
            "灾难级帝国型": self.les_grp,  # Amarr Championship prize
            "狂怒守卫者级": self.
            les_grp,  # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "万王宝座级联邦型": self.les_grp,  # Reward during Crielere event
            "乌鸦级政府型": self.les_grp,  # AT4 prize
            "狂暴级部族型": self.les_grp,  # AT4 prize
            "神圣穿梭机": self.les_grp,  # 5th EVE anniversary present
            "微风级": self.les_grp,  # 2010 new year gift
            "元始级": self.les_grp,  # Promotion of planetary interaction
            "暴狼级": self.les_grp,  # AT7 prize
            "弥米尔级": self.les_grp,  # AT7 prize
            "乌图级": self.les_grp,  # AT8 prize
            "复仇女神级": self.les_grp,  # AT8 prize
            "梯队级": self.les_grp,  # 2011 new year gift
            "恶意级": self.les_grp,  # AT9 prize
            "传道者级": self.les_grp,  # AT9 prize
            "魔裔级": self.les_grp,  # AT10 prize
            "伊塔那级": self.les_grp,  # AT10 prize
            "克雷默斯级": self.les_grp,  # AT11 prize :(
            "莫拉查级": self.les_grp,  # AT11 prize
            "斯特修斯级应急反应型": self.les_grp,  # Issued for Somer Blink lottery
            "米亚莫斯级酷菲特强版":
            self.les_grp,  # Gift to people who purchased FF HD stream
            "星际捷运穿梭机": self.les_grp,
            "美洲豹级": self.les_grp,  # 2013 new year gift
            "长尾蜥级": self.les_grp,  # AT12 prize
            "变色龙级": self.les_grp,  # AT12 prize
            "凯旋奢华游艇":
            self.les_grp,  # Worlds Collide prize \o/ chinese getting owned
            "小鬼级": self.les_grp,  # AT13 prize
            "恶魔级": self.les_grp,  # AT13 prize
        }

        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        self.les_grp.addItems = list(
            self.getItem(itmn)
            for itmn in self.ITEMS_FORCEGROUP_R[self.les_grp])
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "数据破坏仪 I":
            False,  # Not used in EVE, probably will appear with Dust link
            "QA Cross Protocol Analyzer":
            False,  # QA modules used by CCP internally
            "QA测试伤害模块": False,
            "QA测试ECCM": False,
            "QA测试免疫装备": False,
            "QA测试多舰船模块 - 10个玩家": False,
            "QA测试多舰船模块 - 20个玩家": False,
            "QA测试多舰船模块 - 40个玩家": False,
            "QA测试多舰船模块 - 5个玩家": False,
            "QA测试远程装甲维修系统  - 5个玩家": False,
            "QA测试护盾传输装置 - 5个玩家": False,
            "高鲁的穿梭机": False,
            "古斯塔斯穿梭机": False,
            "移动式诱捕装置": False,  # Seems to be left over test mod for deployables
            "锦标赛微型跳跃装置": False,  # Normally seen only on tournament arenas
            "议会外交穿梭机": False,  # CSM X celebration
            "民用加特林磁轨炮": True,
            "民用加特林脉冲激光炮": True,
            "民用加特林自动加农炮": True,
            "民用轻型电子疾速炮": True,
        }

        # do not publish ships that we convert
        for name in conversions.packs['skinnedShips']:
            self.ITEMS_FORCEPUBLISHED[name] = False

        if config.debug:
            # Publish Tactical Dessy Modes if in debug
            # Cannot use GROUPS_FORCEPUBLISHED as this does not force items
            # within group to be published, but rather for the group itself
            # to show up on ship list
            group = self.getGroup("改装件", eager="items")
            for item in group.items:
                self.ITEMS_FORCEPUBLISHED[item.name] = True

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "考察船原型": False
        }  # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "栖息采矿器 I": ("故事线", "采矿器 I"),
            "野性采矿器 I": ("故事线", "采矿器 I"),
            "中型纳米装甲维修组件 I": ("一级科技", "中型装甲维修器 I"),
            "大型回光外壳重塑装置 I": ("故事线", "大型装甲维修器 I"),
            "卡尼迪海军鱼雷发射器": ("势力", "鱼雷发射器 I"),
        }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in self.ITEMS_FORCEDMETAGROUP.items():
            parent = value[1]
            if not parent in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "阿尔法数据分析仪 I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "法典数据分析仪 I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "守护者数据分析仪 I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "圣契数据分析仪 I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "高级大脑加速器": 977,  # Implants & Boosters > Booster
            "民用损伤控制": 615,  # Ship Equipment > Hull & Armor > Damage Controls
            "民用电磁防护力场":
            1695,  # Ship Equipment > Shield > Shield Hardeners > EM Shield Hardeners
            "民用爆炸偏阻力场":
            1694,  # Ship Equipment > Shield > Shield Hardeners > Explosive Shield Hardeners
            "民用地精灵无人机": 837,  # Drones > Combat Drones > Light Scout Drones
            "民用动能偏阻力场":
            1693,  # Ship Equipment > Shield > Shield Hardeners > Kinetic Shield Hardeners
            "民用轻型导弹发射器":
            640,  # Ship Equipment > Turrets & Bays > Missile Launchers > Light Missile Launchers
            "民用鞭挞轻型导弹":
            920,  # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "民用小型远程装甲维修器":
            1059,  # Ship Equipment > Hull & Armor > Remote Armor Repairers > Small
            "民用小型远程护盾回充增量器":
            603,  # Ship Equipment > Shield > Remote Shield Boosters > Small
            "民用停滞缠绕光束":
            683,  # Ship Equipment > Electronic Warfare > Stasis Webifiers
            "民用热能发散力场":
            1692,  # Ship Equipment > Shield > Shield Hardeners > Thermal Shield Hardeners
            "民用跃迁干扰器":
            1935,  # Ship Equipment > Electronic Warfare > Warp Disruptors
            "神经交互强化芯片—载诺 精确射击 ZMX10":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "神经交互强化芯片—载诺 精确射击 ZMX100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "神经交互强化芯片—载诺 精确射击 ZMX1000":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "神经交互强化芯片—载诺 精确射击 ZMX11":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "神经交互强化芯片—载诺 精确射击 ZMX110":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "神经交互强化芯片—载诺 精确射击 ZMX1100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "纳基维合成型蓝色药丸增效体": 977,  # Implants & Boosters > Booster
            "实验级大脑加速器": 977,  # Implants & Boosters > Booster
            "彩虹女神探针发射器原型机":
            712,  # Ship Equipment > Turrets & Bays > Scan Probe Launchers
            "暗影": 1310,  # Drones > Combat Drones > Fighter Bombers
            "冬眠者数据分析仪 I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "标准大脑加速器": 977,  # Implants & Boosters > Booster
            "塔洛迦数据分析仪 I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "地球人数据分析仪 I":
            714,  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "特里蒙数据分析仪 I":
            714  # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
        }

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(
            self.ITEMS_FORCEDMARKETGROUP)

        self.FORCEDMARKETGROUP = {
            685: False,  # Ship Equipment > Electronic Warfare > ECCM
            681:
            False,  # Ship Equipment > Electronic Warfare > Sensor Backup Arrays
        }

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("normal", frozenset((0, 1, 2, 14))),
                                     ("faction", frozenset((4, 3))),
                                     ("complex", frozenset((6, ))),
                                     ("officer", frozenset((5, )))])
        self.SEARCH_CATEGORIES = ("无人机", "装备", "子系统", "弹药", "植入体", "可部署物品",
                                  "铁骑舰载机", "建筑", "建筑装备")
        self.SEARCH_GROUPS = ("冰矿产物", )
        self.ROOT_MARKET_GROUPS = (
            9,  # Modules
            1111,  # Rigs
            157,  # Drones
            11,  # Ammo
            1112,  # Subsystems
            24,  # Implants & Boosters
            404,  # Deployables
            2202,  # Structure Equipment
            2203  # Structure Modifications
        )
        # Tell other threads that Market is at their service
        mktRdy.set()
示例#40
0
    def __init__(self, parent):
        self.MULTIBUY_OPTIONS = (
            (PortMultiBuyOptions.LOADED_CHARGES, _t('Loaded Charges'),
             _t('Export charges loaded into modules'), True),
            (PortMultiBuyOptions.IMPLANTS, _t('Implants'),
             _t('Export implants'), False),
            (PortMultiBuyOptions.BOOSTERS, _t('Boosters'),
             _t('Export boosters'), False),
            (PortMultiBuyOptions.CARGO, _t('Cargo'),
             _t('Export cargo contents'), True),
            (PortMultiBuyOptions.OPTIMIZE_PRICES, _t('Optimize Prices'),
             _t('Replace items by cheaper alternatives'), False),
        )
        self.EFT_OPTIONS = ((PortEftOptions.LOADED_CHARGES,
                             _t('Loaded Charges'),
                             _t('Export charges loaded into modules'), True),
                            (PortEftOptions.MUTATIONS,
                             _t('Mutated Attributes'),
                             _t('Export mutated modules\' stats'),
                             True), (PortEftOptions.IMPLANTS, _t('Implants'),
                                     _t('Export implants'), True),
                            (PortEftOptions.BOOSTERS, _t('Boosters'),
                             _t('Export boosters'),
                             True), (PortEftOptions.CARGO, _t('Cargo'),
                                     _t('Export cargo hold contents'), True))
        self.DNA_OPTIONS = ((
            PortDnaOptions.FORMATTING, _t('Formatting Tags'),
            _t('Include formatting tags to paste fit directly into corp bulletins, MOTD, etc.'
               ), True), )

        super().__init__(parent,
                         id=wx.ID_ANY,
                         title=_t("Select a format"),
                         size=(-1, -1),
                         style=wx.DEFAULT_DIALOG_STYLE)

        self.CopySelectDict = {
            CopySelectDialog.copyFormatEft: self.exportEft,
            CopySelectDialog.copyFormatXml: self.exportXml,
            CopySelectDialog.copyFormatDna: self.exportDna,
            CopySelectDialog.copyFormatEsi: self.exportEsi,
            CopySelectDialog.copyFormatMultiBuy: self.exportMultiBuy,
            CopySelectDialog.copyFormatEfs: self.exportEfs,
            CopySelectDialog.copyFormatFitStats: self.exportFitStats
        }

        self.mainFrame = parent
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.copyFormats = OrderedDict((
            ("EFT", (CopySelectDialog.copyFormatEft, self.EFT_OPTIONS)),
            ("MultiBuy", (CopySelectDialog.copyFormatMultiBuy,
                          self.MULTIBUY_OPTIONS)),
            ("ESI", (CopySelectDialog.copyFormatEsi, None)),
            ("DNA", (CopySelectDialog.copyFormatDna, self.DNA_OPTIONS)),
            ("EFS", (CopySelectDialog.copyFormatEfs, None)),
            ("Stats", (CopySelectDialog.copyFormatFitStats, None)),
            # ("XML", (CopySelectDialog.copyFormatXml, None)),
        ))

        defaultFormatOptions = {}
        for formatId, formatOptions in self.copyFormats.values():
            if formatOptions is None:
                continue
            defaultFormatOptions[formatId] = {
                opt[0]: opt[3]
                for opt in formatOptions
            }

        self.settings = SettingsProvider.getInstance().getSettings(
            "pyfaExport", {
                "format": self.copyFormatEft,
                "options": defaultFormatOptions
            })
        # Options used to be stored as int (EFT export options only),
        # overwrite them with new format when needed
        if isinstance(self.settings["options"], int):
            self.settings["options"] = defaultFormatOptions

        self.options = {}

        initialized = False
        self.copyFormat = self.copyFormatEft
        for formatName, formatData in self.copyFormats.items():
            formatId, formatOptions = formatData
            if not initialized:
                rdo = wx.RadioButton(self,
                                     wx.ID_ANY,
                                     formatName,
                                     style=wx.RB_GROUP)
                initialized = True
            else:
                rdo = wx.RadioButton(self, wx.ID_ANY, formatName)
            rdo.Bind(wx.EVT_RADIOBUTTON, self.Selected)
            if self.settings['format'] == formatId:
                rdo.SetValue(True)
                self.copyFormat = formatId
            mainSizer.Add(rdo, 0, wx.EXPAND | wx.ALL, 5)

            if formatOptions:
                bsizer = wx.BoxSizer(wx.VERTICAL)
                self.options[formatId] = {}

                for optId, optName, optDesc, _ in formatOptions:
                    checkbox = wx.CheckBox(self, -1, optName)
                    if optDesc:
                        checkbox.SetToolTip(wx.ToolTip(optDesc))
                    self.options[formatId][optId] = checkbox
                    if self.settings['options'].get(formatId, {}).get(
                            optId,
                            defaultFormatOptions.get(formatId, {}).get(optId)):
                        checkbox.SetValue(True)
                    bsizer.Add(checkbox, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 3)
                mainSizer.Add(bsizer, 0, wx.EXPAND | wx.LEFT, 20)

        buttonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        if buttonSizer:
            mainSizer.Add(buttonSizer, 0, wx.EXPAND | wx.ALL, 5)

        self.toggleOptions()
        self.SetSizer(mainSizer)
        self.Fit()
        self.Center()
示例#41
0
    def __init__(self):

        # Init recently used module storage
        serviceMarketRecentlyUsedModules = {
            "pyfaMarketRecentlyUsedModules": []
        }

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance(
        ).getSettings("pyfaMarketRecentlyUsedModules",
                      serviceMarketRecentlyUsedModules)

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = types_Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Capsule": self.getGroup("Shuttle"),
            "Opux Luxury Yacht": self.
            les_grp,  # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate": self.les_grp,  # Amarr Championship prize
            "Gold Magnate": self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Guardian-Vexor": self.
            les_grp,  # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue":
            self.les_grp,  # Reward during Crielere event
            "Raven State Issue": self.les_grp,  # AT4 prize
            "Tempest Tribal Issue": self.les_grp,  # AT4 prize
            "Apotheosis": self.les_grp,  # 5th EVE anniversary present
            "Zephyr": self.les_grp,  # 2010 new year gift
            "Primae": self.les_grp,  # Promotion of planetary interaction
            "Council Diplomatic Shuttle": self.les_grp,  # CSM X celebration
            "Freki": self.les_grp,  # AT7 prize
            "Mimir": self.les_grp,  # AT7 prize
            "Utu": self.les_grp,  # AT8 prize
            "Adrestia": self.les_grp,  # AT8 prize
            "Echelon": self.les_grp,  # 2011 new year gift
            "Malice": self.les_grp,  # AT9 prize
            "Vangel": self.les_grp,  # AT9 prize
            "Cambion": self.les_grp,  # AT10 prize
            "Etana": self.les_grp,  # AT10 prize
            "Chremoas": self.les_grp,  # AT11 prize :(
            "Moracha": self.les_grp,  # AT11 prize
            "Stratios Emergency Responder":
            self.les_grp,  # Issued for Somer Blink lottery
            "Miasmos Quafe Ultra Edition":
            self.les_grp,  # Gift to people who purchased FF HD stream
            "InterBus Shuttle": self.les_grp,
            "Leopard": self.les_grp,  # 2013 new year gift
            "Whiptail": self.les_grp,  # AT12 prize
            "Chameleon": self.les_grp,  # AT12 prize
            "Victorieux Luxury Yacht":
            self.les_grp,  # Worlds Collide prize \o/ chinese getting owned
            "Imp": self.les_grp,  # AT13 prize
            "Fiend": self.les_grp,  # AT13 prize
            "Caedes": self.les_grp,  # AT14 prize
            "Rabisu": self.les_grp,  # AT14 prize
            "Victor": self.les_grp,  # AT15 prize
            "Virtuoso": self.les_grp,  # AT15 prize
            "Hydra": self.les_grp,  # AT16 prize
            "Tiamat": self.les_grp,  # AT16 prize
        }

        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        for grp, itemNames in self.ITEMS_FORCEGROUP_R.items():
            grp.addItems = list(self.getItem(i) for i in itemNames)
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Data Subverter I":
            False,  # Not used in EVE, probably will appear with Dust link
            "QA Cross Protocol Analyzer":
            False,  # QA modules used by CCP internally
            "QA Damage Module": False,
            "QA ECCM": False,
            "QA Immunity Module": False,
            "QA Multiship Module - 10 Players": False,
            "QA Multiship Module - 20 Players": False,
            "QA Multiship Module - 40 Players": False,
            "QA Multiship Module - 5 Players": False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players": False,
            "Goru's Shuttle": False,
            "Guristas Shuttle": False,
            "Mobile Decoy Unit":
            False,  # Seems to be left over test mod for deployables
            "Tournament Micro Jump Unit":
            False,  # Normally seen only on tournament arenas
        }

        # do not publish ships that we convert
        for name in conversions.packs['skinnedShips']:
            self.ITEMS_FORCEPUBLISHED[name] = False

        if config.debug:
            # Publish Tactical Dessy Modes if in debug
            # Cannot use GROUPS_FORCEPUBLISHED as this does not force items
            # within group to be published, but rather for the group itself
            # to show up on ship list
            group = self.getGroup("Ship Modifiers", eager="items")
            for item in group.items:
                self.ITEMS_FORCEPUBLISHED[item.name] = True

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False
        }  # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I": ("Storyline", "Miner I"),
            "'Wild' Miner I": ("Storyline", "Miner I"),
            "Khanid Navy Torpedo Launcher": ("Faction", "Torpedo Launcher I"),
            "Dark Blood Tracking Disruptor":
            ("Faction", "Tracking Disruptor I"),
            "Dread Guristas Standup Variable Spectrum ECM":
            ("Structure Faction", "Standup Variable Spectrum ECM I"),
            "Dark Blood Standup Heavy Energy Neutralizer":
            ("Structure Faction", "Standup Heavy Energy Neutralizer I")
        }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in list(self.ITEMS_FORCEDMETAGROUP.items()):
            parent = value[1]
            if parent not in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "Advanced Cerebral Accelerator":
            2487,  # Implants & Boosters > Booster > Cerebral Accelerators
            "Civilian Hobgoblin":
            837,  # Drones > Combat Drones > Light Scout Drones
            "Civilian Light Missile Launcher":
            640,  # Ship Equipment > Turrets & Launchers > Missile Launchers > Light Missile Launchers
            "Civilian Scourge Light Missile":
            920,  # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Small Remote Armor Repairer":
            1059,  # Ship Equipment > Hull & Armor > Remote Armor Repairers > Small
            "Civilian Small Remote Shield Booster":
            603,  # Ship Equipment > Shield > Remote Shield Boosters > Small
            "Hardwiring - Zainou 'Sharpshooter' ZMX10":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX11":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX110":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Prototype Cerebral Accelerator":
            2487,  # Implants & Boosters > Booster > Cerebral Accelerators
            "Prototype Iris Probe Launcher":
            712,  # Ship Equipment > Scanning Equipment > Scan Probe Launchers
            "Standard Cerebral Accelerator":
            2487,  # Implants & Boosters > Booster > Cerebral Accelerators
        }

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(
            self.ITEMS_FORCEDMARKETGROUP)

        self.FORCEDMARKETGROUP = {
            685: False,  # Ship Equipment > Electronic Warfare > ECCM
            681:
            False,  # Ship Equipment > Electronic Warfare > Sensor Backup Arrays
            1639:
            False,  # Ship Equipment > Fleet Assistance > Command Processors
            2527:
            True,  # Ship Equipment > Hull & Armor > Mutadaptive Remote Armor Repairers - has hasTypes set to 1 while actually having no types
        }

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("faction", frozenset((4, 3, 52))),
                                     ("complex", frozenset((6, ))),
                                     ("officer", frozenset((5, )))])
        nonNormalMetas = set(chain(*self.META_MAP.values()))
        self.META_MAP["normal"] = frozenset(
            (0, *(mg.ID for mg in eos.db.getMetaGroups()
                  if mg.ID not in nonNormalMetas)))
        self.META_MAP.move_to_end("normal", last=False)
        self.META_MAP_REVERSE = {
            sv: k
            for k, v in self.META_MAP.items() for sv in v
        }
        self.META_MAP_REVERSE_INDICES = self.__makeReverseMetaMapIndices()
        self.SEARCH_CATEGORIES = (
            "Drone",
            "Module",
            "Subsystem",
            "Charge",
            "Implant",
            "Deployable",
            "Fighter",
            "Structure",
            "Structure Module",
        )
        self.SEARCH_GROUPS = ("Ice Product", "Cargo Container",
                              "Secure Cargo Container",
                              "Audit Log Secure Container",
                              "Freight Container")
        self.ROOT_MARKET_GROUPS = (
            9,  # Ship Equipment
            1111,  # Rigs
            157,  # Drones
            11,  # Ammunition & Charges
            1112,  # Subsystems
            24,  # Implants & Boosters
            404,  # Deployable Structures
            2202,  # Structure Equipment
            2203  # Structure Modifications
        )
        self.SHOWN_MARKET_GROUPS = eos.db.getMarketTreeNodeIds(
            self.ROOT_MARKET_GROUPS)
        self.FIT_CATEGORIES = ['Ship']
        self.FIT_GROUPS = ['Citadel', 'Engineering Complex', 'Refinery']
        # Tell other threads that Market is at their service
        mktRdy.set()
示例#42
0
文件: market.py 项目: bluSch/pyfa
    def __init__(self):
        self.priceCache = {}

        #Init recently used module storage
        serviceMarketRecentlyUsedModules = {"pyfaMarketRecentlyUsedModules": []}

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance().getSettings("pyfaMarketRecentlyUsedModules", serviceMarketRecentlyUsedModules)

        # Start price fetcher
        self.priceWorkerThread = PriceWorkerThread()
        self.priceWorkerThread.daemon = True
        self.priceWorkerThread.start()

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = eos.types.Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Opux Luxury Yacht": self.les_grp, # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate": self.les_grp,  # Amarr Championship prize
            "Gold Magnate": self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue": self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue": self.les_grp, # Amarr Championship prize
            "Guardian-Vexor": self.les_grp, # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue": self.les_grp, # Reward during Crielere event
            "Raven State Issue": self.les_grp,  # AT4 prize
            "Tempest Tribal Issue": self.les_grp, # AT4 prize
            "Apotheosis": self.les_grp, # 5th EVE anniversary present
            "Zephyr": self.les_grp, # 2010 new year gift
            "Primae": self.les_grp, # Promotion of planetary interaction
            "Freki": self.les_grp, # AT7 prize
            "Mimir": self.les_grp, # AT7 prize
            "Utu": self.les_grp, # AT8 prize
            "Adrestia": self.les_grp, # AT8 prize
            "Echelon": self.les_grp, # 2011 new year gift
            "Malice": self.les_grp, # AT9 prize
            "Vangel": self.les_grp, # AT9 prize
            "Iteron Mark IV Quafe Ultra Edition": self.les_grp, # Gift to Fanfest 2012 attendees
            "Iteron Mark IV Quafe Ultramarine Edition": self.les_grp } # Gift to first Japanese subscribers
        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        self.les_grp.items += list(self.getItem(itmn) for itmn in self.ITEMS_FORCEGROUP_R[self.les_grp])
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Ibis": True, # Noobship
            "Impairor": True, # Noobship
            "Velator": True, # Noobship
            "Reaper": True, # Noobship
            "Data Subverter I": False, # Not used in EVE, probably will appear with Dust link
            "Ghost Heavy Missile": False, # Missile used by Sansha
            "QA Damage Module": False, # QA modules used by CCP internally
            "QA ECCM": False,
            "QA Immunity Module": False,
            "QA Multiship Module - 10 Players": False,
            "QA Multiship Module - 20 Players": False,
            "QA Multiship Module - 40 Players": False,
            "QA Multiship Module - 5 Players": False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players": False }

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False, # We moved the only ship from this group to other group anyway
            "Rookie ship": True } # Group-container for published noobships

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I": ("Storyline", "Miner I"),
            "'Wild' Miner I": ("Storyline", "Miner I"),
            "Medium Nano Armor Repair Unit I": ("Tech I", "Medium Armor Repairer I"),
            "Large 'Reprieve' Vestment Reconstructer I": ("Storyline", "Large Armor Repairer I"),
            "Khanid Navy Torpedo Launcher": ("Faction", "Torpedo Launcher I"),
            "Dark Blood Tracking Disruptor": ("Faction", "Tracking Disruptor I"),
            "True Sansha Tracking Disruptor": ("Faction", "Tracking Disruptor I"),
            "Shadow Serpentis Remote Sensor Dampener": ("Faction", "Remote Sensor Dampener I") }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in self.ITEMS_FORCEDMETAGROUP.items():
            parent = value[1]
            if not parent in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "'Alpha' Codebreaker I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Codex' Codebreaker I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Daemon' Codebreaker I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Libram' Codebreaker I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Akemon's Modified 'Noble' ZET5000": 1185, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 10 > Armor Implants
            "Cerebral Accelerator": 977, # Implants & Boosters > Booster
            "Civilian Damage Control": 760, # Ship Equipment > Civilian Modules
            "Civilian EM Ward Field": 760, # Ship Equipment > Civilian Modules
            "Civilian Explosive Deflection Field": 760, # Ship Equipment > Civilian Modules
            "Civilian Hobgoblin": 837, # Drones > Combat Drones > Light Scout Drones
            "Civilian Kinetic Deflection Field": 760, # Ship Equipment > Civilian Modules
            "Civilian Light Missile Launcher": 760, # Ship Equipment > Civilian Modules
            "Civilian Remote Armor Repair System": 760, # Ship Equipment > Civilian Modules
            "Civilian Remote Shield Transporter": 760, # Ship Equipment > Civilian Modules
            "Civilian Stasis Webifier": 760, # Ship Equipment > Civilian Modules
            "Civilian Thermic Dissipation Field": 760, # Ship Equipment > Civilian Modules
            "Civilian Scourge Light Missile": 920, # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Warp Disruptor": 760, # Ship Equipment > Civilian Modules
            "Genolution Core Augmentation CA-1": 618, # Implants & Boosters > Implants > Attribute Enhancers > Implant Slot 1
            "Genolution Core Augmentation CA-2": 621, # Implants & Boosters > Implants > Attribute Enhancers > Implant Slot 4
            "Hardwiring - Zainou 'Sharpshooter' ZMX10": 1156, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 6 > Missile Implants
            "Hardwiring - Zainou 'Sharpshooter' ZMX100": 1156, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 6 > Missile Implants
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000": 1156, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 6 > Missile Implants
            "Hardwiring - Zainou 'Sharpshooter' ZMX11": 1156, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 6 > Missile Implants
            "Hardwiring - Zainou 'Sharpshooter' ZMX110": 1156, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 6 > Missile Implants
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100": 1156, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 6 > Missile Implants
            "Imperial Navy Modified 'Noble' Implant": 1185, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 10 > Armor Implants
            "Imperial Special Ops Field Enhancer - Standard": 618, # Implants & Boosters > Implants > Attribute Enhancers > Implant Slot 1
            "Michi's Excavation Augmentor": 1187, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 10 > Industry Implants
            "Nugoehuvi Synth Blue Pill Booster": 977, # Implants & Boosters > Booster
            "Numon Family Heirloom": 1152, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 6 > Armor Implants
            "Ogdin's Eye Coordination Enhancer": 1163, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 7 > Gunnery Implants
            "Pashan's Turret Customization Mindlink": 1180, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 9 > Gunnery Implants
            "Pashan's Turret Handling Mindlink": 1186, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 10 > Gunnery Implants
            "Prototype Iris Probe Launcher": 712, # Ship Equipment > Turrets & Bays > Scan Probe Launchers
            "Quafe Zero": 977, # Implants & Boosters > Booster
            "Republic Special Ops Field Enhancer - Gamma": 620, # Implants & Boosters > Implants > Attribute Enhancers > Implant Slot 3
            "Sansha Modified 'Gnome' Implant": 1167, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 7 > Shield Implants
            "Shadow": 1310, # Drones > Combat Drones > Fighter Bombers
            "Shaqil's Speed Enhancer": 1157, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 6 > Navigation Implants
            "Sleeper Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Talocan Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Terran Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Tetrimon Data Analyzer I": 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Whelan Machorin's Ballistic Smartlink": 1189, # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 10 > Missile Implants
            "Zor's Custom Navigation Hyper-Link": 1176 } # Implants & Boosters > Implants > Skill Hardwiring > Implant Slot 8 > Navigation Implants

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(self.ITEMS_FORCEDMARKETGROUP)

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("normal",  frozenset((0, 1, 2, 14))),
                                     ("faction", frozenset((4, 3))),
                                     ("complex", frozenset((6,))),
                                     ("officer", frozenset((5,)))])
        self.SEARCH_CATEGORIES = ("Drone", "Module", "Subsystem", "Charge", "Implant")
        self.ROOT_MARKET_GROUPS = (9,     # Modules
                                   1111,  # Rigs
                                   157,   # Drones
                                   11,    # Ammo
                                   1112,  # Subsystems
                                   24)    # Implants & Boosters
        # Tell other threads that Market is at their service
        mktRdy.set()