added now playing text

This commit is contained in:
Timothy GFO 2023-12-04 23:14:43 -04:00
parent c98316446b
commit f38c4b3edf

View file

@ -94,7 +94,7 @@ def check_if_new_version():
return True
#add
mmm_version = "1.8.5.2"
mmm_version = "1.8.5.1"
def check_version(version=False):
api_version = "https://api.megamanmaker.com/version"
ver = requests.get(api_version)
@ -319,8 +319,8 @@ layout = [
[title],
[sg.Text("Input NSF File:"), sg.Input(sg.user_settings_get_entry('-INPUT_NSF-', ''), key="-IN-"),sg.FileBrowse(file_types=(("Supported Formats",".nsf .spc .vgm .nsfe .gbs .gym .ay .hes .kss .sap"),("NSF Files", "*.nsf*"),("NSFe Files", "*.nsfe*"),("SNES Files", "*.spc*"),("Gameboy Files", "*.gbs*"), ("Sega Genesis VGM", "*.vgm*"),("Sega Genesis GYM", "*.gym*"), ("ZX Spectrum", "*.ay*"), ("TurboGrafx 16", "*.hes*"), ("MSX Home Computer", "*.kss*"), ("Atari Pokey", "*.sap*"),))],
[sg.Text("MegaMaker Folder:"), sg.Input(sg.user_settings_get_entry('-MEGAMAKER_FOLDER-', ''), key="-OUT-"), sg.FolderBrowse()],
[sg.TabGroup([[sg.Tab("Play Now", change_all), sg.Tab("Switch a Song", change_one)]]), sg.Image(data=gif, key='_IMAGE_')],
[sg.Exit(),sg.Button("About")],
[sg.TabGroup([[sg.Tab("Play Now", change_all), sg.Tab("Switch a Song", change_one)]]),],
[sg.Exit(),sg.Button("About"),sg.Push(), sg.Frame('\U0001F3B5 Now Playing \U0001F3B5', [[sg.Text("Default Songs", key="-PLAYING-")]]), sg.Image(data=gif, key='_IMAGE_')],
]
how_to_use = "I made this tool to be able to change the music for any Mega Man Maker level while playing the game. It works by replacing every nsf file with a custom one, but while preserving the original folders and file names.\n\nTo use it, just choose a nsf file and then tell the program where you store the *game* folder. That is where the .exe is, not the user folder.\n\nIf you find this useful, you can check out my YouTube Channel or my blog since I will keep making tools like this. Also, if you find any bugs or errors remember to notify me at GitLab by making an Issue."
@ -360,18 +360,25 @@ while True:
if event == "About":
sg.popup(how_to_use)
if event == "Mute":
if values["-BOSS-"] == True or values["-LEVEL-"] == True:
if values["-BOSS-"] == True and values["-LEVEL-"] == True:
whitelist = []
elif values["-BOSS-"] == True:
whitelist = boss_music()
if values["-ALL-"] != True:
if values["-BOSS-"] == True:
if values["-BLACKLIST-"] == True:
whitelist = whitelist_to_blacklist(boss_music())
else:
whitelist = boss_music()
elif values["-LEVEL-"] == True:
whitelist = level_music()
create_mute_file(mute_nsf)
if values["-BLACKLIST-"] == True:
whitelist = whitelist_to_blacklist(level_music())
else:
whitelist = level_music()
else:
whitelist = []
create_mute_file(mute_nsf)
if not nsf_changer(os.path.join(os.path.dirname(__file__), "mmm_nsf_changer_mute.nsf"), values["-OUT-"], whitelist=whitelist):
restore_ogmusic(values["-OUT-"])
if not nsf_changer(os.path.join(os.path.dirname(__file__), "mmm_nsf_changer_mute.nsf"), values["-OUT-"], whitelist=whitelist):
restore_ogmusic(values["-OUT-"])
if not nsf_changer(os.path.join(os.path.dirname(__file__), "mmm_nsf_changer_mute.nsf"), values["-OUT-"], whitelist=whitelist):
sg.popup_error("MegaMaker folder is not valid or definitions are out of date.")
sg.popup_error("MegaMaker folder is not valid or definitions are out of date.")
window["-PLAYING-"].update(f"MUTED")
if event == "Replace Song":
if values["-DROPDOWN-"] == "":
sg.popup_error('Please select which Output NSF File to replace. If not, use "Replace *All* NSF Music".')
@ -405,10 +412,12 @@ while True:
restore_ogmusic(values["-OUT-"])
if not nsf_changer(values["-IN-"], values["-OUT-"], whitelist=whitelist):
sg.popup_error("MegaMaker folder is not valid or definitions out of date.")
window["-PLAYING-"].update(os.path.basename(values["-IN-"]))
if event == "Restore Music": # Needs testing
# sg.popup_error("DOESNT WORK EITHER HAHAHAHAHAHAA")
if not restore_ogmusic(values["-OUT-"]):
sg.popup_error("Already Restored or wrong Mega Man Maker folder.")
window["-PLAYING-"].update("Default Songs")
if event == "Download and Restore Music":
sg.popup_yes_no("WARNING: This will erase all custom songs.\nDo you want to continue?", location=window.current_location())
window["-LAST-CHANGED-"].update("")