Ejemplo n.º 1
0
def main():
    renderer = NXRenderer()
    currentDir = os.getcwd()

    while True:
        renderer.handleinputs()

        imgui.new_frame()

        width, height = renderer.io.display_size
        imgui.set_next_window_size(width, height)
        imgui.set_next_window_position(0, 0)
        imgui.begin("",
                    flags=imgui.WINDOW_NO_TITLE_BAR | imgui.WINDOW_NO_RESIZE
                    | imgui.WINDOW_NO_MOVE | imgui.WINDOW_NO_SAVED_SETTINGS)
        imgui.text("Welcome to PyNX!")
        imgui.text("Touch is supported")
        imgui.text("Current dir: " + os.getcwd())

        if os.getcwd() != "sdmc:/":
            imgui.push_style_color(imgui.COLOR_BUTTON, *FOLDER_COLOR)
            if imgui.button("../", width=200, height=60):
                os.chdir("..")
            imgui.pop_style_color(1)

        dirs = []
        files = []
        for e in os.listdir():
            if os.path.isdir(e):
                dirs.append(e)
            else:
                files.append(e)

        dirs = sorted(dirs)
        files = sorted(files)

        for e in dirs:
            imgui.push_style_color(imgui.COLOR_BUTTON, *FOLDER_COLOR)
            if imgui.button(e + "/", width=200, height=60):
                os.chdir(e)
            imgui.pop_style_color(1)

        for e in files:
            if e.endswith(".py"):
                imgui.push_style_color(imgui.COLOR_BUTTON, *PYFILE_COLOR)
            else:
                imgui.push_style_color(imgui.COLOR_BUTTON, *FILE_COLOR)

            if imgui.button(e, width=200, height=60) and e.endswith(".py"):
                run_python_module(e)

            imgui.pop_style_color(1)

        imgui.end()

        imgui.render()
        renderer.render()

    renderer.shutdown()
def main():
    renderer = NXRenderer()
    # My stuff

    MudData = {
        'Player_text': '',
        'Player_text_changed': False,
        'Player_text_changed1': False,
        'World_text': 'Please Enter the server info like this: serverhost.port',
        'World_text_changed': False,
        'server_host': '',
        'server_port': 0,
        'Entered_server_data': False,
        'Clear_Player_data': False,
        'Shift_enabled': False
    }
    keyboardInner = Keyboard2(MudData)
    TelnetSetup = TelnetBackend(MudData)
    # End Of my stuff
    while True:
        renderer.handleinputs()

        imgui.new_frame()

        width, height = renderer.io.display_size
        imgui.set_next_window_size(width, height)
        imgui.set_next_window_position(0, 0)
        imgui.begin("",
                    flags=imgui.WINDOW_NO_TITLE_BAR | imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE | imgui.WINDOW_NO_SAVED_SETTINGS)

        MudClientWindow(MudData)
        GuiProcess(MudData, TelnetSetup)
        if imgui.begin_popup("select-popup"):
            keyboardInner.create_frames_and_buttons()
            imgui.end_popup()
        imgui.end()

        imgui.render()

        renderer.render()
        PostGuiStuff(MudData)

    renderer.shutdown()
Ejemplo n.º 3
0
def main():
    renderer = NXRenderer()
    currentDir = os.getcwd()

    while True:
        renderer.handleinputs()

        imgui.new_frame()

        width, height = renderer.io.display_size
        imgui.set_next_window_size(width, height)
        imgui.set_next_window_position(0, 0)
        imgui.begin("",
                    flags=imgui.WINDOW_NO_TITLE_BAR | imgui.WINDOW_NO_RESIZE
                    | imgui.WINDOW_NO_MOVE | imgui.WINDOW_NO_SAVED_SETTINGS)
        imgui.text("Cool script!")
        imgui.text("Touch is supported")
        imgui.text("Current dir: " + os.getcwd())

        imgui.end()
        imgui.render()
        renderer.render()

    renderer.shutdown()
Ejemplo n.º 4
0
def main():
    global state
    global debugger
    current_batch_mod = ""
    ctime = 0
    renderer = NXRenderer()

    if os.path.isdir("sdmc:/ReiNX"):
        currentDir = "sdmc:/ReiNX/titles/01006A800016E000/romfs"
        os.chdir(currentDir)
    else:
        currentDir = "sdmc:/Atmosphere/titles/01006A800016E000/romfs"
        os.chdir(currentDir)

    while True:
        while state == "file_manager":
            renderer.handleinputs()

            imgui.new_frame()

            width, height = renderer.io.display_size
            imgui.set_next_window_size(width, height)
            imgui.set_next_window_position(0, 0)
            imgui.begin("",
                        flags=imgui.WINDOW_NO_TITLE_BAR
                        | imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE
                        | imgui.WINDOW_NO_SAVED_SETTINGS)

            imgui.text(
                "   __________ ____  __  __   __  _______  ____     _____   ________________    __    __    __________  "
            )
            imgui.text(
                "  / ___/ ___// __ )/ / / /  /  |/  / __ \/ __ \   /  _/ | / / ___/_  __/   |  / /   / /   / ____/ __ \ "
            )
            imgui.text(
                "  \__ \\__ \/ __  / / / /  / /|_/ / / / / / / /   / //  |/ /\__ \ / / / /| | / /   / /   / __/ / /_/ / "
            )
            imgui.text(
                " ___/ /__/ / /_/ / /_/ /  / /  / / /_/ / /_/ /  _/ // /|  /___/ // / / ___ |/ /___/ /___/ /___/ _, _/  "
            )
            imgui.text(
                "/____/____/_____/\____/  /_/  /_/\____/_____/  /___/_/ |_//____//_/ /_/  |_/_____/_____/_____/_/ |_|   "
            )
            imgui.text("")
            imgui.text("Created by NyxTheShield")
            imgui.text("Based on jam1garner Mod Installer")
            imgui.text("")
            imgui.text("Select the Mod to Install!")

            dirs = []
            files = []
            backups = []

            for e in os.listdir():
                if os.path.isdir(e):
                    dirs.append(e)
                else:
                    if not e.endswith(".exe") and not e.endswith(
                            ".bat") and not e.endswith(
                                ".backup") and not e.endswith(
                                    ".arc") and not e.endswith(".txt"):
                        files.append(e)
                    if e.endswith(".backup"):
                        backups.append(e)

            dirs = sorted(dirs)
            files = sorted(files)
            backups = sorted(backups)

            for e in dirs:
                flag = False
                added_text = ""
                batch_files = os.listdir(e)
                for file in batch_files:
                    if ".backup" in file:
                        imgui.push_style_color(imgui.COLOR_BUTTON,
                                               *FOLDER_COLOR)
                        flag = True
                        added_text = "Uninstall "
                        break
                if flag == False:
                    imgui.push_style_color(imgui.COLOR_BUTTON, *PYFILE_COLOR)
                    added_text = "Install "

                if imgui.button(added_text + e + "/", width=200, height=60):
                    ctime = time.time()
                    current_batch_mod = e
                    batch_install(e)
                imgui.pop_style_color(1)

            for e in files:
                if not e.endswith(".exe") and not e.endswith(
                        ".bat") and not e.endswith(
                            ".backup") and not e.endswith(".arc"):
                    imgui.push_style_color(imgui.COLOR_BUTTON, *PYFILE_COLOR)
                if imgui.button(
                        "Install " + e, width=400, height=60
                ) and not e.endswith(".exe") and not e.endswith(
                        ".bat") and not e.endswith(
                            ".backup") and not e.endswith(".arc"):
                    ctime = time.time()
                    run_python_module(e, 1)

                imgui.pop_style_color(1)

            for e in backups:
                if e.endswith(".backup"):
                    imgui.push_style_color(imgui.COLOR_BUTTON, *FOLDER_COLOR)
                if imgui.button("Uninstall " + e, width=400,
                                height=60) and e.endswith(".backup"):
                    ctime = time.time()
                    run_python_module(e, 2)

                imgui.pop_style_color(1)

            imgui.end()
            imgui.render()
            renderer.render()

        while state == "installed":

            imgui.new_frame()

            width, height = renderer.io.display_size
            imgui.set_next_window_size(width, height)
            imgui.set_next_window_position(0, 0)
            imgui.begin("",
                        flags=imgui.WINDOW_NO_TITLE_BAR
                        | imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE
                        | imgui.WINDOW_NO_SAVED_SETTINGS)

            if time.time() - ctime > 5:
                state = "file_manager"
                ctime = 0
            imgui.text(
                "    __  ___          __   ____           __        ____         __   _____                                ____      ____      ____"
            )
            imgui.text(
                "   /  |/  /___  ____/ /  /  _/___  _____/ /_____ _/ / /__  ____/ /  / ___/__  _______________  __________/ __/_  __/ / /_  __/ / /"
            )
            imgui.text(
                "  / /|_/ / __ \/ __  /   / // __ \/ ___/ __/ __ `/ / / _ \/ __  /   \__ \/ / / / ___/ ___/ _ \/ ___/ ___/ /_/ / / / / / / / / / /"
            )
            imgui.text(
                " / /  / / /_/ / /_/ /  _/ // / / (__  ) /_/ /_/ / / /  __/ /_/ /   ___/ / /_/ / /__/ /__/  __(__  |__  ) __/ /_/ / / / /_/ /_/_/"
            )
            imgui.text(
                "/_/  /_/\____/\__,_/  /___/_/ /_/____/\__/\__,_/_/_/\___/\__,_/   /____/\__,_/\___/\___/\___/____/____/_/  \__,_/_/_/\__, (_|_)"
            )
            imgui.text(
                "                                                                                                                    /____/  "
            )

            imgui.end()
            imgui.render()
            renderer.render()

        while state == "batch_i":

            imgui.new_frame()

            width, height = renderer.io.display_size
            imgui.set_next_window_size(width, height)
            imgui.set_next_window_position(0, 0)
            imgui.begin("",
                        flags=imgui.WINDOW_NO_TITLE_BAR
                        | imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE
                        | imgui.WINDOW_NO_SAVED_SETTINGS)

            if time.time() - ctime > 5:
                state = "file_manager"
                ctime = 0

            imgui.text("Batch Mod Sucesfully Installed")

            imgui.end()
            imgui.render()
            renderer.render()

        while state == "batch_u":

            imgui.new_frame()

            width, height = renderer.io.display_size
            imgui.set_next_window_size(width, height)
            imgui.set_next_window_position(0, 0)
            imgui.begin("",
                        flags=imgui.WINDOW_NO_TITLE_BAR
                        | imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE
                        | imgui.WINDOW_NO_SAVED_SETTINGS)

            if time.time() - ctime > 5:
                state = "file_manager"
                ctime = 0

            imgui.text("Batch Mod Uninstalled")

            imgui.end()
            imgui.render()
            renderer.render()
Ejemplo n.º 5
0
def main(collections):

    global ERROR
    renderer = NXRenderer()

    while True:
        renderer.handleinputs()

        imgui.new_frame()

        width, height = renderer.io.display_size
        imgui.set_next_window_size(width, height)
        imgui.set_next_window_position(0, 0)
        imgui.begin("",
                    flags=imgui.WINDOW_NO_TITLE_BAR | imgui.WINDOW_NO_RESIZE
                    | imgui.WINDOW_NO_MOVE | imgui.WINDOW_NO_SAVED_SETTINGS)

        imgui.push_style_color(imgui.COLOR_TEXT, *TEXT_COLOR)
        imgui.push_style_color(imgui.COLOR_BUTTON_HOVERED, *MENU_BUTTON_COLOR)
        imgui.push_style_color(imgui.COLOR_BUTTON_ACTIVE, *MENU_BUTTON_COLOR)
        imgui.begin_group()

        imgui.text("NX-Rom-Market")

        # Create ROMS folder if it doesn't exist
        directory = "Roms"
        parent_dir = "sdmc:/"
        path = os.path.join(parent_dir, directory)
        try:
            os.makedirs(path, exist_ok=True)
        except OSError as error:
            print("Directory '%s' can not be created" % directory)

        for idx, collectionName in enumerate(sorted([*collections])):

            idx % 3 == 0 and imgui.new_line() or imgui.same_line()

            imgui.push_style_color(imgui.COLOR_BUTTON, *COLLECTION_COLOR)
            if imgui.button(collectionName, width=390, height=150):
                rom_list(collections, collectionName)
            imgui.pop_style_color(1)

        imgui.end_group()

        imgui.end()

        if ERROR:
            imgui.set_next_window_size(width, height)
            imgui.set_next_window_position(0, 0)
            imgui.begin("ERROR",
                        flags=imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE
                        | imgui.WINDOW_NO_SAVED_SETTINGS)
            imgui.text(str(ERROR))
            if imgui.button("OK", width=200, height=60):
                ERROR = ""
            imgui.end()

        imgui.render()
        renderer.render()

    renderer.shutdown()
Ejemplo n.º 6
0
def rom_list(collections,
             console_selected,
             prefix='A',
             checkbox_extract=False):
    # clear both buffers
    imguihelper.clear()
    _nx.gfx_set_mode(TILED_DOUBLE)
    clear_terminal()
    imguihelper.initialize()

    renderer = NXRenderer()

    # TODO fetcing indicator
    roms = fetch_roms(collections[console_selected], prefix)

    # create collection rom folder
    directory = "Roms"
    parent_dir = "sdmc:/"
    path = os.path.join(parent_dir, directory, console_selected)
    try:
        os.makedirs(path, exist_ok=True)
    except OSError as error:
        print("Directory '%s' can not be created" % path)

    os.chdir(path)
    dir_content = os.listdir()

    while True:

        renderer.handleinputs()

        imgui.new_frame()

        width, height = renderer.io.display_size
        imgui.set_next_window_size(width, height)
        imgui.set_next_window_position(0, 0)
        imgui.begin("",
                    flags=imgui.WINDOW_NO_TITLE_BAR | imgui.WINDOW_NO_RESIZE
                    | imgui.WINDOW_NO_MOVE | imgui.WINDOW_NO_SAVED_SETTINGS)

        imgui.begin_group()

        imgui.push_style_color(imgui.COLOR_BUTTON, *MENU_BUTTON_COLOR_SELECTED)
        if imgui.button("< Back", width=70, height=50):
            main(collections)
        imgui.pop_style_color(1)

        imgui.same_line(spacing=50)
        _, checkbox_extract = imgui.checkbox("EXTRACT .ZIP AFTER DOWNLOAD",
                                             checkbox_extract)

        imgui.text("Collection: " + console_selected)

        imgui.new_line()

        for letter in '#' + string.ascii_uppercase:

            button_color = MENU_BUTTON_COLOR_SELECTED if prefix == letter else MENU_BUTTON_COLOR

            imgui.same_line()
            imgui.push_style_color(imgui.COLOR_BUTTON, *button_color)
            if imgui.button(letter, width=28, height=28):
                rom_list(collections, console_selected, letter,
                         checkbox_extract)
            imgui.pop_style_color(1)

        imgui.new_line()
        imgui.begin_child("region", -0, -0, border=True)

        for rom in roms:
            folder_name = os.path.splitext(rom['title'])[0]
            is_downloaded = any(x in dir_content
                                for x in [rom['title'], folder_name])
            button_color = ROM_COLOR_DOWNLOADED if is_downloaded else ROM_COLOR
            imgui.push_style_color(imgui.COLOR_BUTTON, *button_color)
            if imgui.button(rom['title'] + "  " + rom['size'],
                            width=1240,
                            height=30):
                download(rom, console_selected, checkbox_extract)
            imgui.pop_style_color(1)

        imgui.end_child()

        imgui.end_group()

        imgui.end()

        imgui.render()
        renderer.render()

    renderer.shutdown()
Ejemplo n.º 7
0
def main():
    import imgui
    import imguihelper
    import _nx
    import runpy
    from imgui.integrations.nx import NXRenderer

    renderer = NXRenderer()
    currentDir = os.getcwd()
    while True:
        renderer.handleinputs()

        imgui.new_frame()

        width, height = renderer.io.display_size
        imgui.set_next_window_size(width, height)
        imgui.set_next_window_position(0, 0)
        imgui.begin("PyLaylist Maker", 
            flags=imgui.WINDOW_NO_TITLE_BAR | imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE | imgui.WINDOW_NO_SAVED_SETTINGS
        )
        imgui.set_window_font_scale(2.0)
        imgui.begin_group()
        imgui.text("Welcome to Pylaylist Maker for RetroArch!\nTouch is supported\nSettings:")
        imgui.text("RetroArch Path: {}\nRoms Path: {}\nPlaylists Path: {}"
            .format(Settings["retroarchPATH"],Settings["romsPaths"][Settings["indexRomPathUsed"]],Settings["playlistsPath"]))
        imgui.push_style_color(imgui.COLOR_BUTTON, *STRING_COLOR)
        if imgui.button("Toggle Roms Path"):
            Settings["indexRomPathUsed"] = 0 if Settings["indexRomPathUsed"]==1 else 1
            updateSettings()
        imgui.pop_style_color(1)
        imgui.same_line()
        
        if Settings["useAllExtentions"]:
            imgui.push_style_color(imgui.COLOR_BUTTON, *BOOL_TRUE_COLOR )
        else:
            imgui.push_style_color(imgui.COLOR_BUTTON, *BOOL_FALSE_COLOR )
        if imgui.button("Use All Extentions: "+("True" if Settings["useAllExtentions"] else "False")):
            Settings["useAllExtentions"] = not Settings["useAllExtentions"]
            updateSettings()
        imgui.pop_style_color(1)

        if Settings["useShorthandName"]:
            imgui.push_style_color(imgui.COLOR_BUTTON, *BOOL_TRUE_COLOR )
        else:
            imgui.push_style_color(imgui.COLOR_BUTTON, *BOOL_FALSE_COLOR )
        if imgui.button("Use Shorthand Name: "+("True" if Settings["useShorthandName"] else "False")):
            Settings["useShorthandName"] = not Settings["useShorthandName"]
            updateSettings()
        imgui.pop_style_color(1)
        imgui.same_line()

        if Settings["makeJsonPlaylists"]:
            imgui.push_style_color(imgui.COLOR_BUTTON, *BOOL_TRUE_COLOR )
        else:
            imgui.push_style_color(imgui.COLOR_BUTTON, *BOOL_FALSE_COLOR )
        if imgui.button("Generate Json Playlists: "+("True" if Settings["makeJsonPlaylists"] else "False")):
            Settings["makeJsonPlaylists"] = not Settings["makeJsonPlaylists"]
            updateSettings()
        imgui.pop_style_color(1)
        imgui.end_group()
        imgui.separator()
        imgui.begin_group()
        imgui.text("Commands")
        
        imgui.push_style_color(imgui.COLOR_BUTTON, *STRING_COLOR)
        if imgui.button("Validate/Generate Folders"):
            validateFolders()
            logger.info("Folders Validated")
            
        imgui.pop_style_color(1)
        imgui.text("THIS WILL ADD A BUNCH OF FOLDERS TO YOUR ROM PATH!")

        imgui.push_style_color(imgui.COLOR_BUTTON, *STRING_COLOR)
        if imgui.button("Generate/Update Playlists"):
            generatePlaylist()
            logger.info("Complete")
        imgui.pop_style_color(1)
        imgui.text("THIS WILL MODIFY PLAYLISTS, MAKE BACKUPS FIRST!")
        imgui.text("State: "+state+"\n\n\n")
        quitme = False
        """imgui.push_style_color(imgui.COLOR_BUTTON, *STRING_COLOR)
        if imgui.button("Quit"):
            quitme = True
        imgui.pop_style_color(1)
        """
        imgui.end_group()
        imgui.end()


        imgui.render()
        renderer.render()
        if quitme:
            break
    renderer.shutdown()
    return 0
Ejemplo n.º 8
0
 def __init__(self):
     # Our render object
     self.renderer = NXRenderer()
def main():
    fail_exception = None
    status = WindowState.MAIN_MENU
    try:
        local_json, remote_json = fetch_json()
    except:
        fail_exception = traceback.format_exc()
        status = WindowState.FAILED
    else:
        if VERSION != remote_json["updater"]:
            status = WindowState.SELF_UPDATE_AVAILABLE
    can_update = False
    renderer = NXRenderer()
    while True:
        renderer.handleinputs()

        imgui.new_frame()
        width, height = renderer.io.display_size
        imgui.set_next_window_size(width, height)
        imgui.set_next_window_position(0, 0)
        imgui.begin("SwitchGuide Updater", flags=imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE | imgui.WINDOW_NO_SAVED_SETTINGS | imgui.WINDOW_NO_COLLAPSE)
        imgui.set_window_font_scale(2.0)
        if status is WindowState.MAIN_MENU:
            imgui.begin_group()
            imgui.text("Atmosphere Updater")
            imgui.text("Loaded Atmosphere version: {}\nRemote Atmosphere version: {}".format(local_json["atmosphere"], remote_json["atmosphere"]))
            if imgui.button("Update Atmosphere"):
                status = WindowState.UPDATING_AMS
            imgui.end_group()
            imgui.separator()
            imgui.begin_group()
            imgui.text("Loaded Hekate version: {}\nRemote Hekate version: {}"
                    .format(local_json["hekate"], remote_json["hekate"]))                
            if imgui.button("Update Hekate"):
                status = WindowState.UPDATING_HEKATE
            imgui.end_group()
            imgui.separator()
            imgui.begin_group()
            imgui.text("Loaded nx-hbmenu version: {}\nRemote nx-hbmenu version: {}"
                    .format(local_json["nx-hbmenu"], remote_json["nx-hbmenu"]))
            imgui.text("Loaded nx-hbloader version: {}\nRemote nx-hbloader version: {}"
                    .format(local_json["nx-hbloader"], remote_json["nx-hbloader"]))
            if imgui.button("Update nx-hbmenu"):
                status = WindowState.UPDATING_NX_HBMENU
            imgui.same_line()
            if imgui.button("Update nx-hbloader"):
                status = WindowState.UPDATING_NX_HBLOADER
            imgui.end_group()
            imgui.separator()
            imgui.text("SwitchGuide Updater {}".format(VERSION))
            imgui.text("© 2018 - Valentijn \"noirscape\" V.")
        elif status is WindowState.SELF_UPDATE_AVAILABLE:
            imgui.begin_group()
            imgui.text("An update for SwitchGuide-Updater is available.")
            imgui.end_group()
            imgui.separator()
            if imgui.button("Install version {}".format(remote_json["updater"])):
                status = WindowState.UPDATING_SELF
            if imgui.button("Keep running version {}".format(VERSION)):
                status = WindowState.MAIN_MENU
        elif status is WindowState.UPDATING_AMS:
            imgui.text("Updating Atmosphere to version {}...".format(remote_json["atmosphere"]))
            can_update = True
        elif status is WindowState.UPDATING_HEKATE:
            imgui.text("Updating Hekate to version {}...".format(remote_json["hekate"]))
            can_update = True
        elif status is WindowState.UPDATING_SELF:
            imgui.text("Updating SwitchGuide-Updater to version {}...".format(remote_json["updater"]))
            can_update = True
        elif status is WindowState.UPDATING_NX_HBLOADER:
            imgui.text("Updating nx-hbloader to version {}...".format(remote_json["nx-hbloader"]))
            can_update = True
        elif status is WindowState.UPDATING_NX_HBMENU:
            imgui.text("Updating nx-hbmenu to version {}...".format(remote_json["nx-hbmenu"]))
            can_update = True
        elif status is WindowState.SELF_UPDATE_SUCCEEDED:
            imgui.text("Succesfully updated SwitchGuide-Updater")
            imgui.text("Press HOME to exit and reopen PyNX to run this application.")
        elif status is WindowState.FAILED:
            imgui.text(str(fail_exception))
        imgui.end()

        imgui.render()
        renderer.render()

        if status is WindowState.UPDATING_AMS and can_update:
            try:
                update_atmosphere()
            except:
                fail_exception = traceback.format_exc()
                status = WindowState.FAILED
            else:
                try:
                    write_update_file(local_json, remote_json, updated_ams=True)
                    local_json, remote_json = fetch_json()
                    status = WindowState.MAIN_MENU
                    can_update = False
                except:
                    fail_exception = traceback.format_exc()
                    status = WindowState.FAILED
        elif status is WindowState.UPDATING_HEKATE and can_update:
            try:
                update_hekate()
            except:
                fail_exception = traceback.format_exc()
                status = WindowState.FAILED
            else:
                try:
                    write_update_file(local_json, remote_json, updated_hekate=True)
                    local_json, remote_json = fetch_json()
                    status = WindowState.MAIN_MENU
                    can_update = False
                except:
                    fail_exception = traceback.format_exc()
                    status = WindowState.FAILED
        elif status is WindowState.UPDATING_SELF and can_update:
            try:
                update_self()
            except:
                fail_exception = traceback.format_exc()
                status = WindowState.FAILED
            else:
                status = WindowState.SELF_UPDATE_SUCCEEDED
                can_update = False
        elif status is WindowState.UPDATING_NX_HBLOADER and can_update:
            try:
                update_nx_hbloader()
            except:
                fail_exception = traceback.format_exc()
                status = WindowState.FAILED
            else:
                try:
                    write_update_file(local_json, remote_json, updated_nx_hbloader=True)
                    local_json, remote_json = fetch_json()
                    status = WindowState.MAIN_MENU
                    can_update = False
                except:
                    fail_exception = traceback.format_exc()
                    status = WindowState.FAILED
        elif status is WindowState.UPDATING_NX_HBMENU and can_update:
            try:
                update_nx_hbmenu()
            except:
                fail_exception = traceback.format_exc()
                status = WindowState.FAILED
            else:
                try:
                    write_update_file(local_json, remote_json, updated_nx_hbmenu=True)
                    local_json, remote_json = fetch_json()
                    status = WindowState.MAIN_MENU
                    can_update = False
                except:
                    fail_exception = traceback.format_exc()
                    status = WindowState.FAILED

    renderer.shutdown()