Merge branch 'master' of git://git.assembla.com/free_poker_tools.git

Conflicts:
	pyfpdb/Hud.py
This commit is contained in:
eblade 2009-01-07 12:46:19 -05:00
commit 326805950b
2 changed files with 52 additions and 65 deletions

View File

@ -2,7 +2,18 @@
<FreePokerToolsConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FreePokerToolsConfig.xsd">
<supported_sites>
<site enabled="True" site_name="PokerStars" table_finder="PokerStars.exe" screen_name="ENTER HERO NAME" site_path="~/.wine/drive_c/Program Files/PokerStars/" HH_path="~/.wine/drive_c/Program Files/PokerStars/HandHistory/abc/" decoder="pokerstars_decode_table" converter="passthrough" supported_games="holdem,razz,omahahi,omahahilo,studhi,studhilo">
<site enabled="True"
site_name="PokerStars"
table_finder="PokerStars.exe"
screen_name="ENTER HERO NAME"
site_path=""
HH_path=""
decoder="pokerstars_decode_table"
converter="passthrough"
bgcolor="#000000"
fgcolor="#FFFFFF"
hudopacity="1.0"
supported_games="holdem,razz,omahahi,omahahilo,studhi,studhilo">
<layout max="8" width="792" height="546" fav_seat="0">
<location seat="1" x="684" y="61"> </location>
<location seat="2" x="689" y="239"> </location>
@ -49,7 +60,18 @@
<location seat="2" x="10" y="288"> </location>
</layout>
</site>
<site enabled="True" site_name="Full Tilt Poker" table_finder="FullTiltPoker.exe" screen_name="ENTER HERO NAME" site_path="~/.wine/drive_c/Program Files/Full Tilt Poker/" HH_path="~/.wine/drive_c/Program Files/Full Tilt Poker/HandHistory/abc/" decoder="fulltilt_decode_table" converter="passthrough" supported_games="holdem,razz,omahahi,omahahilo,studhi,studhilo">
<site enabled="True"
site_name="Full Tilt Poker"
table_finder="FullTiltPoker.exe"
screen_name="ENTER HERO NAME"
site_path=""
HH_path=""
decoder="fulltilt_decode_table"
converter="passthrough"
bgcolor="#000000"
fgcolor="#FFFFFF"
hudopacity="1.0"
supported_games="holdem,razz,omahahi,omahahilo,studhi,studhilo">
<layout fav_seat="0" height="547" max="8" width="794">
<location seat="1" x="640" y="64"> </location>
<location seat="2" x="650" y="230"> </location>
@ -84,7 +106,18 @@
<location seat="9" x="70" y="53"> </location>
</layout>
</site>
<site enabled="False" site_name="Everleaf" table_finder="Poker.exe" screen_name="ENTER HERO NAME" site_path="" HH_path="" decoder="Unknown" converter="EverleafToFpdb" supported_games="holdem,razz,omahahi,omahahilo,studhi" fgcolor="#48D1CC" bgcolor="#000000" opacity="0.75">
<site enabled="False"
site_name="Everleaf"
table_finder="Poker.exe"
screen_name="ENTER HERO NAME"
site_path=""
HH_path=""
decoder="Unknown"
converter="EverleafToFpdb"
supported_games="holdem,razz,omahahi,omahahilo,studhi"
fgcolor="#48D1CC"
bgcolor="#000000"
opacity="0.75">
<layout fav_seat="0" height="546" max="6" width="792">
<location seat="1" x="581" y="109"> </location>
<location seat="2" x="605" y="287"> </location>
@ -120,7 +153,7 @@
<stat click="tog_decorate" col="1" popup="default" row="1" stat_name="wtsd" tip="tip1"> </stat>
<stat click="tog_decorate" col="2" popup="default" row="1" stat_name="wmsd" tip="tip1"> </stat>
</game>
<game cols="3" db="fpdb" game_name="razz" rows="2">
<game cols="3" db="fpdb" game_name="razz" rows="2" aux="stud_mucked">
<stat click="tog_decorate" col="0" popup="default" row="0" stat_name="vpip" tip="tip1"> </stat>
<stat click="tog_decorate" col="1" popup="default" row="0" stat_name="pfr" tip="tip1"> </stat>
<stat click="tog_decorate" col="2" popup="default" row="0" stat_name="ffreq_1" tip="tip1"> </stat>
@ -144,7 +177,7 @@
<stat click="tog_decorate" col="1" popup="default" row="1" stat_name="wtsd" tip="tip1"> </stat>
<stat click="tog_decorate" col="2" popup="default" row="1" stat_name="wmsd" tip="tip1"> </stat>
</game>
<game cols="3" db="fpdb" game_name="studhi" rows="2">
<game cols="3" db="fpdb" game_name="studhi" rows="2" aux="stud_mucked">
<stat click="tog_decorate" col="0" popup="default" row="0" stat_name="vpip" tip="tip1"> </stat>
<stat click="tog_decorate" col="1" popup="default" row="0" stat_name="pfr" tip="tip1"> </stat>
<stat click="tog_decorate" col="2" popup="default" row="0" stat_name="ffreq_1" tip="tip1"> </stat>
@ -152,7 +185,7 @@
<stat click="tog_decorate" col="1" popup="default" row="1" stat_name="wtsd" tip="tip1"> </stat>
<stat click="tog_decorate" col="2" popup="default" row="1" stat_name="wmsd" tip="tip1"> </stat>
</game>
<game cols="3" db="fpdb" game_name="studhilo" rows="2">
<game cols="3" db="fpdb" game_name="studhilo" rows="2" aux="stud_mucked">
<stat click="tog_decorate" col="0" popup="default" row="0" stat_name="vpip" tip="tip1"> </stat>
<stat click="tog_decorate" col="1" popup="default" row="0" stat_name="pfr" tip="tip1"> </stat>
<stat click="tog_decorate" col="2" popup="default" row="0" stat_name="ffreq_1" tip="tip1"> </stat>
@ -193,9 +226,9 @@
<supported_databases>
<database db_name="fpdb" db_server="mysql" db_ip="localhost" db_user="fpdb" db_pass="YOUR MYSQL PASSWORD" db_type="fpdb"> </database>
</supported_databases>
<mucked_windows>
<mw mw_name="stud1" format="stud" rows="8" cols="11" deck="Cards01.png" card_wd="30" card_ht="42"> </mw>
</mucked_windows>
<aux_windows>
<aw card_ht="42" card_wd="30" class="Stud_mucked" cols="11" deck="Cards01.png" module="Mucked" name="stud_mucked" rows="8"> </aw>
</aux_windows>
</FreePokerToolsConfig>

View File

@ -68,7 +68,6 @@ class Hud:
if font_size == None:
font_size = "8"
print "Setting font to ", font + " " + font_size
self.font = pango.FontDescription(font + " " + font_size)
# do we need to add some sort of condition here for dealing with a request for a font that doesn't exist?
@ -98,7 +97,7 @@ class Hud:
self.main_window.move(self.table.x, self.table.y)
# A popup window for the main window
# A popup menu for the main window
self.menu = gtk.Menu()
self.item1 = gtk.MenuItem('Kill this HUD')
self.menu.append(self.item1)
@ -252,7 +251,10 @@ class Hud:
def update(self, hand, config, stat_dict):
self.hand = hand # this is the last hand, so it is available later
self.stat_dict = stat_dict # so this is available for popups, etc
self.update_table_position()
self.stat_dict = stat_dict
for s in stat_dict:
try:
self.stat_windows[stat_dict[s]['seat']].player_id = stat_dict[s]['player_id']
@ -314,18 +316,10 @@ class Stat_Window:
# and double-clicks.
if event.button == 3: # right button event
if event.type == gtk.gdk.BUTTON_PRESS: # left button single click
if self.sb_click > 0: return
self.sb_click = gobject.timeout_add(250, self.single_click, widget)
elif event.type == gtk.gdk._2BUTTON_PRESS: # left button double click
if self.sb_click > 0:
gobject.source_remove(self.sb_click)
self.sb_click = 0
self.double_click(widget, event, *args)
Popup_window(widget, self)
if event.button == 2: # middle button event
self.window.hide()
pass
if event.button == 1: # left button event
# TODO: make position saving save sizes as well?
@ -334,28 +328,6 @@ class Stat_Window:
else:
self.window.begin_move_drag(event.button, int(event.x_root), int(event.y_root), event.time)
def single_click(self, widget):
# Callback from the timeout in the single-click finding part of the
# button press call back. This needs to be modified to get all the
# arguments from the call.
self.sb_click = 0
Popup_window(widget, self)
return False
def double_click(self, widget, event, *args):
self.toggle_decorated(widget)
def toggle_decorated(self, widget):
top = widget.get_toplevel()
(x, y) = top.get_position()
if top.get_decorated():
top.set_decorated(0)
top.move(x, y)
else:
top.set_decorated(1)
top.move(x, y)
def relocate(self, x, y):
self.x = x + self.table.x
self.y = y + self.table.y
@ -395,7 +367,7 @@ class Stat_Window:
self.e_box[r][c].modify_bg(gtk.STATE_NORMAL, parent.backgroundcolor)
self.e_box[r][c].modify_fg(gtk.STATE_NORMAL, parent.foregroundcolor)
Stats.do_tip(self.e_box[r][c], 'farts')
Stats.do_tip(self.e_box[r][c], 'stuff')
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') )
@ -473,9 +445,9 @@ class Popup_window:
# calculate the stat_dict and then create the text for the pu
# stat_dict = db_connection.get_stats_from_hand(stat_window.parent.hand, stat_window.player_id)
stat_dict = self.db_connection.get_stats_from_hand(stat_window.parent.hand)
# stat_dict = self.db_connection.get_stats_from_hand(stat_window.parent.hand)
# db_connection.close_connection()
stat_dict = stat_window.parent.stat_dict
pu_text = ""
for s in stat_list:
number = Stats.do_stat(stat_dict, player = int(stat_window.player_id), stat = s)
@ -494,31 +466,13 @@ class Popup_window:
# the popup windows. There is a bit of an ugly kludge to separate single-
# and double-clicks. This is the same code as in the Stat_window class
if event.button == 1: # left button event
if event.type == gtk.gdk.BUTTON_PRESS: # left button single click
if self.sb_click > 0: return
self.sb_click = gobject.timeout_add(250, self.single_click, widget)
elif event.type == gtk.gdk._2BUTTON_PRESS: # left button double click
if self.sb_click > 0:
gobject.source_remove(self.sb_click)
self.sb_click = 0
self.double_click(widget, event, *args)
pass
if event.button == 2: # middle button event
pass
if event.button == 3: # right button event
pass
def single_click(self, widget):
# Callback from the timeout in the single-click finding part of the
# button press call back. This needs to be modified to get all the
# arguments from the call.
self.sb_click = 0
self.window.destroy()
return False
def double_click(self, widget, event, *args):
self.toggle_decorated(widget)
def toggle_decorated(self, widget):
top = widget.get_toplevel()