gemwarrior 0.12.6 → 0.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gemwarrior/repl.rb +88 -82
- data/lib/gemwarrior/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8cb18496411a23c6f5cf358966ee637a54cf5af
|
4
|
+
data.tar.gz: 36a10e8a5e4169918459421761eaf6531c25e152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f431f5650418746bdad6a52e5cb12e2a9b37480fd79a21dca9866eaea193faeafbe766898973ea1770c0c7e9fc607659d7d1b3c9227e8d784b32c5106b692482
|
7
|
+
data.tar.gz: fa4f06e96071517d917bc055e9471dd10720f37191921d96a068bd07c7c2ceb58c7fc0fd383d4721ff3e49eb6b4ad5acb63c5d51d2b5f4ce72178880dbef8e0a
|
data/lib/gemwarrior/repl.rb
CHANGED
@@ -149,85 +149,6 @@ module Gemwarrior
|
|
149
149
|
puts '* Most commands can be abbreviated to their first letter *'
|
150
150
|
end
|
151
151
|
|
152
|
-
def print_options
|
153
|
-
puts
|
154
|
-
puts 'Gem Warrior Options'.colorize(:yellow)
|
155
|
-
puts '======================='.colorize(:yellow)
|
156
|
-
puts 'Change whether sound is played, which sound system to use, what game volume is, or whether Wordnik is used to generate more dynamic descriptors of entities (valid WORDNIK_API_KEY environment variable must be set)'
|
157
|
-
puts
|
158
|
-
puts " (1) SOUND ENABLED : #{GameOptions.data['sound_enabled']}"
|
159
|
-
puts " (2) SOUND SYSTEM : #{GameOptions.data['sound_system']}"
|
160
|
-
puts " (3) SOUND VOLUME : #{GameOptions.data['sound_volume']}"
|
161
|
-
puts " (4) USE WORDNIK : #{GameOptions.data['use_wordnik']}"
|
162
|
-
puts
|
163
|
-
puts '======================='
|
164
|
-
puts
|
165
|
-
puts 'Enter option number to change value, or any other key to return to main menu.'
|
166
|
-
print '[GAME_OPTIONS]> '
|
167
|
-
|
168
|
-
answer = STDIN.getch
|
169
|
-
|
170
|
-
case answer
|
171
|
-
when '1'
|
172
|
-
print answer
|
173
|
-
GameOptions.data['sound_enabled'] = !GameOptions.data['sound_enabled']
|
174
|
-
print_options
|
175
|
-
when '2'
|
176
|
-
print answer
|
177
|
-
print "\n"
|
178
|
-
print_sound_system_selection
|
179
|
-
print_options
|
180
|
-
when '3'
|
181
|
-
print answer
|
182
|
-
print "\n"
|
183
|
-
print 'Enter a volume from 0.0 to 1.0: '
|
184
|
-
new_vol = gets.chomp.to_f.abs
|
185
|
-
if new_vol >= 0.0 and new_vol <= 1.0
|
186
|
-
GameOptions.data['sound_volume'] = new_vol
|
187
|
-
else
|
188
|
-
puts 'Not a valid volume.'
|
189
|
-
end
|
190
|
-
print_options
|
191
|
-
when '4'
|
192
|
-
print answer
|
193
|
-
GameOptions.data['use_wordnik'] = !GameOptions.data['use_wordnik']
|
194
|
-
print_options
|
195
|
-
else
|
196
|
-
print answer
|
197
|
-
return
|
198
|
-
end
|
199
|
-
end
|
200
|
-
|
201
|
-
def print_sound_system_selection
|
202
|
-
puts
|
203
|
-
puts 'Sound System Selection'.colorize(:yellow)
|
204
|
-
puts '========================'.colorize(:yellow)
|
205
|
-
puts
|
206
|
-
print ' (1) WIN32-SOUND '
|
207
|
-
print '(SELECTED)'.colorize(:yellow) if GameOptions.data['sound_system'].eql?('win32-sound')
|
208
|
-
print "\n"
|
209
|
-
print ' (2) FEEP '
|
210
|
-
print '(SELECTED)'.colorize(:yellow) if GameOptions.data['sound_system'].eql?('feep')
|
211
|
-
print "\n"
|
212
|
-
puts
|
213
|
-
puts 'Enter option number to select sound system, or any other key to exit.'
|
214
|
-
puts 'Note: win32-sound only works on Windows and will break the game is sound is enabled on non-Windows machines. Feep is cross-platform, but very slow and buggy, so use at your discretion!'
|
215
|
-
puts
|
216
|
-
print '[SOUND_SYSTEM]> '
|
217
|
-
answer = STDIN.getch.chomp.downcase
|
218
|
-
|
219
|
-
case answer
|
220
|
-
when '1'
|
221
|
-
GameOptions.add 'sound_system', 'win32-sound'
|
222
|
-
print_sound_system_selection
|
223
|
-
when '2'
|
224
|
-
GameOptions.add 'sound_system', 'feep'
|
225
|
-
print_sound_system_selection
|
226
|
-
else
|
227
|
-
return
|
228
|
-
end
|
229
|
-
end
|
230
|
-
|
231
152
|
def display_log_of_attempts
|
232
153
|
if File.exist?(GameOptions.data['log_file_path']) and !File.zero?(GameOptions.data['log_file_path'])
|
233
154
|
File.open(GameOptions.data['log_file_path']).readlines.each do |line|
|
@@ -271,18 +192,103 @@ module Gemwarrior
|
|
271
192
|
end
|
272
193
|
end
|
273
194
|
|
195
|
+
def print_options_sound_sytem
|
196
|
+
puts
|
197
|
+
puts 'Sound System Selection'.colorize(:yellow)
|
198
|
+
puts '================================='.colorize(:yellow)
|
199
|
+
puts
|
200
|
+
print ' (1) WIN32-SOUND '
|
201
|
+
print '(SELECTED)'.colorize(:yellow) if GameOptions.data['sound_system'].eql?('win32-sound')
|
202
|
+
print "\n"
|
203
|
+
print ' (2) FEEP '
|
204
|
+
print '(SELECTED)'.colorize(:yellow) if GameOptions.data['sound_system'].eql?('feep')
|
205
|
+
print "\n"
|
206
|
+
puts
|
207
|
+
puts 'Note: WIN32-SOUND is Windows-only, and will break the game if sound is enabled on non-Windows machines.'
|
208
|
+
puts 'Note: FEEP is cross-platform, but VERY SLOW and BUGGY, so use at your discretion!'
|
209
|
+
puts
|
210
|
+
puts '================================='.colorize(:yellow)
|
211
|
+
puts
|
212
|
+
puts 'Enter option number to select sound system, or any other key to exit.'
|
213
|
+
puts
|
214
|
+
print '[GW_OPTS]-[SOUND_SYSTEM]> '
|
215
|
+
answer = STDIN.getch.chomp.downcase
|
216
|
+
|
217
|
+
case answer
|
218
|
+
when '1'
|
219
|
+
GameOptions.add 'sound_system', 'win32-sound'
|
220
|
+
print_options_sound_sytem
|
221
|
+
when '2'
|
222
|
+
GameOptions.add 'sound_system', 'feep'
|
223
|
+
print_options_sound_sytem
|
224
|
+
else
|
225
|
+
return
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
def print_options
|
230
|
+
puts
|
231
|
+
puts 'Gem Warrior General Options'.colorize(:yellow)
|
232
|
+
puts '================================='.colorize(:yellow)
|
233
|
+
puts
|
234
|
+
puts 'Change several sound (quite experimental for now) options, and whether Wordnik is used to generate more dynamic descriptors of entities (valid WORDNIK_API_KEY environment variable must be set).'
|
235
|
+
puts
|
236
|
+
puts " (1) SOUND ENABLED : #{GameOptions.data['sound_enabled']}"
|
237
|
+
puts " (2) SOUND SYSTEM : #{GameOptions.data['sound_system']}"
|
238
|
+
puts " (3) SOUND VOLUME : #{GameOptions.data['sound_volume']}"
|
239
|
+
puts " (4) USE WORDNIK : #{GameOptions.data['use_wordnik']}"
|
240
|
+
puts
|
241
|
+
puts '================================='.colorize(:yellow)
|
242
|
+
puts
|
243
|
+
puts 'Enter option number to change value, or any other key to return to main menu.'
|
244
|
+
puts
|
245
|
+
print '[GW_OPTS]> '
|
246
|
+
|
247
|
+
answer = STDIN.getch
|
248
|
+
|
249
|
+
case answer
|
250
|
+
when '1'
|
251
|
+
print answer
|
252
|
+
GameOptions.data['sound_enabled'] = !GameOptions.data['sound_enabled']
|
253
|
+
print_options
|
254
|
+
when '2'
|
255
|
+
print answer
|
256
|
+
print "\n"
|
257
|
+
print_options_sound_sytem
|
258
|
+
print_options
|
259
|
+
when '3'
|
260
|
+
print answer
|
261
|
+
print "\n"
|
262
|
+
print 'Enter a volume from 0.0 to 1.0: '
|
263
|
+
new_vol = gets.chomp.to_f.abs
|
264
|
+
if new_vol >= 0.0 and new_vol <= 1.0
|
265
|
+
GameOptions.data['sound_volume'] = new_vol
|
266
|
+
else
|
267
|
+
puts 'Not a valid volume.'
|
268
|
+
end
|
269
|
+
print_options
|
270
|
+
when '4'
|
271
|
+
print answer
|
272
|
+
GameOptions.data['use_wordnik'] = !GameOptions.data['use_wordnik']
|
273
|
+
print_options
|
274
|
+
else
|
275
|
+
print answer
|
276
|
+
return
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
274
280
|
def print_main_menu
|
275
281
|
puts
|
276
282
|
puts " GW v#{Gemwarrior::VERSION}"
|
277
283
|
puts '======================='
|
284
|
+
puts ' (R)esume Game'.colorize(:green) if save_file_exist?
|
278
285
|
puts ' (N)ew Game'
|
279
|
-
puts ' (R)esume Game' if save_file_exist?
|
280
286
|
puts ' (A)bout'
|
281
287
|
puts ' (H)elp'
|
282
288
|
puts ' (O)ptions'
|
283
289
|
puts ' (L)og of Attempts'
|
284
290
|
puts ' (C)heck for Updates'
|
285
|
-
puts ' (E)xit'
|
291
|
+
puts ' (E)xit'.colorize(:red)
|
286
292
|
puts '======================='
|
287
293
|
puts
|
288
294
|
end
|
@@ -339,7 +345,7 @@ module Gemwarrior
|
|
339
345
|
puts choice
|
340
346
|
check_for_new_release
|
341
347
|
run_main_menu
|
342
|
-
when 'e', 'x'
|
348
|
+
when 'e', 'x', 'q'
|
343
349
|
puts choice
|
344
350
|
puts MAIN_MENU_QUIT_MESSAGE
|
345
351
|
game.update_options_file
|
data/lib/gemwarrior/version.rb
CHANGED