comparison gamelib/scenes/map.py @ 822:108eeb4d8f65 pyntnclick

Convert map to use InteractText for room labels
author Neil Muller <neil@dip.sun.ac.za>
date Mon, 28 Jan 2013 18:29:32 +0200
parents eed75a1d50c4
children bdebe693453f
comparison
equal deleted inserted replaced
821:cea2a503f6f6 822:108eeb4d8f65
7 Many parts of the ship are derelict and inaccessible. 7 Many parts of the ship are derelict and inaccessible.
8 """ 8 """
9 9
10 from pyntnclick.i18n import _ 10 from pyntnclick.i18n import _
11 from pyntnclick.state import Scene, Thing, Result 11 from pyntnclick.state import Scene, Thing, Result
12 from pyntnclick.scenewidgets import InteractRectUnion 12 from pyntnclick.scenewidgets import (InteractRectUnion, InteractUnion,
13 InteractText, InteractNoImage)
13 14
14 from gamelib.scenes.game_constants import PLAYER_ID 15 from gamelib.scenes.game_constants import PLAYER_ID
15 from gamelib.scenes.game_widgets import make_jim_dialog 16 from gamelib.scenes.game_widgets import make_jim_dialog
16 17
17 18
66 67
67 NAME = "map.tocryo" 68 NAME = "map.tocryo"
68 DEST = "cryo" 69 DEST = "cryo"
69 70
70 INTERACTS = { 71 INTERACTS = {
71 'door': InteractRectUnion(( 72 'door': InteractUnion((
72 (515, 158, 56, 68), 73 InteractNoImage(515, 158, 56, 68),
73 (361, 519, 245, 29), 74 InteractText(361, 512, 245, 33, _("Prisoner cryo chambers"),
75 'white', 20, 'Monospace.ttf'),
74 )) 76 ))
75 } 77 }
76 78
77 INITIAL = 'door' 79 INITIAL = 'door'
78 80
82 84
83 NAME = "map.tobridge" 85 NAME = "map.tobridge"
84 DEST = "bridge" 86 DEST = "bridge"
85 87
86 INTERACTS = { 88 INTERACTS = {
87 'door': InteractRectUnion(( 89 'door': InteractUnion((
88 (36, 260, 60, 83), 90 InteractNoImage(36, 260, 60, 83),
89 (26, 177, 71, 21), 91 InteractText(26, 170, 71, 33, _("Bridge"), 'white', 20,
92 'Monospace.ttf'),
90 )) 93 ))
91 } 94 }
92 95
93 INITIAL = 'door' 96 INITIAL = 'door'
94 97
98 101
99 NAME = "map.tomess" 102 NAME = "map.tomess"
100 DEST = "mess" 103 DEST = "mess"
101 104
102 INTERACTS = { 105 INTERACTS = {
103 'door': InteractRectUnion(( 106 'door': InteractUnion((
104 (395, 262, 64, 80), 107 InteractNoImage(395, 262, 64, 80),
105 (341, 434, 110, 27), 108 InteractText(341, 430, 110, 33, _("Mess hall"), 'white', 20,
109 'Monospace.ttf'),
106 )) 110 ))
107 } 111 }
108 112
109 INITIAL = 'door' 113 INITIAL = 'door'
110 114
114 118
115 NAME = "map.toengine" 119 NAME = "map.toengine"
116 DEST = "engine" 120 DEST = "engine"
117 121
118 INTERACTS = { 122 INTERACTS = {
119 'door': InteractRectUnion(( 123 'door': InteractUnion((
120 (691, 279, 76, 54), 124 InteractNoImage(691, 279, 76, 54),
121 (662, 500, 128, 23), 125 InteractText(662, 496, 128, 33, _("Engine room"), 'white', 20,
126 'Monospace.ttf'),
122 )) 127 ))
123 } 128 }
124 129
125 INITIAL = 'door' 130 INITIAL = 'door'
126 131
138 143
139 NAME = "map.tomachine" 144 NAME = "map.tomachine"
140 DEST = "machine" 145 DEST = "machine"
141 146
142 INTERACTS = { 147 INTERACTS = {
143 'door': InteractRectUnion(( 148 'door': InteractUnion((
144 (608, 156, 57, 72), 149 InteractNoImage(608, 156, 57, 72),
145 (578, 91, 140, 23), 150 InteractText(578, 83, 140, 33, _("Machine room"), 'white', 20,
151 'Monospace.ttf'),
146 )) 152 ))
147 } 153 }
148 154
149 INITIAL = 'door' 155 INITIAL = 'door'
150 156
154 160
155 NAME = "map.tocrew_quarters" 161 NAME = "map.tocrew_quarters"
156 DEST = "crew_quarters" 162 DEST = "crew_quarters"
157 163
158 INTERACTS = { 164 INTERACTS = {
159 'door': InteractRectUnion(( 165 'door': InteractUnion((
160 (210, 321, 37, 64), 166 InteractNoImage(210, 321, 37, 64),
161 (69, 469, 148, 26), 167 InteractText(69, 460, 160, 33, _("Crew quarters"), 'white', 20,
168 'Monospace.ttf'),
162 )) 169 ))
163 } 170 }
164 171
165 INITIAL = 'door' 172 INITIAL = 'door'
166 173
188 195
189 class HydroponicsArea(Thing): 196 class HydroponicsArea(Thing):
190 NAME = 'map.hydroponics' 197 NAME = 'map.hydroponics'
191 198
192 INTERACTS = { 199 INTERACTS = {
193 'areas': InteractRectUnion(( 200 'areas': InteractUnion((
194 (314, 263, 73, 81), 201 InteractNoImage(314, 263, 73, 81),
195 (313, 138, 125, 22), 202 InteractText(313, 132, 140, 33, _("Hydroponics"), 'white', 20,
203 'Monospace.ttf'),
196 )) 204 ))
197 } 205 }
198 206
199 INITIAL = 'areas' 207 INITIAL = 'areas'
200 208