summaryrefslogtreecommitdiff
path: root/games/pysycache/files/patch-pysybuttons.py
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2006-03-15 10:45:00 +0000
committerRenato Botelho <garga@FreeBSD.org>2006-03-15 10:45:00 +0000
commitdaeff6b21b50d15a804d20135e9d83e0debb9f4f (patch)
tree0aedd02bd430679853a6ab94c8927b16bf67955b /games/pysycache/files/patch-pysybuttons.py
parent- Update to 5.2.15 (diff)
Add pysycache 2.0, educational software made in python.
PR: ports/94003 Submitted by: Jose Alonso Cardenas Marquez <acardenas@bsd.org.pe>
Diffstat (limited to 'games/pysycache/files/patch-pysybuttons.py')
-rw-r--r--games/pysycache/files/patch-pysybuttons.py138
1 files changed, 138 insertions, 0 deletions
diff --git a/games/pysycache/files/patch-pysybuttons.py b/games/pysycache/files/patch-pysybuttons.py
new file mode 100644
index 000000000000..09d7f98045a4
--- /dev/null
+++ b/games/pysycache/files/patch-pysybuttons.py
@@ -0,0 +1,138 @@
+--- pysybuttons.py Wed Feb 15 17:23:28 2006
++++ pysybuttons.py Sun Feb 26 23:48:29 2006
+@@ -58,7 +58,7 @@
+ """This class is for the elements that move"""
+ def __init__(self, left, top, filename, id, categ):
+ pygame.sprite.Sprite.__init__(self) #call Sprite intializer
+- dirname = os.path.join(const.GRepPysycache, 'themes-buttons', GLstThemesButtons[const.GIdxThemes])
++ dirname = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-buttons', GLstThemesButtons[const.GIdxThemes])
+ self.image, self.rect = datas.load_png(dirname, filename)
+ self.id = id
+ self.largeur = 96
+@@ -188,7 +188,7 @@
+ #chargement du dessin servant de cache
+ filename = os.path.join(themename, lig)
+ imgfilename = lig
+- ImgFond, background_rect = datas.load_image('themes-buttons', filename )
++ ImgFond, background_rect = datas.load_image('%%DATADIR%%/themes-buttons', filename )
+
+ #on copie ce cache sur l'image de fond
+ screen = pygame.display.get_surface()
+@@ -268,7 +268,7 @@
+ def LoadListConfigFile(themename):
+ """ Find all available pictures of a theme directory """
+
+- filtre = os.path.join(const.GRepPysycache, 'themes-buttons', themename, '*.dfg')
++ filtre = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-buttons', themename, '*.dfg')
+
+ #vider
+ # GLstImage[:] = []
+@@ -301,15 +301,15 @@
+ """ Change logo of a theme """
+ if const.GIdxThemes == 999999:
+ #tous les themes
+- filename = os.path.join(const.GRepPysycache, 'images', 'logo.png')
++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'logo.png')
+ else:
+ #un theme particulier
+- filename = os.path.join(const.GRepPysycache, 'themes-buttons', GLstThemesButtons[const.GIdxThemes], 'logo.png')
++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-buttons', GLstThemesButtons[const.GIdxThemes], 'logo.png')
+
+ if os.path.isfile(filename) == True:
+ imgtmp = pygame.image.load(filename)
+ else:
+- filename = os.path.join(const.GRepPysycache, 'images', 'logo.png')
++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'logo.png')
+ imgtmp = pygame.image.load(filename)
+
+ #mise a jour de l'image du theme
+@@ -393,7 +393,7 @@
+ if objtrouve.rect.left <= GLimFinG:
+ objtrouve.visible = 0
+
+- filename = os.path.join(const.GRepPysycache, 'images', 'button-vide.png')
++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'button-vide.png')
+ imgtmp = pygame.image.load(filename)
+ screen = pygame.display.get_surface()
+ objtrouve.image.blit(imgtmp, (0, 0), (0, 0, objtrouve.largeur, objtrouve.hauteur))
+@@ -409,11 +409,11 @@
+
+ elif str[1] == 1:
+ #-------- on change le mvt : haut <--> bas -----------------
+- datas.load_sound('sounds', 'center.ogg')
++ datas.load_sound('%%DATADIR%%/sounds', 'center.ogg')
+ objtrouve.sens = -1 * objtrouve.sens
+ elif str[2] == 1:
+ #-------------------- a droite -----------------------------
+- datas.load_sound('sounds', 'right.wav')
++ datas.load_sound('%%DATADIR%%/sounds', 'right.wav')
+ ok = 1
+
+ if GLimDroite <= objtrouve.rect.left + 50 + objtrouve.largeur :
+@@ -427,7 +427,7 @@
+ if objtrouve.rect.left + objtrouve.largeur >= GLimFinD:
+ objtrouve.visible = 0
+
+- filename = os.path.join(const.GRepPysycache, 'images', 'button-vide.png')
++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'button-vide.png')
+ imgtmp = pygame.image.load(filename)
+
+ screen = pygame.display.get_surface()
+@@ -464,13 +464,13 @@
+ #change la vitesse du jeu (normal/moyenne/rapide)
+ if const.GSpeed == 3:
+ const.GSpeed = 2
+- filename = os.path.join(const.GRepPysycache, 'images', 'btn-vitesse2.png')
++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'btn-vitesse2.png')
+ elif const.GSpeed == 2:
+ const.GSpeed = 1
+- filename = os.path.join(const.GRepPysycache, 'images', 'btn-vitesse1.png')
++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'btn-vitesse1.png')
+ elif const.GSpeed == 1:
+ const.GSpeed = 3
+- filename = os.path.join(const.GRepPysycache, 'images', 'btn-vitesse3.png')
++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'btn-vitesse3.png')
+ imgtmp = pygame.image.load(filename)
+
+ #mise a jour image
+@@ -568,7 +568,7 @@
+ # cursor = cursor[0], (cursor[0][0] / 2, cursor[0][1] / 2), cursor[2], cursor[3]
+ # pygame.mouse.set_cursor(cursor[0], (0, 0), cursor[2], cursor[3])
+
+- filename = dirname = os.path.join(const.GRepPysycache, 'images', 'souris.png')
++ filename = dirname = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'souris.png')
+ GMaSouris = pygame.image.load(filename)
+ GMaSouris_position = GMaSouris.get_rect()
+ GMaSouris_position.left = const.GPosDepX
+@@ -576,7 +576,7 @@
+ pygame.mouse.set_pos((GMaSouris_position.left, GMaSouris_position.top))
+
+ #------------------ transition vers le jeu ------------------------
+- Gbackground_image, background_rect = datas.load_image('images', 'fond-buttons.bmp')
++ Gbackground_image, background_rect = datas.load_image('%%DATADIR%%/images', 'fond-buttons.bmp')
+ for i in range(300):
+ screen.blit(Gbackground_image, (0, i), (0, i, 800, 1))
+ screen.blit(Gbackground_image, (0, 600 - i), (0, 600 - i, 800, 1))
+@@ -604,11 +604,11 @@
+ GLstFicConfig = []
+
+ #----------------- rechercher les themes disponibles -----------------------
+- repertoire = os.path.join(const.GRepPysycache, 'themes-buttons')
++ repertoire = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-buttons')
+ GLstThemesButtons = []
+ for nom in os.listdir(repertoire):
+ #ne prendre que les repertoires
+- isrep = os.path.join(const.GRepPysycache, 'themes-buttons', nom)
++ isrep = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-buttons', nom)
+ if os.path.isdir(isrep):
+ GLstThemesButtons.append(nom)
+ if len(GLstThemesButtons) == 1:
+@@ -658,7 +658,7 @@
+ datas.PlayWinnerSound()
+
+ #on affiche l'image de gagne
+- imggagne, imgfin_rect = datas.load_png('images', 'gagne.png')
++ imggagne, imgfin_rect = datas.load_png('%%DATADIR%%/images', 'gagne.png')
+ screen.blit(imggagne, (100, 40))
+ pygame.display.flip()
+