updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / curse / curse-0.9.6.patch
blobeb33e1db0a47cc57f93f56a66b8dfa49c9ee8800
1 --- src/curse.py.orig 2009-03-26 05:51:06.393371998 +0100
2 +++ src/curse.py 2009-03-26 05:51:26.030042161 +0100
3 @@ -5,6 +5,16 @@
5 class Game(object):
6 def __init__(self):
7 + # set up savegame directory
8 + self.savedir=os.path.join(os.getenv('HOME'),'.curse')
10 + if not os.path.isdir(self.savedir):
11 + try:
12 + os.mkdir(self.savedir)
13 + except:
14 + print "Unable to create directory", self.savedir
15 + sys.exit(1)
17 # init pygame
18 pygame.mixer.init(44100, -16, 2, 512)
19 pygame.display.init()
20 @@ -15,7 +25,7 @@
22 # create screen
23 size = (640, 480)
24 - self.screen = pygame.display.set_mode(size)
25 + self.screen = pygame.display.set_mode(size, FULLSCREEN)
26 self.main_screen=pygame.Surface((384,384))
27 self.gui_screen=pygame.Surface((232,384))
28 self.message_screen=pygame.Surface((384,72))
29 @@ -64,7 +74,7 @@
30 self.playerpower=6-int(diff)
31 self.flags['pw']=self.playerpower
32 else:
33 - FILE=gzip.open(os.path.join('..',pln+'cs'), 'r', 2)
34 + FILE=gzip.open(os.path.join(self.savedir,pln+'cs'), 'r', 2)
35 self.player,self.world,self.flags=pickle.load(FILE)
36 self.playerpower=self.flags['pw']
37 FILE.close()
38 @@ -89,7 +99,7 @@
39 self.screen.blit(self.key_screen,(8+8+384,8+8+384))
40 def save(self):
41 p=copy.copy(self.player)
42 - FILE=gzip.open(os.path.join('..',p.name+'cs'), 'w')
43 + FILE=gzip.open(os.path.join(self.savedir,p.name+'cs'), 'w')
44 p.game=None
45 pickle.dump((p,self.world,self.flags), FILE, 2)
46 FILE.close()
47 @@ -116,6 +126,9 @@
49 if e.type == pygame.KEYDOWN:
50 if e.key == pygame.K_ESCAPE:
51 + pygame.quit()
52 + sys.exit()
53 + if e.key == pygame.K_F12:
54 pygame.display.toggle_fullscreen()
56 if e.unicode in '12345':
57 @@ -142,6 +155,9 @@
59 if e.type == pygame.KEYDOWN:
60 if e.key == pygame.K_ESCAPE:
61 + pygame.quit()
62 + sys.exit()
63 + if e.key == pygame.K_F12:
64 pygame.display.toggle_fullscreen()
66 if e.unicode in 'pwcln':
67 @@ -389,7 +405,10 @@
68 pygame.quit()
69 sys.exit()
70 if e.type == pygame.KEYDOWN:
71 - if e.key== pygame.K_ESCAPE:
72 + if e.key == pygame.K_ESCAPE:
73 + pygame.quit()
74 + sys.exit()
75 + if e.key== pygame.K_F12:
76 pygame.display.toggle_fullscreen()
77 if e.unicode in 'abcdefghijklmnopqrstuvwxyzQWERTZUIOPLKJHGFDSAYXCVBNM':
78 if n.__len__()<14:
79 @@ -406,7 +425,7 @@
80 pygame.display.flip()
82 #check for saved game:
83 - if os.path.exists(os.path.join('..',(n+'cs'))):
84 + if os.path.exists(os.path.join(self.savedir,(n+'cs'))):
85 return n,None,None
86 else:
87 title , diff = self.new_game(n)
88 @@ -617,7 +636,10 @@
89 pygame.quit()
90 sys.exit()
91 if e.type==pygame.KEYDOWN:
92 - if e.key==pygame.K_ESCAPE:
93 + if e.key == pygame.K_ESCAPE:
94 + pygame.quit()
95 + sys.exit()
96 + if e.key==pygame.K_F12:
97 pygame.display.toggle_fullscreen()
99 if number_of_warriors and ATTACK_STATE==AT_NEW_ROUND:
100 @@ -827,7 +849,10 @@
101 pygame.quit()
102 sys.exit()
103 if e.type == pygame.KEYDOWN:
104 - if e.key==pygame.K_ESCAPE:
105 + if e.key == pygame.K_ESCAPE:
106 + pygame.quit()
107 + sys.exit()
108 + if e.key==pygame.K_F12:
109 pygame.display.toggle_fullscreen()
110 if self.state==STATE_RUNNING:
111 if e.key == pygame.K_DOWN:
112 @@ -976,7 +1001,10 @@
113 pygame.quit()
114 sys.exit()
115 if e.type == pygame.KEYDOWN:
116 - if e.key==pygame.K_ESCAPE:
117 + if e.key == pygame.K_ESCAPE:
118 + pygame.quit()
119 + sys.exit()
120 + if e.key==pygame.K_F12:
121 pygame.display.toggle_fullscreen()
122 if e.unicode == ' ':
123 self.state=STATE_RUNNING
124 --- README.orig 2009-03-26 05:53:56.203354702 +0100
125 +++ README 2009-03-26 05:54:18.498826794 +0100
126 @@ -59,7 +59,9 @@
128 Press s on the world map to toggle music on/off
130 -Press ESC on the world map to toggle fullscreen on/off
131 +Press F12 on the world map to toggle fullscreen on/off
133 +Press ESC to quit game
135 Press SPACE to enter a location