-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI.py
613 lines (607 loc) · 41.6 KB
/
GUI.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
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
from json import JSONDecoder
import json
import webbrowser
import time
import PySimpleGUI as sg
import os
from PIL import Image
PREP1 = open("./Library.json", "w")
PREP1.close()
PREP2 = open("./dir_name.txt", "w")
PREP2.close()
PREP3 = open("./Seed.txt", "w")
PREP3.close()
PREP4 = open("./FL.txt", "w")
PREP4.close()
PREP5 = open("./STIC.txt","w")
PREP5.close()
PREP6 = open("./JPE.txt", "w")
PREP6.close()
PREP7 = open("./PPE.txt","w")
PREP7.close()
PREP8 = open("./SPE.txt", "w")
PREP8.close()
PREP9 = open("./PLE.txt", "w")
PREP9.close()
try:
os.mkdir("./Replacement Images")
os.mkdir("./Replacement Images Backup")
os.mkdir("./Images to put in STIPphoto")
os.mkdir("./Images to put in STIPphoto/Thumbnails")
os.mkdir("./Replacement ImagesP")
os.mkdir("./Original ImagesP")
os.mkdir("./STIContent to put in content")
except FileExistsError:
print("skipping making folders.")
import Replacer
import winreg
import vdf
import PromptParser
S = 0
x = 0
y = 0
x2 = 6.5
winreg.HKEY_LOCAL_MACHINE
gif103 = sg.DEFAULT_BASE64_LOADING_GIF
arrow = sg.SYMBOL_RIGHT_ARROWHEAD
SteamReg = ""
SteamINSD = ""
SteamST = ""
SteamINS = ""
Library = ""
z = 0
global layout
global ISDIR
global x3
global Linux
global ToolFR
global ToolSR
global SelectedToolBU
global imagefile
global PETL1V
global PETL2V
global PETL3V
global PETL4V
global selected_index
global SPN
global T
RRIcon = "iVBORw0KGgoAAAANSUhEUgAAALMAAAAeCAMAAABQSN/xAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAQVQTFRFAAAAIdF8IdF8IdF8IdF8IdF8IdF8IdF8IdF8IdF8IdF8IdF8IdF8IdF8IdF8IdF8////////////////////////////////////////////////////////////////////IdF8IdF8////////////////////////////////GZ5dHrhtHrluHrdt////////////////////AAAAC0InF41TC0EmHrdtIdF8E3pIE3tJFHtIHKplFHpIHrhu////IdF8F5RXF5NXAAAAC0MnF41TC0InFolRGZtcHrluGZhaGZhaEF84AAAAHK5nFYNNE3FDHK9oHK5nGqJg////////vsxuNwAAAFd0Uk5TAClmzHoUXP+PUuDCcNaZoxA/DkAwIJC/r/83/sCAoLDvH+twX39QT2/wYN+rqqvQ3+DPnwFLqUysRxkZlv+Wq489vL0CJVUlLe7/7fN9C7WphLP++gEEFMFrdwAAAwlJREFUeJztlWlb00AQx1cQKyB1a7JpV7ObSJrCBmoO8BbFW+tt0e//UZzZpJA2WRoPHnh8+n/Rbmf2+M3s7JSQhRb6r3VpaRl1eeW8QRrpSusqWV1rFVo/b5xGugagrRNtnDdPE7UntGtLq2T1eut319POHx17w6rabNZw8UaBvGyc4XS73V7NEbksftruxrU3b1Vtrjhtq5LmF7IrLcvzTTk4nVmv5XbVUcfcNM+3C+ZNc8fQ4fOAENYPQ9yWMZYPyCDsa2baD7fwq0O3Q4tMvJO1Cj/s3GgzK+zTnJluhWF+B+DcypktEoV9NLHtkBmCOC7nJbKzO9S6s1PHDB+eFJLDIaIXC8+Hg6USMgZmlrgizTDnriN5VHinmIUSjorAkLkiznJm4QmROgT3cUScT+Z7UuB825ciTuqLpWBut1fI7j4a7t67/2CGea/T6aki5MDF84EoDYiNly6BWYKRApGFEUmcmkbTaxnHHCowpDAVvJPaQEek6HGAmJvIx/ygr54Z+9xm+yEOh4Q8ekyeHDx9NsOcuooPYEC3D7uZj/nJDxCAqutZEzpeXtvaOnlOk7Ui64AgRu2ADTTzIOx1IUwpTy4F04DbYPSmR7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JGwrXxcqvodyGOZI5SFvafvEcyzqMCo4dJSegXo66ItV/hbr47yDUC5bYWXvBdXTtv5z7fLw+5vXzQWAp8LfA88bu0v7sxhXXgG8ZTSt9xp7SWz+xoD5jYIqng4YCjobix41WX52rvepnIOZfgFCtsbN2k/nWT7dD3czfbJwDbgO6gfkg4N2zfvPjc5nPLI5mvbDkWcfLRfcajSumj3es/6/QYrYIEPNUEPNkV6RqCoh5CgjVEt2ngjc6W8vngHirMRvfx3/p4+WEfctD99yy7O7A9EV3VE+//86v3lL27WmZzz06op+2NeJI56NfIwlAuDashx8B5uC1iTNWL7RNu2euZ/Icuyfjy/apU7/p0ULW+HQDM/HN/Kdq/o9FUvNEpIaGhoaGhoaGhoaGhoaGhoZ1/A+xObjHzZ2ipAAAAABJRU5ErkJggg=="
SIcon = "iVBORw0KGgoAAAANSUhEUgAAALMAAAAeCAMAAABQSN/xAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAIdQTFRFAAAAHbVsHbVsHbVsHbVsHbVsHbVsHbVsHbVsHbVs////////////HbVs////////////////////////////////HbVs////////HbVs////////HbVs////////////////////////HbVsHbVs////////////////////////HbVs////XmilpwAAAC10Uk5TAGb/zDNcKdbrRxA/IHpgr7+PT0D/gB/A8MJwoJmwXzDPf2+the9Q0N/gkAqfi0rfYgAAAm1JREFUeJztl317siAUxpmr2dC5lGO4zKlrSvrs+3++5wBOa9nCrHV1Xd1/8CYHf+INKCF3XUcPltLDtTmG6BaZHzXz47U5zDSZPhHyZGtmW5ank2szHZNtzZ6fZ1YjVbbPODx13DOOpvVi9ejFLNZ7nc/nfvBrHwbhGSh3tJj1Mc8WJrEcIs45wI9m4M1VlV2A+a0P2bLeDEKXEMuMLn+07zJfQB2mvVrZXc0gNIEdp7L3ICXSv5A5jkPTDDBztZ9lkuZB098N8pS4DlW9P9pmY7WYa7TD4rN9AINQDmlXQUSUL72gxLjKQu0NTGKsFaXsWhZYfA2BYVSheg1k/oa2tYNX5sjojSygTdktBCM0VN7t8TODgqekjDayK2BXVxSSuarwsV1vKHOD2WzJE1VZmUUmOEWZz2Qx1nPOi0PMlXy6WnLGMiE0ktmp6/N0ZsJqoQ1BIs25lOi9zGq5loDmEFVzGZmj4p32jHtJZhT1IsB3C99iB5jDttxcVnPOInxT+VDsxY6f/6133G2kEhIEEUyLHmVuXom2CCnrCoqBG8eIfaMRk4zVpmtomJMDzBzUvArNTKShBrp6xP7Mtm5ZQ9m2i0xlod6+95g9VS6hZU6HMq/7z8G1QSjf+IETfEEkD40KcjxCfDndMfh57iLVPM/ZPjPO8Ffug9zdWfbhOEHW0htqxPeGJ9SqS9QuR2tZjuT2QONITWIots+UjpmihQWL0TqpGqEqf7tLn6Z9zFPDYMa2j8LtylGJSKaUsVM+VS/8/bwvtQRLqEcM8ef/KTzL80wfjOP0h/+DXsIFX45Hvsn/7ltkvusurf+e+jX6cSOldAAAAABJRU5ErkJggg=="
IIcon = "iVBORw0KGgoAAAANSUhEUgAAALMAAAAeCAMAAABQSN/xAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAF1QTFRFAAAAHbVs////////////////////////////////////////////////////////////////////////////////////////////////////////////////////hSVPTwAAAB90Uk5TAP8IHw8Qb5+/MEP/gdDwwEBg34/P74BQsKCQIHDgT4SOFKUAAAE4SURBVHic7djRboMgFAZg2MZqewaoVVrbru//mEMsisqFgUM6Ev8LPdHkz1djFEvInj1bQ8e8W7I1dJZ3azbFhWaCfjHnu/8da6TOENP38fm1OMK+D8UxpnKZUUjdKaLwBD+LI1xImZm5hCqizhOvLwrtMZfhbb6MOjp/eoQ3DmZZVTXAmempgaYo9F19rqE9sDjuXIdshkaoyxUUIaqDTuk9h9vlBjUC2tHhmuGut7Il9t5Q8NDbR/8rYpPMfO1nBcyapTBnf5vwZo8O12yup+q5g1lIc1ZCeLNHl9YMGZplbc5yHt7s0aU1m1HPXXjzpKPrEeGdsjIz0T7LZytwHtArKca7e2Umdw4AHGXd4S7rXnOq1SgrMS5ynwk6raCRqtNloFpzFmv+LL+tsvyGJTn+V7Bnj80fh9sM1IL1VnMAAAAASUVORK5CYII="
GITI = "iVBORw0KGgoAAAANSUhEUgAAAFUAAAAOCAMAAABpYqBcAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAFRQTFRFAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////MF88lgAAABx0Uk5TADB/r7+fX4D/ED/AQJDwsGDQz+9wIOCgUN9Pj9+dIu8AAAFZSURBVHictZNtd8IgDIVDpyNZSS1SWur+//9cQkGpunnOdna/iNfch5dEAADTvR2O77KwCEAfsoDewp0c3js/y2JvLQ8nSdqa/jPV4Zg/xzatVHpBpXujle+bU0tY1AuVEc+Ss30hyuYBw1gr+ymgkwBiJ1+RD4hH3YarY1tqPWuwFOdlR/URJoylMpwiEXsDZp6EgROYQUB2cJCGEQwmvX7XdTuq1+h5R9U6z3V/ORhla5IqXJQhVUoGXuWnvOg97qhcYA1V/aU8l52zfRCdsdzXoYnyKgBJ8XztRkO1z6lcqZudnOoZlQO9oo6PL6B2zJbq+gJ5nlguQn69ENBnoRq8tNQku5t56xZJMDZUWFYj7KTdShBXbW6Q/gUNk04D+rRRgYc8WYUKC+I8bZMlVbfJgmuS9awe8aQNXDYjK7rvR5rc4+omY/ILWDCV8KTol8KHP/h/UL8AVUkSWCGq9Z8AAAAASUVORK5CYII="
PEIcon = "iVBORw0KGgoAAAANSUhEUgAAALMAAAAeCAYAAABnli/DAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACHRJREFUeJztnHlMFFccxxetVURZYM85tmCtidVYQWu1p7RVtKUIIoiyAisgULQtTT0a0+qqtZZaENAqVJG1igfetiZN+oer9ohpWqxVYzQBeiXGHmzUyqFm+3vre+1jmB1mlWUWM9/kZZk3v/m937z57G9+82aDRtNzCqI3QmeN62/+ePaHzCdz/uL2zLvN78u/zWzOOGsqTdX2YEyqVPmkoJBJ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fct/JSn7NKhQQsXg7qis4e0o4NkWy6r2qj/HD5OeYmqw/oZ2EMmOysXh6EmThevSSBLLzWoD4OJQY7ZC5q5RYfrsfJYRZVTfIsCJBb65Iq4LMe1H39tQZuLufB2jI0PAg6AKg/4EM/bupNJWXdKZKtlSYu199dIunjAdom5lKax1sDyQ7UIaG+vl7aG1Qgqzj9sybjZbtFIz1vhIuZZy99XYecNKvnKY1lqTUcbtzL+nemhyHu4P177ycBBCfgIx8Ff36LeLNSaymB19Rq1Llq4IGJ8fEQG18zVyZfgS2B+kWTp7MVFn3cLU5FyBb/wnZeQ30cRoVZFWBLFNJyoPm8pknoXz4Jfy15/OZzXMO83vzLrGOLBc86G02FidPNKxK1GtUkFUFuvo9FDEaQL4F8N5AQKMMjUoO3aK48YZl8Wh9uY/SMapSJUtsdcbP/IECNzT0+4qTg6fHjNGvSED/C06FWFXvElOd0YqA7hcZEY1KDo1aTqgKYP0L0nHdGi14/tUAAAAASUVORK5CYII="
ISDIR = False
GUID = True
SteamLibrary = []
sg.theme_input_background_color("#1e1e1e")
sg.theme_input_text_color("white")
sg.theme_background_color("#121212")
sg.theme_element_text_color("white")
sg.theme_button_color(("#000000","#BB86FC"))
sg.theme_element_background_color("#121212")
sg.theme_text_element_background_color("#121212")
dir = "./Replacement Images"
T = [None] * 200
print(T)
ImgR = next(os.walk(dir))[2]
imgC = len(ImgR)
ImgFR = sorted( filter( lambda x: os.path.isfile(os.path.join(dir, x)),
os.listdir(dir) ) )
ToolRR = [ [sg.Text('Number of images to insert:' + str(imgC),key='_y_',auto_size_text=True,pad=((0,293),(0,0)))],
[sg.Text('Seed for randomness:',key='_Seed_'), sg.InputText(key='_h_',size=(38,1)), sg.Button('Default', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_D_')], #move seed settings to settings tab and auto-set seed to default.
[sg.Button('Run!', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_R_'), sg.Button('Quit', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_Q1_')] ]
layoutLOAD = [ [sg.Text('Please wait attempting to get STI directory.')],
[sg.Image(data=gif103, key='_IMAGE_', pad=(100,0))], #move seed settings to settings tab and auto-set seed to default.
[sg.Button('Quit',key='_Q_', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold'), sg.ProgressBar(10,'horizontal',s=(10,10),bar_color=("blue","white"),expand_x=True,key='_progressbar_')] ]
ToolRRLinux = [ [sg.Text('Nb of img to insert:' + str(imgC),key='_yL_',auto_size_text=True,pad=((0,329),(0,0)))],
[sg.Text("STIPhoto dir:"), sg.InputText(key='_LD_',pad=((0,88),(0,0)),size=(40,1))],
[sg.Text('Seed:',key='_SeedLinux_'), sg.InputText(key='_hL_',size=(38,1)), sg.Button('Default', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_D1_')], #move seed settings to settings tab and auto-set seed to default.
[sg.Button('Run!', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_R1_'), sg.Button('Quit', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_Q2_'), sg.Button('GUILibSettings',visible=True,disabled=False, mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold')] ]
ToolO = [ [sg.Checkbox("Force load Linux/MacOSX mode",key="_FLL_",enable_events=True)] ]
ToolI = [ [sg.Text("Made by Weegeeday")],[sg.Text("Libraries used: PySimpleGUI, vdf, json, webbrowser and Pillow")],[sg.Text("horse")],[sg.Text("hi yahiamice")],[sg.Button(key="_GitH_",enable_events=True,mouseover_colors=("#323232","#505050"),button_color="#121212",border_width=2,image_data=GITI)] ]
with open("./PLE.txt", "r") as f:
PETL1V = [line.strip() for line in f.readlines()]
with open("./JPE.txt", "r") as f:
PETL2V = [line.strip() for line in f.readlines()]
with open("./PPE.txt", "r") as f:
PETL3V = [line.strip() for line in f.readlines()]
with open("./SPE.txt", "r") as f:
PETL4V = [line.strip() for line in f.readlines()]
ToolPETL1 = [[sg.Listbox(PETL1V,key="_PETL1K_",select_mode="LISTBOX_SELECT_MODE_SINGLE",background_color="#121212",sbar_background_color="#505050",sbar_trough_color="#636363",sbar_arrow_color="white",sbar_frame_color="#505050",expand_y=True,expand_x=True,enable_events=True)]]
ToolPETL2 = [[sg.Listbox(PETL2V,key="_PETL2K_",select_mode="LISTBOX_SELECT_MODE_SINGLE",background_color="#121212",sbar_background_color="#505050",sbar_trough_color="#636363",sbar_arrow_color="white",sbar_frame_color="#505050",expand_y=True,expand_x=True,enable_events=True)]]
ToolPETL3 = [[sg.Listbox(PETL3V,key="_PETL3K_",select_mode="LISTBOX_SELECT_MODE_SINGLE",background_color="#121212",sbar_background_color="#505050",sbar_trough_color="#636363",sbar_arrow_color="white",sbar_frame_color="#505050",expand_y=True,expand_x=True,enable_events=True)]]
ToolPETL4 = [[sg.Listbox(PETL4V,key="_PETL4K_",select_mode="LISTBOX_SELECT_MODE_SINGLE",background_color="#121212",sbar_background_color="#505050",sbar_trough_color="#636363",sbar_arrow_color="white",sbar_frame_color="#505050",expand_y=True,expand_x=True,enable_events=True)]]
ToolPET = [[sg.Tab("Prompt",layout=ToolPETL1,background_color="#121212",key='_PETL1T_'),sg.Tab("Job",layout=ToolPETL2,background_color="#121212",key='_PETL2T_'),sg.Tab("Photo",layout=ToolPETL3,background_color="#121212",key='_PETL3T_'),sg.Tab("Store",layout=ToolPETL4,background_color="#121212",key='_PETL4T_')]]
ToolPE = [[sg.TabGroup(ToolPET,selected_background_color="#323232",expand_x=True,expand_y=True,key='_PETABG_',enable_events=True)],
[sg.InputText(key="_PEIT_",expand_x=True,default_text="Text")],
[sg.Button('Read',key='_PER_', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold'),sg.Button('Write',key='_PEW_', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold'), sg.Button('Save',key='_PETLS_',mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold')],
[sg.Text("Changing tabs will reset progress.")]]
ToolSelect = [ [sg.Canvas(background_color="#121212",size=(10,10),key='_c1_')],
[sg.Button(key='_RR_',mouseover_colors=("#323232","#505050"),button_color="#121212",border_width=0,expand_y=True,s=(10,1),image_data=RRIcon)],
[sg.Canvas(background_color="#121212",size=(10,10),key='_c2_')],
[sg.Button(key='_SR_',mouseover_colors=("#323232","#505050"),button_color="#121212",border_width=0,expand_y=True,s=(10,1),image_data=SRIcon)],
[sg.Canvas(background_color="#121212",size=(10,10),key='_c3_')],
[sg.Button(key='_S_',mouseover_colors=("#323232","#505050"),button_color="#121212",border_width=0,expand_y=True,s=(10,1),image_data=SIcon)],
[sg.Canvas(background_color="#121212",size=(10,10),key='_c4_')],
[sg.Button(key='_I_',mouseover_colors=("#323232","#505050"),button_color="#121212",border_width=0,expand_y=True,s=(10,1),image_data=IIcon)],
[sg.Canvas(background_color="#121212",size=(10,10),key='_c5_')],
[sg.Button(key='_PE_',mouseover_colors=("#323232","#505050"),button_color="#121212",border_width=0,expand_y=True,s=(10,1),image_data=PEIcon,disabled=False,disabled_button_color="#505050")],
]
window2 = sg.Window('STI Image Script', layoutLOAD)
progress_bar = window2['_progressbar_']
event, values = window2.read(timeout=50)
try:
SteamReg = winreg.OpenKey(key=winreg.HKEY_LOCAL_MACHINE,sub_key="SOFTWARE\Valve\Steam",reserved=0,access=winreg.KEY_READ)
Linux = False
progress_bar.Update(x+0.5) #0.5
SteamINSD = winreg.QueryValueEx(SteamReg, "InstallPath")
progress_bar.Update(x+1) #1
SteamST = str(SteamINSD)
SteamST = SteamST.removeprefix("('")
SteamST = SteamST.removesuffix("', 1)")
progress_bar.Update(x+2) #2
SteamINS = SteamST
#install directory gotten, just need to go into the steamapps folder and get libraryfolders.??? and parse it as json, get the id and in what path it is, then path trought
#those files for the image folder.
Library = SteamST + "\\steamapps\\libraryfolders.vdf"
progress_bar.Update(x+2.5) #2.5
LibraryP = vdf.parse(open(Library))
progress_bar.Update(x+3) #3
fO = open("./Library.json", "w")
fO.write(str(LibraryP))
fO.close()
progress_bar.Update(x+3.5)#3.5
fO2 = open("./Library.json", "r")
filedata = fO2.read()
fO2.close()
filedata = filedata.replace('\'', '\"')
progress_bar.Update(x+4)#4
fO3 = open("./Library.json", "w")
fO3.write(filedata)
fO3.close()
progress_bar.Update(x+5)
FO = open("./Library.json", "r")
LibraryJ1 = json.loads(FO.read())
FO.close()
progress_bar.Update(x+6.5)
while True:
event, values = window2.read(timeout=50)
try:
SteamLibrary.append(LibraryJ1['libraryfolders'][str(y)]['path'])
y = int(y) + 1
print("z" + str(z))
print("y" + str(y))
progress_bar.Update(x2)
x2 = x2 + 0.25
except KeyError:
print("keyerror")
if ISDIR == True:
x3 = 10 - x2
x4 = x2 + x3/2
x5 = x4 + x3/2
break
while ISDIR == False:
print("testing dir")
try:
print(z)
ISDIR = os.path.isdir(str(SteamLibrary[z]) + "\\steamapps\\common\\The Jackbox Party Pack 4\\games\\SurviveTheInternet\\content\\STIPhoto")
z = z + 1
print(z)
print(ISDIR)
except IndexError:
print("indexerror")
z = z - 1
dir_name = str(SteamLibrary[z]) + "\\steamapps\\common\\The Jackbox Party Pack 4\\games\\SurviveTheInternet\\content\\STIPhoto"
print("break")
raise
except FileNotFoundError:
try:
SteamReg = winreg.OpenKey(key=winreg.HKEY_LOCAL_MACHINE,sub_key="SOFTWARE\Wow6432Node\Valve\Steam",reserved=0,access=winreg.KEY_READ)
Linux = False
progress_bar.Update(x+0.5) #0.5
SteamINSD = winreg.QueryValueEx(SteamReg, "InstallPath")
progress_bar.Update(x+1) #1
SteamST = str(SteamINSD)
SteamST = SteamST.removeprefix("('")
SteamST = SteamST.removesuffix("', 1)")
progress_bar.Update(x+2) #2
SteamINS = SteamST
#install directory gotten, just need to go into the steamapps folder and get libraryfolders.??? and parse it as json, get the id and in what path it is, then path trought
#those files for the image folder.
Library = SteamST + "\\steamapps\\libraryfolders.vdf"
progress_bar.Update(x+2.5) #2.5
LibraryP = vdf.parse(open(Library))
progress_bar.Update(x+3) #3
fO = open("./Library.json", "w")
fO.write(str(LibraryP))
fO.close()
progress_bar.Update(x+3.5)#3.5
fO2 = open("./Library.json", "r")
filedata = fO2.read()
fO2.close()
filedata = filedata.replace('\'', '\"')
progress_bar.Update(x+4)#4
fO3 = open("./Library.json", "w")
fO3.write(filedata)
fO3.close()
progress_bar.Update(x+5)
FO = open("./Library.json", "r")
LibraryJ1 = json.loads(FO.read())
FO.close()
progress_bar.Update(x+6.5)
while True:
event, values = window2.read(timeout=50)
try:
SteamLibrary.append(LibraryJ1['libraryfolders'][str(y)]['path'])
y = int(y) + 1
print("z" + str(z))
print("y" + str(y))
progress_bar.Update(x2)
x2 = x2 + 0.25
except KeyError:
print("keyerror")
if ISDIR == True:
x3 = 10 - x2
x4 = x2 + x3/2
x5 = x4 + x3/2
z = z - 1
dir_name = str(SteamLibrary[z]) + "\\steamapps\\common\\The Jackbox Party Pack 4\\games\\SurviveTheInternet\\content\\STIPhoto"
break
while ISDIR == False:
print("testing dir")
try:
print(z)
ISDIR = os.path.isdir(str(SteamLibrary[z]) + "\\steamapps\\common\\The Jackbox Party Pack 4\\games\\SurviveTheInternet\\content\\STIPhoto")
z = z + 1
print(z)
print(ISDIR)
except IndexError:
print("indexerror")
z = z - 1
dir_name = str(SteamLibrary[z]) + "\\steamapps\\common\\The Jackbox Party Pack 4\\games\\SurviveTheInternet\\content\\STIPhoto"
print(dir_name)
print("break")
raise
except FileNotFoundError:
print("On linux. Tried to use GUI.")
Linux = True
sg.popup_error_with_traceback("STI Linux GUI Error","Hi! It seems as you are running the GUI script on Linux/MacOSX.","You will need to manually set STIPhoto directory.","ex: \\steamapps\\common\\The Jackbox Party Pack 4\\games\\SurviveTheInternet\\content\\STIPhoto","PySimpleGUI settings checkbox (click on dev box!) has been enabled.")
x2 = x2 + 0.25
x3 = 10 - x2
x4 = x2 + x3/2
x5 = x4 + x3/2
z = z - 1
time.sleep(0.5)
progress_bar.Update(x4)
time.sleep(0.5)
progress_bar.Update(x5)
time.sleep(0.5)
window2.close()
print("window2 close")
STICWR = open("./STIC.txt","w")
STICWR.write(str(str(SteamLibrary[z]) + "\\steamapps\\common\\The Jackbox Party Pack 4\\games\\SurviveTheInternet\\content"))
STICWR.close()
FLC = open("./FL.txt","r")
FLC = FLC.readline(1)
if FLC == "True":
Linux = True
elif FLC == "False":
Linux = False
if Linux == True:
ToolFR = ToolRRLinux
dir_nameL = "./"
ImgFO = sorted( filter( lambda x: os.path.isfile(os.path.join(dir_nameL, x)),
os.listdir(dir_nameL) ))
ToolSR = [ [sg.Text("STIPhoto dir:"), sg.InputText(key='_STIPSRDIR_'),sg.Button("Set dir!",key="_SRSD_")],
[sg.Listbox(ImgFR,select_mode="LISTBOX_SELECT_MODE_SINGLE",key='_LIST1L_',background_color="#121212",sbar_background_color="#505050",sbar_trough_color="#636363",sbar_arrow_color="white",sbar_frame_color="#505050",expand_y=True,expand_x=True,enable_events=True),sg.VSeparator(),sg.Listbox(ImgFO,select_mode="LISTBOX_SELECT_MODE_SINGLE",key='_LIST2L_',background_color="#121212",sbar_background_color="#505050",sbar_trough_color="#636363",sbar_arrow_color="white",sbar_frame_color="#505050",expand_y=True,expand_x=True,enable_events=True)], #move seed settings to settings tab and auto-set seed to default.
[sg.Image(key="_SRRILIPL_"),sg.Text(arrow,auto_size_text=True),sg.Image(key="_SROILIPL_")],
[sg.Button("Replace!",mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_SRRBL_')],
[sg.Button("Reload files!",key="_SRRFL_",mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold')],
[sg.Button('Quit', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_Q3_')] ]
ToolWindow = [[sg.Frame('',ToolFR,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_FRF_",element_justification="c",vertical_alignment="c",visible=True),
sg.Frame('',ToolSR,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_SRF_",element_justification="c",vertical_alignment="c",visible=False, size=(500,200)),
sg.Frame('',ToolO,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_OF_",element_justification="c",vertical_alignment="c",visible=False, size=(500,200)),
sg.Frame('',ToolI,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_IF_",element_justification="c",vertical_alignment="c",visible=False, size=(500,200)),
sg.Frame('',ToolPE,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_PEF_",element_justification="c",vertical_alignment="c",visible=False, size=(500,200))]]
layout = [[sg.Column(ToolSelect, element_justification='c'), sg.VSeperator(),sg.Column(ToolWindow, element_justification='c',key='_ToolVC_')]]
window = sg.Window('STI Image Script Linux/MacOSX', layout,size=(725,230))
window.refresh()
elif Linux == False:
ToolFR = ToolRR
ImgFO = sorted( filter( lambda x: os.path.isfile(os.path.join(dir_name, x)),
os.listdir(dir_name) ) )
ToolSR = [ [sg.Listbox(ImgFR,select_mode="LISTBOX_SELECT_MODE_SINGLE",key='_LIST1_',background_color="#121212",sbar_background_color="#505050",sbar_trough_color="#636363",sbar_arrow_color="white",sbar_frame_color="#505050",expand_y=True,expand_x=True,enable_events=True),sg.VSeparator(),sg.Listbox(ImgFO,select_mode="LISTBOX_SELECT_MODE_SINGLE",key='_LIST2_',background_color="#121212",sbar_background_color="#505050",sbar_trough_color="#636363",sbar_arrow_color="white",sbar_frame_color="#505050",expand_y=True,expand_x=True,enable_events=True)], #move seed settings to settings tab and auto-set seed to default.
[sg.Image(key="_SRRILIP_"),sg.Text(arrow,auto_size_text=True),sg.Image(key="_SROILIP_")],
[sg.Button("Replace!",mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_SRRB_'),sg.Button("Reload files!",key="_SRRF_",mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold'),sg.Button('Quit', mouseover_colors=("#c394fc","#BB86FC"),font='_ 9 bold',key='_Q3_')] ]
ToolWindow = [[sg.Frame('',ToolFR,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_FRF_",element_justification="c",vertical_alignment="c",visible=True),
sg.Frame('',ToolSR,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_SRF_",element_justification="c",vertical_alignment="c",visible=False, size=(500,200)),
sg.Frame('',ToolO,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_OF_",element_justification="c",vertical_alignment="c",visible=False, size=(500,200)),
sg.Frame('',ToolI,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_IF_",element_justification="c",vertical_alignment="c",visible=False, size=(500,200)),
sg.Frame('',ToolPE,background_color="#121212",relief=sg.RELIEF_FLAT,expand_x=True,expand_y=True,grab=False,border_width=0,key="_PEF_",element_justification="c",vertical_alignment="c",visible=False, size=(500,200))]]
layout = [[sg.Column(ToolSelect, element_justification='c'), sg.VSeperator(),sg.Column(ToolWindow, element_justification='c',key='_ToolVC_')]]
window = sg.Window('STI Image Script Windows', layout,size=(725,280))
window.refresh()
while True:
event, values = window.read(timeout=50)
ImgR = next(os.walk(dir))[2]
imgC = len(ImgR)
if Linux == True:
window['_yL_'].update('Nb of img to insert:' + str(imgC))
window.refresh()
elif Linux == False:
window['_y_'].update('Number of images to insert:' + str(imgC))
window.refresh()
if event == sg.WIN_CLOSED or event == '_Q_' or event == '_Q1_' or event == '_Q2_' or event == '_Q3_' : # if user closes window or clicks cancel
break
if event == '_R_' or event == '_R1_' and values['_h_'] > str(0) and values['_h_'] != str(0):
print("helo")
if Linux == True:
if values['_LD_'] != "":
fO4 = open("./Seed.txt", "w")
fO4.write(str(values['_hL_']))
fO4.close()
fO5 = open("./dir_name.txt", "w")
fO5.write(str(values['_LD_']))
fO5.close()
fO6 = open("./dir_name.txt", "r")
filedata2 = fO6.read()
fO6.close()
time.sleep(0.5)
print(filedata2)
fO7 = open("./dir_name.txt", "w")
fO7.write(filedata2)
fO7.close()
Replacer.Replacer.reset()
ImgR = next(os.walk(dir))[2]
imgC = len(ImgR)
window['_y2_'].update('Number of images to insert:' + str(imgC))
time.sleep(0.5)
sg.popup("Done!")
elif values['_LD_'] == "":
sg.popup("STIPhoto directory cannot be empty!")
elif Linux == False:
fO4 = open("./Seed.txt", "w")
fO4.write(str(values['_h_']))
fO4.close()
fO5 = open("./dir_name.txt", "w")
fO5.write(str(dir_name))
fO5.close()
fO6 = open("./dir_name.txt", "r")
filedata2 = fO6.read()
fO6.close()
time.sleep(0.5)
print(filedata2)
fO7 = open("./dir_name.txt", "w")
fO7.write(filedata2)
fO7.close()
Replacer.Replacer.reset()
time.sleep(0.5)
sg.popup("Done!")
elif event == '_R_' or event == '_R1_':
sg.popup('Seed cannot be 0 or empty!')
if event == '_D_' or event == '_D1_':
Replacer.SeeD = 34587345
values[0] = str(34587345)
print(values[0])
window['_h_'].update(values[0])
if event == 'GUILibSettings':
sg.main_global_pysimplegui_settings()
if event == '_RR_':
print("selected tool FR")
window['_RR_'].update(button_color="#323232")
window['_SR_'].update(button_color="#121212")
window['_S_'].update(button_color="#121212")
window['_I_'].update(button_color="#121212")
window['_PE_'].update(button_color="#121212")
window['_IF_'].update(visible=False)
window['_OF_'].update(visible=False)
window['_FRF_'].update(visible=True)
window['_SRF_'].update(visible=False)
window['_PEF_'].update(visible=False)
if event == '_SR_':
print("selected tool SR")
window['_SR_'].update(button_color="#323232")
window['_RR_'].update(button_color="#121212")
window['_S_'].update(button_color="#121212")
window['_I_'].update(button_color="#121212")
window['_PE_'].update(button_color="#121212")
window['_IF_'].update(visible=False)
window['_OF_'].update(visible=False)
window['_FRF_'].update(visible=False)
window['_SRF_'].update(visible=True)
window['_PEF_'].update(visible=False)
if event == '_S_':
print("selected tool O")
window['_S_'].update(button_color="#323232")
window['_SR_'].update(button_color="#121212")
window['_RR_'].update(button_color="#121212")
window['_I_'].update(button_color="#121212")
window['_PE_'].update(button_color="#121212")
window['_IF_'].update(visible=False)
window['_OF_'].update(visible=True)
window['_FRF_'].update(visible=False)
window['_SRF_'].update(visible=False)
window['_PEF_'].update(visible=False)
if event == '_I_':
print("selected tool I")
window['_I_'].update(button_color="#323232")
window['_SR_'].update(button_color="#121212")
window['_S_'].update(button_color="#121212")
window['_RR_'].update(button_color="#121212")
window['_PE_'].update(button_color="#121212")
window['_IF_'].update(visible=True)
window['_OF_'].update(visible=False)
window['_FRF_'].update(visible=False)
window['_SRF_'].update(visible=False)
window['_PEF_'].update(visible=False)
if event == '_PE_':
print("selected tool PE")
window['_I_'].update(button_color="#121212")
window['_SR_'].update(button_color="#121212")
window['_S_'].update(button_color="#121212")
window['_RR_'].update(button_color="#121212")
window['_PE_'].update(button_color="#323232")
window['_IF_'].update(visible=False)
window['_OF_'].update(visible=False)
window['_FRF_'].update(visible=False)
window['_SRF_'].update(visible=False)
window['_PEF_'].update(visible=True)
if Linux == True and event == '_SRSD_':
dir_nameL = str(values['_STIPSRDIR_'])
ImgFO = sorted( filter( lambda x: os.path.isfile(os.path.join(dir_nameL, x)),
os.listdir(dir_nameL) ))
window['_LIST2L_'].update(ImgFO)
if event == '_SRRF_':
ImgFR = sorted( filter( lambda x: os.path.isfile(os.path.join(dir, x)),
os.listdir(dir) ) )
ImgFO = sorted( filter( lambda x: os.path.isfile(os.path.join(dir_name, x)),
os.listdir(dir_name) ) )
window['_LIST1_'].update(ImgFR)
if event == '_SRRFL_':
ImgFR = sorted( filter( lambda x: os.path.isfile(os.path.join(dir, x)),
os.listdir(dir) ) )
ImgFO = sorted( filter( lambda x: os.path.isfile(os.path.join(dir_nameL, x)),
os.listdir(dir_nameL) ) )
window['_LIST1L_'].update(ImgFR)
if event == '_LIST1_':
try:
imagefile = dir + "/" + str(values['_LIST1_'][0])
print(imagefile)
img = Image.open(imagefile)
head, sep, tail = str(values['_LIST1_'][0]).partition('.')
print(head)
img = img.resize((100,50))
img.save("./Replacement ImagesP/" + head + ".png")
imagef = "./Replacement ImagesP/" + head + ".png"
window['_SRRILIP_'].update(source=imagef)
except IndexError:
sg.popup("No files in Replacement Images! Can't select anything!")
if event == '_LIST1L_':
try:
imagefile = dir + "/" + str(values['_LIST1L_'][0])
print(imagefile)
img = Image.open(imagefile)
head, sep, tail = str(values['_LIST1_'][0]).partition('.')
print(head)
img = img.resize((100,50))
img.save("./Replacement ImagesP/" + head + ".png")
imagef = "./Replacement ImagesP/" + head + ".png"
window['_SRRILIPL_'].update(source=imagef)
except IndexError:
sg.popup("No files in Replacement Images! Can't select anything!")
if event == '_LIST2_':
try:
imagefile = dir_name + "/" + str(values['_LIST2_'][0])
print(imagefile)
img = Image.open(imagefile)
head, sep, tail = str(values['_LIST2_'][0]).partition('.')
print(head)
img = img.resize((100,50))
img.save("./Original ImagesP/" + head + ".png")
imagef = "./Original ImagesP/" + head + ".png"
window['_SROILIP_'].update(source=imagef)
except IndexError:
sg.popup("No files in Replacement Images! Can't select anything!")
if event == '_LIST2L_':
try:
imagefile = dir_nameL + "/" + str(values['_LIST2L_'][0])
print(imagefile)
img = Image.open(imagefile)
head, sep, tail = str(values['_LIST2L_'][0]).partition('.')
print(head)
img = img.resize((100,50))
img.save("./Original ImagesP/" + head + ".png")
imagef = "./Original ImagesP/" + head + ".png"
window['_SROILIPL_'].update(source=imagef)
except IndexError:
sg.popup("No files in Replacement Images! Can't select anything!")
if event == '_SRRB_':
fO5 = open("./dir_name.txt", "w")
fO5.write(str(dir_name))
fO5.close()
Orimg = str(values['_LIST2_'][0])
Reimg = str(values['_LIST1_'][0])
Replacer.Replacer.SRTOOL(Reimg,Orimg)
ImgFR = sorted( filter( lambda x: os.path.isfile(os.path.join(dir, x)),
os.listdir(dir) ) )
window['_LIST1_'].update(ImgFR)
sg.popup("Done!")
if event == '_SRRBL_':
fO5 = open("./dir_name.txt", "w")
fO5.write(str(values['_LD_']))
fO5.close()
Orimg = str(values['_LIST2L_'][0])
Reimg = str(values['_LIST1L_'][0])
Replacer.Replacer.SRTOOL(Reimg,Orimg)
ImgFR = sorted( filter( lambda x: os.path.isfile(os.path.join(dir, x)),
os.listdir(dir) ) )
window['_LIST1L_'].update(ImgFR)
sg.popup("Done!")
if event == '_FLL_':
FLT = open("./FL.txt", "w")
if values['_FLL_'] == True:
FLT.write("True")
FLT.close()
sg.popup("Please reload the program for this to take effect.")
elif values['_FLL_'] == False:
FLT.write("False")
FLT.close()
sg.popup("Please reload the program for this to take effect.")
if event == '_GitH_':
webbrowser.open("https://github.com/weegeeday/Jackbox-sti-script")
if event == '_PEW_':
print(SPN)
print(T)
PromptParser.PromptParser.newwrite(SPN,T) #updated! fixed multiple writing bug
sg.popup("Done!")
if event == '_PETLS_':
print(selected_index)
T.insert(int(selected_index),str(values['_PEIT_']))
window['_PETLS_'].update('Saved!')
time.sleep(1)
window['_PETLS_'].update('Save')
if event == '_PER_':
PromptParser.PromptParser.read()
with open("./PLE.txt", "r") as f:
PETL1V = [line.strip() for line in f.readlines()]
with open("./JPE.txt", "r") as f:
PETL2V = [line.strip() for line in f.readlines()]
with open("./PPE.txt", "r") as f:
PETL3V = [line.strip() for line in f.readlines()]
with open("./SPE.txt", "r") as f:
PETL4V = [line.strip() for line in f.readlines()]
window['_PETL1K_'].update(PETL1V)
window['_PETL2K_'].update(PETL2V)
window['_PETL3K_'].update(PETL3V)
window['_PETL4K_'].update(PETL4V)
window.refresh()
if event == '_PETL1K_':
values[0] = str(values['_PETL1K_'][0])
window['_PEIT_'].update(values[0])
selected_indices = window['_PETL1K_'].GetIndexes()
selected_index = selected_indices[0]
SPN = 1
if event == '_PETL2K_':
values[0] = str(values['_PETL2K_'][0])
window['_PEIT_'].update(values[0])
selected_indices = window['_PETL2K_'].GetIndexes()
selected_index = selected_indices[0]
SPN = 2
if event == '_PETL3K_':
values[0] = str(values['_PETL3K_'][0])
window['_PEIT_'].update(values[0])
selected_indices= window['_PETL3K_'].GetIndexes()
selected_index = selected_indices[0]
SPN = 3
if event == '_PETL4K_':
values[0] = str(values['_PETL4K_'][0])
window['_PEIT_'].update(values[0])
selected_indices = window['_PETL4K_'].GetIndexes()
selected_index = selected_indices[0]
SPN = 4
if event == '_PETABG_':
print("tab change")
T = [None] * 200
print("window close")
window.close()