37
37
'nutexbcliLocation' : defaultCliLocation ,
38
38
'searchDir' : "" ,
39
39
'destDir' : "" ,
40
- 'root. maxThreads' : "4"
40
+ 'maxThreads' : "4"
41
41
}
42
42
43
43
@@ -102,20 +102,23 @@ def ValidatePorgram():
102
102
message (type = "ERROR" ,text = "Selected file not valid" )
103
103
root .destroy ()
104
104
sys .exit ("No img2nutexb.exe file" )
105
+
105
106
#if we don't have nutexbCli here, then ask for it!
106
107
if (ValidCliExe () == False ):
107
- message (type = "Warning" ,text = "nutexb_cli.exe not found, please select it (this can be skipped)" )
108
- ftypes = [
109
- ('nutexb_cli program' , ["*.exe" ])
110
- ]
111
- file = filedialog .askopenfile (title = "Search" ,filetypes = ftypes )
112
- root .nutexbcliLocation = file .name if file else ""
113
- #if selected file is in valid, quit
114
- if (not ValidCliExe ()):
115
- config .set ("DEFAULT" ,"nutexbcliLocation" ,defaultLocation )
116
- #message(type = "ERROR",text = "Selected file not valid")
117
- #root.destroy()
118
- #sys.exit("No nutexb_cli.exe file")
108
+ root .nutexbcliLocation = root .imgnutexbLocation .replace ("img2nutexb.exe" ,"nutexb_cli/nutexb_cli.exe" )
109
+ if not ValidCliExe ():
110
+ message (type = "Warning" ,text = "nutexb_cli.exe not found, please select it (this can be skipped)" )
111
+ ftypes = [
112
+ ('nutexb_cli program' , ["*.exe" ])
113
+ ]
114
+ file = filedialog .askopenfile (title = "Search" ,filetypes = ftypes )
115
+ root .nutexbcliLocation = file .name if file else ""
116
+ #if selected file is in valid, quit
117
+ if (not ValidCliExe ()):
118
+ config .set ("DEFAULT" ,"nutexbcliLocation" ,defaultLocation )
119
+ #message(type = "ERROR",text = "Selected file not valid")
120
+ #root.destroy()
121
+ #sys.exit("No nutexb_cli.exe file")
119
122
120
123
#write new location to config
121
124
config .set ("DEFAULT" ,"img2nutexbLocation" ,root .imgnutexbLocation )
@@ -242,7 +245,7 @@ def startGUI():
242
245
243
246
#create cli combo
244
247
root .varCli = IntVar (value = (1 if ValidCliExe else 0 ))
245
- if (ValidCliExe ):
248
+ if (ValidCliExe () ):
246
249
root .checkCli = Checkbutton (searchFrame , text = 'Use nutexb_cli.exe' ,variable = root .varCli , onvalue = 1 , offvalue = 0 )
247
250
searchFrame .add (root .checkCli )
248
251
@@ -335,8 +338,8 @@ def init(searchDir="",destDir="",currentDir=""):
335
338
336
339
root .imgnutexbLocation = config ["DEFAULT" ]["img2nutexbLocation" ]
337
340
print ("imgnutexbLocation: " + root .imgnutexbLocation )
338
- if not "root. maxThreads" in config ["DEFAULT" ]:
339
- config ["DEFAULT" ]["root. maxThreads" ]= "4"
341
+ if not "maxThreads" in config ["DEFAULT" ]:
342
+ config ["DEFAULT" ]["maxThreads" ]= "4"
340
343
with open ('config.ini' , 'w+' ) as configfile :
341
344
config .write (configfile )
342
345
root .maxThreads = int (config ["DEFAULT" ]["maxThreads" ])
@@ -456,6 +459,7 @@ def BatchImg(textures):
456
459
subcallTarget .append (targetFile )
457
460
subcallNewFile .append (newNutexb )
458
461
462
+ progressroot .UseCli = UseCli ()
459
463
if (UseCli ()):
460
464
useDDSPrompt = False
461
465
useDDSOption = False
@@ -467,9 +471,6 @@ def BatchImg(textures):
467
471
subcallExtra .append ("-u" )
468
472
469
473
root .withdraw ()
470
-
471
-
472
-
473
474
progressroot .deiconify ()
474
475
475
476
progressroot .queue = Queue (maxsize = 0 )
@@ -588,7 +589,7 @@ def BatchImgSubCall():
588
589
sourceFilePath = subcall [1 ]
589
590
targetFilePath = subcall [2 ]
590
591
convertedDDS = " using nutexb_cli.exe"
591
- if (not UseCli () ):
592
+ if (not progressroot . UseCli ):
592
593
sourceFilePath = subcall [2 ]
593
594
targetFilePath = subcall [3 ]
594
595
convertedDDS = " using dds options" if len (subcall )> 4 else ""
0 commit comments