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

Method ShowWidget

CryGame/ScriptObjectUI.cpp:564–617  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

562
563//-------------------------------------------------------------------------------------------------
564int CScriptObjectUI::ShowWidget(IFunctionHandler *pH)
565{
566 CHECK_SCRIPT_FUNCTION_PARAMCOUNT2(m_pScriptSystem, "UI", ShowWidget, 1, 2);
567
568 CUIWidget *pWidget = 0;
569 char *szWidgetName = 0;
570 char *szScreenName = 0;
571
572 if (pH->GetParamCount() == 1)
573 {
574 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", ShowWidget, 1, svtObject, svtString);
575
576 if (pH->GetParamType(1) == svtObject)
577 {
578 IScriptObject *pObject = m_pScriptSystem->CreateEmptyObject();
579
580 pH->GetParam(1, pObject);
581
582 pWidget = (CUIWidget *)pObject->GetNativeData();
583
584 pObject->Release();
585 }
586 else
587 {
588 pH->GetParam(1, szWidgetName);
589
590 pWidget = m_pUISystem->GetWidget(szWidgetName);
591 }
592 }
593 else
594 {
595 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", ShowWidget, 1, svtString);
596 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", ShowWidget, 2, svtString);
597
598 pH->GetParam(1, szWidgetName);
599 pH->GetParam(2, szScreenName);
600
601 if (szScreenName && szWidgetName)
602 {
603 pWidget = m_pUISystem->GetWidget(szWidgetName, szScreenName);
604 }
605 else if (szWidgetName)
606 {
607 pWidget = m_pUISystem->GetWidget(szWidgetName);
608 }
609 }
610
611 if (pWidget)
612 {
613 m_pUISystem->ShowWidget(pWidget);
614 }
615
616 return pH->EndFunctionNull();
617}
618
619//-------------------------------------------------------------------------------------------------
620int CScriptObjectUI::HideWidget(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