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

Method IsWidgetEnabled

CryGame/ScriptObjectUI.cpp:844–897  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

842
843//-------------------------------------------------------------------------------------------------
844int CScriptObjectUI::IsWidgetEnabled(IFunctionHandler *pH)
845{
846 CHECK_SCRIPT_FUNCTION_PARAMCOUNT2(m_pScriptSystem, "UI", IsWidgetEnabled, 1, 2);
847
848 CUIWidget *pWidget = 0;
849 char *szWidgetName = 0;
850 char *szScreenName = 0;
851
852 if (pH->GetParamCount() == 1)
853 {
854 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", IsWidgetEnabled, 1, svtObject, svtString);
855
856 if (pH->GetParamType(1) == svtObject)
857 {
858 IScriptObject *pObject = m_pScriptSystem->CreateEmptyObject();
859
860 pH->GetParam(1, pObject);
861
862 pWidget = (CUIWidget *)pObject->GetNativeData();
863
864 pObject->Release();
865 }
866 else
867 {
868 pH->GetParam(1, szWidgetName);
869
870 pWidget = m_pUISystem->GetWidget(szWidgetName);
871 }
872 }
873 else
874 {
875 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", IsWidgetEnabled, 1, svtString);
876 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", IsWidgetEnabled, 2, svtString);
877
878 pH->GetParam(1, szWidgetName);
879 pH->GetParam(2, szScreenName);
880
881 if (szScreenName && szWidgetName)
882 {
883 pWidget = m_pUISystem->GetWidget(szWidgetName, szScreenName);
884 }
885 else if (szWidgetName)
886 {
887 pWidget = m_pUISystem->GetWidget(szWidgetName);
888 }
889 }
890
891 if (pWidget)
892 {
893 return pH->EndFunction(m_pUISystem->IsWidgetEnabled(pWidget) != 0);
894 }
895
896 return pH->EndFunction(false);
897}
898
899//-------------------------------------------------------------------------------------------------
900int CScriptObjectUI::SendMessage(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