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

Method GetWidget

CryGame/ScriptObjectUI.cpp:497–553  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

495
496//-------------------------------------------------------------------------------------------------
497int CScriptObjectUI::GetWidget(IFunctionHandler *pH)
498{
499 CHECK_SCRIPT_FUNCTION_PARAMCOUNT2(m_pScriptSystem, "UI", GetWidget, 1, 2);
500
501 char *szWidgetName = 0;
502 char *szScreenName = 0;
503
504 CUIScreen *pScreen = 0;
505 CUIWidget *pWidget = 0;
506
507 if (pH->GetParamCount() >= 1)
508 {
509 CHECK_SCRIPT_FUNCTION_PARAMTYPE(m_pScriptSystem, "UI", GetWidget, 1, svtString);
510
511 pH->GetParam(1, szWidgetName);
512 }
513
514 if (pH->GetParamCount() == 2)
515 {
516 CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", GetWidget, 2, svtString, svtObject);
517
518 if (pH->GetParamType(2) == svtString)
519 {
520 pH->GetParam(2, szScreenName);
521 }
522 else
523 {
524 IScriptObject *pObj = m_pScriptSystem->CreateEmptyObject();
525
526 pH->GetParam(2, pObj);
527
528 pScreen = (CUIScreen *)pObj->GetNativeData();
529
530 pObj->Release();
531 }
532 }
533
534 if ((szScreenName) && (szWidgetName))
535 {
536 pWidget = m_pUISystem->GetWidget(szWidgetName, szScreenName);
537 }
538 else if ((pScreen) && (szWidgetName))
539 {
540 pWidget = pScreen->GetWidget(szWidgetName);
541 }
542 else if (szWidgetName)
543 {
544 pWidget = m_pUISystem->GetWidget(szWidgetName);
545 }
546
547 if (pWidget)
548 {
549 return pH->EndFunction(m_pUISystem->GetWidgetScriptObject(pWidget));
550 }
551
552 return pH->EndFunctionNull();
553}
554

Callers 10

ShowWidgetMethod · 0.45
HideWidgetMethod · 0.45
IsWidgetVisibleMethod · 0.45
EnableWidgetMethod · 0.45
DisableWidgetMethod · 0.45
IsWidgetEnabledMethod · 0.45
SendMessageMethod · 0.45
CaptureMouseMethod · 0.45
SetTopMostWidgetMethod · 0.45
SetFocusMethod · 0.45

Calls 9

GetParamTypeMethod · 0.80
CreateEmptyObjectMethod · 0.80
GetNativeDataMethod · 0.80
EndFunctionMethod · 0.80
GetWidgetScriptObjectMethod · 0.80
EndFunctionNullMethod · 0.80
GetParamCountMethod · 0.45
GetParamMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected