12
12
import shutil
13
13
#from PIL import Image
14
14
import git
15
-
16
-
15
+ import ctypes as ct
17
16
18
17
class SourceSDK ():
19
18
selected_folder : string
@@ -341,50 +340,50 @@ def Init(folder=False):
341
340
def button_init ():
342
341
343
342
if os .path .isfile (sdk .bin_folder + "/hammer.exe" ):
344
- sdk .btn_hammer = tk .Button (root , text = "hammer" , command = open_hammer ,image = iconHammer ,compound = tk .LEFT )
343
+ sdk .btn_hammer = tk .Button (root , text = "hammer" , command = open_hammer ,image = iconHammer ,compound = tk .LEFT , background = "#4c5844" , fg = "white" )
345
344
sdk .btn_hammer .pack (side = "left" )
346
345
347
346
if os .path .isfile (sdk .bin_folder + "/hammerplusplus.exe" ):
348
- sdk .btn_hammer_plus_plus = tk .Button (root , text = "hammer++" , command = open_hammer_plus_plus , image = iconHpp , compound = tk .LEFT )
347
+ sdk .btn_hammer_plus_plus = tk .Button (root , text = "hammer++" , command = open_hammer_plus_plus , image = iconHpp , compound = tk .LEFT , background = "#4c5844" , fg = "white" )
349
348
sdk .btn_hammer_plus_plus .pack (side = "left" )
350
349
351
350
if os .path .isfile (sdk .bin_folder + "/hlmv.exe" ):
352
- sdk .btn_hlmv = tk .Button (root , text = "hlmv" , command = open_hlmv , image = iconHLMV , compound = tk .LEFT )
351
+ sdk .btn_hlmv = tk .Button (root , text = "hlmv" , command = open_hlmv , image = iconHLMV , compound = tk .LEFT , background = "#4c5844" , fg = "white" )
353
352
sdk .btn_hlmv .pack (side = "left" )
354
353
355
354
if os .path .isfile (sdk .bin_folder + "/qc_eyes.exe" ):
356
- sdk .btn_qc_eyes = tk .Button (root , text = "qc_eyes" , command = open_qc_eyes , image = iconQc_eyes , compound = tk .LEFT )
355
+ sdk .btn_qc_eyes = tk .Button (root , text = "qc_eyes" , command = open_qc_eyes , image = iconQc_eyes , compound = tk .LEFT , background = "#4c5844" , fg = "white" )
357
356
sdk .btn_qc_eyes .pack (side = "left" )
358
357
359
358
if os .path .isfile (sdk .bin_folder + "/hlfaceposer.exe" ):
360
- sdk .btn_hlfaceposer = tk .Button (root , text = "hlfaceposer" , command = open_hlfaceposer , image = iconHlposer , compound = tk .LEFT )
359
+ sdk .btn_hlfaceposer = tk .Button (root , text = "hlfaceposer" , command = open_hlfaceposer , image = iconHlposer , compound = tk .LEFT , background = "#4c5844" , fg = "white" )
361
360
sdk .btn_hlfaceposer .pack (side = "left" )
362
361
363
362
if os .path .exists (sdk .selected_folder + "/src/games.sln" ):
364
- sdk .btn_games = tk .Button (root , text = "games" , command = open_games , image = iconVisualStudio , compound = tk .LEFT )
363
+ sdk .btn_games = tk .Button (root , text = "games" , command = open_games , image = iconVisualStudio , compound = tk .LEFT , background = "#4c5844" , fg = "white" )
365
364
sdk .btn_games .pack (side = "left" )
366
365
367
366
if os .path .exists (sdk .selected_folder + "/src/everything.sln" ):
368
- sdk .btn_everything = tk .Button (root , text = "everything" , command = open_everything , image = iconVisualStudio , compound = tk .LEFT )
367
+ sdk .btn_everything = tk .Button (root , text = "everything" , command = open_everything , image = iconVisualStudio , compound = tk .LEFT , background = "#4c5844" , fg = "white" )
369
368
sdk .btn_everything .pack (side = "left" )
370
369
371
- sdk .btn_particle = tk .Button (root , text = "Particle" , command = particle , image = iconSource , compound = tk .LEFT )
370
+ sdk .btn_particle = tk .Button (root , text = "Particle" , command = particle , image = iconSource , compound = tk .LEFT , background = "#4c5844" , fg = "white" )
372
371
sdk .btn_particle .pack (side = "left" )
373
372
374
- sdk .btn_Launch_dev = tk .Button (root , text = "Launch Dev" , command = Launch_dev , image = iconSource , compound = tk .LEFT )
373
+ sdk .btn_Launch_dev = tk .Button (root , text = "Launch Dev" , command = Launch_dev , image = iconSource , compound = tk .LEFT , background = "#4c5844" , fg = "white" )
375
374
sdk .btn_Launch_dev .pack (side = "left" )
376
375
377
- sdk .btn_Launch = tk .Button (root , text = "Launch" , command = Launch , image = iconSource , compound = tk .LEFT )
376
+ sdk .btn_Launch = tk .Button (root , text = "Launch" , command = Launch , image = iconSource , compound = tk .LEFT , background = "#4c5844" , fg = "white" )
378
377
sdk .btn_Launch .pack (side = "left" )
379
378
380
379
if sdk .first_init == 0 :
381
- sdk .texture_menu = tk .Menu (sdk .menu_bar , tearoff = 0 )
380
+ sdk .texture_menu = tk .Menu (sdk .menu_bar , tearoff = 0 , background = "#4c5844" , fg = "white" )
382
381
sdk .menu_bar .add_cascade (label = "Texture" , menu = sdk .texture_menu )
383
- sdk .map_menu = tk .Menu (sdk .menu_bar , tearoff = 0 )
382
+ sdk .map_menu = tk .Menu (sdk .menu_bar , tearoff = 0 , background = "#4c5844" , fg = "white" )
384
383
sdk .menu_bar .add_cascade (label = "Map" , menu = sdk .map_menu )
385
- sdk .model_menu = tk .Menu (sdk .menu_bar , tearoff = 0 )
384
+ sdk .model_menu = tk .Menu (sdk .menu_bar , tearoff = 0 , background = "#4c5844" , fg = "white" )
386
385
sdk .menu_bar .add_cascade (label = "Model" , menu = sdk .model_menu )
387
- sdk .other_menu = tk .Menu (sdk .menu_bar , tearoff = 0 )
386
+ sdk .other_menu = tk .Menu (sdk .menu_bar , tearoff = 0 , background = "#4c5844" , fg = "white" )
388
387
sdk .menu_bar .add_cascade (label = "Other" , menu = sdk .other_menu )
389
388
390
389
sdk .map_menu .add_command (label = "Build Map" , command = build_map )
@@ -601,11 +600,14 @@ def downbload_source_code():
601
600
602
601
download_github_code ("https://github.com/ValveSoftware/source-sdk-2013" , sdk .selected_folder + "/src/" )
603
602
604
-
605
603
shutil .rmtree (sdk .selected_folder + "/src/mp/" )
606
604
move_files (sdk .selected_folder + "/src/sp/src/" , sdk .selected_folder + "/src/" )
607
605
shutil .rmtree (sdk .selected_folder + "/src/sp/" )
608
- shutil .rmtree (sdk .selected_folder + "/src/.git/" )
606
+
607
+ generate_games ()
608
+ generate_everything ()
609
+
610
+ Init ()
609
611
610
612
def download_github_code (repo_url , destination_folder ):
611
613
git .Repo .clone_from (repo_url , destination_folder )
@@ -631,11 +633,15 @@ def move_files(source_folder, destination_folder):
631
633
root = tk .Tk ()
632
634
root .title ("Source SDK" )
633
635
636
+ root .tk_setPalette (background = "#4c5844" , foreground = "white" )
637
+
638
+ root .configure (background = "#3e4637" )
639
+
634
640
sdk .menu_bar = tk .Menu (root )
635
- root .config (menu = sdk .menu_bar )
641
+ root .config (menu = sdk .menu_bar , background = "#3e4637" )
636
642
637
643
# Create a "File" menu
638
- file_menu = tk .Menu (sdk .menu_bar , tearoff = 0 )
644
+ file_menu = tk .Menu (sdk .menu_bar , tearoff = 0 , background = "#4c5844" , fg = "white" )
639
645
sdk .menu_bar .add_cascade (label = "File" , menu = file_menu )
640
646
641
647
# Add "Open" option to the "File" menu
@@ -645,9 +651,9 @@ def move_files(source_folder, destination_folder):
645
651
#file_menu.add_cascade(label="Previous Projects", menu=previous_projects_menu)
646
652
file_menu .add_command (label = "Exit" , command = launch_exit )
647
653
648
- help_menu = tk .Menu (sdk .menu_bar , tearoff = 0 )
654
+ help_menu = tk .Menu (sdk .menu_bar , tearoff = 0 , background = "#4c5844" , fg = "white" )
649
655
sdk .menu_bar .add_cascade (label = "Help" , menu = help_menu )
650
- help_menu .add_command (label = "About" , command = open_about_window , )
656
+ help_menu .add_command (label = "About" , command = open_about_window )
651
657
652
658
# Create a Text widget to display terminal output
653
659
terminal = Terminal (root , wrap = tk .WORD , height = 20 , width = 80 )
@@ -657,7 +663,7 @@ def move_files(source_folder, destination_folder):
657
663
sys .stdout = terminal
658
664
sys .stderr = terminal
659
665
660
- lbl_result = tk .Label (root , text = "Tools" , wraplength = 400 )
666
+ lbl_result = tk .Label (root , text = "Tools" , wraplength = 400 , background = "#3e4637" , fg = 'white' )
661
667
lbl_result .pack ()
662
668
663
669
# Bind keyboard shortcuts to the root window
0 commit comments