|
@@ -0,0 +1,659 @@
|
|
1
|
+import bge
|
|
2
|
+keyboard = bge.logic.keyboard
|
|
3
|
+JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+#exit functions
|
|
7
|
+#=======
|
|
8
|
+def endpoint(funct, motion, dict, cont):
|
|
9
|
+ print('endpoint', funct,motion)
|
|
10
|
+ scene = bge.logic.getCurrentScene()
|
|
11
|
+ shirt = scene.objects["Char4:Zshirtt1"]
|
|
12
|
+ shoeR = scene.objects['Char4:Shoes02.R']
|
|
13
|
+ shoeL = scene.objects['Char4:Shoes02.L']
|
|
14
|
+ deck = scene.objects["deck"]
|
|
15
|
+ throw_deck = scene.objectsInactive["throw_deck"]
|
|
16
|
+ cam = scene.objects['Camera.003']
|
|
17
|
+ c_move = .025 #color move amount
|
|
18
|
+ if funct == 'exit':
|
|
19
|
+ print("exit function", motion)
|
|
20
|
+ bge.logic.endGame()
|
|
21
|
+ if funct == 'restart':
|
|
22
|
+ print("restart function", motion)
|
|
23
|
+ bge.logic.restartGame()
|
|
24
|
+ if funct == 'shirt color r':
|
|
25
|
+ s_color = shirt.color
|
|
26
|
+ s_color_r = s_color[0]
|
|
27
|
+ if motion == 'inc':
|
|
28
|
+ if s_color_r < 1:
|
|
29
|
+ s_color_r += c_move
|
|
30
|
+ s_color_r = round(s_color_r, 2)
|
|
31
|
+ else:
|
|
32
|
+ s_color_r = 1
|
|
33
|
+ if motion == 'dec':
|
|
34
|
+ if s_color_r > c_move:
|
|
35
|
+ s_color_r -= c_move
|
|
36
|
+ s_color_r = round(s_color_r, 2)
|
|
37
|
+ else:
|
|
38
|
+ s_color_r = 0
|
|
39
|
+ new_col = [s_color_r, s_color[1], s_color[2], s_color[3]]
|
|
40
|
+ shirt.color = new_col
|
|
41
|
+ dict['shirt_color_r'] = new_col[0]
|
|
42
|
+
|
|
43
|
+ if funct == 'shirt color g':
|
|
44
|
+ s_color = shirt.color
|
|
45
|
+ s_color_g = s_color[1]
|
|
46
|
+ if motion == 'inc':
|
|
47
|
+ if s_color_g < 1:
|
|
48
|
+ s_color_g += c_move
|
|
49
|
+ s_color_g = round(s_color_g, 2)
|
|
50
|
+ else:
|
|
51
|
+ s_color_rg = 1
|
|
52
|
+ if motion == 'dec':
|
|
53
|
+ if s_color_g > c_move:
|
|
54
|
+ s_color_g -= c_move
|
|
55
|
+ s_color_g = round(s_color_g, 2)
|
|
56
|
+ else:
|
|
57
|
+ s_color_g = 0
|
|
58
|
+ new_col = [s_color[0], s_color_g, s_color[2], s_color[3]]
|
|
59
|
+ shirt.color = new_col
|
|
60
|
+ dict['shirt_color_g'] = new_col[1]
|
|
61
|
+ if funct == 'shirt color b':
|
|
62
|
+ s_color = shirt.color
|
|
63
|
+ s_color_b = s_color[2]
|
|
64
|
+ if motion == 'inc':
|
|
65
|
+ if s_color_b < 1:
|
|
66
|
+ s_color_b += c_move
|
|
67
|
+ s_color_b = round(s_color_b, 2)
|
|
68
|
+ else:
|
|
69
|
+ s_color_b = 1
|
|
70
|
+ if motion == 'dec':
|
|
71
|
+ if s_color_b > c_move:
|
|
72
|
+ s_color_b -= c_move
|
|
73
|
+ s_color_b = round(s_color_b, 2)
|
|
74
|
+ else:
|
|
75
|
+ s_color_b = 0
|
|
76
|
+ new_col = [s_color[0], s_color[1], s_color_b, s_color[3]]
|
|
77
|
+ shirt.color = new_col
|
|
78
|
+ print(new_col)
|
|
79
|
+ dict['shirt_color_b'] = new_col[2]
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+ if funct == 'shoe color r':
|
|
85
|
+ s_color = shoeL.color
|
|
86
|
+ s_color_r = s_color[0]
|
|
87
|
+ if motion == 'inc':
|
|
88
|
+ if s_color_r < 1:
|
|
89
|
+ s_color_r += c_move
|
|
90
|
+ s_color_r = round(s_color_r, 2)
|
|
91
|
+ else:
|
|
92
|
+ s_color_r = 1
|
|
93
|
+ if motion == 'dec':
|
|
94
|
+ if s_color_r > c_move:
|
|
95
|
+ s_color_r -= c_move
|
|
96
|
+ s_color_r = round(s_color_r, 2)
|
|
97
|
+ else:
|
|
98
|
+ s_color_r = 0
|
|
99
|
+ new_col = [s_color_r, s_color[1], s_color[2], s_color[3]]
|
|
100
|
+ shoeL.color = new_col
|
|
101
|
+ shoeR.color = new_col
|
|
102
|
+ dict['shoe_color_r'] = new_col[0]
|
|
103
|
+
|
|
104
|
+ if funct == 'shoe color g':
|
|
105
|
+ s_color = shoeL.color
|
|
106
|
+ s_color_g = s_color[1]
|
|
107
|
+ if motion == 'inc':
|
|
108
|
+ if s_color_g < 1:
|
|
109
|
+ s_color_g += c_move
|
|
110
|
+ s_color_g = round(s_color_g, 2)
|
|
111
|
+ else:
|
|
112
|
+ s_color_rg = 1
|
|
113
|
+ if motion == 'dec':
|
|
114
|
+ if s_color_g > c_move:
|
|
115
|
+ s_color_g -= c_move
|
|
116
|
+ s_color_g = round(s_color_g, 2)
|
|
117
|
+ else:
|
|
118
|
+ s_color_g = 0
|
|
119
|
+ new_col = [s_color[0], s_color_g, s_color[2], s_color[3]]
|
|
120
|
+ shoeL.color = new_col
|
|
121
|
+ shoeR.color = new_col
|
|
122
|
+ dict['shoe_color_g'] = new_col[1]
|
|
123
|
+ if funct == 'shoe color b':
|
|
124
|
+ s_color = shoeL.color
|
|
125
|
+ s_color_b = s_color[2]
|
|
126
|
+ if motion == 'inc':
|
|
127
|
+ if s_color_b < 1:
|
|
128
|
+ s_color_b += c_move
|
|
129
|
+ s_color_b = round(s_color_b, 2)
|
|
130
|
+ else:
|
|
131
|
+ s_color_b = 1
|
|
132
|
+ if motion == 'dec':
|
|
133
|
+ if s_color_b > c_move:
|
|
134
|
+ s_color_b -= c_move
|
|
135
|
+ s_color_b = round(s_color_b, 2)
|
|
136
|
+ else:
|
|
137
|
+ s_color_b = 0
|
|
138
|
+ new_col = [s_color[0], s_color[1], s_color_b, s_color[3]]
|
|
139
|
+ shoeL.color = new_col
|
|
140
|
+ shoeR.color = new_col
|
|
141
|
+ print(new_col)
|
|
142
|
+ dict['shoe_color_b'] = new_col[2]
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+ if funct == 'deck color r':
|
|
146
|
+ s_color = deck.color
|
|
147
|
+ s_color_r = s_color[0]
|
|
148
|
+ if motion == 'inc':
|
|
149
|
+ if s_color_r < 1:
|
|
150
|
+ s_color_r += c_move
|
|
151
|
+ s_color_r = round(s_color_r, 2)
|
|
152
|
+ else:
|
|
153
|
+ s_color_r = 1
|
|
154
|
+ if motion == 'dec':
|
|
155
|
+ if s_color_r > c_move:
|
|
156
|
+ s_color_r -= c_move
|
|
157
|
+ s_color_r = round(s_color_r, 2)
|
|
158
|
+ else:
|
|
159
|
+ s_color_r = 0
|
|
160
|
+ new_col = [s_color_r, s_color[1], s_color[2], s_color[3]]
|
|
161
|
+ deck.color = new_col
|
|
162
|
+ throw_deck.color = new_col
|
|
163
|
+ dict['deck_color_r'] = new_col[0]
|
|
164
|
+
|
|
165
|
+ if funct == 'deck color g':
|
|
166
|
+ s_color = deck.color
|
|
167
|
+ s_color_g = s_color[1]
|
|
168
|
+ if motion == 'inc':
|
|
169
|
+ if s_color_g < 1:
|
|
170
|
+ s_color_g += c_move
|
|
171
|
+ s_color_g = round(s_color_g, 2)
|
|
172
|
+ else:
|
|
173
|
+ s_color_rg = 1
|
|
174
|
+ if motion == 'dec':
|
|
175
|
+ if s_color_g > c_move:
|
|
176
|
+ s_color_g -= c_move
|
|
177
|
+ s_color_g = round(s_color_g, 2)
|
|
178
|
+ else:
|
|
179
|
+ s_color_g = 0
|
|
180
|
+ new_col = [s_color[0], s_color_g, s_color[2], s_color[3]]
|
|
181
|
+ deck.color = new_col
|
|
182
|
+ throw_deck.color = new_col
|
|
183
|
+ dict['deck_color_g'] = new_col[1]
|
|
184
|
+ if funct == 'deck color b':
|
|
185
|
+ s_color = deck.color
|
|
186
|
+ s_color_b = s_color[2]
|
|
187
|
+ if motion == 'inc':
|
|
188
|
+ if s_color_b < 1:
|
|
189
|
+ s_color_b += c_move
|
|
190
|
+ s_color_b = round(s_color_b, 2)
|
|
191
|
+ else:
|
|
192
|
+ s_color_b = 1
|
|
193
|
+ if motion == 'dec':
|
|
194
|
+ if s_color_b > c_move:
|
|
195
|
+ s_color_b -= c_move
|
|
196
|
+ s_color_b = round(s_color_b, 2)
|
|
197
|
+ else:
|
|
198
|
+ s_color_b = 0
|
|
199
|
+ new_col = [s_color[0], s_color[1], s_color_b, s_color[3]]
|
|
200
|
+ deck.color = new_col
|
|
201
|
+ throw_deck.color = new_col
|
|
202
|
+ print(new_col)
|
|
203
|
+ dict['deck_color_b'] = new_col[2]
|
|
204
|
+
|
|
205
|
+ if funct == 'shirt logo':
|
|
206
|
+ logo = dict['shirt_logo']
|
|
207
|
+ logo1 = shirt.meshes[0].materials[0].textures[6]
|
|
208
|
+ logo2 = shirt.meshes[0].materials[0].textures[7]
|
|
209
|
+ logo3 = shirt.meshes[0].materials[0].textures[5]
|
|
210
|
+ if motion == 'inc':
|
|
211
|
+ if logo == 0:
|
|
212
|
+ logo = 1
|
|
213
|
+ elif logo == 1:
|
|
214
|
+ logo = 2
|
|
215
|
+ elif logo == 2:
|
|
216
|
+ logo = 3
|
|
217
|
+ elif logo == 3:
|
|
218
|
+ logo = 0
|
|
219
|
+ if motion == 'dec':
|
|
220
|
+ if logo == 0:
|
|
221
|
+ logo = 3
|
|
222
|
+ elif logo == 1:
|
|
223
|
+ logo = 0
|
|
224
|
+ elif logo == 2:
|
|
225
|
+ logo = 1
|
|
226
|
+ elif logo == 3:
|
|
227
|
+ logo = 2
|
|
228
|
+ if logo == 1:
|
|
229
|
+ logo1.diffuseIntensity = 1
|
|
230
|
+ logo2.diffuseIntensity = 0
|
|
231
|
+ logo1.diffuseFactor = 1
|
|
232
|
+ logo2.diffuseFactor = 0
|
|
233
|
+ logo3.diffuseIntensity = 0
|
|
234
|
+ logo3.diffuseFactor = 0
|
|
235
|
+ if logo == 2:
|
|
236
|
+ logo1.diffuseIntensity = 0
|
|
237
|
+ logo1.diffuseFactor = 0
|
|
238
|
+ logo2.diffuseIntensity = 1
|
|
239
|
+ logo2.diffuseFactor = 1
|
|
240
|
+ logo3.diffuseIntensity = 0
|
|
241
|
+ logo3.diffuseFactor = 0
|
|
242
|
+ if logo == 3:
|
|
243
|
+ logo1.diffuseIntensity = 0
|
|
244
|
+ logo1.diffuseFactor = 0
|
|
245
|
+ logo2.diffuseIntensity = 0
|
|
246
|
+ logo2.diffuseFactor = 0
|
|
247
|
+ logo3.diffuseIntensity = 1
|
|
248
|
+ logo3.diffuseFactor = 1
|
|
249
|
+ if logo == 0:
|
|
250
|
+ logo1.diffuseIntensity = 0
|
|
251
|
+ logo2.diffuseIntensity = 0
|
|
252
|
+ logo1.diffuseFactor = 0
|
|
253
|
+ logo2.diffuseFactor = 0
|
|
254
|
+ logo3.diffuseIntensity = 0
|
|
255
|
+ logo3.diffuseFactor = 0
|
|
256
|
+ dict['shirt_logo'] = logo
|
|
257
|
+
|
|
258
|
+ if funct == 'brightness / contrast on':
|
|
259
|
+ if motion == 'inc':
|
|
260
|
+ cont.activate(cam.actuators["bc"])
|
|
261
|
+ cam['bc'] = 1
|
|
262
|
+ dict['bc'] = 1
|
|
263
|
+ else:
|
|
264
|
+ cont.activate(cam.actuators["bc_off"])
|
|
265
|
+ cam['bc'] = 0
|
|
266
|
+ dict['bc'] = 0
|
|
267
|
+ if funct == 'brightness value':
|
|
268
|
+ b = cam['BC_BRIGHTNESS']
|
|
269
|
+ if motion == 'inc':
|
|
270
|
+ b += .05
|
|
271
|
+ else:
|
|
272
|
+ b -= .05
|
|
273
|
+ cam['BC_BRIGHTNESS'] = round(b,2)
|
|
274
|
+ dict['BC_BRIGHTNESS'] = round(b,2)
|
|
275
|
+
|
|
276
|
+ if funct == 'contrast value':
|
|
277
|
+ b = cam['BC_CONTRAST']
|
|
278
|
+ if motion == 'inc':
|
|
279
|
+ b += .05
|
|
280
|
+ else:
|
|
281
|
+ b -= .05
|
|
282
|
+ cam['BC_CONTRAST'] = round(b,2)
|
|
283
|
+ dict['BC_CONTRAST'] = round(b,2)
|
|
284
|
+
|
|
285
|
+ if funct == 'hdr on':
|
|
286
|
+ if motion == 'inc':
|
|
287
|
+ cont.activate(cam.actuators["hdr"])
|
|
288
|
+ cam['hdr'] = 1
|
|
289
|
+ dict['hdr'] = 1
|
|
290
|
+ else:
|
|
291
|
+ cont.activate(cam.actuators["hdr_off"])
|
|
292
|
+ cam['hdr'] = 0
|
|
293
|
+ dict['hdr'] = 0
|
|
294
|
+ if funct == 'avgL':
|
|
295
|
+ b = cam['avgL']
|
|
296
|
+ if motion == 'inc':
|
|
297
|
+ b += .05
|
|
298
|
+ else:
|
|
299
|
+ b -= .05
|
|
300
|
+ cam['avgL'] = round(b,2)
|
|
301
|
+ dict['avgL'] = round(b,2)
|
|
302
|
+
|
|
303
|
+ if funct == 'hdr strength':
|
|
304
|
+ b = cam['HDRamount']
|
|
305
|
+ if motion == 'inc':
|
|
306
|
+ b += .05
|
|
307
|
+ else:
|
|
308
|
+ b -= .05
|
|
309
|
+ cam['HDRamount'] = round(b,2)
|
|
310
|
+ dict['HDRamount'] = round(b,2)
|
|
311
|
+
|
|
312
|
+ if funct == 'ao on':
|
|
313
|
+ if motion == 'inc':
|
|
314
|
+ cont.activate(cam.actuators["ao"])
|
|
315
|
+ cam['ao'] = 1
|
|
316
|
+ dict['ao'] = 1
|
|
317
|
+ else:
|
|
318
|
+ cont.activate(cam.actuators["ao_off"])
|
|
319
|
+ cam['ao'] = 0
|
|
320
|
+ dict['ao'] = 0
|
|
321
|
+ if funct == 'ao width':
|
|
322
|
+ b = cam['aowidth']
|
|
323
|
+ if motion == 'inc':
|
|
324
|
+ b += 1
|
|
325
|
+ else:
|
|
326
|
+ b -= 1
|
|
327
|
+ cam['aowidth'] = round(b,2)
|
|
328
|
+ dict['aowidth'] = round(b,2)
|
|
329
|
+
|
|
330
|
+ if funct == 'ao radius':
|
|
331
|
+ b = cam['aoradius']
|
|
332
|
+ if motion == 'inc':
|
|
333
|
+ b += 1
|
|
334
|
+ else:
|
|
335
|
+ b -= 1
|
|
336
|
+ cam['aoradius'] = round(b,2)
|
|
337
|
+ dict['aoradius'] = round(b,2)
|
|
338
|
+ if funct == 'ao only':
|
|
339
|
+ b = cam['onlyAO']
|
|
340
|
+ if motion == 'inc':
|
|
341
|
+ b = 1
|
|
342
|
+ else:
|
|
343
|
+ b = 0
|
|
344
|
+ cam['onlyAO'] = b
|
|
345
|
+ dict['onlyAO'] = b
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+ if funct == 'dof on':
|
|
349
|
+ if motion == 'inc':
|
|
350
|
+ cont.activate(cam.actuators["DOF"])
|
|
351
|
+ cam['dof_on'] = 1
|
|
352
|
+ dict['dof_on'] = 1
|
|
353
|
+ else:
|
|
354
|
+ cont.activate(cam.actuators["DOF_off"])
|
|
355
|
+ cam['dof_on'] = 0
|
|
356
|
+ dict['dof_on'] = 0
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+ if funct == 'sun strength':
|
|
360
|
+ b = cam['sun_strength']
|
|
361
|
+ if motion == 'inc':
|
|
362
|
+ b += .05
|
|
363
|
+ else:
|
|
364
|
+ b -= .05
|
|
365
|
+ cam['sun_strength'] = round(b,2)
|
|
366
|
+ dict['sun_strength'] = round(b,2)
|
|
367
|
+ if 'sun33' in scene.objects:
|
|
368
|
+ sun = scene.objects['sun33']
|
|
369
|
+ sun.energy = b
|
|
370
|
+ if funct == 'ambient strength':
|
|
371
|
+ b = cam['ambient_strength']
|
|
372
|
+ if motion == 'inc':
|
|
373
|
+ b += .05
|
|
374
|
+ else:
|
|
375
|
+ b -= .05
|
|
376
|
+ cam['ambient_strength'] = round(b,2)
|
|
377
|
+ dict['ambient_strength'] = round(b,2)
|
|
378
|
+ if 'sun33' in scene.objects:
|
|
379
|
+ scene.world.envLightEnergy = b
|
|
380
|
+ if funct == 'sun rot x':
|
|
381
|
+ #b = cam['sun_rot_x']
|
|
382
|
+ b=0
|
|
383
|
+ if motion == 'inc':
|
|
384
|
+ b += .05
|
|
385
|
+ else:
|
|
386
|
+ b -= .05
|
|
387
|
+ if 'camposEmpty' in scene.objects:
|
|
388
|
+
|
|
389
|
+ em = scene.objects['camposEmpty']
|
|
390
|
+
|
|
391
|
+ rot = [ b, 0.0, 0]
|
|
392
|
+ em.applyRotation(rot,True)
|
|
393
|
+ cam['sun_rot_x'] = round(b,2)
|
|
394
|
+ dict['sun_rot_x'] = round(b,2)
|
|
395
|
+ if funct == 'sun rot y':
|
|
396
|
+ #b = cam['sun_rot_y']
|
|
397
|
+ b=0
|
|
398
|
+ if motion == 'inc':
|
|
399
|
+ b += .05
|
|
400
|
+ else:
|
|
401
|
+ b -= .05
|
|
402
|
+ if 'camposEmpty' in scene.objects:
|
|
403
|
+
|
|
404
|
+ em = scene.objects['camposEmpty']
|
|
405
|
+
|
|
406
|
+ rot = [ 0, b, 0]
|
|
407
|
+ em.applyRotation(rot,True)
|
|
408
|
+ cam['sun_rot_y'] = round(b,2)
|
|
409
|
+ dict['sun_rot_y'] = round(b,2)
|
|
410
|
+
|
|
411
|
+#=======
|
|
412
|
+#end exit functions
|
|
413
|
+
|
|
414
|
+def get_c_list(dict):
|
|
415
|
+ #main menu
|
|
416
|
+ if dict['mlevel'] == 0:
|
|
417
|
+ dict['current_list'] = ['exit', 'settings', 'level', 'replay', 'restart']
|
|
418
|
+
|
|
419
|
+ #opt = dict['current_list'][dict['current_index']]
|
|
420
|
+
|
|
421
|
+ if dict['mlevel'] == 1:
|
|
422
|
+ if dict['lv0_opt'] == 'settings':
|
|
423
|
+ #if opt == 'settings':
|
|
424
|
+ dict['current_list'] = ['graphics', 'player', 'level', 'camera', 'physics']
|
|
425
|
+ if dict['lv0_opt'] == 'replay':
|
|
426
|
+ dict['current_list'] = ['enter replay', 'recorder on', 'record length']
|
|
427
|
+ if dict['mlevel'] == 2:
|
|
428
|
+ if dict['lv1_opt'] == 'graphics':
|
|
429
|
+ #if opt == 'settings':
|
|
430
|
+ dict['current_list'] = ['brightness / contrast', 'ao', 'hdr', 'dof']
|
|
431
|
+ if dict['mlevel'] == 2:
|
|
432
|
+ if dict['lv1_opt'] == 'player':
|
|
433
|
+ #if opt == 'settings':
|
|
434
|
+ dict['current_list'] = ['shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo']
|
|
435
|
+
|
|
436
|
+ if dict['mlevel'] == 2:
|
|
437
|
+ if dict['lv1_opt'] == 'level':
|
|
438
|
+ #if opt == 'settings':
|
|
439
|
+ dict['current_list'] = ['sun strength', 'ambient strength', 'sun rot x', 'sun rot y', 'shadow on']
|
|
440
|
+
|
|
441
|
+ if dict['mlevel'] == 3:
|
|
442
|
+ if dict['lv2_opt'] == 'ao':
|
|
443
|
+ dict['current_list'] = ['ao on', 'ao radius', 'ao width', 'ao only']
|
|
444
|
+ if dict['lv2_opt'] == 'brightness / contrast':
|
|
445
|
+ dict['current_list'] = ['brightness / contrast on', 'brightness value', 'contrast value']
|
|
446
|
+
|
|
447
|
+ if dict['lv2_opt'] == 'hdr':
|
|
448
|
+ dict['current_list'] = ['hdr on', 'avgL', 'hdr strength']
|
|
449
|
+ if dict['lv2_opt'] == 'dof':
|
|
450
|
+ dict['current_list'] = ['dof on']
|
|
451
|
+
|
|
452
|
+def get_inputs(dict, cont):
|
|
453
|
+ #opt = dict['current_list'][dict['current_index']]
|
|
454
|
+ #b
|
|
455
|
+ if keyboard.events[bge.events.LEFTARROWKEY] == JUST_ACTIVATED or (dict['bBut'] == False and dict['last_bBut'] == True):
|
|
456
|
+ if dict['current_index'] not in dict['menu_end_points']:
|
|
457
|
+ #print('lkey')
|
|
458
|
+ if dict['mlevel'] == 2:
|
|
459
|
+ dict['mlevel'] = 1
|
|
460
|
+ dict['current_index'] = dict['lv1_index']
|
|
461
|
+ elif dict['mlevel'] == 1:
|
|
462
|
+ dict['mlevel'] = 0
|
|
463
|
+ dict['current_index'] = dict['lv0_index']
|
|
464
|
+ elif dict['mlevel'] == 3:
|
|
465
|
+ dict['mlevel'] = 2
|
|
466
|
+ dict['current_index'] = dict['lv2_index']
|
|
467
|
+ else:
|
|
468
|
+ pass
|
|
469
|
+# funct = dict['current_index']
|
|
470
|
+# motion = 'dec'
|
|
471
|
+# endpoint(funct, motion, dict)
|
|
472
|
+ #a
|
|
473
|
+ if (keyboard.events[bge.events.RIGHTARROWKEY] == JUST_ACTIVATED) or (dict['aBut'] == False and dict['last_aBut'] == True):
|
|
474
|
+ if dict['current_opt'] not in dict['menu_end_points']:
|
|
475
|
+ if dict['mlevel'] == 0:
|
|
476
|
+ dict['lv0_opt'] = dict['current_list'][dict['current_index']]
|
|
477
|
+ dict['lv0_index'] = dict['current_index']
|
|
478
|
+ dict['mlevel'] = 1
|
|
479
|
+ dict['lv1_index'] = 0
|
|
480
|
+ dict['current_index'] = 0
|
|
481
|
+ elif dict['mlevel'] == 1:
|
|
482
|
+ dict['lv1_opt'] = dict['current_list'][dict['current_index']]
|
|
483
|
+ dict['lv1_index'] = dict['current_index']
|
|
484
|
+ dict['mlevel'] = 2
|
|
485
|
+ dict['lv2_index'] = 0
|
|
486
|
+ dict['current_index'] = 0
|
|
487
|
+ elif dict['mlevel'] == 2:
|
|
488
|
+ dict['lv2_opt'] = dict['current_list'][dict['current_index']]
|
|
489
|
+ dict['lv2_index'] = dict['current_index']
|
|
490
|
+ dict['mlevel'] = 3
|
|
491
|
+ dict['lv3_index'] = 0
|
|
492
|
+ dict['current_index'] = 0
|
|
493
|
+ elif dict['mlevel'] == 3:
|
|
494
|
+ dict['lv3_opt'] = dict['current_list'][dict['current_index']]
|
|
495
|
+ dict['lv3_index'] = dict['current_index']
|
|
496
|
+ #dict['mlevel'] = 3
|
|
497
|
+ #dict['lv3_index'] = 0
|
|
498
|
+ dict['current_index'] = 0
|
|
499
|
+ else:
|
|
500
|
+ pass
|
|
501
|
+ funct = dict['current_opt']
|
|
502
|
+ motion = 'inc'
|
|
503
|
+ endpoint(funct, motion, dict, cont)
|
|
504
|
+ #down
|
|
505
|
+ if keyboard.events[bge.events.DOWNARROWKEY] == JUST_ACTIVATED or (dict['ddPad'] == False and dict['last_ddPad'] == True):
|
|
506
|
+ if dict['current_index'] < (len(dict['current_list']) - 1):
|
|
507
|
+ dict['current_index'] += 1
|
|
508
|
+ if dict['mlevel'] == 0:
|
|
509
|
+ dict['lv0_index'] = dict['current_index']
|
|
510
|
+ if dict['mlevel'] == 1:
|
|
511
|
+ dict['lv1_index'] = dict['current_index']
|
|
512
|
+ if dict['mlevel'] == 2:
|
|
513
|
+ dict['lv2_index'] = dict['current_index']
|
|
514
|
+ if dict['mlevel'] == 3:
|
|
515
|
+ dict['lv3_index'] = dict['current_index']
|
|
516
|
+ #up
|
|
517
|
+ if keyboard.events[bge.events.UPARROWKEY] == JUST_ACTIVATED or (dict['udPad'] == False and dict['last_udPad'] == True):
|
|
518
|
+ if dict['current_index'] > 0:
|
|
519
|
+ dict['current_index'] -= 1
|
|
520
|
+ if dict['mlevel'] == 0:
|
|
521
|
+ dict['lv0_index'] = dict['current_index']
|
|
522
|
+ if dict['mlevel'] == 1:
|
|
523
|
+ dict['lv1_index'] = dict['current_index']
|
|
524
|
+ if dict['mlevel'] == 2:
|
|
525
|
+ dict['lv2_index'] = dict['current_index']
|
|
526
|
+ if dict['mlevel'] == 3:
|
|
527
|
+ dict['lv3_index'] = dict['current_index']
|
|
528
|
+
|
|
529
|
+ #left
|
|
530
|
+ if dict['ldPad'] == False and dict['last_ldPad'] == True:
|
|
531
|
+ if dict['current_opt'] in dict['menu_end_points']:
|
|
532
|
+ funct = dict['current_opt']
|
|
533
|
+ motion = 'dec'
|
|
534
|
+ endpoint(funct, motion, dict, cont)
|
|
535
|
+
|
|
536
|
+ #right
|
|
537
|
+ if dict['rdPad'] == False and dict['last_rdPad'] == True:
|
|
538
|
+ if dict['current_opt'] in dict['menu_end_points']:
|
|
539
|
+ funct = dict['current_opt']
|
|
540
|
+ motion = 'inc'
|
|
541
|
+ endpoint(funct, motion, dict, cont)
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+def init(own, dict):
|
|
545
|
+ print('initing')
|
|
546
|
+ own['inited'] = True
|
|
547
|
+ dict['lv0_opt'] = 0
|
|
548
|
+ dict['lv0_index'] = 0
|
|
549
|
+ dict['lv1_opt'] = 0
|
|
550
|
+ dict['lv1_index'] = 0
|
|
551
|
+ dict['lv2_opt'] = 0
|
|
552
|
+ dict['lv2_index'] = 0
|
|
553
|
+ dict['lv3_opt'] = 0
|
|
554
|
+ dict['lv3_index'] = 0
|
|
555
|
+ dict['current_list'] = ['']
|
|
556
|
+ dict['current_index'] = 0
|
|
557
|
+ dict['mlevel'] = 0
|
|
558
|
+ dict['current_opt'] = ''
|
|
559
|
+ dict['pause_menu_text'] = ''
|
|
560
|
+ dict['menu_end_points'] = ['exit', 'restart', 'shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo', 'brightness / contrast on', 'brightness value', 'contrast value', 'hdr on', 'avgL', 'hdr strength', 'ao on', 'ao radius', 'ao width', 'ao only', 'dof on', 'sun strength', 'sun rot x', 'sun rot y', 'shadow on', 'ambient strength']
|
|
561
|
+
|
|
562
|
+def output(dict):
|
|
563
|
+ try:
|
|
564
|
+ opt = dict['current_list'][dict['current_index']]
|
|
565
|
+ except:
|
|
566
|
+ print('broken!!', dict['current_list'], dict['current_index'])
|
|
567
|
+ dict['current_opt'] = opt
|
|
568
|
+ #print(dict['lv1_index'], 'level: ', dict['mlevel'], dict['lv0_opt'], dict['current_index'], dict['current_list'], dict['current_opt'])
|
|
569
|
+ outp = 'menu > '
|
|
570
|
+ if dict['mlevel'] == 0:
|
|
571
|
+ outp = outp + dict['current_opt']
|
|
572
|
+ if dict['mlevel'] == 1:
|
|
573
|
+ outp = outp + dict['lv0_opt'] +' > ' + dict['current_opt']
|
|
574
|
+ if dict['mlevel'] == 2:
|
|
575
|
+ outp = outp + dict['lv0_opt'] +' > ' + dict['lv1_opt'] + ' > ' + dict['current_opt']
|
|
576
|
+ if dict['mlevel'] == 3:
|
|
577
|
+ outp = outp + dict['lv0_opt'] +' > ' + dict['lv1_opt'] + ' > ' + dict['lv2_opt'] + ' > ' + dict['current_opt']
|
|
578
|
+
|
|
579
|
+ #print(outp)
|
|
580
|
+ #print(dict['current_opt'])
|
|
581
|
+ if dict['current_opt'] in dict['menu_end_points']:
|
|
582
|
+ #print('adding end point value')
|
|
583
|
+ if dict['current_opt'] == 'shirt color r':
|
|
584
|
+ outp = outp + ': ' + str(dict['shirt_color_r'])
|
|
585
|
+ print(outp + ': ' + str(dict['shirt_color_r']))
|
|
586
|
+ if dict['current_opt'] == 'shirt color g':
|
|
587
|
+ outp = outp + ': ' + str(dict['shirt_color_g'])
|
|
588
|
+ if dict['current_opt'] == 'shirt color b':
|
|
589
|
+ outp = outp + ': ' + str(dict['shirt_color_b'])
|
|
590
|
+
|
|
591
|
+ if dict['current_opt'] == 'shoe color r':
|
|
592
|
+ outp = outp + ': ' + str(dict['shoe_color_r'])
|
|
593
|
+ print(outp + ': ' + str(dict['shoe_color_r']))
|
|
594
|
+ if dict['current_opt'] == 'shoe color g':
|
|
595
|
+ outp = outp + ': ' + str(dict['shoe_color_g'])
|
|
596
|
+ if dict['current_opt'] == 'shoe color b':
|
|
597
|
+ outp = outp + ': ' + str(dict['shoe_color_b'])
|
|
598
|
+ if dict['current_opt'] == 'deck color r':
|
|
599
|
+ outp = outp + ': ' + str(dict['deck_color_r'])
|
|
600
|
+ print(outp + ': ' + str(dict['deck_color_r']))
|
|
601
|
+ if dict['current_opt'] == 'deck color g':
|
|
602
|
+ outp = outp + ': ' + str(dict['deck_color_g'])
|
|
603
|
+ if dict['current_opt'] == 'deck color b':
|
|
604
|
+ outp = outp + ': ' + str(dict['deck_color_b'])
|
|
605
|
+ if dict['current_opt'] == 'shirt logo':
|
|
606
|
+ outp = outp + ': ' + str(dict['shirt_logo'])
|
|
607
|
+ if dict['current_opt'] == 'brightness / contrast on':
|
|
608
|
+ outp = outp + ': ' + str(dict['bc'])
|
|
609
|
+
|
|
610
|
+ if dict['current_opt'] == 'brightness value':
|
|
611
|
+ outp = outp + ': ' + str(dict['BC_BRIGHTNESS'])
|
|
612
|
+ if dict['current_opt'] == 'contrast value':
|
|
613
|
+ outp = outp + ': ' + str(dict['BC_CONTRAST'])
|
|
614
|
+
|
|
615
|
+ if dict['current_opt'] == 'hdr on':
|
|
616
|
+ outp = outp + ': ' + str(dict['hdr'])
|
|
617
|
+ if dict['current_opt'] == 'avgL':
|
|
618
|
+ outp = outp + ': ' + str(dict['avgL'])
|
|
619
|
+ if dict['current_opt'] == 'hdr strength':
|
|
620
|
+ outp = outp + ': ' + str(dict['HDRamount'])
|
|
621
|
+
|
|
622
|
+ if dict['current_opt'] == 'ao on':
|
|
623
|
+ outp = outp + ': ' + str(dict['ao'])
|
|
624
|
+ if dict['current_opt'] == 'ao width':
|
|
625
|
+ outp = outp + ': ' + str(dict['aowidth'])
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+ if dict['current_opt'] == 'ao radius':
|
|
629
|
+ outp = outp + ': ' + str(dict['aoradius'])
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+ if dict['current_opt'] == 'ao only':
|
|
633
|
+ outp = outp + ': ' + str(dict['onlyAO'])
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+ if dict['current_opt'] == 'dof on':
|
|
637
|
+ outp = outp + ': ' + str(dict['dof_on'])
|
|
638
|
+ if dict['current_opt'] == 'sun strength':
|
|
639
|
+ outp = outp + ': ' + str(dict['sun_strength'])
|
|
640
|
+ if dict['current_opt'] == 'sun rot x':
|
|
641
|
+ outp = outp + ': ' + str(dict['sun_rot_x'])
|
|
642
|
+ if dict['current_opt'] == 'sun rot y':
|
|
643
|
+ outp = outp + ': ' + str(dict['sun_rot_y'])
|
|
644
|
+ if dict['current_opt'] == 'shadow on':
|
|
645
|
+ outp = outp + ': ' + str(dict['shadow_on'])
|
|
646
|
+ if dict['current_opt'] == 'ambient strength':
|
|
647
|
+ outp = outp + ': ' + str(dict['ambient_strength'])
|
|
648
|
+
|
|
649
|
+ dict['pause_menu_text'] = outp
|
|
650
|
+def main(cont):
|
|
651
|
+
|
|
652
|
+ own = cont.owner
|
|
653
|
+ dict = bge.logic.globalDict
|
|
654
|
+ if 'inited' not in own:
|
|
655
|
+ init(own, dict)
|
|
656
|
+ get_c_list(dict)
|
|
657
|
+ get_inputs(dict, cont)
|
|
658
|
+ get_c_list(dict)
|
|
659
|
+ output(dict)
|