Esempio n. 1
0
File: hps.py Progetto: TeamSWAP/swap
    def onAnalyzerTick(self, analyzer):
        self.beginBatch()
        self.clearList()

        index = 0
        raidTotalHealing = 0
        for player in raid.playerData:
            raidTotalHealing += player['totalHealing']

        for player in sorted(raid.playerData, key=lambda x:x['totalHealing'], reverse=True):
            if player['totalHealing'] == 0:
                continue
            if raidTotalHealing > 0:
                percent = "%.2f"%((float(player['totalHealing']) / float(raidTotalHealing)) * 100.0)
            else:
                percent = "%.2f"%0

            color = self.getForegroundColor()
            if player['name'] == analyzer.parser.me.rawName:
                color = config.getColor("overlayListSelfColor")

            hps = player['avgHps']
            percent = util.div(player['totalHealing'], raidTotalHealing)

            color = self.getForegroundColor()
            if player['name'] == analyzer.parser.me.rawName:
                color = config.getColor("overlayListSelfColor")

            self.addRow([player['name'][1:], locale.format("%.2f", hps, grouping=True), percent], color)

            index += 1
        self.endBatch()
        self.panel.Layout()
Esempio n. 2
0
    def onAnalyzerTick(self, analyzer):
        self.beginBatch()
        self.clearList()

        index = 0
        raidTotalDamageTaken = 0
        for player in raid.playerData:
            raidTotalDamageTaken += player['totalDamageTaken']

        for player in sorted(raid.playerData,
                             key=lambda x: x['totalDamageTaken'],
                             reverse=True):
            if player['totalDamageTaken'] == 0:
                continue

            percent = util.div(player['totalDamageTaken'],
                               raidTotalDamageTaken)

            color = self.getForegroundColor()
            if player['name'] == analyzer.parser.me.rawName:
                color = config.getColor("overlayListSelfColor")

            self.addRow([
                player['name'][1:],
                locale.format("%d", player['totalDamageTaken'], grouping=True),
                percent
            ], color)

            index += 1
        self.endBatch()
        self.panel.Layout()
Esempio n. 3
0
    def addColorOption(self, key, label, parent, sizer):
        box = wx.BoxSizer(wx.HORIZONTAL)

        nameLabel = wx.StaticText(parent, -1, label)
        nameLabel.SetFont(self.nameFont)

        button = wx.Button(parent, -1, "", size=(100, -1))
        button.SetBackgroundColour(config.getColor(key))

        def buttonClick(e):
            data = wx.ColourData()
            data.SetChooseFull(True)
            data.SetColour(button.GetBackgroundColour())
            dialog = wx.ColourDialog(self, data)
            if dialog.ShowModal() == wx.ID_OK:
                (red, green, blue) = dialog.GetColourData().GetColour().Get()
                color = wx.Colour(red, green, blue, 255)
                button.SetBackgroundColour(color)

        button.Bind(wx.EVT_BUTTON, buttonClick)

        box.Add(nameLabel, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        box.Add(button, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.colorOptions[key] = button

        sizer.Add(box, 0, wx.LEFT | wx.RIGHT | wx.EXPAND, 10)
Esempio n. 4
0
    def onAnalyzerTick(self, analyzer):
        self.beginBatch()
        self.clearList()

        index = 0
        raidTotalThreat = 0
        for player in raid.playerData:
            if player['totalThreat'] < 0:
                continue
            raidTotalThreat += player['totalThreat']

        for player in sorted(raid.playerData, key=lambda x:x['totalThreat'], reverse=True):
            if player['totalThreat'] == 0:
                continue

            percent = 0
            if player['totalThreat'] >  0:
                percent = util.div(player['totalThreat'], raidTotalThreat)

            color = self.getForegroundColor()
            if player['name'] == analyzer.parser.me.rawName:
                color = config.getColor("overlayListSelfColor")

            self.addRow([player['name'][1:], locale.format("%d", player['totalThreat'], grouping=True), percent], color)

            index += 1
        self.endBatch()
        self.panel.Layout()
Esempio n. 5
0
    def addColorOption(self, key, label, parent, sizer):
        box = wx.BoxSizer(wx.HORIZONTAL)

        nameLabel = wx.StaticText(parent, -1, label)
        nameLabel.SetFont(self.nameFont)

        button = wx.Button(parent, -1, "", size=(100, -1))
        button.SetBackgroundColour(config.getColor(key))

        def buttonClick(e):
            data = wx.ColourData()
            data.SetChooseFull(True)
            data.SetColour(button.GetBackgroundColour())
            dialog = wx.ColourDialog(self, data)
            if dialog.ShowModal() == wx.ID_OK:
                (red, green, blue) = dialog.GetColourData().GetColour().Get()
                color = wx.Colour(red, green, blue, 255)
                button.SetBackgroundColour(color)
        button.Bind(wx.EVT_BUTTON, buttonClick)

        box.Add(nameLabel, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        box.Add(button, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.colorOptions[key] = button

        sizer.Add(box, 0, wx.LEFT | wx.RIGHT | wx.EXPAND, 10)
Esempio n. 6
0
File: hps.py Progetto: TeamSWAP/swap
    def onAnalyzerTick(self, analyzer):
        self.beginBatch()
        self.clearList()

        index = 0
        raidTotalHealing = 0
        for player in raid.playerData:
            raidTotalHealing += player['totalHealing']

        for player in sorted(raid.playerData,
                             key=lambda x: x['totalHealing'],
                             reverse=True):
            if player['totalHealing'] == 0:
                continue
            if raidTotalHealing > 0:
                percent = "%.2f" % (
                    (float(player['totalHealing']) / float(raidTotalHealing)) *
                    100.0)
            else:
                percent = "%.2f" % 0

            color = self.getForegroundColor()
            if player['name'] == analyzer.parser.me.rawName:
                color = config.getColor("overlayListSelfColor")

            hps = player['avgHps']
            percent = util.div(player['totalHealing'], raidTotalHealing)

            color = self.getForegroundColor()
            if player['name'] == analyzer.parser.me.rawName:
                color = config.getColor("overlayListSelfColor")

            self.addRow([
                player['name'][1:],
                locale.format("%.2f", hps, grouping=True), percent
            ], color)

            index += 1
        self.endBatch()
        self.panel.Layout()
Esempio n. 7
0
 def getForegroundColor(self):
     return config.getColor("overlayFgColor")
Esempio n. 8
0
 def getBackgroundColor(self):
     return config.getColor("overlayBgColor")
Esempio n. 9
0
 def getForegroundColor(self):
     return config.getColor("overlayFgColor")
Esempio n. 10
0
 def getBackgroundColor(self):
     return config.getColor("overlayBgColor")
Esempio n. 11
0
def genbgstatement(sec):
	return ((dorgba(config.getColor(
						sec.bgcolor[0]), 
						sec.bgcolor[1])+" " if hasattr(sec, "bgcolor") else "") +
		(sec.bkgimg if hasattr(sec, "bkgimg") else "") )