HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled ) { char path[PATH_MAX]; if(hObjPressed == m_romlist) { int index = m_romlist.GetCurSel(); convert_wchar_to_char(str_buffer, (const wchar_t *)m_romlist.GetText(index), sizeof(str_buffer)); if(path_file_exists(tmp_browser.current_dir.list->elems[index].data)) { snprintf(g_extern.console.external_launch.launch_app, sizeof(g_extern.console.external_launch.launch_app), "%s\\%s", filebrowser_get_current_dir(&tmp_browser), str_buffer); rarch_settings_change(S_RETURN_TO_LAUNCHER); } else if(tmp_browser.current_dir.list->elems[index].attr.b) { snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(&tmp_browser), str_buffer); filebrowser_set_root_and_ext(&tmp_browser, "xex|XEX", path); uint64_t action = (1ULL << RMENU_DEVICE_NAV_B); filebrowser_fetch_directory_entries(&tmp_browser, action, &m_romlist, &m_rompathtitle); } } bHandled = TRUE; return 0; }
HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled ) { char path[PATH_MAX]; process_input_ret = 0; if(hObjPressed == m_menulist) { int index = XuiListGetCurSel(m_menulist, NULL); wcstombs(str_buffer, (const wchar_t *)XuiListGetText(m_menulist, index), sizeof(str_buffer)); if (path_file_exists(rgui->browser->list->elems[index].data)) { fill_pathname_join(g_extern.fullpath, rgui->browser->current_dir.directory_path, str_buffer, sizeof(g_extern.fullpath)); g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME); process_input_ret = -1; } else if(rgui->browser->list->elems[index].attr.b) { fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path)); filebrowser_set_root_and_ext(rgui->browser, rgui->info.valid_extensions, path); filebrowser_fetch_directory_entries(RGUI_ACTION_OK); } } bHandled = TRUE; return 0; }
HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled ) { char path[PATH_MAX]; process_input_ret = 0; if(hObjPressed == m_menulist) { int index = XuiListGetCurSel(m_menulist, NULL); wcstombs(str_buffer, (const wchar_t *)XuiListGetText(m_menulist, index), sizeof(str_buffer)); if(path_file_exists(rgui->browser->list->elems[index].data)) { fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path)); rarch_environment_cb(RETRO_ENVIRONMENT_SET_LIBRETRO_PATH, (void*)path); g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN); process_input_ret = -1; } else if (rgui->browser->list->elems[index].attr.b) { fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path)); filebrowser_set_root_and_ext(rgui->browser, "xex|XEX", path); filebrowser_fetch_directory_entries(RGUI_ACTION_OK); } } bHandled = TRUE; return 0; }
HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled ) { char path[PATH_MAX]; if(hObjPressed == m_romlist) { int index = m_romlist.GetCurSel(); convert_wchar_to_char(str_buffer, (const wchar_t *)m_romlist.GetText(index), sizeof(str_buffer)); if(path_file_exists(browser.current_dir.list->elems[index].data)) { snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(&browser), str_buffer); rarch_console_load_game_wrap(path, g_extern.file_state.zip_extract_mode, S_DELAY_45); } else if(browser.current_dir.list->elems[index].attr.b) { snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(&browser), str_buffer); uint64_t action = (1ULL << RMENU_DEVICE_NAV_B); filebrowser_set_root_and_ext(&browser, rarch_console_get_rom_ext(), path); filebrowser_fetch_directory_entries(&browser, action, &m_romlist, &m_rompathtitle); } } else if (hObjPressed == m_dir_game) { filebrowser_set_root_and_ext(&browser, rarch_console_get_rom_ext(), g_extern.console.main_wrap.paths.default_rom_startup_dir); uint64_t action = (1ULL << RMENU_DEVICE_NAV_B); filebrowser_fetch_directory_entries(&browser, action, &m_romlist, &m_rompathtitle); } #ifdef HAVE_HDD_CACHE_PARTITION else if (hObjPressed == m_dir_cache) { filebrowser_set_root_and_ext(&browser, rarch_console_get_rom_ext(), "cache:"); uint64_t action = (1ULL << RMENU_DEVICE_NAV_B); filebrowser_fetch_directory_entries(&browser, action, &m_romlist, &m_rompathtitle); if (g_extern.console.rmenu.state.msg_info.enable) rarch_settings_msg(S_MSG_CACHE_PARTITION, S_DELAY_180); } #endif bHandled = TRUE; return 0; }
HRESULT CRetroArchShaderBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) { GetChildById(L"XuiMenuList", &m_menulist); GetChildById(L"XuiTxtTitle", &m_menutitle); GetChildById(L"XuiTxtBottom", &m_menutitlebottom); filebrowser_set_root_and_ext(rgui->browser, "cg", "game:\\media\\shaders"); filebrowser_fetch_directory_entries(RGUI_ACTION_OK); return 0; }
HRESULT CRetroArchCoreBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) { GetChildById(L"XuiRomList", &m_romlist); GetChildById(L"XuiBackButton1", &m_back); GetChildById(L"XuiTxtRomPath", &m_rompathtitle); filebrowser_set_root_and_ext(&tmp_browser, "xex|XEX", "game:"); uint64_t action = (1ULL << RMENU_DEVICE_NAV_B); filebrowser_fetch_directory_entries(&tmp_browser, action, &m_romlist, &m_rompathtitle); return 0; }
HRESULT CRetroArchShaderBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) { GetChildById(L"XuiRomList", &m_shaderlist); GetChildById(L"XuiBackButton1", &m_back); GetChildById(L"XuiTxtRomPath", &m_shaderpathtitle); filebrowser_set_root_and_ext(tmp_browser, "cg|CG", "game:\\media\\shaders"); uint64_t action = (1 << RMENU_DEVICE_NAV_B); filebrowser_fetch_directory_entries(tmp_browser, action, &m_shaderlist, &m_shaderpathtitle); return 0; }
HRESULT CRetroArchFileBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) { GetChildById(L"XuiMenuList", &m_menulist); GetChildById(L"XuiTxtTitle", &m_menutitle); GetChildById(L"XuiTxtBottom", &m_menutitlebottom); filebrowser_set_root_and_ext(rgui->browser, rgui->info.valid_extensions, default_paths.filebrowser_startup_dir); filebrowser_fetch_directory_entries(RGUI_ACTION_OK); return 0; }
HRESULT CRetroArchFileBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled) { GetChildById(L"XuiRomList", &m_romlist); GetChildById(L"XuiBackButton1", &m_back); GetChildById(L"XuiTxtRomPath", &m_rompathtitle); GetChildById(L"XuiBtnGameDir", &m_dir_game); GetChildById(L"XuiBtnCacheDir", &m_dir_cache); filebrowser_set_root_and_ext(&browser, rarch_console_get_rom_ext(), g_extern.console.main_wrap.paths.default_rom_startup_dir); uint64_t action = (1ULL << RMENU_DEVICE_NAV_B); filebrowser_fetch_directory_entries(&browser, action, &m_romlist, &m_rompathtitle); return 0; }
void filebrowser_update(void *data, uint64_t input, const char *extensions) { filebrowser_action_t action = FILEBROWSER_ACTION_NOOP; bool ret = true; if (input & (1ULL << DEVICE_NAV_DOWN)) action = FILEBROWSER_ACTION_DOWN; else if (input & (1ULL << DEVICE_NAV_UP)) action = FILEBROWSER_ACTION_UP; else if (input & (1ULL << DEVICE_NAV_RIGHT)) action = FILEBROWSER_ACTION_RIGHT; else if (input & (1ULL << DEVICE_NAV_LEFT)) action = FILEBROWSER_ACTION_LEFT; else if (input & (1ULL << DEVICE_NAV_R2)) action = FILEBROWSER_ACTION_SCROLL_DOWN; else if (input & (1ULL << DEVICE_NAV_L2)) action = FILEBROWSER_ACTION_SCROLL_UP; else if (input & (1ULL << DEVICE_NAV_A)) { char tmp_str[PATH_MAX]; fill_pathname_parent_dir(tmp_str, rgui->browser->current_dir.directory_path, sizeof(tmp_str)); if (tmp_str[0] != '\0') action = FILEBROWSER_ACTION_CANCEL; } else if (input & (1ULL << DEVICE_NAV_START)) { action = FILEBROWSER_ACTION_RESET; filebrowser_set_root_and_ext(rgui->browser, NULL, default_paths.filesystem_root_dir); strlcpy(rgui->browser->current_dir.extensions, extensions, sizeof(rgui->browser->current_dir.extensions)); #ifdef HAVE_RMENU_XUI filebrowser_fetch_directory_entries(1ULL << DEVICE_NAV_B); #endif } if (action != FILEBROWSER_ACTION_NOOP) ret = filebrowser_iterate(rgui->browser, action); if (!ret) msg_queue_push(g_extern.msg_queue, "ERROR - Failed to open directory.", 1, 180); }
HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled ) { char path[PATH_MAX]; if(hObjPressed == m_shaderlist) { int index = m_shaderlist.GetCurSel(); if(path_file_exists(tmp_browser.current_dir.list->elems[index].data)) { convert_wchar_to_char(str_buffer, (const wchar_t *)m_shaderlist.GetText(index), sizeof(str_buffer)); switch(set_shader) { case 1: snprintf(g_settings.video.cg_shader_path, sizeof(g_settings.video.cg_shader_path), "%s\\%s", filebrowser_get_current_dir(&tmp_browser), str_buffer); rarch_load_shader(set_shader, g_settings.video.cg_shader_path); break; case 2: snprintf (g_settings.video.second_pass_shader, sizeof(g_settings.video.second_pass_shader), "%s\\%s", filebrowser_get_current_dir(&tmp_browser), str_buffer); rarch_load_shader(set_shader, g_settings.video.second_pass_shader); break; default: break; } } else if(tmp_browser.current_dir.list->elems[index].attr.b) { convert_wchar_to_char(str_buffer, (const wchar_t *)m_shaderlist.GetText(index), sizeof(str_buffer)); snprintf(path, sizeof(path), "%s\\%s", filebrowser_get_current_dir(&tmp_browser), str_buffer); filebrowser_set_root_and_ext(&tmp_browser, "cg|CG", path); uint64_t action = (1ULL << RMENU_DEVICE_NAV_B); filebrowser_fetch_directory_entries(&tmp_browser, action, &m_shaderlist, &m_shaderpathtitle); } } bHandled = TRUE; return 0; }
HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled ) { char path[PATH_MAX]; process_input_ret = 0; if(hObjPressed == m_menulist) { int index = XuiListGetCurSel(m_menulist, NULL); if (path_file_exists(rgui->browser->list->elems[index].data)) wcstombs(str_buffer, (const wchar_t *)XuiListGetText(m_menulist, index), sizeof(str_buffer)); else if (rgui->browser->list->elems[index].attr.b) { wcstombs(str_buffer, (const wchar_t *)XuiListGetText(m_menulist, index), sizeof(str_buffer)); fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path)); filebrowser_set_root_and_ext(rgui->browser, "cg", path); filebrowser_fetch_directory_entries(RGUI_ACTION_OK); } } bHandled = TRUE; return 0; }