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

Method IsWidgetVisible

CryGame/ScriptObjectUI.cpp:676–729  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

674
675//-------------------------------------------------------------------------------------------------
676int CScriptObjectUI::IsWidgetVisible(IFunctionHandler *pH)
677{
678 CHECK_SCRIPT_FUNCTION_PARAMCOUNT2(m_pScriptSystem, "UI", IsWidgetVisible, 1, 2);
679
680 CUIWidget *pWidget = 0;
681 char *szWidgetName = 0;
682 char *szScreenName = 0;
683
684 if (pH->GetParamCount() == 1)
685 {
686 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", IsWidgetVisible, 1, svtObject, svtString);
687
688 if (pH->GetParamType(1) == svtObject)
689 {
690 IScriptObject *pObject = m_pScriptSystem->CreateEmptyObject();
691
692 pH->GetParam(1, pObject);
693
694 pWidget = (CUIWidget *)pObject->GetNativeData();
695
696 pObject->Release();
697 }
698 else
699 {
700 pH->GetParam(1, szWidgetName);
701
702 pWidget = m_pUISystem->GetWidget(szWidgetName);
703 }
704 }
705 else
706 {
707 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", IsWidgetVisible, 1, svtString);
708 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", IsWidgetVisible, 2, svtString);
709
710 pH->GetParam(1, szWidgetName);
711 pH->GetParam(2, szScreenName);
712
713 if (szScreenName && szWidgetName)
714 {
715 pWidget = m_pUISystem->GetWidget(szWidgetName, szScreenName);
716 }
717 else if (szWidgetName)
718 {
719 pWidget = m_pUISystem->GetWidget(szWidgetName);
720 }
721 }
722
723 if (pWidget)
724 {
725 return pH->EndFunction(m_pUISystem->IsWidgetVisible(pWidget) != 0);
726 }
727
728 return pH->EndFunction(false);
729}
730
731//-------------------------------------------------------------------------------------------------
732int CScriptObjectUI::EnableWidget(IFunctionHandler *pH)

Callers

nothing calls this directly

Calls 8

GetParamTypeMethod · 0.80
CreateEmptyObjectMethod · 0.80
GetNativeDataMethod · 0.80
EndFunctionMethod · 0.80
GetParamCountMethod · 0.45
GetParamMethod · 0.45
ReleaseMethod · 0.45
GetWidgetMethod · 0.45

Tested by

no test coverage detected