44import zipfile
55import requests
66import threading
7- import configparser
87import customtkinter
98import CTkMessagebox as messagebox
109
@@ -52,10 +51,9 @@ def install():
5251 return
5352 path_entry .configure (state = customtkinter .DISABLED )
5453 browse_button .configure (state = customtkinter .DISABLED )
55- disable_logs_button .configure (state = customtkinter .DISABLED )
5654 install_button .destroy ()
5755 progress_bar = customtkinter .CTkProgressBar (app , determinate_speed = 50 / 2 )
58- progress_bar .grid (column = 0 , row = 2 , columnspan = 2 , padx = 5 , pady = 5 )
56+ progress_bar .grid (column = 0 , row = 1 , columnspan = 2 , padx = 5 , pady = 5 )
5957 progress_bar .set (0 )
6058 threading .Thread (target = _install , daemon = True , args = (path , )).start ()
6159
@@ -71,26 +69,15 @@ def _install(path):
7169 open (path + "/BepInEx/plugins/PolyMod.dll" , "wb" ).write (
7270 requests .get (POLYMOD ).content
7371 )
74- os .makedirs (path + "/BepInEx/config/" )
75- config_file = open (path + "/BepInEx/config/BepInEx.cfg" , "a+" )
76- config = configparser .ConfigParser ()
77- config .read_file (config_file )
78- logs = not bool (disable_logs_button .get ())
79- if "Logging.Console" in config :
80- config ["Logging.Console" ]["Enabled" ] = logs
81- else :
82- config ["Logging.Console" ] = {
83- "Enabled" : logs }
84- config .write (config_file )
8572 progress_bar .step ()
8673
8774 customtkinter .CTkButton (app , text = "Launch" , command = launch ).grid (
88- column = 0 , row = 3 , columnspan = 2 , padx = 5 , pady = 5
75+ column = 0 , row = 2 , columnspan = 2 , padx = 5 , pady = 5
8976 )
9077
9178
9279def launch ():
93- os .system ( "start steam://rungameid/874390" )
80+ os .startfile ( " steam://rungameid/874390" )
9481 app .destroy ()
9582 sys .exit ()
9683
@@ -104,13 +91,10 @@ def launch():
10491 app , placeholder_text = "Game path" , width = 228 )
10592browse_button = customtkinter .CTkButton (
10693 app , text = "Browse" , command = browse , width = 1 )
107- disable_logs_button = customtkinter .CTkCheckBox (app , text = "Disable logs" )
108- disable_logs_button .select ()
10994install_button = customtkinter .CTkButton (app , text = "Install" , command = install )
11095
11196path_entry .grid (column = 0 , row = 0 , padx = 5 , pady = 5 )
11297browse_button .grid (column = 1 , row = 0 , padx = (0 , 5 ), pady = 5 )
113- disable_logs_button .grid (column = 0 , row = 1 , columnspan = 2 , padx = 5 , pady = 5 )
114- install_button .grid (column = 0 , row = 2 , columnspan = 2 , padx = 5 , pady = 5 )
98+ install_button .grid (column = 0 , row = 1 , columnspan = 2 , padx = 5 , pady = 5 )
11599
116100app .mainloop ()
0 commit comments