MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / ActivateScreen

Method ActivateScreen

CryGame/ScriptObjectUI.cpp:1833–1873  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1831
1832//-------------------------------------------------------------------------------------------------
1833int CScriptObjectUI::ActivateScreen(IFunctionHandler *pH)
1834{
1835 CHECK_SCRIPT_FUNCTION_PARAMCOUNT(m_pScriptSystem, "UI", ActivateScreen, 1);
1836 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", ActivateScreen, 1, svtString, svtObject);
1837
1838 CUIScreen *pScreen = 0;
1839
1840 if (pH->GetParamType(1) == svtString)
1841 {
1842 char *szName;
1843
1844 pH->GetParam(1, szName);
1845
1846 pScreen = m_pUISystem->GetScreen(szName);
1847
1848 if (!pScreen)
1849 {
1850 m_pLog->LogToConsole("\001$4[Error]:$1 Tried to activate screen '%s' which was not found!", szName);
1851 }
1852 }
1853 else
1854 {
1855 IScriptObject *pObj = m_pScriptSystem->CreateEmptyObject();
1856
1857 pH->GetParam(1, pObj);
1858
1859 pScreen = (CUIScreen *)pObj->GetNativeData();
1860
1861 if (!pScreen)
1862 {
1863 m_pLog->LogToConsole("\001$4[Error]:$1 Tried to activate a screen which was not found!");
1864 }
1865 }
1866
1867 if (pScreen)
1868 {
1869 m_pUISystem->ActivateScreen(pScreen);
1870 }
1871
1872 return pH->EndFunctionNull();
1873}
1874
1875//-------------------------------------------------------------------------------------------------
1876int CScriptObjectUI::DeactivateScreen(IFunctionHandler *pH)

Callers

nothing calls this directly

Calls 7

GetParamTypeMethod · 0.80
CreateEmptyObjectMethod · 0.80
GetNativeDataMethod · 0.80
EndFunctionNullMethod · 0.80
GetParamMethod · 0.45
GetScreenMethod · 0.45
LogToConsoleMethod · 0.45

Tested by

no test coverage detected