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

Method EnableWidget

CryGame/ScriptObjectUI.cpp:732–785  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

730
731//-------------------------------------------------------------------------------------------------
732int CScriptObjectUI::EnableWidget(IFunctionHandler *pH)
733{
734 CHECK_SCRIPT_FUNCTION_PARAMCOUNT2(m_pScriptSystem, "UI", EnableWidget, 1, 2);
735
736 CUIWidget *pWidget = 0;
737 char *szWidgetName = 0;
738 char *szScreenName = 0;
739
740 if (pH->GetParamCount() == 1)
741 {
742 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", EnableWidget, 1, svtObject, svtString);
743
744 if (pH->GetParamType(1) == svtObject)
745 {
746 IScriptObject *pObject = m_pScriptSystem->CreateEmptyObject();
747
748 pH->GetParam(1, pObject);
749
750 pWidget = (CUIWidget *)pObject->GetNativeData();
751
752 pObject->Release();
753 }
754 else
755 {
756 pH->GetParam(1, szWidgetName);
757
758 pWidget = m_pUISystem->GetWidget(szWidgetName);
759 }
760 }
761 else
762 {
763 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", EnableWidget, 1, svtString);
764 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", EnableWidget, 2, svtString);
765
766 pH->GetParam(1, szWidgetName);
767 pH->GetParam(2, szScreenName);
768
769 if (szScreenName && szWidgetName)
770 {
771 pWidget = m_pUISystem->GetWidget(szWidgetName, szScreenName);
772 }
773 else if (szWidgetName)
774 {
775 pWidget = m_pUISystem->GetWidget(szWidgetName);
776 }
777 }
778
779 if (pWidget)
780 {
781 m_pUISystem->EnableWidget(pWidget);
782 }
783
784 return pH->EndFunctionNull();
785}
786
787//-------------------------------------------------------------------------------------------------
788int CScriptObjectUI::DisableWidget(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