Merge branch 'master' of git://git.assembla.com/fpdb-eric

This commit is contained in:
Ray 2008-10-28 09:37:54 -04:00
commit 81e787221a
3 changed files with 36 additions and 6 deletions

View File

@ -53,6 +53,20 @@ class Site:
self.site_path = node.getAttribute("site_path") self.site_path = node.getAttribute("site_path")
self.HH_path = node.getAttribute("HH_path") self.HH_path = node.getAttribute("HH_path")
self.decoder = node.getAttribute("decoder") self.decoder = node.getAttribute("decoder")
self.hudopacity = node.getAttribute("hudopacity")
if self.hudopacity == "":
self.hudopacity = 0.90
else:
self.hudopacity = float(self.hudopacity)
self.hudbgcolor = node.getAttribute("bgcolor")
if self.hudbgcolor == "":
self.hudbgcolor = "#FFFFFF"
self.hudfgcolor = node.getAttribute("fgcolor")
if self.hudfgcolor == "":
self.hudfgcolor = "#000000"
self.layout = {} self.layout = {}
for layout_node in node.getElementsByTagName('layout'): for layout_node in node.getElementsByTagName('layout'):

View File

@ -29,7 +29,6 @@ Main for FreePokerTools HUD.
# to do no hud window for hero # to do no hud window for hero
# to do things to add to config.xml # to do things to add to config.xml
# to do font and size # to do font and size
# to do bg and fg color
# to do opacity # to do opacity
# Standard Library modules # Standard Library modules

View File

@ -67,13 +67,20 @@ class Hud:
# self.main_window.set_keep_above(True) # self.main_window.set_keep_above(True)
self.main_window.set_title(table.name + " FPDBHUD") self.main_window.set_title(table.name + " FPDBHUD")
self.main_window.connect("destroy", self.kill_hud) self.main_window.connect("destroy", self.kill_hud)
self.main_window.set_decorated(False)
#self.main_window.set_transient_for(parent.get_toplevel()) #self.main_window.set_transient_for(parent.get_toplevel())
self.ebox = gtk.EventBox() self.ebox = gtk.EventBox()
self.label = gtk.Label("Close this window to\nkill the HUD for\n %s\nMinimizing it hides stats." % self.label = gtk.Label("Right click to close HUD for %s\nor Save Stat Positions." % (table.name))
(table.name))
self.label.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(config.supported_sites[self.table.site].hudbgcolor))
self.label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(config.supported_sites[self.table.site].hudfgcolor))
self.main_window.add(self.ebox) self.main_window.add(self.ebox)
self.ebox.add(self.label) self.ebox.add(self.label)
self.ebox.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(config.supported_sites[self.table.site].hudbgcolor))
self.ebox.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(config.supported_sites[self.table.site].hudfgcolor))
self.main_window.move(self.table.x, self.table.y) self.main_window.move(self.table.x, self.table.y)
# A popup window for the main window # A popup window for the main window
@ -331,7 +338,9 @@ class Stat_Window:
self.window = gtk.Window() self.window = gtk.Window()
self.window.set_decorated(0) self.window.set_decorated(0)
self.window.set_opacity(parent.config.supported_sites[self.table.site].hudopacity)
self.window.set_gravity(gtk.gdk.GRAVITY_STATIC) self.window.set_gravity(gtk.gdk.GRAVITY_STATIC)
# self.window.set_keep_above(1) # self.window.set_keep_above(1)
self.window.set_title("%s" % seat) self.window.set_title("%s" % seat)
self.window.set_property("skip-taskbar-hint", True) self.window.set_property("skip-taskbar-hint", True)
@ -348,9 +357,17 @@ class Stat_Window:
self.label.append([]) self.label.append([])
for c in range(self.game.cols): for c in range(self.game.cols):
self.e_box[r].append( gtk.EventBox() ) self.e_box[r].append( gtk.EventBox() )
self.e_box[r][c].modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(parent.config.supported_sites[self.table.site].hudbgcolor))
self.e_box[r][c].modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(parent.config.supported_sites[self.table.site].hudfgcolor))
Stats.do_tip(self.e_box[r][c], 'farts') Stats.do_tip(self.e_box[r][c], 'farts')
self.grid.attach(self.e_box[r][c], c, c+1, r, r+1, xpadding = 0, ypadding = 0) self.grid.attach(self.e_box[r][c], c, c+1, r, r+1, xpadding = 0, ypadding = 0)
self.label[r].append( gtk.Label('xxx') ) self.label[r].append( gtk.Label('xxx') )
self.label[r][c].modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(parent.config.supported_sites[self.table.site].hudbgcolor))
self.label[r][c].modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(parent.config.supported_sites[self.table.site].hudfgcolor))
self.e_box[r][c].add(self.label[r][c]) self.e_box[r][c].add(self.label[r][c])
self.e_box[r][c].connect("button_press_event", self.button_press_cb) self.e_box[r][c].connect("button_press_event", self.button_press_cb)
# font = pango.FontDescription("Sans 8") # font = pango.FontDescription("Sans 8")
@ -541,7 +558,7 @@ if __name__== "__main__":
c = Configuration.Config() c = Configuration.Config()
#tables = Tables.discover(c) #tables = Tables.discover(c)
t = Tables.discover_table_by_name(c, "Corona") t = Tables.discover_table_by_name(c, "Chelsea")
if t is None: if t is None:
print "Table not found." print "Table not found."
db = Database.Database(c, 'fpdb', 'holdem') db = Database.Database(c, 'fpdb', 'holdem')