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

Method HideWidget

CryGame/ScriptObjectUI.cpp:620–673  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

618
619//-------------------------------------------------------------------------------------------------
620int CScriptObjectUI::HideWidget(IFunctionHandler *pH)
621{
622 CHECK_SCRIPT_FUNCTION_PARAMCOUNT2(m_pScriptSystem, "UI", HideWidget, 1, 2);
623
624 CUIWidget *pWidget = 0;
625 char *szWidgetName = 0;
626 char *szScreenName = 0;
627
628 if (pH->GetParamCount() == 1)
629 {
630 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", HideWidget, 1, svtObject, svtString);
631
632 if (pH->GetParamType(1) == svtObject)
633 {
634 IScriptObject *pObject = m_pScriptSystem->CreateEmptyObject();
635
636 pH->GetParam(1, pObject);
637
638 pWidget = (CUIWidget *)pObject->GetNativeData();
639
640 pObject->Release();
641 }
642 else
643 {
644 pH->GetParam(1, szWidgetName);
645
646 pWidget = m_pUISystem->GetWidget(szWidgetName);
647 }
648 }
649 else
650 {
651 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", HideWidget, 1, svtString);
652 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", HideWidget, 2, svtString);
653
654 pH->GetParam(1, szWidgetName);
655 pH->GetParam(2, szScreenName);
656
657 if (szScreenName && szWidgetName)
658 {
659 pWidget = m_pUISystem->GetWidget(szWidgetName, szScreenName);
660 }
661 else if (szWidgetName)
662 {
663 pWidget = m_pUISystem->GetWidget(szWidgetName);
664 }
665 }
666
667 if (pWidget)
668 {
669 m_pUISystem->HideWidget(pWidget);
670 }
671
672 return pH->EndFunctionNull();
673}
674
675//-------------------------------------------------------------------------------------------------
676int CScriptObjectUI::IsWidgetVisible(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
ReleaseMethod · 0.45
GetWidgetMethod · 0.45

Tested by

no test coverage detected