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

Method IsScreenActive

CryGame/ScriptObjectUI.cpp:1919–1959  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1917
1918//-------------------------------------------------------------------------------------------------
1919int CScriptObjectUI::IsScreenActive(IFunctionHandler *pH)
1920{
1921 CHECK_SCRIPT_FUNCTION_PARAMCOUNT(m_pScriptSystem, "UI", IsScreenActive, 1);
1922 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", IsScreenActive, 1, svtString, svtObject);
1923
1924 CUIScreen *pScreen = 0;
1925
1926 if (pH->GetParamType(1) == svtString)
1927 {
1928 char *szName;
1929
1930 pH->GetParam(1, szName);
1931
1932 pScreen = m_pUISystem->GetScreen(szName);
1933
1934 if (!pScreen)
1935 {
1936 m_pLog->LogToConsole("\001$4[Error]:$1 Tried to check for screen '%s' which was not found!", szName);
1937 }
1938 }
1939 else
1940 {
1941 IScriptObject *pObj = m_pScriptSystem->CreateEmptyObject();
1942
1943 pH->GetParam(1, pObj);
1944
1945 pScreen = (CUIScreen *)pObj->GetNativeData();
1946
1947 if (!pScreen)
1948 {
1949 m_pLog->LogToConsole("\001$4[Error]:$1 Tried to check for a screen which was not found!");
1950 }
1951 }
1952
1953 if (pScreen)
1954 {
1955 return pH->EndFunction(m_pUISystem->IsScreenActive(pScreen));
1956 }
1957
1958 return pH->EndFunction(false);
1959}
1960
1961//-------------------------------------------------------------------------------------------------
1962int CScriptObjectUI::GetActiveScreenCount(IFunctionHandler *pH)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected