def __init__(self): BlackEventBox.__init__(self) f = BlackFrame("Afflictions") t = gtk.Table(columns=6, rows=1, homogeneous=True) f.add(t) self.all_labels = {} self.add(f) vboxes = [gtk.VBox() for i in xrange(6)] for i in xrange(6): t.attach(vboxes[i], left_attach=i, right_attach=i + 1, top_attach=0, bottom_attach=1) aff_file = open(os.path.join(os.path.expanduser("~"), "muddata", "affs_gui.csv"), "r") reader = csv.DictReader(aff_file) affs = {c: [] for c in GUI_CURES} for row in reader: if row["cure"] in GUI_CURES: affs[row["cure"]].append((row["affliction"], row["short_name"])) # if row['cure2'] in GUI_CURES: # affs[row['cure2']].append((row['affliction'],row['short_name'])) for i, c in enumerate(affs.keys()): group = AffGroup(c, affs[c], self) vboxes[i % 6].pack_start(group, expand=False)
def __init__(self, name): BlackEventBox.__init__(self) f = BlackFrame(name) self.add(f) self.data_label = gtk.Label() self.data_label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(ge.OFF_WHITE)) f.add(self.data_label)
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame("Hp/Mana") vbox = gtk.VBox() self.hp = HpManaWidget("HP") self.mana = HpManaWidget("Mana") vbox.pack_start(self.hp, expand=True) vbox.pack_start(self.mana, expand=True) f.add(vbox) self.add(f)
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame("Self") box = gtk.VBox() f.add(box) self.hp_mana = HpManaPanel() box.pack_start(self.hp_mana, expand=False) self.bleed = BleedPanel() box.pack_start(self.bleed, expand=False) self.add(f)
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame("Bleed") t = gtk.Table(rows=1, columns=5, homogeneous=True) l = FormattedLabel("Bleed") t.attach(l, left_attach=0, right_attach=1, top_attach=0, bottom_attach=1) self.current = 0 self.max = 150 self.pb = gtk.ProgressBar() t.attach(self.pb, left_attach=1, right_attach=5, top_attach=0, bottom_attach=1) self.update() f.add(t) self.add(f)
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame('Character') hbox=gtk.HBox() self.elements={'class':CharDataLabel('Class'), 'level':CharDataLabel('Level'), 'org':CharDataLabel('Org')} hbox.pack_start(self.elements['class'],expand=True) hbox.pack_start(self.elements['level'],expand=True) hbox.pack_start(self.elements['org'],expand=True) f.add(hbox) self.add(f)
def __init__(self): BlackEventBox.__init__(self) self.shield = ToggleLabel("Shield", ge.RED) self.rebound = ToggleLabel("Rebounding", ge.RED) self.prism = ToggleLabel("Prismatic", ge.RED) self.curseward = ToggleLabel("Curseward", ge.PURPLE) f = BlackFrame("Shields") t = gtk.Table(columns=2, rows=2, homogeneous=True) t.attach(self.shield, top_attach=0, bottom_attach=1, left_attach=0, right_attach=1) t.attach(self.curseward, top_attach=1, bottom_attach=2, left_attach=0, right_attach=1) t.attach(self.rebound, top_attach=0, bottom_attach=1, left_attach=1, right_attach=2) t.attach(self.prism, top_attach=1, bottom_attach=2, left_attach=1, right_attach=2) f.add(t) self.add(f)
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame('Limbs') self.add(f) t = gtk.Table(rows=3, columns=2, homogeneous=True) f.add(t) self.limbs = {'head':LimbDamageLabel('Head'), 'torso':LimbDamageLabel('Torso'), 'left arm':LimbDamageLabel('Left Arm'), 'right arm':LimbDamageLabel('Right Arm'), 'left leg':LimbDamageLabel('Left Leg'), 'right leg':LimbDamageLabel('Right Leg')} l=['head','torso','left arm','right arm','left leg','right leg'] for i,k in enumerate(l): t.attach(self.limbs[k], top_attach=i/2, bottom_attach=i/2+1, left_attach=i%2, right_attach=i%2+1)
def __init__(self, limb_name): BlackEventBox.__init__(self) self.limb_name = limb_name self.title_label = FormattedLabel(limb_name) self.data_label = FormattedLabel("") self.damage = 0 self.hits_left = 0 self.confirmed_damage = 0 self.hits = 0 f = BlackFrame("") self.add(f) t = gtk.Table(rows=1, columns=3, homogeneous=True) f.add(t) t.attach(self.title_label, bottom_attach=1, top_attach=0, left_attach=0, right_attach=1) t.attach(self.data_label, bottom_attach=1, top_attach=0, left_attach=1, right_attach=3) self.update(self.damage, self.hits_left, self.confirmed_damage, self.hits)
def __init__(self, name, seconds): BlackEventBox.__init__(self) self.working = False self.timer_start = 0 f = BlackFrame("") t = gtk.Table(columns=4, rows=1, homogeneous=True) l = FormattedLabel(name) vbox = gtk.VBox() self.timer_label = CountdownTimer(seconds) self.timer_bar = CountdownBar(seconds) vbox.pack_start(self.timer_label, expand=True) vbox.pack_start(self.timer_bar, expand=True) t.attach(l, left_attach=0, right_attach=1, top_attach=0, bottom_attach=1) t.attach(vbox, left_attach=1, right_attach=4, top_attach=0, bottom_attach=1) f.add(t) self.add(f)
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame("Character") hbox = gtk.HBox() self.elements = { "class": CharDataLabel("Class"), "level": CharDataLabel("Level"), "statpack": CharDataLabel("Statpack"), "org": CharDataLabel("Org"), } hbox.pack_start(self.elements["class"], expand=True) hbox.pack_start(self.elements["level"], expand=True) hbox.pack_start(self.elements["statpack"], expand=True) hbox.pack_start(self.elements["org"], expand=True) f.add(hbox) self.add(f)
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame("Limbs") self.add(f) t = gtk.Table(rows=3, columns=2, homogeneous=True) f.add(t) self.limbs = { "head": LimbDamageLabel("Head"), "torso": LimbDamageLabel("Torso"), "left arm": LimbDamageLabel("Left Arm"), "right arm": LimbDamageLabel("Right Arm"), "left leg": LimbDamageLabel("Left Leg"), "right leg": LimbDamageLabel("Right Leg"), } l = ["head", "torso", "left arm", "right arm", "left leg", "right leg"] for i, k in enumerate(l): t.attach( self.limbs[k], top_attach=i / 2, bottom_attach=i / 2 + 1, left_attach=i % 2, right_attach=i % 2 + 1 )
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame('Cooldowns') t=gtk.Table(columns=2, rows=3, homogeneous=True) self.cooldowns={'herb':CountdownWidget('Herb',HERB_BALANCE), 'pipe':CountdownWidget('Smoke',PIPE_BALANCE), 'salve':CountdownWidget('Salve',SALVE_BALANCE), 'focus':CountdownWidget('Focus',FOCUS_BALANCE), 'purge':CountdownWidget('Purge',PURGE_BALANCE), 'tree':CountdownWidget('Tree',TREE_BALANCE)} t.attach(self.cooldowns['herb'],left_attach=0, right_attach=1, top_attach=0, bottom_attach=1) t.attach(self.cooldowns['pipe'],left_attach=0, right_attach=1, top_attach=1, bottom_attach=2) t.attach(self.cooldowns['salve'],left_attach=0, right_attach=1, top_attach=2, bottom_attach=3) t.attach(self.cooldowns['focus'],left_attach=1, right_attach=2, top_attach=0, bottom_attach=1) t.attach(self.cooldowns['purge'],left_attach=1, right_attach=2, top_attach=1, bottom_attach=2) t.attach(self.cooldowns['tree'],left_attach=1, right_attach=2, top_attach=2, bottom_attach=3) f.add(t) self.add(f)
class AffGroup(BlackEventBox): def __init__(self, cure_name, affs, panel=None): BlackEventBox.__init__(self) self.cure_name = cure_name self.frame = BlackFrame(cure_name) self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(ge.BG_DARK_GRAY)) t = gtk.Table(columns=1, rows=len(affs), homogeneous=True) self.labels = {} for i, (name, short_name) in enumerate(affs): label = AffLabel(name, short_name, i % 2 == 0) t.attach(label, left_attach=0, right_attach=1, top_attach=i, bottom_attach=i + 1) self.labels[name] = label if panel: panel.all_labels[name] = label self.frame.add(t) self.add(self.frame) def __getitem__(self, item): return self.labels[item]
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame("Cooldowns") t = gtk.Table(columns=2, rows=3, homogeneous=True) self.cooldowns = { "herb": CountdownWidget("Herb", HERB_BALANCE), "pipe": CountdownWidget("Smoke", PIPE_BALANCE), "salve": CountdownWidget("Salve", SALVE_BALANCE), "focus": CountdownWidget("Focus", FOCUS_BALANCE), "purge": CountdownWidget("Purge", PURGE_BALANCE), "tree": CountdownWidget("Tree", TREE_BALANCE), } t.attach(self.cooldowns["herb"], left_attach=0, right_attach=1, top_attach=0, bottom_attach=1) t.attach(self.cooldowns["pipe"], left_attach=0, right_attach=1, top_attach=1, bottom_attach=2) t.attach(self.cooldowns["salve"], left_attach=0, right_attach=1, top_attach=2, bottom_attach=3) t.attach(self.cooldowns["focus"], left_attach=1, right_attach=2, top_attach=0, bottom_attach=1) t.attach(self.cooldowns["purge"], left_attach=1, right_attach=2, top_attach=1, bottom_attach=2) t.attach(self.cooldowns["tree"], left_attach=1, right_attach=2, top_attach=2, bottom_attach=3) f.add(t) self.add(f)
def __init__(self): BlackEventBox.__init__(self) f = BlackFrame("Enemy") box = gtk.VBox() self.name_label = gtk.Label("Hello") self.name_label.modify_font(pango.FontDescription("monospace 20")) self.name_label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(ge.RED)) box.pack_start(self.name_label, expand=False) self.char_data_panel = CharDataPanel() box.pack_start(self.char_data_panel, expand=False) self.cooldown_panel = CountdownPanel() box.pack_start(self.cooldown_panel, expand=False) self.aff_panel = AffPanel() box.pack_start(self.aff_panel, expand=False) f.add(box) self.add(f) self.shield = ShieldBox() box.pack_start(self.shield, expand=False) self.hp_mana = HpManaPanel() box.pack_start(self.hp_mana, expand=False) self.limb_panel = LimbDamagePanel() box.pack_start(self.limb_panel, expand=False)