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

Method SetFocusScreen

CryGame/ScriptObjectUI.cpp:1604–1651  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1602
1603//-------------------------------------------------------------------------------------------------
1604int CScriptObjectUI::SetFocusScreen(IFunctionHandler *pH)
1605{
1606 CHECK_SCRIPT_FUNCTION_PARAMCOUNT2(m_pScriptSystem, "UI", SetFocusScreen, 1, 0);
1607
1608 if (pH->GetParamCount())
1609 {
1610 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", SetFocusScreen, 1, svtString, svtObject);
1611 }
1612
1613 CUIScreen *pScreen = 0;
1614
1615 if (pH->GetParamCount())
1616 {
1617 if (pH->GetParamType(1) == svtString)
1618 {
1619 char *szName;
1620
1621 pH->GetParam(1, szName);
1622
1623 if (szName && strlen(szName) > 0)
1624 {
1625 pScreen = m_pUISystem->GetScreen(szName);
1626
1627 if (!pScreen)
1628 {
1629 m_pLog->LogToConsole("\001$4[Error]:$1 Tried to set focusscreen to screen '%s' which was not found!", szName);
1630 }
1631 }
1632 }
1633 else
1634 {
1635 IScriptObject *pObj = m_pScriptSystem->CreateEmptyObject();
1636
1637 pH->GetParam(1, pObj);
1638
1639 pScreen = (CUIScreen *)pObj->GetNativeData();
1640
1641 if (!pScreen)
1642 {
1643 m_pLog->LogToConsole("\001$4[Error]:$1 Tried to set focusscreen to a screen which was not found!");
1644 }
1645 }
1646 }
1647
1648 m_pUISystem->SetFocusScreen(pScreen);
1649
1650 return pH->EndFunctionNull();
1651}
1652
1653//-------------------------------------------------------------------------------------------------
1654int CScriptObjectUI::GetFocusScreen(IFunctionHandler *pH)

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected