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

Method GetScreen

CryGame/ScriptObjectUI.cpp:1790–1830  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1788
1789//-------------------------------------------------------------------------------------------------
1790int CScriptObjectUI::GetScreen(IFunctionHandler *pH)
1791{
1792 CHECK_SCRIPT_FUNCTION_PARAMCOUNT(m_pScriptSystem, "UI", GetScreen, 1);
1793 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", GetScreen, 1, svtString, svtNumber);
1794
1795 CUIScreen *pScreen = 0;
1796
1797 if (pH->GetParamType(1) == svtString)
1798 {
1799 char *szName;
1800
1801 pH->GetParam(1, szName);
1802
1803 pScreen = m_pUISystem->GetScreen(szName);
1804
1805 if (!pScreen)
1806 {
1807 m_pLog->LogToConsole("\001$4[Error]:$1 Screen '%s' was not found!", szName);
1808 }
1809 }
1810 else
1811 {
1812 int iScreenIndex;
1813
1814 pH->GetParam(1, iScreenIndex);
1815
1816 pScreen = m_pUISystem->GetScreen(iScreenIndex);
1817
1818 if (!pScreen)
1819 {
1820 m_pLog->LogToConsole("\001$4[Error]:$1 Screen number '%d' was not found!", iScreenIndex);
1821 }
1822 }
1823
1824 if (pScreen)
1825 {
1826 return pH->EndFunction(pScreen->GetScriptObject());
1827 }
1828
1829 return pH->EndFunctionNull();
1830}
1831
1832//-------------------------------------------------------------------------------------------------
1833int CScriptObjectUI::ActivateScreen(IFunctionHandler *pH)

Callers 5

SetFocusScreenMethod · 0.45
CreateObjectFromTableMethod · 0.45
ActivateScreenMethod · 0.45
DeactivateScreenMethod · 0.45
IsScreenActiveMethod · 0.45

Calls 6

GetParamTypeMethod · 0.80
EndFunctionMethod · 0.80
EndFunctionNullMethod · 0.80
GetParamMethod · 0.45
LogToConsoleMethod · 0.45
GetScriptObjectMethod · 0.45

Tested by

no test coverage detected