DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
RadialQuickbarMenu.c
См. документацию.
6
8{
9 protected bool m_IsLightSourceExtra;
10 protected bool m_IsNVG;
11 protected int m_Id;
12 protected int m_Category;
13 protected int m_CategorySwitchID;
14 protected EntityAI m_Item;
15 protected string m_ItemName;
16
17 //radial menu
20
21 void RadialQuickbarItem( int id, EntityAI item, string item_name, int category = RadialQuickbarCategory.DEFAULT, int category_switch = -1 )
22 {
23 m_Id = id;
24 m_Item = item;
25 m_ItemName = item_name;
26 m_Category = category;
27 m_CategorySwitchID = category_switch;
28
29 //
30 if (ItemBase.Cast(m_Item))
31 {
32 m_IsNVG = ItemBase.Cast(m_Item).IsNVG();
33 m_IsLightSourceExtra = ItemBase.Cast(m_Item).IsLightSource();
34 }
35 }
36
38 {
39 return m_Item;
40 }
41
42 void SetItem( EntityAI item )
43 {
44 m_Item = item;
45 }
46
48 {
50 }
51
53 {
54 return m_IsNVG;
55 }
56
57 int GetId()
58 {
59 return m_Id;
60 }
61
63 {
64 return m_Category;
65 }
66
68 {
69 return m_CategorySwitchID;
70 }
71
76
78 {
79 m_RadialMenuItemCard = widget;
80 }
81
82 string GetItemName()
83 {
84 return m_ItemName;
85 }
86}
87
88class RadialQuickbarMenu extends UIScriptedMenu
89{
92 protected Widget m_ToolbarPanel;
93
94 protected bool m_IsMenuClosing;
95 protected int m_CurrentCategory;
96 //
97 const string TEXT_ITEM_NAME = "ItemName";
98 const string TEXT_ITEM_TITLE = "ItemTitle";
99 //selections
100 protected Widget m_SelectedItem;
102
103 //instance
105
106 //============================================
107 // RadialQuickbarMenu
108 //============================================
121
123 {
124 if (GetGame() && GetGame().GetMission())
125 {
126 GetGame().GetMission().RemoveActiveInputExcludes({"radialmenu"},false);
127 }
128 }
129
130 static void SetItemToAssign( EntityAI item )
131 {
132 m_ItemToAssign = item;
133 }
134
136 {
137 return m_ItemToAssign;
138 }
139
141 {
142 return instance;
143 }
144
145 protected void OnInputPresetChanged()
146 {
147 #ifdef PLATFORM_CONSOLE
149 #endif
150 }
151
152 //============================================
153 // Menu Controls
154 //============================================
155 static void OpenMenu( UIScriptedMenu parent = NULL )
156 {
158 }
159
160 static void CloseMenu()
161 {
163 //GetGame().GetMission().RemoveActiveInputExcludes({"radialmenu"},false);
164 }
165
166 //============================================
167 // Init & Widget Events
168 //============================================
169 override Widget Init()
170 {
171 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/radial_menu/radial_quickbar/radial_quickbar_menu.layout");
172 m_ItemCardPanel = layoutRoot.FindAnyWidget(RadialMenu.RADIAL_ITEM_CARD_CONTAINER);
173
174 //register gestures menu
175 RadialMenu.GetInstance().RegisterClass(this);
176
177 //delay updates until fully initialized
178 RadialMenu.GetInstance().SetWidgetInitialized(false);
179
180 //set radial menu properties
181 RadialMenu.GetInstance().SetWidgetProperties("gui/layouts/radial_menu/radial_quickbar/radial_quickbar_delimiter.layout");
182
183 //create content (widgets) for items
185
186 //set controller toolbar icons
188
189 m_ToolbarPanel = layoutRoot.FindAnyWidget( "toolbar_bg" );
190 m_ToolbarPanel.Show( true );
191
192 return layoutRoot;
193 }
194
195 override void OnShow()
196 {
197 super.OnShow();
198
200 if (mission)
201 {
202 IngameHud hud = IngameHud.Cast(mission.GetHud());
203 if (hud)
204 {
205 hud.ShowQuickbarUI(false);
206 }
207 }
208
209 SetFocus(layoutRoot);
210 m_IsMenuClosing = false;
211 }
212
213 override void OnHide()
214 {
215 super.OnHide();
216
218 if (mission)
219 {
220 IngameHud hud = IngameHud.Cast(mission.GetHud());
221 if (hud)
222 {
223 hud.ShowQuickbarUI(true);
224 }
225 }
226
227 //reset item to assign
228 RadialQuickbarMenu.SetItemToAssign(NULL);
229 m_IsMenuClosing = true;
230 }
231
232 override bool OnController( Widget w, int control, int value )
233 {
234 super.OnController( w, control, value );
235
236 RadialMenu.GetInstance().SetControlType( RadialMenuControlType.CONTROLLER );
237
238 return false;
239 }
240
241 override bool OnMouseEnter( Widget w, int x, int y )
242 {
243 super.OnMouseEnter( w, x, y );
244
245 RadialMenu.GetInstance().SetControlType( RadialMenuControlType.MOUSE );
246
247 return false;
248 }
249
250 override bool UseMouse()
251 {
252 return true;
253 }
254
255 override bool UseGamepad()
256 {
257 return true;
258 }
259
260 //============================================
261 // Content
262 //============================================
263 //reset_selection - if false, selected quick bar item will be remembered after content refresh
264 protected void RefreshQuickbar( bool reset_selection = true )
265 {
266 int selected_item_id = -1;
267 if ( !reset_selection )
268 {
269 RadialQuickbarItem quickbar_item;
270 if ( instance.m_SelectedItem )
271 {
272 instance.m_SelectedItem.GetUserData( quickbar_item );
273 selected_item_id = quickbar_item.GetId();
274 }
275 }
276
277 GetItems( m_Items );
278 //CheckForLightsAndNVG( m_Items );
279 CreateContent( selected_item_id );
280 }
281
282 //
283 // ITEMS
284 //
285 protected void GetItems( out array<ref RadialQuickbarItem> items )
286 {
287 items.Clear();
288
289 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
290 int size = player.GetQuickBarSize();
291 EntityAI entity;
292
293 for ( int i = 0; i < size; ++i )
294 {
295 entity = player.GetQuickBarEntity( i );
296
297 items.Insert( new RadialQuickbarItem( i, entity, "" ) );
298 }
299
301 }
302
303 protected void CheckForLightsAndNVG( out array<ref RadialQuickbarItem> items, int last_idx )
304 {
305 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
306 int count = 0;
307 EntityAI entity;
308 ItemBase headgear = ItemBase.Cast(player.FindAttachmentBySlotName("Headgear"));
309 ItemBase eyewear = ItemBase.Cast(player.FindAttachmentBySlotName("Eyewear"));
310
311 //nvg - headgear check
312 if ( headgear )
313 {
314 entity = headgear.FindAttachmentBySlotName("NVG");
315 if (entity)
316 {
317 items.Insert( new RadialQuickbarItem( count, entity, "", RadialQuickbarCategory.SPECIALIZED_LIGHTS ) );
318 count++;
319 }
320 }
321 //nvg/light - eyewear check
322 if ( eyewear )
323 {
324 entity = eyewear.FindAttachmentBySlotName("NVG");
325 if (entity)
326 {
327 items.Insert( new RadialQuickbarItem( count, entity, "", RadialQuickbarCategory.SPECIALIZED_LIGHTS ) );
328 count++;
329 }
330 else if ( eyewear.IsLightSource() && eyewear.HasEnergyManager() && eyewear.GetCompEM().CanWork() )
331 {
332 entity = eyewear;
333 items.Insert( new RadialQuickbarItem( count, entity, "", RadialQuickbarCategory.SPECIALIZED_LIGHTS ) );
334 count++;
335 }
336 }
337 //light
338 if ( headgear )
339 {
340 if ( headgear.GetInventory().AttachmentCount() > 0 )
341 {
342 ItemBase attachment;
343 for (int i = 0; i < headgear.GetInventory().AttachmentCount(); i++)
344 {
345 attachment = ItemBase.Cast(headgear.GetInventory().GetAttachmentFromIndex(i));
346 if ( attachment && attachment.IsLightSource() && attachment.HasEnergyManager() && attachment.GetCompEM().CanWork() )
347 {
348 entity = attachment;
349 items.Insert( new RadialQuickbarItem( count, entity, "", RadialQuickbarCategory.SPECIALIZED_LIGHTS ) );
350 count++;
351 }
352 }
353 }
354 }
355
356 //Add a category switchers
357 if (m_CurrentCategory == RadialQuickbarCategory.DEFAULT && count > 0)
358 {
359 items.InsertAt( new RadialQuickbarItem(32,null,"#toggle_lights",RadialQuickbarCategory.DEFAULT,RadialQuickbarCategory.SPECIALIZED_LIGHTS),0 );
360 }
361 else if (m_CurrentCategory == RadialQuickbarCategory.SPECIALIZED_LIGHTS)
362 {
363 items.InsertAt( new RadialQuickbarItem(32,null,"#menu_back",RadialQuickbarCategory.SPECIALIZED_LIGHTS,RadialQuickbarCategory.DEFAULT),0 );
364 }
365 }
366
367 protected void CreateContent( int selected_item_id = -1 )
368 {
369 //delete existing content
370 DeleteItems();
371
372 int category_item_count;
373
374 for ( int i = 0; i < m_Items.Count(); ++i )
375 {
376 RadialQuickbarItem quickbar_item = m_Items.Get( i );
377
378 if (quickbar_item.GetItemCategory() == m_CurrentCategory)
379 {
380 //create item card
381 Widget item_card_widget = Widget.Cast( GetGame().GetWorkspace().CreateWidgets( "gui/layouts/radial_menu/radial_quickbar/radial_quickbar_item_card.layout", m_ItemCardPanel ) );
382 quickbar_item.SetRadialItemCard( item_card_widget );
383
384 //update item card widget
385 UpdateQuickbarItemCard( quickbar_item );
386
387 //set data
388 item_card_widget.SetUserData( quickbar_item );
389
390 //set selection
391 if ( quickbar_item.GetId() == selected_item_id )
392 {
393 MarkSelected( quickbar_item.GetRadialItemCard() );
394 }
395 category_item_count++;
396 }
397 }
398
399 //adjust radial parameters for content
400 if ( /*m_Items.Count()*/category_item_count > 0 )
401 {
402 RadialMenu radial_menu = RadialMenu.GetInstance();
403 radial_menu.SetRadiusOffset( 0 );
404 radial_menu.SetExecuteDistOffset( 0.5 );
405 radial_menu.SetOffsetFromTop( 0 );
406 radial_menu.SetItemCardRadiusOffset( 0.25 );
407 radial_menu.ActivateControllerTimeout( false );
408 }
409
410 //refresh radial menu
411 RadialMenu.GetInstance().Refresh( false );
412 }
413
414 protected void UpdateQuickbarItemCard( RadialQuickbarItem quickbar_item )
415 {
416 Widget item_card_widget = quickbar_item.GetRadialItemCard();
417
418 //get content panels
419 Widget item_details = item_card_widget.FindAnyWidget( "ItemDetails" );
420 TextWidget item_title = TextWidget.Cast( item_card_widget.FindAnyWidget( "ItemTitle" ) );
421
422 //set text
423 TextWidget text_widget = TextWidget.Cast( item_card_widget.FindAnyWidget( TEXT_ITEM_NAME ) );
424 EntityAI item = quickbar_item.GetItem();
425
426 Widget quantity_panel = item_card_widget.FindAnyWidget( "QuantityPanel" );
427 if ( item )
428 {
429 //item text
430 text_widget.SetText( quickbar_item.GetItem().GetDisplayName() );
431
432 //item preview
433 ItemPreviewWidget item_preview = ItemPreviewWidget.Cast( item_card_widget.FindAnyWidget( "ItemPreview" ) );
434 item_preview.SetItem( item );
435 item_preview.SetView( item.GetViewIndex() );
436 item_preview.SetModelOrientation( Vector( 0,0,0 ) );
437
438 //item quantity
439 Widget quantity_stack = quantity_panel.FindAnyWidget( "QuantityStackPanel" );
440 ProgressBarWidget quantity_bar = ProgressBarWidget.Cast( quantity_panel.FindAnyWidget( "QuantityBar" ) );
441 int has_quantity = QuantityConversions.HasItemQuantity( item );
442 //calculate and set quantity
443 if ( has_quantity == QUANTITY_HIDDEN )
444 {
445 quantity_panel.Show( false );
446 }
447 else if ( has_quantity == QUANTITY_COUNT )
448 {
449 //hide bar
450 quantity_bar.Show( false );
451
452 //show stack
453 TextWidget quantity_text = TextWidget.Cast( quantity_stack.FindAnyWidget( "Quantity" ) );
454 quantity_text.SetText( QuantityConversions.GetItemQuantityText( item ) );
455 quantity_stack.Show( true );
456 }
457 else if ( has_quantity == QUANTITY_PROGRESS )
458 {
459 //hide stack
460 quantity_stack.Show( false );
461
462 //show bar
463 float progress_max = quantity_bar.GetMax();
464 int max = item.ConfigGetInt( "varQuantityMax" );
465 int count = item.ConfigGetInt( "count" );
466 float quantity = QuantityConversions.GetItemQuantity( ItemBase.Cast( item ) );
467
468 if ( count > 0 )
469 {
470 max = count;
471 }
472 if ( max > 0 )
473 {
474
475 float value = Math.Round( ( quantity / max ) * 100 );
476 quantity_bar.SetCurrent( value );
477 }
478
479 quantity_bar.Show( true );
480 }
481
482 //display content panels
483 item_details.Show( true );
484 item_title.Show( false );
485 }
486 else if ( quickbar_item.GetCategorySwitchID() != -1 )
487 {
488 item_title.SetText( quickbar_item.GetItemName() );
489
490 item_details.Show( false );
491 item_title.Show( true );
492 }
493 else
494 {
495 item_title.SetText( "#container_empty" );
496
497 //display content panels
498 item_details.Show( false );
499 item_title.Show( true );
500 }
501 }
502
503 //Common
504 protected void DeleteItems()
505 {
506 Widget child;
507 Widget child_to_destroy;
508
509 child = m_ItemCardPanel.GetChildren();
510 while ( child )
511 {
512 child_to_destroy = child;
513 child = child.GetSibling();
514
515 delete child_to_destroy;
516 }
517 }
518
519 protected void ChangeCurrentCategory(int category)
520 {
521 m_CurrentCategory = category;
522 RefreshQuickbar(false);
524 }
525
526 //============================================
527 // Radial Menu Events
528 //============================================
529 //Common
531 {
532 }
533
534 //Mouse
536 {
537 MarkSelected( w );
538 }
539
541 {
542 UnmarkSelected( w );
543 }
544
546 {
547 }
548
551 {
552 PrimaryAction( w );
553 }
554
557 {
558 BackOneLevel();
559 }
560
561 //Controller
563 {
564 MarkSelected( w );
565 }
566
568 {
569 UnmarkSelected( w );
570 }
571
573 {
574 PrimaryAction( w );
575 }
576
578 {
579 //SecondaryAction( w );
580 BackOneLevel();
581 }
582
583 //Actions
584 protected void MarkSelected( Widget w )
585 {
586 m_SelectedItem = w;
587
588 if (w)
589 {
590 RadialQuickbarItem quickbar_item;
591 w.GetUserData( quickbar_item );
592 ItemBase item;
593
594 if (quickbar_item && Class.CastTo(item,quickbar_item.GetItem()))
595 {
596 w.SetFlags(WidgetFlags.DISABLED);
597 }
598 else
599 {
600 w.ClearFlags(WidgetFlags.DISABLED);
601 }
602/*
603 //is not category
604 if ( quickbar_item )
605 {
606 if ( quickbar_item.GetItem() )
607 {
608 //alter item visual
609 TextWidget text_widget = TextWidget.Cast( quickbar_item.GetRadialItemCard().FindAnyWidget( TEXT_ITEM_NAME ) );
610 text_widget.SetColor( ARGB( 255, 66, 175, 95 ) );
611 }
612 else
613 {
614 //alter item visual
615 TextWidget title_widget = TextWidget.Cast( quickbar_item.GetRadialItemCard().FindAnyWidget( TEXT_ITEM_TITLE ) );
616 title_widget.SetColor( ARGB( 255, 66, 175, 95 ) );
617 }
618 }
619*/
620 }
621 }
622
623 protected void UnmarkSelected( Widget w )
624 {
625 m_SelectedItem = NULL;
626
627 /*
628 if ( w )
629 {
630 RadialQuickbarItem quickbar_item;
631 w.GetUserData( quickbar_item );
632
633 //is not category
634 if ( quickbar_item )
635 {
636 if ( quickbar_item.GetItem() )
637 {
638 //alter item visual
639 TextWidget text_widget = TextWidget.Cast( quickbar_item.GetRadialItemCard().FindAnyWidget( TEXT_ITEM_NAME ) );
640 text_widget.SetColor( ARGB( 255, 255, 255, 255 ) );
641 }
642 else
643 {
644 //alter item visual
645 TextWidget title_widget = TextWidget.Cast( quickbar_item.GetRadialItemCard().FindAnyWidget( TEXT_ITEM_TITLE ) );
646 title_widget.SetColor( ARGB( 255, 255, 255, 255 ) );
647 }
648 }
649 }
650 */
651 }
652
653 protected void PrimaryAction( Widget w )
654 {
655 if ( instance.m_SelectedItem )
656 {
657 if ( !GetGame().IsDedicatedServer() )
658 {
659 RadialQuickbarItem quickbar_item;
660 instance.m_SelectedItem.GetUserData( quickbar_item );
661
662 if ( quickbar_item )
663 {
664 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
665
666 //ASSIGN ACTION
667 if ( GetItemToAssign() )
668 {
669 //assign item to slot
670 if ( quickbar_item.GetItem() == GetItemToAssign() )
671 {
672 player.RemoveQuickBarEntityShortcut( GetItemToAssign() );
673 }
674 else
675 {
676 player.SetQuickBarEntityShortcut( GetItemToAssign(), quickbar_item.GetId() );
677 }
678 }
679 //LIGHTS
680 else if (m_CurrentCategory == RadialQuickbarCategory.SPECIALIZED_LIGHTS && quickbar_item.IsLightSourceExtra())
681 {
682 HandleLights(quickbar_item);
683 }
684 //NVG
685 else if (m_CurrentCategory == RadialQuickbarCategory.SPECIALIZED_LIGHTS && quickbar_item.IsNVGExtra())
686 {
687 HandleNVG(quickbar_item);
688 }
689 //change quickbar category
690 else if (quickbar_item.GetCategorySwitchID() != -1)
691 {
692 ChangeCurrentCategory(quickbar_item.GetCategorySwitchID());
693 return;
694 }
695 //SWAP
696 else
697 {
698 EntityAI item = quickbar_item.GetItem();
699
700 if ( item )
701 {
702 //swap
703 player.RadialQuickBarSingleUse( quickbar_item.GetId() + 1 ); //id must begin with 1 (simulating key press 1-9)
704 }
705 }
706
707 RefreshQuickbar( false );
708 }
709 }
710 }
711 }
712
713 protected void SecondaryAction( Widget w )
714 {
715 if ( instance.m_SelectedItem && m_CurrentCategory == RadialQuickbarCategory.DEFAULT )
716 {
717 if ( !GetGame().IsDedicatedServer() )
718 {
719 RadialQuickbarItem quickbar_item;
720 instance.m_SelectedItem.GetUserData( quickbar_item );
721
722 if ( quickbar_item )
723 {
724 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
725 EntityAI item = quickbar_item.GetItem();
726
727 if ( item )
728 {
729 player.RadialQuickBarCombine( quickbar_item.GetId() + 1 ); //id must begin with 1 (simulating key press 1-9)
730 RefreshQuickbar( false );
731 }
732 }
733 }
734 }
735 }
736
737 // returns to default, missing hierarchy to properly traverse ATM
738 protected void BackOneLevel()
739 {
741 {
743 }
744 }
745
746 //-------------------------------------------
747 //NVG/Light handling extension
748 //-------------------------------------------
750 {
751 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
752 ItemBase item = ItemBase.Cast(quickbar_item.GetItem());
753 ActionManagerClient mngr_client = ActionManagerClient.Cast(player.GetActionManager());
754 ActionTarget atrg;
755
756 if ( Headtorch_ColorBase.Cast(item) )
757 {
758 atrg = new ActionTarget(item,null,-1,vector.Zero,-1.0);
759 if ( mngr_client.GetAction(ActionTurnOnHeadtorch).Can(player,atrg,null) )
760 {
761 mngr_client.PerformActionStart(player.GetActionManager().GetAction(ActionTurnOnHeadtorch),atrg,null);
762 }
763 else if ( mngr_client.GetAction(ActionTurnOffHeadtorch).Can(player,atrg,null) )
764 {
765 mngr_client.PerformActionStart(player.GetActionManager().GetAction(ActionTurnOffHeadtorch),atrg,null);
766 }
767 }
768 else if ( Mich2001Helmet.Cast(item.GetHierarchyParent()) )
769 {
770 atrg = new ActionTarget(item.GetHierarchyParent(),null,-1,vector.Zero,-1.0);
771 if ( mngr_client.GetAction(ActionTurnOnHelmetFlashlight).Can(player,atrg,null) )
772 {
773 mngr_client.PerformActionStart(player.GetActionManager().GetAction(ActionTurnOnHelmetFlashlight),atrg,null);
774 }
775 else if ( mngr_client.GetAction(ActionTurnOffHelmetFlashlight).Can(player,atrg,null) )
776 {
777 mngr_client.PerformActionStart(player.GetActionManager().GetAction(ActionTurnOffHelmetFlashlight),atrg,null);
778 }
779 }
780 }
781
782 void HandleNVG(RadialQuickbarItem quickbar_item)
783 {
784 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
785 ActionManagerClient mngr_client = ActionManagerClient.Cast(player.GetActionManager());
786 ActionTarget atrg;
787
788 atrg = new ActionTarget(quickbar_item.GetItem().GetHierarchyParent(),null,-1,vector.Zero,-1.0);
789 if ( mngr_client.GetAction(ActionToggleNVG).Can(player,atrg,null) )
790 {
791 mngr_client.PerformActionStart(player.GetActionManager().GetAction(ActionToggleNVG),atrg,null);
792 }
793 }
794
796 {
797 return m_IsMenuClosing;
798 }
799
800 void SetMenuClosing(bool state)
801 {
802 m_IsMenuClosing = state;
803 }
804
805 protected void UpdateControlsElements()
806 {
807 Widget toolbarBackSpacer = layoutRoot.FindAnyWidget("BackSpacer");
808
809 RichTextWidget toolbarSelectIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("SelectIcon"));
810 RichTextWidget toolbarBackIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon"));
811
812 string selectAction;
813 string backAction;
814 int controllerID;
815
816 if (GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer() && GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.MOUSE_AND_KEYBOARD)
817 {
818 selectAction = "UAMenuSelect";
819 backAction = "UAMenuBack";
820 controllerID = EUAINPUT_DEVICE_KEYBOARDMOUSE;
821 }
822 else
823 {
824 selectAction = "UAUISelect";
825 backAction = "UAUIBack";
826 controllerID = EUAINPUT_DEVICE_CONTROLLER;
827 }
828
829 toolbarSelectIcon.SetText(InputUtils.GetRichtextButtonIconFromInputAction(selectAction, "", controllerID, InputUtils.ICON_SCALE_TOOLBAR));
830 toolbarBackIcon.SetText(InputUtils.GetRichtextButtonIconFromInputAction(backAction, "", controllerID, InputUtils.ICON_SCALE_TOOLBAR));
831 toolbarBackSpacer.Show(m_CurrentCategory != RadialQuickbarCategory.DEFAULT);
832 }
833
834 override void OnPlayerDeath()
835 {
836 super.OnPlayerDeath();
837
838 // Close inventory menu when this menu got closed by the character death event as player could be assigning a item to the quickbar
839 // in the moment he dies and the inventory menu is opened too.
840 MissionGameplay missionGameplay = MissionGameplay.Cast(g_Game.GetMission());
841 if (missionGameplay && missionGameplay.GetInventory())
842 {
843 missionGameplay.HideInventory();
844 }
845 }
846}
DetachActionData m_ItemName
ItemBase m_Item
Определения ActionInput.c:16
class ActionTargets ActionTarget
class ServerBrowserHelperFunctions m_Id
DayZGame g_Game
Определения DayZGame.c:3868
Mission mission
Определения DisplayStatus.c:28
@ DEFAULT
Определения ECrewMemberState.c:3
Widget m_RadialMenuSelector
Определения GesturesMenu.c:20
void SetRadialItemCard(Widget widget)
Определения GesturesMenu.c:90
Widget m_RadialMenuItemCard
Определения GesturesMenu.c:21
Widget GetRadialItemCard()
Определения GesturesMenu.c:85
Icon x
Icon y
void RefreshQuickbar()
Определения InventoryMenu.c:75
void UpdateControlsElements()
Определения ItemDropWarningMenu.c:206
PlayerBase GetPlayer()
Определения ModifierBase.c:51
RadialMenuControlType
Определения RadialMenu.c:2
void RadialMenu()
Определения RadialMenu.c:84
RadialQuickbarCategory
Определения RadialQuickbarMenu.c:2
@ SPECIALIZED_LIGHTS
Определения RadialQuickbarMenu.c:4
bool IsNVGExtra()
Определения RadialQuickbarMenu.c:52
string GetItemName()
Определения RadialQuickbarMenu.c:82
bool IsLightSourceExtra()
Определения RadialQuickbarMenu.c:47
enum RadialQuickbarCategory m_IsLightSourceExtra
void RadialQuickbarItem(int id, EntityAI item, string item_name, int category=RadialQuickbarCategory.DEFAULT, int category_switch=-1)
Определения RadialQuickbarMenu.c:21
void SetItem(EntityAI item)
Определения RadialQuickbarMenu.c:42
int GetItemCategory()
Определения RadialQuickbarMenu.c:62
int m_CategorySwitchID
Определения RadialQuickbarMenu.c:13
EntityAI GetItem()
Определения RadialQuickbarMenu.c:37
int GetCategorySwitchID()
Определения RadialQuickbarMenu.c:67
int GetId()
Определения RadialQuickbarMenu.c:57
bool m_IsNVG
Определения RadialQuickbarMenu.c:10
void PerformActionStart(ActionBase action, ActionTarget target, ItemBase item, Param extra_data=NULL)
Определения ActionManagerClient.c:762
Определения ActionToggleNVG.c:2
proto native UIManager GetUIManager()
proto native WorkspaceWidget GetWorkspace()
proto native Mission GetMission()
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения Building.c:6
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Определения InputUtils.c:167
static const float ICON_SCALE_TOOLBAR
Определения InputUtils.c:15
Определения InputUtils.c:2
Определения InventoryItem.c:731
proto native void SetView(int viewIndex)
proto native void SetItem(EntityAI object)
proto native void SetModelOrientation(vector vOrientation)
Определения gameplay.c:277
Определения EnMath.c:7
ScriptInvoker GetOnInputPresetChanged()
Определения gameplay.c:859
void RemoveActiveInputExcludes(array< string > excludes, bool bForceSupress=false)
deprecated
Mission class.
Определения gameplay.c:687
Определения PlayerBaseClient.c:2
static float GetItemQuantity(InventoryItem item)
Определения QuantityConversions.c:72
static int HasItemQuantity(notnull EntityAI item)
Определения QuantityConversions.c:143
static string GetItemQuantityText(EntityAI item, bool showMax=false)
Определения QuantityConversions.c:3
Определения gameplay.c:317
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
Определения EnWidgets.c:220
proto native UIScriptedMenu EnterScriptedMenu(int id, UIMenuPanel parent)
Create & open menu with specific id (see MenuID) and set its parent.
bool Back()
Close top window on windows stack, returns true when any window is closed.
Определения UIManager.c:62
void CreateContent(int selected_item_id=-1)
Определения RadialQuickbarMenu.c:367
override bool OnMouseEnter(Widget w, int x, int y)
Определения RadialQuickbarMenu.c:241
override void OnShow()
Определения RadialQuickbarMenu.c:195
void UpdateQuickbarItemCard(GestureMenuItem gesture_item)
Определения GesturesMenu.c:437
bool m_IsMenuClosing
Определения GesturesMenu.c:122
static EntityAI m_ItemToAssign
Определения RadialQuickbarMenu.c:101
const string TEXT_ITEM_TITLE
Определения RadialQuickbarMenu.c:98
void UpdateQuickbarItemCard(RadialQuickbarItem quickbar_item)
Определения RadialQuickbarMenu.c:414
static void CloseMenu()
Определения RadialQuickbarMenu.c:160
void BackOneLevel()
Определения GesturesMenu.c:663
void RadialQuickbarMenu()
Определения RadialQuickbarMenu.c:109
override bool UseMouse()
Определения RadialQuickbarMenu.c:250
const string TEXT_ITEM_NAME
Определения RadialQuickbarMenu.c:97
void MarkSelected(Widget w)
Определения GesturesMenu.c:569
static void SetItemToAssign(EntityAI item)
Определения RadialQuickbarMenu.c:130
void OnControllerPressSelect(Widget w)
Определения RadialQuickbarMenu.c:572
void CheckForLightsAndNVG(out array< ref RadialQuickbarItem > items, int last_idx)
Определения RadialQuickbarMenu.c:303
ref array< ref RadialQuickbarItem > m_Items
Определения RadialQuickbarMenu.c:91
void RefreshQuickbar(bool reset_selection=true)
Определения RadialQuickbarMenu.c:264
override void OnHide()
Определения RadialQuickbarMenu.c:213
int m_CurrentCategory
Определения GesturesMenu.c:123
void OnControlsChanged(RadialMenuControlType type)
Определения RadialQuickbarMenu.c:530
void OnMousePressRight(Widget w)
RMB.
Определения RadialQuickbarMenu.c:556
void OnMouseExecute(Widget w)
Определения RadialQuickbarMenu.c:545
void ~RadialQuickbarMenu()
Определения RadialQuickbarMenu.c:122
void OnControllerDeselect(Widget w)
Определения RadialQuickbarMenu.c:567
override bool UseGamepad()
Определения RadialQuickbarMenu.c:255
void UnmarkSelected(Widget w)
Определения GesturesMenu.c:590
void OnControllerSelect(Widget w)
Определения RadialQuickbarMenu.c:562
static RadialQuickbarMenu GetMenuInstance()
Определения RadialQuickbarMenu.c:140
void DeleteItems()
Определения RadialQuickbarMenu.c:504
void UpdateControlsElements()
Определения RadialQuickbarMenu.c:805
void GetItems(out array< ref RadialQuickbarItem > items)
Определения RadialQuickbarMenu.c:285
void HandleLights(RadialQuickbarItem quickbar_item)
Определения RadialQuickbarMenu.c:749
static GesturesMenu instance
Определения GesturesMenu.c:126
void PrimaryAction(Widget w)
Определения RadialQuickbarMenu.c:653
void HandleNVG(RadialQuickbarItem quickbar_item)
Определения RadialQuickbarMenu.c:782
void OnMouseDeselect(Widget w)
Определения RadialQuickbarMenu.c:540
Widget m_SelectedItem
Определения GesturesMenu.c:120
void OnControllerPressBack(Widget w)
Определения RadialQuickbarMenu.c:577
override Widget Init()
Определения RadialQuickbarMenu.c:169
Widget m_ItemCardPanel
Определения RadialQuickbarMenu.c:90
override bool OnController(Widget w, int control, int value)
Определения RadialQuickbarMenu.c:232
void SetMenuClosing(bool state)
Определения RadialQuickbarMenu.c:800
void OnMousePressLeft(Widget w)
LMB.
Определения RadialQuickbarMenu.c:550
void OnMouseSelect(Widget w)
Определения RadialQuickbarMenu.c:535
bool IsMenuClosing()
Определения RadialQuickbarMenu.c:795
override void OnPlayerDeath()
Определения RadialQuickbarMenu.c:834
static void OpenMenu(UIScriptedMenu parent=NULL)
Определения RadialQuickbarMenu.c:155
Widget m_ToolbarPanel
Определения GesturesMenu.c:110
static EntityAI GetItemToAssign()
Определения RadialQuickbarMenu.c:135
void OnInputPresetChanged()
Определения ControlsXboxNew.c:63
void ChangeCurrentCategory(int category)
Определения RadialQuickbarMenu.c:519
void SecondaryAction(Widget w)
Определения RadialQuickbarMenu.c:713
Определения DayZGame.c:64
Определения EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static const vector Zero
Определения EnConvert.c:110
Определения EnConvert.c:106
proto native CGame GetGame()
const int QUANTITY_PROGRESS
Определения constants.c:516
const int QUANTITY_COUNT
Определения constants.c:515
const int QUANTITY_HIDDEN
Определения constants.c:514
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
string m_Category
folder structure eg. StaticEntities/Walls
Определения EnEntity.c:844
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Round(float f)
Returns mathematical round of value.
const int MENU_RADIAL_QUICKBAR
Определения constants.c:198
WidgetFlags
Определения EnWidgets.c:58
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
proto native void SetFocus(Widget w)
EInputDeviceType
Определения input.c:3