@@ -222,14 +222,21 @@ def writeProtectCheck():
222
222
223
223
ID0 , ID0Count , ID1 , ID1Count = "" , 0 , "" , 0
224
224
225
- haxStates = {
226
- 0 : "\033 [30;1mID1 not created\033 [0m" ,
227
- 1 : "\033 [33;1mNot ready - check MSET9 status for more details\033 [0m" ,
228
- 2 : "\033 [32mReady\033 [0m" ,
225
+ class haxStates :
226
+ ID1_NOT_PRESENT = 0
227
+ NOT_READY = 1
228
+ READY_TO_INJECT = 2
229
+ TRIGGER_FILE_REMOVED = 3
230
+
231
+ haxStateLabel = {
232
+ haxStates .ID1_NOT_PRESENT : "\033 [30;1mID1 not created\033 [0m" ,
233
+ haxStates .NOT_READY : "\033 [33;1mNot ready - check MSET9 status for more details\033 [0m" ,
234
+ haxStates .READY_TO_INJECT : "\033 [32mReady\033 [0m" ,
229
235
# "\033[32;1mInjected\033[0m", # you must go
230
- 3 : "\033 [32mRemoved trigger file\033 [0m"
236
+ haxStates . TRIGGER_FILE_REMOVED : "\033 [32mRemoved trigger file\033 [0m"
231
237
}
232
- haxState = 0
238
+
239
+ haxState = haxStates .ID1_NOT_PRESENT
233
240
234
241
realID1Path = ""
235
242
realID1BackupTag = "_user-id1"
@@ -453,7 +460,7 @@ def remove():
453
460
ID1 = ID1 [:32 ]
454
461
realID1Path = ID0 + "/" + ID1
455
462
456
- haxState = 0
463
+ haxState = haxStates . ID1_NOT_PRESENT
457
464
prgood ("Successfully removed MSET9!" )
458
465
459
466
def softcheck (keyfile , expectedSize = None , crc32 = None , silent = False ):
@@ -569,30 +576,30 @@ def is3DSID(name):
569
576
570
577
if os .path .exists (triggerFilePath ):
571
578
os .remove (triggerFilePath )
572
- haxState = 3 # Removed
579
+ haxState = haxStates . TRIGGER_FILE_REMOVED
573
580
elif sanityOK :
574
- haxState = 2 # Ready!
581
+ haxState = haxStates . READY_TO_INJECT
575
582
else :
576
- haxState = 1 # Not ready...
583
+ haxState = haxStates . NOT_READY
577
584
578
585
if ID1Count != 1 :
579
586
prbad (f"Error 05: You don't have 1 ID1 in your Nintendo 3DS folder, you have { ID1Count } !" )
580
587
prinfo ("Consult: https://3ds.hacks.guide/troubleshooting-mset9.html for help!" )
581
588
exitOnEnter ()
582
589
583
- if haxState != 0 and not realID1Path .endswith (realID1BackupTag ): # ?
590
+ if haxState != haxStates . ID1_NOT_PRESENT and not realID1Path .endswith (realID1BackupTag ): # ?
584
591
os .rename (abs (realID1Path ), abs (realID1Path + realID1BackupTag ))
585
592
586
593
clearScreen ()
587
594
print (f"MSET9 { VERSION } SETUP by zoogie, Aven, DannyAAM and thepikachugamer" )
588
595
print ()
589
- print (f"Current MSET9 state: { haxStates [haxState ]} " )
596
+ print (f"Current MSET9 state: { haxStateLabel [haxState ]} " )
590
597
591
598
print ("\n -- Please type in a number then hit return --\n " )
592
599
593
600
print ("↓ Input one of these numbers!" )
594
601
595
- if haxState == 0 :
602
+ if haxState == haxStates . ID1_NOT_PRESENT :
596
603
print ("1. Create MSET9 ID1" )
597
604
else :
598
605
print (f"1. Change console version (Current: { consoleNames [consoleIndex ]} )" )
@@ -614,21 +621,21 @@ def is3DSID(name):
614
621
exitOnEnter ()
615
622
616
623
elif optSelect == 2 : # Check status
617
- if haxState == 0 : # MSET9 ID1 not present
624
+ if haxState == haxStates . ID1_NOT_PRESENT :
618
625
prbad ("Can't do that now!" )
619
626
continue
620
627
sanityReport ()
621
628
exitOnEnter ()
622
629
623
630
elif optSelect == 3 : # Inject trigger file
624
- if haxState != 2 : # Ready to inject
631
+ if haxState != haxStates . READY_TO_INJECT :
625
632
prbad ("Can't do that now!" )
626
633
continue
627
634
injection ()
628
635
exitOnEnter ()
629
636
630
637
elif optSelect == 4 : # Remove MSET9
631
- if haxState == 0 :
638
+ if haxState == haxStates . ID1_NOT_PRESENT :
632
639
prinfo ("Nothing to do." )
633
640
continue
634
641
0 commit comments