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

Method DeactivateScreen

CryGame/ScriptObjectUI.cpp:1876–1916  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1874
1875//-------------------------------------------------------------------------------------------------
1876int CScriptObjectUI::DeactivateScreen(IFunctionHandler *pH)
1877{
1878 CHECK_SCRIPT_FUNCTION_PARAMCOUNT(m_pScriptSystem, "UI", DeactivateScreen, 1);
1879 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", DeactivateScreen, 1, svtString, svtObject);
1880
1881 CUIScreen *pScreen = 0;
1882
1883 if (pH->GetParamType(1) == svtString)
1884 {
1885 char *szName;
1886
1887 pH->GetParam(1, szName);
1888
1889 pScreen = m_pUISystem->GetScreen(szName);
1890
1891 if (!pScreen)
1892 {
1893 m_pLog->LogToConsole("\001$4[Error]:$1 Tried to Deactivate screen '%s' which was not found!", szName);
1894 }
1895 }
1896 else
1897 {
1898 IScriptObject *pObj = m_pScriptSystem->CreateEmptyObject();
1899
1900 pH->GetParam(1, pObj);
1901
1902 pScreen = (CUIScreen *)pObj->GetNativeData();
1903
1904 if (!pScreen)
1905 {
1906 m_pLog->LogToConsole("\001$4[Error]:$1 Tried to Deactivate a screen which was not found!");
1907 }
1908 }
1909
1910 if (pScreen)
1911 {
1912 m_pUISystem->DeactivateScreen(pScreen);
1913 }
1914
1915 return pH->EndFunctionNull();
1916}
1917
1918//-------------------------------------------------------------------------------------------------
1919int CScriptObjectUI::IsScreenActive(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