diff options
author | Renato Botelho <garga@FreeBSD.org> | 2006-03-15 10:45:00 +0000 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2006-03-15 10:45:00 +0000 |
commit | daeff6b21b50d15a804d20135e9d83e0debb9f4f (patch) | |
tree | 0aedd02bd430679853a6ab94c8927b16bf67955b /games/pysycache/files | |
parent | 2571a1881c06b74ea42ea7bd6bb6af43a60636e2 (diff) | |
download | ports-daeff6b21b50d15a804d20135e9d83e0debb9f4f.tar.gz ports-daeff6b21b50d15a804d20135e9d83e0debb9f4f.zip |
Notes
Diffstat (limited to 'games/pysycache/files')
-rw-r--r-- | games/pysycache/files/patch-datas.py | 35 | ||||
-rw-r--r-- | games/pysycache/files/patch-datasclass.py | 45 | ||||
-rw-r--r-- | games/pysycache/files/patch-pysybuttons.py | 138 | ||||
-rw-r--r-- | games/pysycache/files/patch-pysycache.py | 147 | ||||
-rw-r--r-- | games/pysycache/files/patch-pysyclick.py | 154 | ||||
-rw-r--r-- | games/pysycache/files/patch-pysymove.py | 162 | ||||
-rw-r--r-- | games/pysycache/files/pkg-message.in | 6 |
7 files changed, 687 insertions, 0 deletions
diff --git a/games/pysycache/files/patch-datas.py b/games/pysycache/files/patch-datas.py new file mode 100644 index 000000000000..3c24d9dfe540 --- /dev/null +++ b/games/pysycache/files/patch-datas.py @@ -0,0 +1,35 @@ +--- /home/acardenas/pysycache/datas.py Wed Feb 15 17:23:27 2006 ++++ datas.py Sun Feb 26 23:20:02 2006 +@@ -34,7 +34,7 @@ + from pygame.locals import * + import const + +- ++sys.path.append("%%DATADIR%%") + + #******************************************************************************* + # # +@@ -135,11 +135,11 @@ + def PlayWinnerSound(): + idxsnd = random.randint(0, 2) + if idxsnd == 0 : +- load_sound('sounds', 'youpee.ogg') ++ load_sound('%%DATADIR%%/sounds', 'youpee.ogg') + elif idxsnd == 1 : +- load_sound('sounds', 'yahoo.ogg') ++ load_sound('%%DATADIR%%/sounds', 'yahoo.ogg') + else : +- load_sound('sounds', 'rire.ogg') ++ load_sound('%%DATADIR%%/sounds', 'rire.ogg') + + + +@@ -150,7 +150,7 @@ + def ShowTransitionOfTheme(duree, fileimage): + screen = pygame.display.get_surface() + +- background_image2, background_rect = load_image('images', fileimage) ++ background_image2, background_rect = load_image('%%DATADIR%%/images', fileimage) + for i in range(267): + screen.blit(background_image2, (0, i), (0, i, 710, 1)) + screen.blit(background_image2, (0, 534 - i), (0, 534 - i, 710, 1)) diff --git a/games/pysycache/files/patch-datasclass.py b/games/pysycache/files/patch-datasclass.py new file mode 100644 index 000000000000..ea090e67ef0e --- /dev/null +++ b/games/pysycache/files/patch-datasclass.py @@ -0,0 +1,45 @@ +--- datasclass.py Wed Feb 15 17:23:27 2006 ++++ datasclass.py Sun Feb 26 23:20:53 2006 +@@ -43,7 +43,7 @@ + """This class is for the menus buttons""" + def __init__(self, left, top, filename, id, btnlarg, btnhaut): + pygame.sprite.Sprite.__init__(self) #call Sprite intializer +- self.image, self.rect = datas.load_png('images', filename) ++ self.image, self.rect = datas.load_png('%%DATADIR%%/images', filename) + (shortname, extension) = os.path.splitext(filename) + self.imagename = shortname + self.rect.left = left +@@ -53,27 +53,27 @@ + self.hauteur = btnhaut + + def showhelp(self, imgdest): +- myfont = os.path.join(const.GRepPysycache, 'fonts', 'FreeSansBold.ttf' ) ++ myfont = os.path.join(const.GRepPysycache, '%%DATADIR%%/fonts', 'FreeSansBold.ttf' ) + font = pygame.font.Font(myfont, 20) + textcolor = 46, 113, 169 + screen = pygame.display.get_surface() + +- myrep = os.path.join(const.GRepPysycache, 'help', const.GMyLocale ) ++ myrep = os.path.join(const.GRepPysycache, '%%DATADIR%%/help', const.GMyLocale ) + + #joue le fichier d'aide + if const.GWithSound == 1: + if const.GWithHelp == 1 : +- dirname = os.path.join('help', const.GMyLocale) ++ dirname = os.path.join('%%DATADIR%%/help', const.GMyLocale) + filename = str(self.id) + '.ogg' + datas.load_sound(dirname, filename) + + #affiche l'aide + if os.path.isdir(myrep): +- filename = os.path.join(const.GRepPysycache, 'help', const.GMyLocale , str(self.id) + '.txt') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/help', const.GMyLocale , str(self.id) + '.txt') + else : +- filename = os.path.join(const.GRepPysycache, 'help', 'en_EN' , str(self.id) + '.txt') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/help', 'en_EN' , str(self.id) + '.txt') + +- filename = os.path.join(const.GRepPysycache, 'help', const.GMyLocale , str(self.id) + '.txt') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/help', const.GMyLocale , str(self.id) + '.txt') + if os.path.isfile(filename): + f = open(filename, 'r') + lignes = f.readlines() 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() + diff --git a/games/pysycache/files/patch-pysycache.py b/games/pysycache/files/patch-pysycache.py new file mode 100644 index 000000000000..da2f912b730e --- /dev/null +++ b/games/pysycache/files/patch-pysycache.py @@ -0,0 +1,147 @@ +--- pysycache.py Wed Feb 15 17:23:28 2006 ++++ pysycache.py Mon Feb 27 00:15:58 2006 +@@ -37,6 +37,8 @@ + from pygame.locals import * + import glob + ++sys.path.append("%%DATADIR%%") ++ + import datas + from datasclass import BtnMenu + import const +@@ -51,7 +53,7 @@ + + + def ReadCreditOfDirectory(dirname): +- myfont = os.path.join(const.GRepPysycache, 'fonts', 'FreeSansBold.ttf' ) ++ myfont = os.path.join(const.GRepPysycache, '%%DATADIR%%/fonts', 'FreeSansBold.ttf' ) + font = pygame.font.Font(myfont, 20) + textcolor = 46, 113, 169 + +@@ -129,9 +131,9 @@ + #on est actuellement en image normale et on passe en image floue + const.GBtnMenu = btn.id + +- datas.load_sound('sounds', 'btnmenu.wav') ++ datas.load_sound('%%DATADIR%%/sounds', 'btnmenu.wav') + +- filename = os.path.join(const.GRepPysycache, 'images', btn.imagename + '1.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', btn.imagename + '1.png') + imgtmp = pygame.image.load(filename) + btn.image.blit(imgtmp, (btn.rect.left, btn.rect.top), (0, 0, btn.largeur, btn.hauteur)) + btn.image = imgtmp +@@ -154,13 +156,13 @@ + for btn in LstBtn.sprites(): + if btn.id == const.GBtnMenu: + #mise a jour de l'image +- filename = os.path.join(const.GRepPysycache, 'images', btn.imagename + '.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', btn.imagename + '.png') + imgtmp = pygame.image.load(filename) + btn.image.blit(imgtmp, (btn.rect.left, btn.rect.top), (0, 0, btn.largeur, btn.hauteur)) + btn.image = imgtmp + + #mise a jour de la zone d'aide (effacement) +- imgnuage, background_rect = datas.load_image('images', 'fond-menu.bmp') ++ imgnuage, background_rect = datas.load_image('%%DATADIR%%/images', 'fond-menu.bmp') + Gbackground_image.blit(imgnuage, (300, 300), (300, 300, 400, 220)) + + break +@@ -176,7 +178,7 @@ + if ( event.pos[0] >= obj.rect.left ) & ( event.pos[0] <= obj.rect.left + obj.largeur ) & ( event.pos[1] >= obj.rect.top ) & ( event.pos[1] <= obj.rect.top + obj.hauteur ) : + #----------- show the correct window ----------------- + #mise a jour de la zone d'aide +- imgnuage, background_rect = datas.load_image('images', 'fond-menu.bmp') ++ imgnuage, background_rect = datas.load_image('%%DATADIR%%/images', 'fond-menu.bmp') + Gbackground_image.blit(imgnuage, (300, 300), (300, 300, 370, 200)) + + if pygame.mixer.music.get_busy : +@@ -261,14 +263,14 @@ + #recuperation de la valeur de la langue + locale.setlocale(locale.LC_ALL,"") + const.GMyLocale, myencoding = locale.getlocale() +- myrep = os.path.join(const.GRepPysycache, 'help', const.GMyLocale ) ++ myrep = os.path.join(const.GRepPysycache, '%%DATADIR%%/help', const.GMyLocale ) + + if os.path.isdir(myrep): + #le repertoire de la locale existe : rien a faire + pass + else : + #on essaie sur les deux premiers caracteres +- myrep = os.path.join(const.GRepPysycache, 'help', const.GMyLocale[0:2]) ++ myrep = os.path.join(const.GRepPysycache, '%%DATADIR%%/help', const.GMyLocale[0:2]) + if os.path.isdir(myrep): + #le repertoire de la (nouvelle) locale existe : rien a faire + const.GMyLocale = const.GMyLocale[0:2] +@@ -283,7 +285,7 @@ + pygame.display.set_caption('PySyCache') + + #-------------------------- image vide de fond ----------------------------- +- background_image, background_rect = datas.load_image('images', 'fond1.bmp') ++ background_image, background_rect = datas.load_image('%%DATADIR%%/images', 'fond1.bmp') + screen.blit(background_image, (0,0)) + pygame.display.flip() + +@@ -291,7 +293,7 @@ + pygame.time.delay(500) + + #------------------ transition vers le titre du jeu ------------------------ +- background_image2, background_rect = datas.load_image('images', 'fond2.bmp') ++ background_image2, background_rect = datas.load_image('%%DATADIR%%/images', 'fond2.bmp') + for i in range(300): + screen.blit(background_image2, (0, i), (0, i, 800, 1)) + screen.blit(background_image2, (0, 600 - i), (0, 600 - i, 800, 1)) +@@ -304,7 +306,7 @@ + pygame.time.delay(2000) + + #----------------------- transition vers le menu --------------------------- +- Gbackground_image, background_rect = datas.load_image('images', 'fond-menu.bmp') ++ Gbackground_image, background_rect = datas.load_image('%%DATADIR%%/images', 'fond-menu.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)) +@@ -336,7 +338,7 @@ + # cursor = pygame.cursors.load_xbm(filename, maskname) + # 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 = 400 # const.GPosDepX +@@ -357,7 +359,7 @@ + pygame.display.flip() + + #-------------------------------- fin du jeu ------------------------------- +- Gbackground_image, background_rect = datas.load_image('images', 'fond4.bmp') ++ Gbackground_image, background_rect = datas.load_image('%%DATADIR%%/images', 'fond4.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)) +@@ -371,12 +373,12 @@ + + #------------------ affichage des credits ------------------------ + if const.GWithCredits : +- myfont = os.path.join(const.GRepPysycache, 'fonts', 'FreeSansBold.ttf' ) ++ myfont = os.path.join(const.GRepPysycache, '%%DATADIR%%/fonts', 'FreeSansBold.ttf' ) + font = pygame.font.Font(myfont, 30) + textcolor = 46, 113, 169 + + #credits auteur +- fichier = os.path.join(const.GRepPysycache, 'credits.txt') ++ fichier = os.path.join(const.GRepPysycache, '%%DATADIR%%/credits.txt') + if os.path.isfile(fichier): + #afficher le contenu + f = open(fichier, 'r') +@@ -393,9 +395,9 @@ + pygame.time.wait(3000) + + #credit images for themes +- ReadCreditOfDirectory('themes-buttons') +- ReadCreditOfDirectory('themes-click') +- ReadCreditOfDirectory('themes-move') ++ ReadCreditOfDirectory('%%DATADIR%%/themes-buttons') ++ ReadCreditOfDirectory('%%DATADIR%%/themes-click') ++ ReadCreditOfDirectory('%%DATADIR%%/themes-move') + + + diff --git a/games/pysycache/files/patch-pysyclick.py b/games/pysycache/files/patch-pysyclick.py new file mode 100644 index 000000000000..3dc3c185be3b --- /dev/null +++ b/games/pysycache/files/patch-pysyclick.py @@ -0,0 +1,154 @@ +--- pysyclick.py Wed Feb 15 17:23:28 2006 ++++ pysyclick.py Sun Feb 26 23:52:12 2006 +@@ -66,7 +66,7 @@ + if os.path.isfile(filetmp) == True: + self.image, self.rect = datas.load_png(dirname, filename) + else : +- self.image, self.rect = datas.load_png('images', 'vide-off.png') ++ self.image, self.rect = datas.load_png('%%DATADIR%%/images', 'vide-off.png') + self.imagename = filename + self.rect.left = 712 + self.rect.top = 50 + 51 * id +@@ -99,7 +99,7 @@ + + #chargement du dessin servant de cache + filename = os.path.join(directory, GImgBackground) +- ImgFond, background_rect = datas.load_image('themes-click', filename ) ++ ImgFond, background_rect = datas.load_image('%%DATADIR%%/themes-click', filename ) + + #on copie ce cache sur l'image de fond + screen = pygame.display.get_surface() +@@ -127,15 +127,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-click', GLstThemesClick[const.GIdxThemes], 'logo.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-click', GLstThemesClick[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 +@@ -181,7 +181,7 @@ + pho = Photo() + lig = lig.split('-') + (shortname, extension) = os.path.splitext(lig[0]) +- pho.chemin = os.path.join(const.GRepPysycache, 'themes-click', themename, lig[0]) ++ pho.chemin = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-click', themename, lig[0]) + pho.miniature = shortname #nom (sans extension de la miniature) + pho.id = cpt - 1 + pho.left = int(lig[1]) + const.MARGELEFT +@@ -207,7 +207,7 @@ + for pho in const.GTabPhotos: + for img in GLstImgPhotos.sprites() : + if img.id == pho.id : +- filename = os.path.join(const.GRepPysycache, 'themes-click', GLstThemesClick[const.GIdxThemes], pho.miniature + '-off.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-click', GLstThemesClick[const.GIdxThemes], pho.miniature + '-off.png') + imgtmp = pygame.image.load(filename) + screen.blit(Gbackground_image, (img.rect.left, img.rect.top), (0, 0, 96, 50)) + img.image.blit(imgtmp, (0, 0), (0, 0, 96, 50)) +@@ -226,7 +226,7 @@ + """ Find all definition files of a theme directoy """ + + #-------------------------- definition files ------------------------------- +- filtre = os.path.join(const.GRepPysycache, 'themes-click', themename, '*.dfg') ++ filtre = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-click', themename, '*.dfg') + + #vider + cptliste = 0 +@@ -307,9 +307,9 @@ + if const.GTypeSouris == 0: + #on est actuellement en appareil photo normal et on passe en mode couleur + if const.GWithSound == 1: +- datas.load_sound('sounds', 'photo-beep0.ogg') ++ datas.load_sound('%%DATADIR%%/sounds', 'photo-beep0.ogg') + +- filename = os.path.join(const.GRepPysycache, 'images', 'souris0.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'souris0.png') + souristmp = pygame.image.load(filename) + colsvg = GMaSouris.get_at((0,0)) + GMaSouris.fill(colsvg) +@@ -327,7 +327,7 @@ + pass + else: + #on est en appareil photo en couleur : on passe a normal +- filename = os.path.join(const.GRepPysycache, 'images', 'souris1.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'souris1.png') + souristmp = pygame.image.load(filename) + colsvg = GMaSouris.get_at((0,0)) + GMaSouris.fill(colsvg) +@@ -420,14 +420,14 @@ + #mise a jour du dessin representant la photo prise + for img in GLstImgPhotos.sprites() : + if img.id == car.id : +- filename = os.path.join(const.GRepPysycache, 'themes-click', GLstThemesClick[const.GIdxThemes], car.miniature + '-on.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-click', GLstThemesClick[const.GIdxThemes], car.miniature + '-on.png') + imgtmp = pygame.image.load(filename) + screen.blit(Gbackground_image, (img.rect.left, img.rect.top), (0, 0, 96, 50)) + img.image.blit(imgtmp, (img.rect.left, img.rect.top), (0, 0, 96, 50)) + img.image = imgtmp + break + +- datas.load_sound('sounds', 'photo-click.ogg'); ++ datas.load_sound('%%DATADIR%%/sounds', 'photo-click.ogg'); + + #on affiche la photo + screen.blit(Gbackground_image, (0,0)) +@@ -493,7 +493,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 = os.path.join(const.GRepPysycache, 'images', 'souris1.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'souris1.png') + GMaSouris = pygame.image.load(filename) + GMaSouris_position = GMaSouris.get_rect() + GMaSouris_position.left = const.GPosDepX +@@ -501,7 +501,7 @@ + const.Gtypsouris = 0 + + #------------------ transition vers le jeu ------------------------ +- Gbackground_image, background_rect = datas.load_image('images', 'fond-click.bmp') ++ Gbackground_image, background_rect = datas.load_image('%%DATADIR%%/images', 'fond-click.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)) +@@ -527,11 +527,11 @@ + GLstFicConfig = [] + + #----------------- rechercher les themes disponibles ----------------------- +- repertoire = os.path.join(const.GRepPysycache, 'themes-click') ++ repertoire = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-click') + GLstThemesClick = [] + for nom in os.listdir(repertoire): + #ne prendre que les repertoires +- isrep = os.path.join(const.GRepPysycache, 'themes-click', nom) ++ isrep = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-click', nom) + if os.path.isdir(isrep): + GLstThemesClick.append(nom) + +@@ -576,7 +576,7 @@ + + #on affiche l'image de gagne + screen = pygame.display.get_surface() +- imggagne, imgfin_rect = datas.load_png('images', 'gagne.png') ++ imggagne, imgfin_rect = datas.load_png('%%DATADIR%%/images', 'gagne.png') + screen.blit(imggagne, (100, 40)) + LstBtn.draw(screen) + GLstImgPhotos.draw(screen) +@@ -602,7 +602,7 @@ + RAZMiniatures() + + #on remet la souris en normal +- filename = os.path.join(const.GRepPysycache, 'images', 'souris1.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'souris1.png') + souristmp = pygame.image.load(filename) + colsvg = GMaSouris.get_at((0,0)) + GMaSouris.fill(colsvg) diff --git a/games/pysycache/files/patch-pysymove.py b/games/pysycache/files/patch-pysymove.py new file mode 100644 index 000000000000..fb9d48eba473 --- /dev/null +++ b/games/pysycache/files/patch-pysymove.py @@ -0,0 +1,162 @@ +--- pysymove.py Wed Feb 15 17:23:28 2006 ++++ pysymove.py Mon Feb 27 00:02:12 2006 +@@ -134,7 +134,7 @@ + + #chargement du dessin servant de cache + filename = os.path.join(directory, 'cache', imgcache) +- GCacheImage, background_rect = datas.load_image('themes-move', filename) ++ GCacheImage, background_rect = datas.load_image('%%DATADIR%%/themes-move', filename) + + #on copie ce cache sur l'image de fond + screen = pygame.display.get_surface() +@@ -150,7 +150,7 @@ + + #chargement du dessin a trouver + filename = os.path.join(directory, imgdessous) +- GImageATrouver, background_rect = datas.load_image('themes-move', filename) ++ GImageATrouver, background_rect = datas.load_image('%%DATADIR%%/themes-move', filename) + + #redessin de la souris a sa position + GMaSouris_position.left = const.GPosDepX +@@ -193,15 +193,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-move', GLstThemesMove[const.GIdxThemes], 'logo.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-move', GLstThemesMove[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 +@@ -225,10 +225,10 @@ + def ChangeTypeJeu(): + """ Change mode of a theme """ + if const.GModeJeu == MODENORMAL: +- filename = os.path.join(const.GRepPysycache, 'images', 'mode0.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'mode0.png') + elif const.GModeJeu == MODEFANTOM: +- filename = os.path.join(const.GRepPysycache, 'images', 'mode1.png') +- else: filename = os.path.join(const.GRepPysycache, 'images', 'mode2.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'mode1.png') ++ else: filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'mode2.png') + + if os.path.isfile(filename) == True: + imgtmp = pygame.image.load(filename) +@@ -253,7 +253,7 @@ + def LoadListImage(themename): + """ Find all available pictures of a theme directory """ + +- filtre = os.path.join(const.GRepPysycache, 'themes-move', themename, '*.dfg') ++ filtre = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-move', themename, '*.dfg') + + #vider + GLstImage[:] = [] +@@ -286,12 +286,12 @@ + if len(lig) == 0: + continue + #fichier de cache +- nomcache = os.path.join(const.GRepPysycache, 'themes-move', themename, 'cache', lig[0]) ++ nomcache = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-move', themename, 'cache', lig[0]) + if os.path.isfile(nomcache): + lstcache.append(lig[0]) + + #fichier de son +- nomcache = os.path.join('themes-move', themename, 'cache', lig[1]) ++ nomcache = os.path.join('%%DATADIR%%/themes-move', themename, 'cache', lig[1]) + lstsndcache.append(nomcache) + else: + print "error in definition file : cache file ", nomcache, " doesn't exist" +@@ -356,7 +356,7 @@ + pygame.display.flip() + + #on joue la musique +- datas.load_sound('sounds', 'fantom.wav') ++ datas.load_sound('%%DATADIR%%/sounds', 'fantom.wav') + + break + return 1 +@@ -401,7 +401,7 @@ + const.GNbCarreau = const.GNbCarreau - 1 + + #on joue la musique +- datas.load_sound('sounds', 'pop.ogg') ++ datas.load_sound('%%DATADIR%%/sounds', 'pop.ogg') + + break + +@@ -483,11 +483,11 @@ + if const.GTailleCarreau == CARREAUSMALL + 1: + const.GTailleCarreau = CARREAUBIG + if const.GTailleCarreau == CARREAUBIG: +- filename = os.path.join(const.GRepPysycache, 'images', 'btn-size1.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'btn-size1.png') + elif const.GTailleCarreau == CARREAUNORMAL: +- filename = os.path.join(const.GRepPysycache, 'images', 'btn-size2.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'btn-size2.png') + else: +- filename = os.path.join(const.GRepPysycache, 'images', 'btn-size3.png') ++ filename = os.path.join(const.GRepPysycache, '%%DATADIR%%/images', 'btn-size3.png') + imgtmp = pygame.image.load(filename) + + #mise a jour image taille carreau +@@ -553,12 +553,12 @@ + # 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) + GCarre_position = GMaSouris.get_rect() + + #------------------ transition vers le jeu ------------------------ +- Gbackground_image, background_rect = datas.load_image('images', 'fond-move.bmp') ++ Gbackground_image, background_rect = datas.load_image('%%DATADIR%%/images', 'fond-move.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)) +@@ -592,10 +592,10 @@ + GLstSndCache = [] + + #---------------- rechercher les themes disponibles ---------------------- +- repertoire = os.path.join(const.GRepPysycache, 'themes-move') ++ repertoire = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-move') + for nom in os.listdir(repertoire): + #ne prendre que les repertoires +- isrep = os.path.join(const.GRepPysycache, 'themes-move', nom) ++ isrep = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-move', nom) + if os.path.isdir(isrep): + GLstThemesMove.append(nom) + if len(GLstThemesMove) == 1 : +@@ -653,11 +653,11 @@ + if const.GWithSound == 1: + #on joue la musique de l'image + (shortname, extension) = os.path.splitext(GLstImage[const.GIdxImage]) +- music = os.path.join(const.GRepPysycache, 'themes-move', GLstThemesMove[const.GIdxThemes], shortname + '.ogg') ++ music = os.path.join(const.GRepPysycache, '%%DATADIR%%/themes-move', GLstThemesMove[const.GIdxThemes], shortname + '.ogg') + if os.path.isfile(music) == True: +- datas.load_sound(os.path.join('themes-move', GLstThemesMove[const.GIdxThemes]), shortname + '.ogg') ++ datas.load_sound(os.path.join('%%DATADIR%%/themes-move', GLstThemesMove[const.GIdxThemes]), shortname + '.ogg') + else: +- datas.load_sound(os.path.join('themes-move', GLstThemesMove[const.GIdxThemes]), shortname + '.wav') ++ datas.load_sound(os.path.join('%%DATADIR%%/themes-move', GLstThemesMove[const.GIdxThemes]), shortname + '.wav') + pygame.time.wait(500) + + #attende de 2 secondes (pour faire voir l'image) +@@ -666,7 +666,7 @@ + #----------------- on affiche l'image de gagne --------------------- + datas.PlayWinnerSound() + +- 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() + diff --git a/games/pysycache/files/pkg-message.in b/games/pysycache/files/pkg-message.in new file mode 100644 index 000000000000..b661ca6ce082 --- /dev/null +++ b/games/pysycache/files/pkg-message.in @@ -0,0 +1,6 @@ +############################################################### + +1) Install language pack using games/pysycache-lang port +2) Install additional themes using games/pysycache-themes port + +############################################################### |