-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpbproc.py
583 lines (469 loc) · 22.7 KB
/
pbproc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# ************************************************************************************************#
# ************************************************************************************************#
# Directory Structure
# ************************************************************************************************#
# ************************************************************************************************#
# /photonmain.py # primary program
# /pgvar.py # global variable declarations
# /pgui.py # photon gui elements and buttons
# /pfunc.py # functions
# /pclass.py # button processing class that handles drawing / displaying UI
# /pbproc.py # processing sticky, group, dropdown etc button actions
# /photon_ref.py # references, dev notes, style guide, modification instructions
# pbproc.py
moduleName = "pbproc.py"
# ************************************************************************************************#
# ************************************************************************************************#
# Import Modules
# ************************************************************************************************#
# ************************************************************************************************#
# # public python modules
import pygame
import random
import math
import sys
import time # for FPS functions
import inspect # for displaying the line number of the code in print commands
# # unique modules for this app
import pgvar
import pfunc
import pgui
#import pclass
#import pbproc
# ************************************************************************************************#
# ************************************************************************************************#
# Local Variables
# ************************************************************************************************#
# ************************************************************************************************#
screen = pygame.display.set_mode((pgvar.pygame_window_width, pgvar.pygame_window_height))
# ************************************************************************************************#
# ************************************************************************************************#
# Button Processing
# ************************************************************************************************#
# ************************************************************************************************#
####### -------------------------------------##########
####### Sticky Buttons ##########
####### -------------------------------------##########
def updateStickyButtons(selected_button):
print moduleName, pfunc.lineNum(), "updateStickyButtons() - started"
print moduleName, pfunc.lineNum(), "selected_button = ", selected_button
"""
# for sticky buttons, iterate through nested allButtons dictionary and flip buttonEnabled
for allButtonsID, allButtonsValue in allButtons.items():
for key in allButtonsValue:
#print moduleName, pfunc.lineNum(), "key", key
#buttonToCheck[key] = allButtonsValue[key]
#print moduleName, pfunc.lineNum(), "buttonToCheck", key, allButtonsValue[key]
if allButtonsValue[key] == "sticky":
print moduleName, pfunc.lineNum(), "found a sticky button"
print moduleName, pfunc.lineNum(), "key, ", key, "value", allButtonsValue[key]
#print moduleName, pfunc.lineNum(), "buttonToCheck", key, allButtonsValue[key]
"""
if selected_button == "sticky01":
if pgui.buttonSticky01["enabled"] == False:
print moduleName, pfunc.lineNum(), "sticky01 button found"
pgui.buttonSticky01["enabled"] = True
pgui.buttonSticky01["color"] = pgvar.UI_button_selected_color
print moduleName, pfunc.lineNum(), "flipped sticky01 from false to true"
pfunc.defineButtons()
elif pgui.buttonSticky01["enabled"] == True:
print moduleName, pfunc.lineNum(), "sticky01 button found"
pgui.buttonSticky01["enabled"] = False
pgui.buttonSticky01["color"] = pgvar.UI_button_color
print moduleName, pfunc.lineNum(), "flipped stick01 from true to false"
pfunc.defineButtons()
if selected_button == "sticky02":
if pgui.buttonSticky02["enabled"] == False:
print moduleName, pfunc.lineNum(), "sticky02 button found"
pgui.buttonSticky02["enabled"] = True
pgui.buttonSticky02["color"] = pgvar.UI_button_selected_color
print moduleName, pfunc.lineNum(), "flipped sticky02 from false to true"
pfunc.defineButtons()
elif pgui.buttonSticky02["enabled"] == True:
print moduleName, pfunc.lineNum(), "sticky02 button found"
pgui.buttonSticky02["enabled"] = False
pgui.buttonSticky02["color"] = pgvar.UI_button_color
print moduleName, pfunc.lineNum(), "flipped sticky02 from true to false"
pfunc.defineButtons()
if selected_button == "sticky03":
if pgui.buttonSticky03["enabled"] == False:
print moduleName, pfunc.lineNum(), "sticky03 button found"
pgui.buttonSticky03["enabled"] = True
pgui.buttonSticky03["color"] = pgvar.UI_button_selected_color
print moduleName, pfunc.lineNum(), "flipped sticky03 from false to true"
pfunc.defineButtons()
elif pgui.buttonSticky03["enabled"] == True:
print moduleName, pfunc.lineNum(), "sticky03 button found"
pgui.buttonSticky03["enabled"] = False
pgui.buttonSticky03["color"] = pgvar.UI_button_color
print moduleName, pfunc.lineNum(), "flipped sticky03 from true to false"
pfunc.defineButtons()
# # # FPS BUTTON
if selected_button == "fps":
if pgui.buttonFPS["enabled"] == False:
pgui.buttonFPS["enabled"] = True
pgui.buttonFPS["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.buttonFPS["enabled"] == True:
pgui.buttonFPS["enabled"] = False
pgui.buttonFPS["color"] = pgvar.UI_button_color
pfunc.redrawEverything()
# # # Scale BUTTON
if selected_button == "scale":
if pgui.buttonScale["enabled"] == False:
pgui.buttonScale["enabled"] = True
pgui.buttonScale["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.buttonScale["enabled"] == True:
pgui.buttonScale["enabled"] = False
pgui.buttonScale["color"] = pgvar.UI_button_color
pfunc.redrawEverything()
# # # GRID BUTTON
if selected_button == "grid":
if pgui.buttonGrid["enabled"] == False:
pgui.buttonGrid["enabled"] = True
pgui.buttonGrid["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
pfunc.redrawEverything()
elif pgui.buttonGrid["enabled"] == True:
pgui.buttonGrid["enabled"] = False
pgui.buttonGrid["color"] = pgvar.UI_button_color
pfunc.defineButtons()
pfunc.redrawEverything()
# # # ORIGIN BUTTON
if selected_button == "origin":
if pgui.buttonOrigin["enabled"] == False:
pgui.buttonOrigin["enabled"] = True
pgui.buttonOrigin["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
pfunc.redrawEverything()
elif pgui.buttonOrigin["enabled"] == True:
pgui.buttonOrigin["enabled"] = False
pgui.buttonOrigin["color"] = pgvar.UI_button_color
pfunc.defineButtons()
pfunc.redrawEverything()
####### -------------------------------------##########
####### Group Buttons ##########
####### -------------------------------------##########
def updateGroupButtons(selected_button):
print moduleName, pfunc.lineNum(), "running update group buttons"
# # Group 01 processing
if selected_button == "Group01Button01":
if pgui.bGroup01Button01["enabled"] == True:
pgui.bGroup01Button01["enabled"] = False
pgui.bGroup01Button01["color"] = pgvar.UI_button_color
pgui.bGroup01Button02["enabled"] = True
pgui.bGroup01Button02["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.bGroup01Button01["enabled"] == False:
pgui.bGroup01Button01["enabled"] = True
pgui.bGroup01Button01["color"] = pgvar.UI_button_selected_color
pgui.bGroup01Button02["enabled"] = False
pgui.bGroup01Button02["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "Group01Button02":
if pgui.bGroup01Button02["enabled"] == True:
pgui.bGroup01Button02["enabled"] = False
pgui.bGroup01Button02["color"] = pgvar.UI_button_color
pgui.bGroup01Button01["enabled"] = True
pgui.bGroup01Button01["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.bGroup01Button02["enabled"] == False:
pgui.bGroup01Button02["enabled"] = True
pgui.bGroup01Button02["color"] = pgvar.UI_button_selected_color
pgui.bGroup01Button01["enabled"] = False
pgui.bGroup01Button01["color"] = pgvar.UI_button_color
pfunc.defineButtons()
# # Group 02 processing
if selected_button == "Group02Button01":
if pgui.bGroup02Button01["enabled"] == True:
pgui.bGroup02Button01["enabled"] = False
pgui.bGroup02Button01["color"] = pgvar.UI_button_color
pgui.bGroup02Button02["enabled"] = True
pgui.bGroup02Button02["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.bGroup02Button01["enabled"] == False:
pgui.bGroup02Button01["enabled"] = True
pgui.bGroup02Button01["color"] = pgvar.UI_button_selected_color
pgui.bGroup02Button02["enabled"] = False
pgui.bGroup02Button02["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "Group02Button02":
if pgui.bGroup02Button02["enabled"] == True:
pgui.bGroup02Button02["enabled"] = False
pgui.bGroup02Button02["color"] = pgvar.UI_button_color
pgui.bGroup02Button01["enabled"] = True
pgui.bGroup02Button01["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.bGroup02Button02["enabled"] == False:
pgui.bGroup02Button02["enabled"] = True
pgui.bGroup02Button02["color"] = pgvar.UI_button_selected_color
pgui.bGroup02Button01["enabled"] = False
pgui.bGroup02Button01["color"] = pgvar.UI_button_color
pfunc.defineButtons()
# # Group 03 processing
if selected_button == "Group03Button01":
if pgui.bGroup03Button01["enabled"] == False:
pgui.bGroup03Button01["enabled"] = True
pgui.bGroup03Button01["color"] = pgvar.UI_button_selected_color
pgui.bGroup03Button02["enabled"] = False
pgui.bGroup03Button02["color"] = pgvar.UI_button_color
pgui.bGroup03Button03["enabled"] = False
pgui.bGroup03Button03["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "Group03Button02":
if pgui.bGroup03Button02["enabled"] == False:
pgui.bGroup03Button02["enabled"] = True
pgui.bGroup03Button02["color"] = pgvar.UI_button_selected_color
pgui.bGroup03Button01["enabled"] = False
pgui.bGroup03Button01["color"] = pgvar.UI_button_color
pgui.bGroup03Button03["enabled"] = False
pgui.bGroup03Button03["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "Group03Button03":
if pgui.bGroup03Button03["enabled"] == False:
pgui.bGroup03Button03["enabled"] = True
pgui.bGroup03Button03["color"] = pgvar.UI_button_selected_color
pgui.bGroup03Button01["enabled"] = False
pgui.bGroup03Button01["color"] = pgvar.UI_button_color
pgui.bGroup03Button02["enabled"] = False
pgui.bGroup03Button02["color"] = pgvar.UI_button_color
pfunc.defineButtons()
## ############################################################################################
## UPDATE DROPDOWN BUTTONS
## ############################################################################################
def updateDropdownButtons(selected_button):
print pfunc.lineNum(), "running update Dropdown buttons"
if selected_button == "dropdown01opener":
if pgui.bDropdown01opener["enabled"] == False:
print pfunc.lineNum(), "~~~~ running dropdown opener fasle to true ~~~~"
# update this button
pgui.bDropdown01opener["enabled"] = True
pgui.bDropdown01opener["color"] = pgvar.UI_button_selected_color
pgui.bDropdown01opener["label_txt"] = "<<"
# update associated buttons
pgui.bDropdown01option01["visible"] = True
pgui.bDropdown01option02["visible"] = True
pgui.bDropdown01option03["visible"] = True
pfunc.defineButtons()
print pfunc.lineNum(), "~~~~ running dropdown opener fasle to true ~~~~"
print pfunc.lineNum(), pgui.bDropdown01opener["name"], "enabled:", pgui.bDropdown01opener["enabled"], "visible:", pgui.bDropdown01opener["visible"]
elif pgui.bDropdown01opener["enabled"] == True:
print " --------------------------------------- "
print pfunc.lineNum(), "STARTED dropdown true to false "
print " --------------------------------------- "
# udapte this button
print pfunc.lineNum(), pgui.bDropdown01opener["name"], "enabled was: ", pgui.bDropdown01opener["enabled"]
pgui.bDropdown01opener["enabled"] = False
pgui.bDropdown01opener["color"] = pgvar.UI_button_color
pgui.bDropdown01opener["label_txt"] = ">>"
print pfunc.lineNum(), pgui.bDropdown01opener["name"], "enabled:", pgui.bDropdown01opener["enabled"], "visible:", pgui.bDropdown01opener["visible"]
# update associated buttons
pgui.bDropdown01option01["visible"] = False
pgui.bDropdown01option02["visible"] = False
pgui.bDropdown01option03["visible"] = False
print pfunc.lineNum(), "buttons27,28,29 visible:", pgui.bDropdown01option01["visible"], pgui.bDropdown01option02["visible"], pgui.bDropdown01option03["visible"]
#screen.fill(pgvar.background_color)
pfunc.defineButtons()
pfunc.redrawEverything()
print pfunc.lineNum(), pgui.bDropdown01opener["name"], "enabled:", pgui.bDropdown01opener["enabled"], "visible:", pgui.bDropdown01opener["visible"]
print " --------------------------------------- "
print pfunc.lineNum(), "FINISHED dropdown true to false "
print " --------------------------------------- "
print type(pgui.bDropdown01option01["visible"])
if selected_button == "dropdown01option01":
if pgui.bDropdown01opener["enabled"] == True:
pgui.lDropdown01TEXT["label_txt"] = "Option 01"
pgui.bDropdown01option01["color"] = pgvar.UI_button_selected_color
pgui.bDropdown01option02["color"] = pgvar.UI_button_color
pgui.bDropdown01option03["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "dropdown01option02":
if pgui.bDropdown01opener["enabled"] == True:
pgui.lDropdown01TEXT["label_txt"] = "Option 02"
pgui.bDropdown01option01["color"] = pgvar.UI_button_color
pgui.bDropdown01option02["color"] = pgvar.UI_button_selected_color
pgui.bDropdown01option03["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "dropdown01option03":
if pgui.bDropdown01opener["enabled"] == True:
pgui.lDropdown01TEXT["label_txt"] = "Option 03"
pgui.bDropdown01option01["color"] = pgvar.UI_button_color
pgui.bDropdown01option02["color"] = pgvar.UI_button_color
pgui.bDropdown01option03["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
if selected_button == "dropdown01TEXT":
if pgui.lDropdown01TEXT["label_txt"] != "- select -":
if pgui.lDropdown01TEXT["enabled"] == False:
pgui.lDropdown01TEXT["enabled"] = True
pgui.lDropdown01TEXT["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
pfunc.redrawEverything()
elif pgui.lDropdown01TEXT["enabled"] == True:
pgui.lDropdown01TEXT["enabled"] = False
pgui.lDropdown01TEXT["color"] = pgvar.UI_button_color
pfunc.defineButtons()
pfunc.redrawEverything()
## ############################################################################################
## UPDATE TEXT ENTRY BUTTONS
## ############################################################################################
def updateTextEntry(selected_button):
if selected_button == "textField01":
if pgui.textField01["enabled"] == False:
pgui.textField01["enabled"] = True
pgui.textField01["color"] = pgvar.UI_text_entry_box_color_active
pfunc.defineButtons()
#enumerateButtons()
elif pgui.textField01["enabled"] == True:
pgui.textField01["enabled"] = False
pgui.textField01["color"] = pgvar.UI_text_entry_box_color
pfunc.defineButtons()
## ############################################################################################
## UPDATE MENU BUTTONS
## ############################################################################################
def updateMenuButtons(selected_button):
print pfunc.lineNum(), "running updateMenuButtons"
## START MENU 01 HANDLING
if selected_button == "menu01":
print pfunc.lineNum(), "menu01 was clicked on"
print pfunc.lineNum(), pgui.bMenu01["name"], "is ", pgui.bMenu01["enabled"]
if pgui.bMenu01["enabled"] == False:
print "was false, turning to true"
pgui.bMenu01["enabled"] = True
pgui.bMenu01["color"] = pgvar.UI_button_selected_color
pgui.bMenu01option01["visible"] = True
pgui.bMenu01option02["visible"] = True
pgui.bMenu01option03["visible"] = True
pgui.bMenu01option04["visible"] = True
pgui.bMenu01option05["visible"] = True
print pfunc.lineNum(), "~", pgui.bMenu01option01["name"], "Visible=", pgui.bMenu01option01["visible"]
print pfunc.lineNum(), "~", pgui.bMenu01option02["name"], "Visible=", pgui.bMenu01option02["visible"]
print pfunc.lineNum(), "~", pgui.bMenu01option03["name"], "Visible=", pgui.bMenu01option03["visible"]
print pfunc.lineNum(), "~", pgui.bMenu01option04["name"], "Visible=", pgui.bMenu01option04["visible"]
print pfunc.lineNum(), "~", pgui.bMenu01option05["name"], "Visible=", pgui.bMenu01option05["visible"]
pfunc.defineButtons()
elif pgui.bMenu01["enabled"] == True:
print pfunc.lineNum(), "was true, turning to false"
pgui.bMenu01["enabled"] = False
pgui.bMenu01["color"] = pgvar.UI_button_color
pgui.bMenu01option01["visible"] = False
pgui.bMenu01option02["visible"] = False
pgui.bMenu01option03["visible"] = False
pgui.bMenu01option04["visible"] = False
pgui.bMenu01option05["visible"] = False
print pfunc.lineNum(), "~", pgui.bMenu01option01["name"], "Visible=", pgui.bMenu01option01["visible"]
print pfunc.lineNum(), "~", pgui.bMenu01option02["name"], "Visible=", pgui.bMenu01option02["visible"]
print pfunc.lineNum(), "~", pgui.bMenu01option03["name"], "Visible=", pgui.bMenu01option03["visible"]
print pfunc.lineNum(), "~", pgui.bMenu01option04["name"], "Visible=", pgui.bMenu01option04["visible"]
print pfunc.lineNum(), "~", pgui.bMenu01option05["name"], "Visible=", pgui.bMenu01option05["visible"]
pfunc.defineButtons()
pfunc.redrawEverything()
if selected_button == "menu01option01":
if pgui.bMenu01["enabled"] == True:
print "~~ you clicked Monday ~~"
if pgui.bMenu01option01["enabled"] == False:
pgui.bMenu01option01["enabled"] = True
pgui.bMenu01option01["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.bMenu01option01["enabled"] == True:
pgui.bMenu01option01["enabled"] = False
pgui.bMenu01option01["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "menu01option02":
if pgui.bMenu01["enabled"] == True:
print "~~ you clicked Tuesday ~~"
if pgui.bMenu01option02["enabled"] == False:
pgui.bMenu01option02["enabled"] = True
pgui.bMenu01option02["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.bMenu01option02["enabled"] == True:
pgui.bMenu01option02["enabled"] = False
pgui.bMenu01option02["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "menu01option03":
if pgui.bMenu01["enabled"] == True:
print "~~ you clicked Wednesday ~~"
if pgui.bMenu01option03["enabled"] == False:
pgui.bMenu01option03["enabled"] = True
pgui.bMenu01option03["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.bMenu01option03["enabled"] == True:
pgui.bMenu01option03["enabled"] = False
pgui.bMenu01option03["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "menu01option04":
if pgui.bMenu01["enabled"] == True:
print "~~ you clicked Thursday ~~"
if pgui.bMenu01option04["enabled"] == False:
pgui.bMenu01option04["enabled"] = True
pgui.bMenu01option04["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.bMenu01option04["enabled"] == True:
pgui.bMenu01option04["enabled"] = False
pgui.bMenu01option04["color"] = pgvar.UI_button_color
pfunc.defineButtons()
if selected_button == "menu01option05":
if pgui.bMenu01["enabled"] == True:
print "~~ you clicked Friday ~~"
if pgui.bMenu01option05["enabled"] == False:
pgui.bMenu01option05["enabled"] = True
pgui.bMenu01option05["color"] = pgvar.UI_button_selected_color
pfunc.defineButtons()
elif pgui.bMenu01option05["enabled"] == True:
pgui.bMenu01option05["enabled"] = False
pgui.bMenu01option05["color"] = pgvar.UI_button_color
pfunc.defineButtons()
## END MENU 01 HANDLING
## START MENU 02 HANDLING
if selected_button == "menu02":
if pgui.bMenu02["enabled"] == False:
# flip this menu button
pgui.bMenu02["enabled"] = True
pgui.bMenu02["color"] = pgvar.UI_button_selected_color
# flip related buttons in the group
pgui.bMenu02popup01["visible"] = True
pgui.bMenu02popup02["visible"] = True
pgui.bMenu02popup03["visible"] = True
pfunc.defineButtons()
elif pgui.bMenu02["enabled"] == True:
# flip this menu button
pgui.bMenu02["enabled"] = False
pgui.bMenu02["color"] = pgvar.UI_button_color
# flip related buttons in the group
pgui.bMenu02popup01["visible"] = False
pgui.bMenu02popup02["visible"] = False
pgui.bMenu02popup03["visible"] = False
pfunc.defineButtons()
pfunc.redrawEverything()
if selected_button == "menu02popup01":
if pgui.bMenu02["enabled"] == True:
if pgui.bMenu02popup01["enabled"] == False:
#flip this menu buttone
pgui.bMenu02popup01["enabled"] = True
pgui.bMenu02popup01["color"] = pgvar.UI_button_selected_color
#flip related buttons
pgui.menu02popup01element01["visible"] = True
pgui.menu02popup01element02["visible"] = True
pgui.menu02popup01element03["visible"] = True
pgui.menu02popup01element04["visible"] = True
pgui.menu02popup01element05["visible"] = True
pgui.menu02popup01element06["visible"] = True
pgui.menu02popup01element07["visible"] = True
pgui.menu02popup01element08["visible"] = True
pfunc.defineButtons()
#pfunc.redrawEverything()
elif pgui.bMenu02popup01["enabled"] == True:
#flop this menu buttone
pgui.bMenu02popup01["enabled"] = False
pgui.bMenu02popup01["color"] = pgvar.UI_button_color
pgui.menu02popup01element01["visible"] = False
pgui.menu02popup01element02["visible"] = False
pgui.menu02popup01element03["visible"] = False
pgui.menu02popup01element04["visible"] = False
pgui.menu02popup01element05["visible"] = False
pgui.menu02popup01element06["visible"] = False
pgui.menu02popup01element07["visible"] = False
pgui.menu02popup01element08["visible"] = False
pfunc.defineButtons()
pfunc.redrawEverything()
## END START MENU 02 HANDLING