mirror of
https://github.com/libretro/RetroArch
synced 2025-02-08 15:40:14 +00:00
(RMenu XUI 360) Add initial Load Game History
This commit is contained in:
parent
21c335df74
commit
f1358e1643
@ -153,6 +153,7 @@ CREATE_CLASS(CRetroArchAudioOptions, L"RetroArchAudioOptions");
|
|||||||
CREATE_CLASS(CRetroArchCoreOptions, L"RetroArchCoreOptions");
|
CREATE_CLASS(CRetroArchCoreOptions, L"RetroArchCoreOptions");
|
||||||
CREATE_CLASS(CRetroArchSettings, L"RetroArchSettings");
|
CREATE_CLASS(CRetroArchSettings, L"RetroArchSettings");
|
||||||
CREATE_CLASS(CRetroArchControls, L"RetroArchControls");
|
CREATE_CLASS(CRetroArchControls, L"RetroArchControls");
|
||||||
|
CREATE_CLASS(CRetroArchLoadGameHistory, L"RetroArchLoadGameHistory");
|
||||||
|
|
||||||
CRetroArch app;
|
CRetroArch app;
|
||||||
|
|
||||||
@ -173,6 +174,7 @@ HRESULT CRetroArch::RegisterXuiClasses (void)
|
|||||||
CRetroArchCoreOptions::Register();
|
CRetroArchCoreOptions::Register();
|
||||||
CRetroArchControls::Register();
|
CRetroArchControls::Register();
|
||||||
CRetroArchSettings::Register();
|
CRetroArchSettings::Register();
|
||||||
|
CRetroArchLoadGameHistory::Register();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -189,6 +191,7 @@ HRESULT CRetroArch::UnregisterXuiClasses (void)
|
|||||||
XuiUnregisterClass(L"RetroArchCoreOptions");
|
XuiUnregisterClass(L"RetroArchCoreOptions");
|
||||||
XuiUnregisterClass(L"RetroArchControls");
|
XuiUnregisterClass(L"RetroArchControls");
|
||||||
XuiUnregisterClass(L"RetroArchSettings");
|
XuiUnregisterClass(L"RetroArchSettings");
|
||||||
|
XuiUnregisterClass(L"RetroArchLoadGameHistory");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -329,6 +332,41 @@ static void init_menulist(unsigned menu_id)
|
|||||||
{
|
{
|
||||||
XuiListInsertItems(m_menulist, 0, 1);
|
XuiListInsertItems(m_menulist, 0, 1);
|
||||||
XuiListSetText(m_menulist, 0, L"No options available.");
|
XuiListSetText(m_menulist, 0, L"No options available.");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case INGAME_MENU_LOAD_GAME_HISTORY_MODE:
|
||||||
|
{
|
||||||
|
size_t history_size = rom_history_size(rgui->history);
|
||||||
|
|
||||||
|
if (history_size)
|
||||||
|
{
|
||||||
|
size_t opts = history_size;
|
||||||
|
for (size_t i = 0; i < opts; i++)
|
||||||
|
{
|
||||||
|
const char *path = NULL;
|
||||||
|
const char *core_path = NULL;
|
||||||
|
const char *core_name = NULL;
|
||||||
|
|
||||||
|
rom_history_get_index(rgui->history, i,
|
||||||
|
&path, &core_path, &core_name);
|
||||||
|
|
||||||
|
char path_short[PATH_MAX];
|
||||||
|
fill_pathname(path_short, path_basename(path), "", sizeof(path_short));
|
||||||
|
|
||||||
|
char fill_buf[PATH_MAX];
|
||||||
|
snprintf(fill_buf, sizeof(fill_buf), "%s (%s)",
|
||||||
|
path_short, core_name);
|
||||||
|
|
||||||
|
mbstowcs(strw_buffer, fill_buf, sizeof(strw_buffer) / sizeof(wchar_t));
|
||||||
|
XuiListInsertItems(m_menulist, i, 1);
|
||||||
|
XuiListSetText(m_menulist, i, strw_buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XuiListInsertItems(m_menulist, 0, 1);
|
||||||
|
XuiListSetText(m_menulist, 0, L"No history available.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case INGAME_MENU_INPUT_OPTIONS_MODE:
|
case INGAME_MENU_INPUT_OPTIONS_MODE:
|
||||||
@ -431,6 +469,27 @@ static void init_menulist(unsigned menu_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT CRetroArchLoadGameHistory::OnControlNavigate(
|
||||||
|
XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
|
||||||
|
{
|
||||||
|
bHandled = TRUE;
|
||||||
|
|
||||||
|
switch(pControlNavigateData->nControlNavigate)
|
||||||
|
{
|
||||||
|
case XUI_CONTROL_NAVIGATE_LEFT:
|
||||||
|
case XUI_CONTROL_NAVIGATE_RIGHT:
|
||||||
|
case XUI_CONTROL_NAVIGATE_UP:
|
||||||
|
case XUI_CONTROL_NAVIGATE_DOWN:
|
||||||
|
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HRESULT CRetroArchControls::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
HRESULT CRetroArchControls::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||||
{
|
{
|
||||||
GetChildById(L"XuiMenuList", &m_menulist);
|
GetChildById(L"XuiMenuList", &m_menulist);
|
||||||
@ -632,6 +691,19 @@ HRESULT CRetroArchControls::OnControlNavigate(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT CRetroArchLoadGameHistory::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
||||||
|
{
|
||||||
|
if ( hObjPressed == m_menulist)
|
||||||
|
{
|
||||||
|
XUIMessageControlNavigate controls;
|
||||||
|
controls.nControlNavigate = (XUI_CONTROL_NAVIGATE)XUI_CONTROL_NAVIGATE_OK;
|
||||||
|
OnControlNavigate(&controls, bHandled);
|
||||||
|
}
|
||||||
|
|
||||||
|
bHandled = TRUE;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT CRetroArchControls::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
HRESULT CRetroArchControls::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
|
||||||
{
|
{
|
||||||
if ( hObjPressed == m_menulist)
|
if ( hObjPressed == m_menulist)
|
||||||
@ -645,6 +717,19 @@ HRESULT CRetroArchControls::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT CRetroArchLoadGameHistory::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||||
|
{
|
||||||
|
GetChildById(L"XuiMenuList", &m_menulist);
|
||||||
|
GetChildById(L"XuiBackButton", &m_back);
|
||||||
|
GetChildById(L"XuiTxtTitle", &m_menutitle);
|
||||||
|
|
||||||
|
XuiTextElementSetText(m_menutitle, L"Load History");
|
||||||
|
|
||||||
|
init_menulist(INGAME_MENU_LOAD_GAME_HISTORY_MODE);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
|
||||||
{
|
{
|
||||||
GetChildById(L"XuiMenuList", &m_menulist);
|
GetChildById(L"XuiMenuList", &m_menulist);
|
||||||
@ -1163,6 +1248,15 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case INGAME_MENU_LOAD_GAME_HISTORY_MODE:
|
case INGAME_MENU_LOAD_GAME_HISTORY_MODE:
|
||||||
|
if (input == XUI_CONTROL_NAVIGATE_OK)
|
||||||
|
{
|
||||||
|
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_load_game_history.xur", NULL, ¤t_menu);
|
||||||
|
|
||||||
|
if (hr < 0)
|
||||||
|
RARCH_ERR("Failed to load scene.\n");
|
||||||
|
|
||||||
|
XuiSceneNavigateForward(current_obj, false, current_menu, XUSER_INDEX_FOCUS);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case INGAME_MENU_CHANGE_GAME:
|
case INGAME_MENU_CHANGE_GAME:
|
||||||
if (input == XUI_CONTROL_NAVIGATE_OK)
|
if (input == XUI_CONTROL_NAVIGATE_OK)
|
||||||
|
@ -17,6 +17,8 @@ call :subroutine_f
|
|||||||
call :subroutine_g
|
call :subroutine_g
|
||||||
@echo "Creating sd/rarch_core_options.xui ..."
|
@echo "Creating sd/rarch_core_options.xui ..."
|
||||||
call :subroutine_h
|
call :subroutine_h
|
||||||
|
@echo "Creating sd/rarch_load_game_history.xui ..."
|
||||||
|
call :subroutine_i
|
||||||
|
|
||||||
cd ../
|
cd ../
|
||||||
cd hd
|
cd hd
|
||||||
@ -37,6 +39,8 @@ call :subroutine_f
|
|||||||
call :subroutine_g
|
call :subroutine_g
|
||||||
@echo "Creating hd/rarch_core_options.xui ..."
|
@echo "Creating hd/rarch_core_options.xui ..."
|
||||||
call :subroutine_h
|
call :subroutine_h
|
||||||
|
@echo "Creating hd/rarch_load_game_history.xui ..."
|
||||||
|
call :subroutine_i
|
||||||
goto :eof
|
goto :eof
|
||||||
|
|
||||||
:subroutine_a
|
:subroutine_a
|
||||||
@ -78,3 +82,8 @@ goto :eof
|
|||||||
del rarch_core_options.xui 2>NUL
|
del rarch_core_options.xui 2>NUL
|
||||||
call rarch_core_options.bat
|
call rarch_core_options.bat
|
||||||
goto :eof
|
goto :eof
|
||||||
|
|
||||||
|
:subroutine_i
|
||||||
|
del rarch_load_game_history.xui 2>NUL
|
||||||
|
call rarch_load_game_history.bat
|
||||||
|
goto :eof
|
||||||
|
14
media/360/hd/rarch_load_game_history.bat
Normal file
14
media/360/hd/rarch_load_game_history.bat
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
for /f "tokens=* delims=" %%f in ('type rarch_main.xui') do CALL :DOREPLACE "%%f"
|
||||||
|
|
||||||
|
GOTO :EOF
|
||||||
|
:DOREPLACE
|
||||||
|
SET INPUT=%*
|
||||||
|
SET OUTPUT=%INPUT:RetroArchMain=RetroArchLoadGameHistory%
|
||||||
|
|
||||||
|
for /f "tokens=* delims=" %%g in ('ECHO %OUTPUT%') do ECHO %%~g>>rarch_load_game_history.xui
|
||||||
|
|
||||||
|
EXIT /b
|
||||||
|
|
||||||
|
:EOF
|
14
media/360/sd/rarch_load_game_history.bat
Normal file
14
media/360/sd/rarch_load_game_history.bat
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
for /f "tokens=* delims=" %%f in ('type rarch_main.xui') do CALL :DOREPLACE "%%f"
|
||||||
|
|
||||||
|
GOTO :EOF
|
||||||
|
:DOREPLACE
|
||||||
|
SET INPUT=%*
|
||||||
|
SET OUTPUT=%INPUT:RetroArchMain=RetroArchLoadGameHistory%
|
||||||
|
|
||||||
|
for /f "tokens=* delims=" %%g in ('ECHO %OUTPUT%') do ECHO %%~g>>rarch_load_game_history.xui
|
||||||
|
|
||||||
|
EXIT /b
|
||||||
|
|
||||||
|
:EOF
|
@ -555,6 +555,21 @@
|
|||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">$(OutDir)media\sd\rarch_core_options.xur;</Outputs>
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">$(OutDir)media\sd\rarch_core_options.xur;</Outputs>
|
||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">$(OutDir)media\sd\rarch_core_options.xur;</Outputs>
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">$(OutDir)media\sd\rarch_core_options.xur;</Outputs>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
|
<CustomBuild Include="..\..\media\360\sd\rarch_load_game_history.xui">
|
||||||
|
<FileType>Document</FileType>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='CodeAnalysis|Xbox 360'">$(OutDir)media\sd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">$(OutDir)media\sd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Profile|Xbox 360'">$(OutDir)media\sd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Profile_FastCap|Xbox 360'">$(OutDir)media\sd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">$(OutDir)media\sd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">$(OutDir)media\sd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='CodeAnalysis|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\sd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\sd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Profile|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\sd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Profile_FastCap|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\sd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\sd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\sd\rarch_load_game_history.xur"</Command>
|
||||||
|
</CustomBuild>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<CustomBuild Include="..\..\media\360\sd\rarch_libretrocore_browser.xui">
|
<CustomBuild Include="..\..\media\360\sd\rarch_libretrocore_browser.xui">
|
||||||
@ -664,6 +679,21 @@
|
|||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_core_options.xui" "$(OutDir)media\hd\rarch_core_options.xur"</Command>
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_core_options.xui" "$(OutDir)media\hd\rarch_core_options.xur"</Command>
|
||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_core_options.xui" "$(OutDir)media\hd\rarch_core_options.xur"</Command>
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_core_options.xui" "$(OutDir)media\hd\rarch_core_options.xur"</Command>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
|
<CustomBuild Include="..\..\media\360\hd\rarch_load_game_history.xui">
|
||||||
|
<FileType>Document</FileType>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='CodeAnalysis|Xbox 360'">$(OutDir)media\hd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">$(OutDir)media\hd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Profile|Xbox 360'">$(OutDir)media\hd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Profile_FastCap|Xbox 360'">$(OutDir)media\hd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">$(OutDir)media\hd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">$(OutDir)media\hd\rarch_load_game_history.xur;</Outputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='CodeAnalysis|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\hd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\hd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Profile|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\hd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Profile_FastCap|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\hd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\hd\rarch_load_game_history.xur"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">xui2bin /D /NOLOGO "%(RelativeDir)rarch_load_game_history.xui" "$(OutDir)media\hd\rarch_load_game_history.xur"</Command>
|
||||||
|
</CustomBuild>
|
||||||
<CustomBuild Include="..\..\media\360\hd\rarch_settings.xui">
|
<CustomBuild Include="..\..\media\360\hd\rarch_settings.xui">
|
||||||
<FileType>Document</FileType>
|
<FileType>Document</FileType>
|
||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">$(OutDir)media\hd\rarch_settings.xur;</Outputs>
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">$(OutDir)media\hd\rarch_settings.xur;</Outputs>
|
||||||
|
@ -171,6 +171,12 @@
|
|||||||
<CustomBuild Include="..\..\media\360\sd\rarch_settings.xui">
|
<CustomBuild Include="..\..\media\360\sd\rarch_settings.xui">
|
||||||
<Filter>Source Files\media\sd</Filter>
|
<Filter>Source Files\media\sd</Filter>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
|
<CustomBuild Include="..\..\media\360\hd\rarch_load_game_history.xui">
|
||||||
|
<Filter>Source Files\media\hd</Filter>
|
||||||
|
</CustomBuild>
|
||||||
|
<CustomBuild Include="..\..\media\360\sd\rarch_load_game_history.xui">
|
||||||
|
<Filter>Source Files\media\sd</Filter>
|
||||||
|
</CustomBuild>
|
||||||
<CustomBuild Include="..\..\media\360\rarch.ttf">
|
<CustomBuild Include="..\..\media\360\rarch.ttf">
|
||||||
<Filter>Source Files\media</Filter>
|
<Filter>Source Files\media</Filter>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user