Skip to content

Commit

Permalink
Make Titan DD's active, and add DPS numbers for them.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebag333 committed Jun 24, 2017
1 parent 7cce5d0 commit 7248628
Show file tree
Hide file tree
Showing 24 changed files with 92 additions and 50 deletions.
6 changes: 6 additions & 0 deletions eos/effects/online.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
effectType = "active"


def handler(fit, src, context):
# Used to make modules active
pass
2 changes: 1 addition & 1 deletion eos/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def rel_listener(target, value, initiator):
if not target or (isinstance(value, Module) and value.isEmpty):
return

pyfalog.debug('{0} changed the relationship with {1}', repr(value), repr(target))
pyfalog.debug(u'Changed the relationship with {0}', target.ship.name)
target.modified = datetime.datetime.now()


Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def addCommandBonus(self, warfareBuffID, value, _module, effect, runTime="normal
self.commandBonuses[warfareBuffID] = (runTime, value, _module, effect)

def __runCommandBoosts(self, runTime="normal"):
pyfalog.debug("Applying gang boosts for {0}", repr(self))
pyfalog.debug(u"Applying gang boosts for {0}", self.name)
for warfareBuffID in self.commandBonuses.keys():
# Unpack all data required to run effect properly
effect_runTime, value, thing, effect = self.commandBonuses[warfareBuffID]
Expand Down
9 changes: 8 additions & 1 deletion eos/saveddata/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,15 @@ def damageStats(self, targetResists):
volley *= self.getModifiedItemAttr("damageMultiplier") or 1
if volley:
cycleTime = self.cycleTime
# Some weapons repeat multiple times in one cycle (think doomsdays)
# Get the number of times it fires off
weaponDoT = max(
self.getModifiedItemAttr("doomsdayDamageDuration", 1) / self.getModifiedItemAttr("doomsdayDamageCycleTime", 1),
1
)

self.__volley = volley
self.__dps = volley / (cycleTime / 1000.0)
self.__dps = (volley * weaponDoT) / (cycleTime / 1000.0)

return self.__dps, self.__volley

Expand Down
2 changes: 1 addition & 1 deletion gui/PFListPane.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def RefreshList(self, doRefresh=False, doFocus=False):
self.SetFocus()

for i in xrange(len(self._wList)):
iwidth, iheight = self._wList[i].GetSize()
__, iheight = self._wList[i].GetSize()
self._wList[i].SetSize((cwidth, iheight))
if doRefresh is True:
self._wList[i].Refresh()
Expand Down
2 changes: 1 addition & 1 deletion gui/aboutData.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"DarkPhoenix \tKadesh Priestess (retired)",
"Darriele \t\tDarriele (retired)",
)
credits = (
devcredits = (
"Entity (Entity) \tCapacitor calculations / EVEAPI python lib / Reverence",
"Aurora \t\tMaths",
"Corollax (Aamrr) \tVarious EOS / pyfa improvements",
Expand Down
4 changes: 2 additions & 2 deletions gui/builtinContextMenus/commandFits.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def populateFits(cls, evt):
if evt is not None:
ids = getattr(evt, 'typeID')
if not isinstance(ids, set):
ids = set([ids])
ids = {ids}
else:
ids = None

Expand Down Expand Up @@ -67,7 +67,7 @@ def getSubMenu(self, context, selection, rootMenu, i, pitem):

if len(self.__class__.commandFits) < 15:
for fit in sorted(self.__class__.commandFits, key=lambda x: x.name):
pyfalog.debug(repr(fit))
pyfalog.debug(fit.name)
menuItem = self.addFit(rootMenu if msw else sub, fit, True)
sub.AppendItem(menuItem)
else:
Expand Down
8 changes: 4 additions & 4 deletions gui/builtinStatsViews/firepowerViewFull.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ def refreshPanel(self, fit):
else:
self.stEff.Hide()

stats = (("labelFullDpsWeapon", lambda: fit.weaponDPS, 3, 0, 0, "%s DPS", None),
("labelFullDpsDrone", lambda: fit.droneDPS, 3, 0, 0, "%s DPS", None),
("labelFullVolleyTotal", lambda: fit.totalVolley, 3, 0, 0, "%s", "Volley: %.1f"),
("labelFullDpsTotal", lambda: fit.totalDPS, 3, 0, 0, "%s", None))
stats = (("labelFullDpsWeapon", lambda: fit.weaponDPS, 3, 0, 3, "%s DPS", None),
("labelFullDpsDrone", lambda: fit.droneDPS, 3, 0, 3, "%s DPS", None),
("labelFullVolleyTotal", lambda: fit.totalVolley, 3, 0, 3, "%s", "Volley: %.1f"),
("labelFullDpsTotal", lambda: fit.totalDPS, 3, 0, 3, "%s", None))
# See GH issue #
# if fit is not None and fit.totalYield > 0:
# self.miningyield.Show()
Expand Down
9 changes: 6 additions & 3 deletions gui/builtinViewColumns/baseName.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@


class BaseName(ViewColumn):
def delayedText(self, display, colItem):
pass

name = "Base Name"

def __init__(self, fittingView, params):
Expand All @@ -44,7 +47,8 @@ def __init__(self, fittingView, params):
self.columnText = "Name"
self.shipImage = fittingView.imageList.GetImageIndex("ship_small", "gui")
self.mask = wx.LIST_MASK_TEXT
self.projectedView = isinstance(fittingView, gui.projectedView.ProjectedView)
# We can't do an isInstance here because we'll get a circular import
self.projectedView = type(fittingView).__name__ == "ProjectedView"

def getColumnText(self, stuff):
if isinstance(stuff, Drone):
Expand All @@ -63,8 +67,7 @@ def getColumnText(self, stuff):
if info:
return "%dx %s (%s)" % (stuff.getProjectionInfo(fitID).amount, stuff.name, stuff.ship.item.name)

pyfalog.warning("Projected View trying to display things that aren't there. stuff: {}, info: {}", repr(stuff),
info)
pyfalog.warning(u"Projected View trying to display things that aren't there.")
return "<unknown>"
else:
return "%s (%s)" % (stuff.name, stuff.ship.item.name)
Expand Down
30 changes: 29 additions & 1 deletion gui/builtinViewColumns/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@


class Miscellanea(ViewColumn):
def delayedText(self, display, colItem):
pass

name = "Miscellanea"

def __init__(self, fittingView, params=None):
Expand Down Expand Up @@ -72,6 +75,31 @@ def __getData(self, stuff):

if itemGroup == "Ship Modifiers":
return "", None
elif itemGroup in ("Super Weapon", "Structure Doomsday Weapon"):
doomsday_duration = stuff.getModifiedItemAttr("doomsdayDamageDuration", 1)
doomsday_dottime = stuff.getModifiedItemAttr("doomsdayDamageCycleTime", 1)
func = stuff.getModifiedItemAttr

volley = sum(
map(
lambda attr: (func("%sDamage" % attr) or 0),
("em", "thermal", "kinetic", "explosive")
)
)
volley *= stuff.getModifiedItemAttr("damageMultiplier") or 1

if volley <= 0:
text = ""
tooltip = ""
elif max(doomsday_duration / doomsday_dottime, 1) > 1:
text = "{0} dmg over {1} s".format(formatAmount(volley * (doomsday_duration / doomsday_dottime), 3, 0, 3), doomsday_duration / 1000)
tooltip = "Raw damage done over time"
else:
text = "{0} dmg".format(formatAmount(volley * (doomsday_duration / doomsday_dottime), 3, 0, 3))
tooltip = "Raw damage done"
return text, tooltip

pass
elif itemGroup in ("Energy Weapon", "Hybrid Weapon", "Projectile Weapon", "Combat Drone", "Fighter Drone"):
trackingSpeed = stuff.getModifiedItemAttr("trackingSpeed")
if not trackingSpeed:
Expand Down Expand Up @@ -524,7 +552,7 @@ def __getData(self, stuff):

duration = cycles * cycleTime / 1000
for number_of_cycles in {5, 10, 25}:
tooltip = "{0}\n{1} charges lasts {2} seconds ({3} cycles)".format(
tooltip = "{0}\n{1} charges lasts {2} ` ({3} cycles)".format(
tooltip,
formatAmount(number_of_cycles * cycles, 3, 0, 3),
formatAmount((duration + reload_time) * number_of_cycles, 3, 0, 3),
Expand Down
2 changes: 1 addition & 1 deletion gui/characterEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def __fetchCallback(self, e=None):
if e is None:
self.stStatus.SetLabel("Successfully fetched {}\'s skills from EVE API.".format(charName))
else:
exc_type, exc_obj, __ = e
__, exc_obj, __ = e
pyfalog.error("Unable to retrieve {0}\'s skills. Error message:\n{1}".format(charName, exc_obj))
self.stStatus.SetLabel("Unable to retrieve {}\'s skills. Error message:\n{}".format(charName, exc_obj))

Expand Down
2 changes: 1 addition & 1 deletion gui/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def populate(self, stuff):
if listItemCount > stuffItemCount:
if listItemCount - stuffItemCount > 20 > stuffItemCount:
self.DeleteAllItems()
for i in range(stuffItemCount):
for __ in range(stuffItemCount):
self.InsertStringItem(sys.maxint, "")
else:
for i in range(listItemCount - stuffItemCount):
Expand Down
8 changes: 2 additions & 6 deletions gui/droneView.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from gui.utils.helpers_wxPython import DragDropHelper
from service.fit import Fit
from service.market import Market
from gui.utils.helpers_static import DRONE_ORDER


class DroneViewDrop(wx.PyDropTarget):
Expand Down Expand Up @@ -155,17 +156,12 @@ def _merge(self, src, dst):
if sFit.mergeDrones(fitID, self.drones[src], self.drones[dst]):
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))

DRONE_ORDER = ('Light Scout Drones', 'Medium Scout Drones',
'Heavy Attack Drones', 'Sentry Drones', 'Fighters',
'Fighter Bombers', 'Combat Utility Drones',
'Electronic Warfare Drones', 'Logistic Drones', 'Mining Drones', 'Salvage Drones')

def droneKey(self, drone):
sMkt = Market.getInstance()

groupName = sMkt.getMarketGroupByItem(drone.item).name

return (self.DRONE_ORDER.index(groupName),
return (DRONE_ORDER.index(groupName),
drone.item.name)

def fitChanged(self, event):
Expand Down
8 changes: 3 additions & 5 deletions gui/mainFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import threading
import time
import webbrowser
from codecs import open
from time import gmtime, strftime

import sqlalchemy
Expand Down Expand Up @@ -53,7 +52,6 @@
from gui.characterSelection import CharacterSelection
from gui.chromeTabs import PFNotebook
from gui.copySelectDialog import CopySelectDialog
from gui.graphFrame import GraphFrame
from gui.mainMenuBar import MainMenuBar
from gui.marketBrowser import ItemSelected, MarketBrowser
from gui.multiSwitch import MultiSwitch
Expand All @@ -67,6 +65,7 @@
from gui.updateDialog import UpdateDialog
from gui.utils.clipboard import fromClipboard, toClipboard
from gui.utils.helpers_wxPython import Frame
from gui.utils.ExportHtml import ExportHtml
from service.character import Character
from service.fit import Fit
from service.port import IPortUser, Port
Expand Down Expand Up @@ -366,7 +365,7 @@ def ShowAboutBox(self, evt):
info.Description = wordwrap(gui.aboutData.description + "\n\nDevelopers:\n\t" +
"\n\t".join(gui.aboutData.developers) +
"\n\nAdditional credits:\n\t" +
"\n\t".join(gui.aboutData.credits) +
"\n\t".join(gui.aboutData.devcredits) +
"\n\nLicenses:\n\t" +
"\n\t".join(gui.aboutData.licenses) +
"\n\nEVE Data: \t" + gamedata_version +
Expand Down Expand Up @@ -881,7 +880,6 @@ def backupToXml(self, event):
self.progressDialog.ShowModal()

def exportHtml(self, event):
from gui.utils.exportHtml import ExportHtml
sFit = Fit.getInstance()
settings = HTMLExportSettings.getInstance()

Expand Down Expand Up @@ -1034,7 +1032,7 @@ def closeWaitDialog(self):

def openGraphFrame(self, event):
if not self.graphFrame:
self.graphFrame = GraphFrame(self)
self.graphFrame = graphFrame.GraphFrame(self)

if graphFrame.graphFrame_enabled:
self.graphFrame.Show()
Expand Down
5 changes: 3 additions & 2 deletions gui/marketBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# noinspection PyPackageRequirements
import wx
from wx.lib import newevent
from service.market import Market
from service.attribute import Attribute
from gui.display import Display
Expand All @@ -32,7 +33,7 @@

pyfalog = Logger(__name__)

ItemSelected, ITEM_SELECTED = wx.lib.newevent.NewEvent()
ItemSelected, ITEM_SELECTED = newevent.NewEvent()

RECENTLY_USED_MODULES = -2
MAX_RECENTLY_USED_MODULES = 50
Expand Down Expand Up @@ -207,7 +208,7 @@ def expandLookup(self, event):
self.SortChildren(root)

def jump(self, item):
pyfalog.debug("Open market group and meta tab for item: {0}", repr(item))
pyfalog.debug("Open market group and meta tab for item: {0}", item.name)
self.marketBrowser.searchMode = False
sMkt = self.sMkt
mg = sMkt.getMarketGroupByItem(item)
Expand Down
4 changes: 2 additions & 2 deletions gui/multiSwitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def AddPage(self, tabWnd=None, tabTitle="Empty Tab", tabImage=None, showClose=Tr

PFNotebook.AddPage(self, tabWnd, tabTitle, tabImage, True)

def DeletePage(self, n, *args, **kwargs):
PFNotebook.DeletePage(self, n, *args, **kwargs)
def DeletePage(self, n, internal=False):
PFNotebook.DeletePage(self, n, internal=internal)
if self.GetPageCount() == 0:
self.AddPage()

Expand Down
15 changes: 7 additions & 8 deletions gui/projectedView.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
# noinspection PyPackageRequirements
import wx
from logbook import Logger
import gui.display as d
import gui.globalEvents as GE
import gui.droneView
from gui.utils.helpers_static import DRONE_ORDER
from gui.display import Display
from gui.builtinViewColumns.state import State
from gui.contextMenu import ContextMenu
from gui.utils.helpers_wxPython import DragDropHelper
Expand Down Expand Up @@ -62,15 +62,15 @@ def OnData(self, x, y, t):
return t


class ProjectedView(d.Display):
class ProjectedView(Display):
DEFAULT_COLS = ["State",
"Ammo Icon",
"Base Icon",
"Base Name",
"Ammo"]

def __init__(self, parent):
d.Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)
Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)

self.lastFitId = None

Expand All @@ -80,8 +80,6 @@ def __init__(self, parent):
self.Bind(wx.EVT_LEFT_DCLICK, self.remove)
self.Bind(wx.EVT_KEY_UP, self.kbEvent)

self.droneView = gui.droneView.DroneView

if "__WXGTK__" in wx.PlatformInfo:
self.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
else:
Expand Down Expand Up @@ -167,7 +165,7 @@ def droneSort(self, drone):
if item.marketGroup is None:
item = item.metaGroup.parent

return (self.droneView.DRONE_ORDER.index(item.marketGroup.name),
return (DRONE_ORDER.index(item.marketGroup.name),
drone.item.name)

@staticmethod
Expand All @@ -177,7 +175,8 @@ def fitSort(fit):
def fitChanged(self, event):
sFit = Fit.getInstance()
fit = sFit.getFit(event.fitID)
pyfalog.debug("ProjectedView::fitChanged: {}", repr(fit))
if fit:
pyfalog.debug("ProjectedView::fitChanged: {0}", fit.name)

self.Parent.Parent.DisablePage(self, not fit or fit.isStructure)

Expand Down
2 changes: 1 addition & 1 deletion gui/sfBrowserItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def MouseClick(self, event):
button.SetState(state | (not BTN_PRESSED))
return button

bwidth, bheight = button.GetSize()
bwidth, __ = button.GetSize()
bx += bwidth + self.padding

return None
Expand Down
6 changes: 3 additions & 3 deletions gui/shipBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ def DrawItem(self, mdc):

mdc.SetFont(Fonts.getFont("font_plus_one"))

categoryName, fittings = self.fittingInfo
categoryName, __ = self.fittingInfo

mdc.DrawText(categoryName, self.catx, self.caty)

Expand Down Expand Up @@ -1233,7 +1233,7 @@ def MouseLeftUp(self, event):
self.newBtn.SetBitmap(self.newBmp)
self.Refresh()
else:
shipName, __, fittings = self.shipFittingInfo
__, __, fittings = self.shipFittingInfo
if fittings > 0:
wx.PostEvent(self.shipBrowser, Stage3Selected(shipID=self.shipID, back=True))
else:
Expand Down Expand Up @@ -1299,7 +1299,7 @@ def UpdateElementsPos(self, mdc):

self.shipNamey = (rect.height - self.shipBmp.GetHeight()) / 2

shipName, shipTrait, fittings = self.shipFittingInfo
shipName, __, fittings = self.shipFittingInfo

mdc.SetFont(Fonts.getFont("font_plus_one"))
__, htext = mdc.GetTextExtent(shipName)
Expand Down
Loading

0 comments on commit 7248628

Please sign in to comment.