33 m_EmoteClass = player.GetEmoteManager().GetNameEmoteMap().Get(
id);
49 if (button_map && button_map.Count() > 0)
52 for (
int j = 0; j < button_map.Count(); j++)
59 buttons = button_map.GetElement(j);
60 for (
int i = 0; i < buttons.Count(); i++)
108 protected Widget m_GestureItemCardPanel;
110 protected Widget m_ToolbarPanel;
115 const string RADIAL_TEXT =
"RadialText";
116 const string GESTURE_TEXT =
"GestureNameText";
117 const string INPUT_TEXT =
"InputActionText";
118 const string CATEGORY_NAME =
"CategoryName";
120 protected Widget m_SelectedItem;
121 protected bool m_IsCategorySelected;
122 protected bool m_IsMenuClosing;
123 protected int m_CurrentCategory;
126 static GesturesMenu instance;
147 GetGame().GetMission().RemoveActiveInputExcludes({
"radialmenu"},
false);
154 static void OpenMenu()
159 static void CloseMenu()
162 instance.OnMenuRelease();
164 GetGame().GetUIManager().Back();
171 #ifdef PLATFORM_CONSOLE
181 m_CurrentCategory = -1;
183 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/radial_menu/radial_gestures/day_z_gestures.layout" );
184 m_GestureItemCardPanel = layoutRoot.FindAnyWidget(
RadialMenu.RADIAL_ITEM_CARD_CONTAINER );
187 RadialMenu.GetInstance().RegisterClass(
this );
190 RadialMenu.GetInstance().SetWidgetInitialized(
false);
193 RadialMenu.GetInstance().SetWidgetProperties(
"gui/layouts/radial_menu/radial_gestures/day_z_gesture_delimiter.layout" );
198 m_ToolbarPanel = layoutRoot.FindAnyWidget(
"toolbar_bg" );
199 m_ToolbarPanel.Show(
true );
202 UpdateCategoryName(
"" );
214 IngameHud hud = IngameHud.Cast(
mission.GetHud());
217 hud.ShowQuickbarUI(
false);
222 m_IsMenuClosing =
false;
232 IngameHud hud = IngameHud.Cast(
mission.GetHud());
235 hud.ShowQuickbarUI(
true);
239 m_IsMenuClosing =
true;
244 super.OnController( w, control, value );
253 super.OnMouseEnter( w,
x,
y );
260 override bool UseMouse()
265 override bool UseGamepad()
270 override void Update(
float timeslice)
272 super.Update(timeslice);
276 if (m_CurrentCategory !=
GestureCategories.CATEGORIES && m_CurrentCategory != -1 && player)
278 for (
int i = 0; i < m_GestureItems.Count(); i++)
280 UpdateQuickbarItemCard(m_GestureItems[i]);
288 if (player && m_CurrentCategory != -1)
290 bool can = player.GetEmoteManager().CanPlayEmote(gesture_item.GetID()) && !player.GetEmoteManager().IsEmotePlaying();
291 gesture_item.SetCanPerformEmote(can);
301 if ( category_id > -1 )
303 GetGestureItems( m_GestureItems, category_id);
304 m_CurrentCategory = category_id;
309 m_CurrentCategory = -1;
310 instance.m_IsCategorySelected =
false;
313 CreateGestureContent();
319 gesture_items.Clear();
388 protected void CreateGestureContent()
391 DeleteGestureItems();
393 for (
int i = 0; i < m_GestureItems.Count(); ++i )
398 Widget gesture_item_card_widget =
Widget.Cast(
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/radial_menu/radial_gestures/day_z_gesture_item_card.layout", m_GestureItemCardPanel ) );
399 gesture_item.SetRadialItemCard( gesture_item_card_widget );
402 UpdateQuickbarItemCard( gesture_item );
405 gesture_item_card_widget.SetUserData( gesture_item );
409 if ( m_GestureItems.Count() > 0 )
412 radial_menu.SetRadiusOffset( 0 );
413 radial_menu.SetExecuteDistOffset( 0.5 );
414 radial_menu.SetOffsetFromTop( 0 );
415 radial_menu.SetItemCardRadiusOffset( 0.25 );
416 radial_menu.ActivateControllerTimeout(
false );
425 Widget gesture_item_card_widget = gesture_item.GetRadialItemCard();
429 gesture_text.SetText( gesture_item.GetName() );
430 bool input_name_available = gesture_item.GetBoundButtonText() !=
"";
431 input_text.Show(input_name_available);
432 if (input_name_available)
434 input_text.SetText(gesture_item.GetBoundButtonText());
437 ProcessEmoteConditionRequest(gesture_item);
438 if (gesture_item.GetCanPerformEmote())
440 gesture_item_card_widget.SetFlags(
WidgetFlags.DISABLED);
441 gesture_text.SetColor(
ARGB(255,255,255,255));
442 input_text.SetColor(
ARGB(255,255,255,255));
446 gesture_item_card_widget.ClearFlags(
WidgetFlags.DISABLED);
447 gesture_text.SetColor(
ARGB(255,150,150,150));
448 input_text.SetColor(
ARGB(255,150,150,150));
452 protected void DeleteGestureItems()
457 child = m_GestureItemCardPanel.GetChildren();
460 child_to_destroy = child;
461 child = child.GetSibling();
463 delete child_to_destroy;
468 protected void UpdateToolbar() {}
470 protected void UpdateCategoryName(
string name )
472 if ( !m_CategoryNameText )
474 m_CategoryNameText =
TextWidget.Cast( layoutRoot.FindAnyWidget( CATEGORY_NAME ) );
477 m_CategoryNameText.SetText(
name );
489 void OnMouseSelect(
Widget w )
494 void OnMouseDeselect(
Widget w )
499 void OnMouseExecute(
Widget w )
504 void OnMousePressLeft(
Widget w )
506 if (instance.m_IsCategorySelected)
508 ExecuteSelectedItem();
512 ExecuteSelectedCategory( w );
517 void OnMousePressRight(
Widget w )
523 void OnControllerSelect(
Widget w )
528 void OnControllerDeselect(
Widget w )
533 void OnControllerExecute(
Widget w )
537 void OnControllerPressSelect(
Widget w )
539 if (instance.m_IsCategorySelected)
541 ExecuteSelectedItem();
545 ExecuteSelectedCategory( w );
549 void OnControllerPressBack(
Widget w )
555 protected void MarkSelected(
Widget w )
557 instance.m_SelectedItem = w;
562 w.GetUserData( gesture_item );
576 protected void UnmarkSelected(
Widget w )
578 instance.m_SelectedItem = NULL;
583 w.GetUserData( gesture_item );
597 protected void ExecuteSelectedCategory(
Widget w )
603 w.GetUserData( gesture_item );
606 if ( !instance.m_IsCategorySelected && gesture_item.GetCategory() ==
GestureCategories.CATEGORIES )
609 instance.m_IsCategorySelected =
true;
612 GetGestureItems( m_GestureItems, gesture_item.GetID() );
613 CreateGestureContent();
614 RefreshGestures( gesture_item.GetID() );
617 UpdateCategoryName( gesture_item.GetName() );
626 protected void ExecuteSelectedItem()
628 if ( instance.m_IsCategorySelected && instance.m_SelectedItem )
630 if ( !
GetGame().IsDedicatedServer() )
635 instance.m_SelectedItem.GetUserData( gesture_item );
639 if( player.GetEmoteManager() )
641 player.GetEmoteManager().CreateEmoteCBFromMenu( gesture_item.GetID() );
649 protected void BackOneLevel()
652 UpdateCategoryName(
"" );
657 return m_IsMenuClosing;
660 void SetMenuClosing(
bool state)
662 m_IsMenuClosing = state;
667 Widget toolbarBackSpacer = layoutRoot.FindAnyWidget(
"BackSpacer");
678 selectAction =
"UAMenuSelect";
679 backAction =
"UAMenuBack";
680 controllerID = EUAINPUT_DEVICE_KEYBOARDMOUSE;
684 selectAction =
"UAUISelect";
685 backAction =
"UAUIBack";
686 controllerID = EUAINPUT_DEVICE_CONTROLLER;
689 toolbarSelectIcon.SetText(
InputUtils.GetRichtextButtonIconFromInputAction(selectAction,
"", controllerID,
InputUtils.ICON_SCALE_TOOLBAR));
690 toolbarBackIcon.SetText(
InputUtils.GetRichtextButtonIconFromInputAction(backAction,
"", controllerID,
InputUtils.ICON_SCALE_TOOLBAR));
691 toolbarBackSpacer.Show(instance.m_IsCategorySelected);
696 protected void OnMenuRelease();