24
24
25
25
from update import UpdateWindow , CheckForUpdate
26
26
from errorhandler import ShowError
27
- from settings import SettingsWindow , CheckboxSeperateSongPatching
27
+ from settings import SettingsWindow
28
28
from dialog import RiivolutionWindow , SuccessWindow , PackRomWindow , RevertChangesWindow , ImportChangesWindow , ConfirmDialog , DownloadSongThread
29
29
from firstsetup import FirstSetupWindow
30
30
from pypresence import Presence
@@ -634,7 +634,7 @@ def DownloadSongs(self):
634
634
def SE_Patchable (self ):
635
635
allow = True
636
636
if (self .SE_Midi .isEnabled () and (self .SE_Midi .isChecked () or Songs [self .SE_SongToChange .currentRow ()].SongType == SongTypeValue .Menu )):
637
- if (self .brseqInfo [1 ] == 0 ) or (self .brseqInfo [0 ] == 0 and self .SE_Midi_File_Replace_Song .isChecked () and LoadSetting ("Settings" ,"LoadSongSeparately" ,False )): allow = False
637
+ if (self .brseqInfo [1 ] == 0 ) or (self .brseqInfo [0 ] == 0 and self .SE_Midi_File_Replace_Song .isChecked () and LoadSetting ("Settings" ,"LoadSongSeparately" ,False ) and ( Songs [ self . SE_SongToChange . currentRow ()]. SongType != SongTypeValue . Maestro ) ): allow = False
638
638
elif (Songs [self .SE_SongToChange .currentRow ()].SongType != SongTypeValue .Menu ):
639
639
if (self .SE_ChangeSongText_Name_Input .text () == editor .textFromTxt [0 ][self .SE_SongToChange .currentRow ()] and
640
640
self .SE_ChangeSongText_Desc_Input .toPlainText () == editor .textFromTxt [1 ][self .SE_SongToChange .currentRow ()] and
@@ -677,11 +677,29 @@ def Button_SE_Midi_Length(self):
677
677
if (self .SE_Midi_Length_Measures .isChecked ()): self .SE_Midi_Length_Input .setValue (round (int (self .SE_Midi_Length_Input .text ())/ (3 + self .SE_Midi_TimeSignature_4 .isChecked ())))
678
678
else : self .SE_Midi_Length_Input .setValue (round (int (self .SE_Midi_Length_Input .text ())* (3 + self .SE_Midi_TimeSignature_4 .isChecked ())))
679
679
680
+ def SE_SeperateSongPatching (self ):
681
+ if LoadSetting ("Settings" ,"LoadSongSeparately" ,False ):
682
+ self .SE_Midi_File_Song_Button .show ()
683
+ self .SE_Midi_File_Song_Title .show ()
684
+ self .SE_Midi_File_Song_Label .show ()
685
+ self .SE_Midi_File_Score_Title .show ()
686
+ self .SE_Midi_File_Replace_Song .show ()
687
+ enabled = (not self .SE_Midi .isEnabled () or Songs [self .SE_SongToChange .currentRow ()].SongType != SongTypeValue .Maestro )
688
+ self .SE_Midi_File_Song_Button .setEnabled (enabled )
689
+ self .SE_Midi_File_Song_Title .setEnabled (enabled )
690
+ self .SE_Midi_File_Song_Label .setEnabled (enabled )
691
+ self .SE_Midi_File_Replace_Song .setEnabled (enabled )
692
+ else :
693
+ self .SE_Midi_File_Song_Button .hide ()
694
+ self .SE_Midi_File_Song_Title .hide ()
695
+ self .SE_Midi_File_Song_Label .hide ()
696
+ self .SE_Midi_File_Score_Title .hide ()
697
+ self .SE_Midi_File_Replace_Song .hide ()
698
+
680
699
def List_SE_SongToChange (self ):
681
700
if (AllowType (LoadType .Brsar )):
682
- if (not self .SE_Midi .isCheckable ()):
683
- self .SE_Midi .setCheckable (True )
684
- self .SE_Midi .setEnabled (True )
701
+ self .SE_Midi .setCheckable (True )
702
+ self .SE_Midi .setEnabled (True )
685
703
if (AllowType (LoadType .Carc )):
686
704
if (Songs [self .SE_SongToChange .currentRow ()].SongType != SongTypeValue .Menu ):
687
705
self .SE_ChangeSongText .setEnabled (True )
@@ -696,6 +714,7 @@ def List_SE_SongToChange(self):
696
714
self .SE_Midi .setCheckable (False )
697
715
self .SE_Midi .setEnabled (True )
698
716
if (AllowType (LoadType .Brsar )):
717
+ self .SE_SeperateSongPatching ()
699
718
self .SE_StyleLabel .setEnabled (Songs [self .SE_SongToChange .currentRow ()].SongType == SongTypeValue .Regular )
700
719
self .SE_StyleText .setEnabled (Songs [self .SE_SongToChange .currentRow ()].SongType == SongTypeValue .Regular )
701
720
self .SE_OpenDefaultStyleEditor .setEnabled (Songs [self .SE_SongToChange .currentRow ()].SongType == SongTypeValue .Regular )
@@ -716,7 +735,7 @@ def Button_SE_Patch(self):
716
735
tmpInfo [1 ] = midiInfo [0 ]
717
736
tmpLength [1 ] = midiInfo [1 ]
718
737
719
- if (not self .SE_Midi_File_Replace_Song .isChecked () or not LoadSetting ("Settings" ,"LoadSongSeparately" ,False )):
738
+ if (not self .SE_Midi_File_Replace_Song .isChecked () or not LoadSetting ("Settings" ,"LoadSongSeparately" ,False ) or not self . SE_Midi_File_Replace_Song . isEnabled () ):
720
739
tmpInfo [0 ] = tmpInfo [1 ]
721
740
tmpLength [0 ] = tmpLength [1 ]
722
741
tmpPath [0 ] = ""
@@ -1115,7 +1134,7 @@ def run(self):
1115
1134
if (version != "null" ): UpdateWindow (win ,version )
1116
1135
except :
1117
1136
print ("Could Not Update" )
1118
- CheckboxSeperateSongPatching ( win )
1137
+ win . SE_SeperateSongPatching ( )
1119
1138
app .exec ()
1120
1139
if (win .discord ): win .discord .close ()
1121
1140
sys .exit ()
0 commit comments