Add 'Currencies' filter to the ring player stats viewer.
[fpdb-dooglus.git] / pyfpdb / HHReplayer.py
blob6fab934c831f2a937bed20fc01a3b11545e51362
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 #Copyright 2008-2011 Carl Gherardi
5 #This program is free software: you can redistribute it and/or modify
6 #it under the terms of the GNU Affero General Public License as published by
7 #the Free Software Foundation, version 3 of the License.
9 #This program is distributed in the hope that it will be useful,
10 #but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #GNU General Public License for more details.
14 #You should have received a copy of the GNU Affero General Public License
15 #along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #In the "official" distribution you can find the license in agpl-3.0.txt.
18 import os, pygame
19 import time
20 from pygame.locals import *
21 from pygame.compat import geterror
23 main_dir = os.path.split(os.path.abspath(__file__))[0]
24 data_dir = os.path.join(main_dir, '.')
26 def load_image(name, colorkey=None):
27 fullname = os.path.join(data_dir, name)
28 try:
29 image = pygame.image.load(fullname)
30 except pygame.error:
31 print ('Cannot load image:', fullname)
32 print "data_dir: '%s' name: '%s'" %( data_dir, name)
33 raise SystemExit(str(geterror()))
34 image = image.convert()
35 if colorkey is not None:
36 if colorkey is -1:
37 colorkey = image.get_at((0,0))
38 image.set_colorkey(colorkey, RLEACCEL)
39 return image, image.get_rect()
42 def main():
43 #Initialize Everything
44 pygame.init()
45 clock = pygame.time.Clock()
46 screen = pygame.display.set_mode((640, 480))
47 table_string = "Tournament 2010090009 Table %s - Blinds $600/$1200 Anto $150"
48 table_no = 1
49 table_title = "Nongoma V - $200/$400 USD - Limit Holdem"
50 pygame.display.set_caption(table_title)
51 pygame.mouse.set_visible(0)
53 # Load background image
54 bgimage, rect = load_image('../gfx/Table.png')
55 background = pygame.Surface(screen.get_size())
56 background.blit(bgimage, (0, 0))
58 #Put Text On The Background, Centered
59 if pygame.font:
60 font = pygame.font.Font(None, 24)
61 text = font.render("FPDB Replayer Table", 1, (10, 10, 10))
62 textpos = text.get_rect(centerx=background.get_width()/2)
63 background.blit(text, textpos)
65 #Display The Background
66 screen.blit(background, (0, 0))
67 pygame.display.flip()
69 going = True
70 while going:
71 clock.tick(6000)
72 # Draw
73 screen.blit(background, (0, 0))
74 # Change table #
75 #table_no += 1
76 #table_title = "Tournament 2010090009 Table %s - Blinds $600/$1200 Anto $150" % table_no
77 #pygame.display.set_caption(table_title)
78 time.sleep(10)
81 if __name__ == '__main__':
82 main()