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

Method DisableWidget

CryGame/ScriptObjectUI.cpp:788–841  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

786
787//-------------------------------------------------------------------------------------------------
788int CScriptObjectUI::DisableWidget(IFunctionHandler *pH)
789{
790 CHECK_SCRIPT_FUNCTION_PARAMCOUNT2(m_pScriptSystem, "UI", DisableWidget, 1, 2);
791
792 CUIWidget *pWidget = 0;
793 char *szWidgetName = 0;
794 char *szScreenName = 0;
795
796 if (pH->GetParamCount() == 1)
797 {
798 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", DisableWidget, 1, svtObject, svtString);
799
800 if (pH->GetParamType(1) == svtObject)
801 {
802 IScriptObject *pObject = m_pScriptSystem->CreateEmptyObject();
803
804 pH->GetParam(1, pObject);
805
806 pWidget = (CUIWidget *)pObject->GetNativeData();
807
808 pObject->Release();
809 }
810 else
811 {
812 pH->GetParam(1, szWidgetName);
813
814 pWidget = m_pUISystem->GetWidget(szWidgetName);
815 }
816 }
817 else
818 {
819 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", DisableWidget, 1, svtString);
820 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", DisableWidget, 2, svtString);
821
822 pH->GetParam(1, szWidgetName);
823 pH->GetParam(2, szScreenName);
824
825 if (szScreenName && szWidgetName)
826 {
827 pWidget = m_pUISystem->GetWidget(szWidgetName, szScreenName);
828 }
829 else if (szWidgetName)
830 {
831 pWidget = m_pUISystem->GetWidget(szWidgetName);
832 }
833 }
834
835 if (pWidget)
836 {
837 m_pUISystem->DisableWidget(pWidget);
838 }
839
840 return pH->EndFunctionNull();
841}
842
843//-------------------------------------------------------------------------------------------------
844int CScriptObjectUI::IsWidgetEnabled(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