Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
slotsicon.c
Go to the documentation of this file.
2{
3 protected static int m_NormalWidth;
4 protected static int m_NormalHeight;
5
6 protected bool m_IsWeapon = false;
7 protected bool m_IsMagazine = false;
8 protected bool m_HasTemperature = false;
9 protected bool m_HasQuantity = false;
10 protected bool m_HasItemSize = false;
11 protected float m_CurrQuantity = -1;
12
13 protected EntityAI m_Obj;
14 protected ItemBase m_Item;
17 protected int m_SlotID;
18 protected bool m_IsDragged = false;
19
20 protected Widget m_PanelWidget;
21
22 protected Widget m_CursorWidget;
23 protected Widget m_ColWidget;
24 protected Widget m_MountedWidget;
25 protected Widget m_OutOfReachWidget;
26 protected Widget m_ReservedWidget;
27
29 protected ImageWidget m_GhostSlot;
30
31 protected Widget m_ColorWidget;
32 protected Widget m_SelectedPanel;
33 protected Widget m_EmptySelectedPanel;
34 protected Widget m_MicromanagedPanel;
35
36 protected Widget m_QuantityPanel;
37 protected TextWidget m_QuantityItem;
38 protected ProgressBarWidget m_QuantityProgress;
39 protected Widget m_QuantityStack;
40
41 protected string m_SlotDisplayName;
42 protected string m_SlotDesc;
43
44 protected Widget m_ItemSizePanel;
45 protected TextWidget m_ItemSizeWidget;
46
47 protected Widget m_RadialIconPanel;
48 protected Widget m_RadialIconClosed;
49 protected Widget m_RadialIcon;
50
51 protected bool m_Reserved;
52
53 protected ImageWidget m_AmmoIcon;
55
56 void SlotsIcon( LayoutHolder parent, Widget root, int index, EntityAI slot_parent )
57 {
58 m_MainWidget = root;
59
60 m_PanelWidget = m_MainWidget.FindAnyWidget( "PanelWidget" + index );
61
62 m_CursorWidget = m_MainWidget.FindAnyWidget( "Cursor" + index );
63 m_ColWidget = m_MainWidget.FindAnyWidget( "Col" + index );
64 m_MountedWidget = m_MainWidget.FindAnyWidget( "Mounted" + index );
65 m_OutOfReachWidget = m_MainWidget.FindAnyWidget( "OutOfReach" + index );
66
67 m_ItemPreview = ItemPreviewWidget.Cast( m_MainWidget.FindAnyWidget( "Render" + index ) );
68 m_ItemPreview.SetForceFlipEnable(true);
69 m_ItemPreview.SetForceFlip(false);
70
71 m_GhostSlot = ImageWidget.Cast( m_MainWidget.FindAnyWidget( "GhostSlot" + index ) );
72
73 m_ColorWidget = m_MainWidget.FindAnyWidget( "Color" + index );
74 m_SelectedPanel = m_MainWidget.FindAnyWidget( "Selected" + index );
75 m_EmptySelectedPanel = m_MainWidget.FindAnyWidget( "EmptySelected" + index );
76 m_MicromanagedPanel = m_MainWidget.FindAnyWidget( "Micromanaged" + index );
77
78 m_QuantityPanel = m_MainWidget.FindAnyWidget( "QuantityPanel" + index );
79 m_QuantityItem = TextWidget.Cast( m_MainWidget.FindAnyWidget( "Quantity" + index ) );
80 m_QuantityProgress = ProgressBarWidget.Cast( m_MainWidget.FindAnyWidget( "QuantityBar" + index ) );
81 m_QuantityStack = m_MainWidget.FindAnyWidget( "QuantityStackPanel" + index );
82
83 m_ItemSizePanel = m_MainWidget.FindAnyWidget( "ItemSizePanel" + index );
84 m_ItemSizeWidget = TextWidget.Cast( m_MainWidget.FindAnyWidget( "ItemSize" + index ) );
85
86 m_AmmoIcon = ImageWidget.Cast(m_MainWidget.FindAnyWidget( "AmmoIcon" + index ));
87
88 m_RadialIconPanel = m_MainWidget.FindAnyWidget( "RadialIconPanel" + index );
89 m_RadialIconClosed = m_MainWidget.FindAnyWidget( "RadialIconClosed" + index );
90 m_RadialIcon = m_MainWidget.FindAnyWidget( "RadialIcon" + index );
91
92 m_ReservedWidget = Widget.Cast( GetGame().GetWorkspace().CreateWidgets( "gui/layouts/inventory_new/reserved_icon.layout", m_MainWidget ) );
93 m_ReservedWidget.Show(false);
94
97
98 WidgetEventHandler.GetInstance().RegisterOnMouseEnter( m_GhostSlot, this, "MouseEnterGhostSlot" );
99 WidgetEventHandler.GetInstance().RegisterOnMouseLeave( m_GhostSlot, this, "MouseLeaveGhostSlot" );
100
103
106
107 m_Reserved = false;
108 m_SlotID = -1;
109 m_Item = null;
110 m_Obj = null;
111 m_Container = null;
112
113 m_SlotParent = slot_parent;
114
115 m_PanelWidget.SetUserData(this);
116 m_ItemPreview.SetUserData(this);
117 m_GhostSlot.SetUserData(this);
118 m_MainWidget.SetUserData(this);
119
120 float w,h;
121 root.GetSize(w,h);
122
123 m_NormalWidth = w;
124 m_NormalHeight = h;
125
126 SetActive( false );
127 }
128
129 override bool IsVisible()
130 {
131 return m_MainWidget.IsVisible();
132 }
133
135 {
136 m_SlotParent = parent;
137 }
138
139 void SetContainer( Container container )
140 {
141 m_Container = container;
142 }
143
144 void SetSlotDisplayName( string text )
145 {
146 m_SlotDisplayName = text;
147 }
148
150 {
151 return m_Container;
152 }
153
155 {
156 return m_SlotDisplayName;
157 }
158
159 void SetSlotDesc( string text )
160 {
161 m_SlotDesc = text;
162 }
163
164 string GetSlotDesc()
165 {
166 return m_SlotDesc;
167 }
168
170 {
171 if (m_IsDragged)
172 {
173 m_IsDragged = false;
176 }
177
178 if (m_Obj)
179 {
180 m_Obj.GetOnItemFlipped().Remove( UpdateFlip );
181 m_Obj.GetOnViewIndexChanged().Remove( SetItemPreview );
182 }
183 }
184
186 {
187 return m_SlotParent;
188 }
189
191 {
192 return m_SlotID;
193 }
194
195 void SetSlotID(int slot_ID)
196 {
197 m_SlotID = slot_ID;
198 }
199
201 {
202 return m_Reserved;
203 }
204
206 {
207 return m_PanelWidget;
208 }
209
211 {
212 return m_CursorWidget;
213 }
214
216 {
217 return m_ColWidget;
218 }
219
221 {
222 return m_ReservedWidget;
223 }
224
226 {
227 return m_MountedWidget;
228 }
229
231 {
232 return m_ItemPreview;
233 }
234
235 ImageWidget GetGhostSlot()
236 {
237 return m_GhostSlot;
238 }
239
241 {
242 return m_ColorWidget;
243 }
244
246 {
247 return m_SelectedPanel;
248 }
249
251 {
253 }
254
256 {
257 return m_MicromanagedPanel;
258 }
259
261 {
262 return m_QuantityPanel;
263 }
264
266 {
267 return m_OutOfReachWidget;
268 }
269
270 TextWidget GetQuantityItem()
271 {
272 return m_QuantityItem;
273 }
274
275 ProgressBarWidget GetQuantityProgress()
276 {
277 return m_QuantityProgress;
278 }
279
281 {
282 return m_QuantityStack;
283 }
284
286 {
287 return m_ItemSizePanel;
288 }
289
290 TextWidget GetItemSizeWidget()
291 {
292 return m_ItemSizeWidget;
293 }
294
295 ImageWidget GetAmmoIcon()
296 {
297 return m_AmmoIcon;
298 }
299
301 {
302 return m_RadialIconPanel;
303 }
304
306 {
307 return m_RadialIconClosed;
308 }
309
311 {
312 return m_RadialIcon;
313 }
314
316 {
317 return GetCursorWidget().IsVisible();
318 }
319
320 override void SetActive( bool active )
321 {
322#ifdef PLATFORM_CONSOLE
323 super.SetActive( active );
324 float x, y;
325 if( active && GetObject() )
326 {
327 GetMainWidget().GetScreenPos( x, y );
328 PrepareOwnedTooltip( EntityAI.Cast( GetObject() ), x, y );
329 }
330 else if (active)
331 {
332 GetMainWidget().GetScreenPos( x, y );
333 PrepareOwnedSlotsTooltip( GetMainWidget(), m_SlotDisplayName, m_SlotDesc, x, y );
334 }
335
336 m_SelectedPanel.Show( active );
337#endif
338 }
339
340 override void SetLayoutName()
341 {
342 m_LayoutName = "";
343 }
344
345 override void Refresh()
346 {
347 //if (m_HasTemperature)
349 if (m_IsWeapon)
351 if (m_HasQuantity)
352 SetQuantity();
353 }
354
359
361 {
362 return m_Obj;
363 }
364
366 {
367 return EntityAI.Cast( m_Obj );
368 }
369
371 {
372 return m_Item;
373 }
374
376 {
377 Weapon_Base wpn = Weapon_Base.Cast(GetObject());
378 if (wpn)
379 {
380 int i;
381 if (!wpn.IsShowingChamberedBullet())
382 {
383 for (i = 0; i < m_AmmoIcons.Count(); i++)
384 m_AmmoIcon = m_AmmoIcons.Get(i);
385 }
386 else
387 {
388 for (i = 0; i < wpn.GetMuzzleCount(); i++)
389 {
390 if (i > m_AmmoIcons.Count())
391 break;
392
393 m_AmmoIcon = m_AmmoIcons.Get(i);
394 if (wpn.IsChamberFull(i))
395 {
396 m_AmmoIcon.Show(true);
397 if (wpn.IsJammed())
398 {
399 m_AmmoIcon.Show(true);
400 m_AmmoIcon.SetImage(2);
401 }
402 else if (wpn.IsChamberFiredOut(i))
403 {
404 m_AmmoIcon.Show(true);
405 m_AmmoIcon.SetImage(1);
406 }
407 else
408 {
409 m_AmmoIcon.Show(true);
410 m_AmmoIcon.SetImage(0);
411 }
412 }
413 else
414 {
415 m_AmmoIcon.Show(false);
416 }
417 }
418 }
419 }
420 }
421
423 {
424 if (m_Item)
425 {
426 int quantityType = QuantityConversions.HasItemQuantity(m_Item);
427 if (quantityType != QUANTITY_HIDDEN && m_CurrQuantity != QuantityConversions.GetItemQuantity(m_Item))
428 {
429 m_CurrQuantity = QuantityConversions.GetItemQuantity(m_Item);
430
431 if (quantityType == QUANTITY_COUNT)
432 {
433 string q_text = QuantityConversions.GetItemQuantityText(m_Item, true);
434
435 if (QuantityConversions.GetItemQuantityMax(m_Item) == 1 || q_text == "")
436 {
437 m_QuantityStack.Show(false);
438 }
439 else
440 {
441 m_QuantityItem.SetText(q_text);
442 m_QuantityStack.Show(true);
443 }
444
445 m_QuantityProgress.Show(false);
446 }
447 else if (quantityType == QUANTITY_PROGRESS)
448 {
449 float progress_max = m_QuantityProgress.GetMax();
450 int max = m_Item.GetQuantityMax();
451 int count = m_Item.ConfigGetInt("count");
452 float quantity = m_CurrQuantity;
453
454 if (count > 0)
455 {
456 max = count;
457 }
458
459 if (max > 0)
460 {
461 float value = Math.Round((quantity / max) * 100);
462 m_QuantityProgress.SetCurrent(value);
463 }
464 m_QuantityStack.Show(false);
465 m_QuantityProgress.Show(true);
466 }
467 }
468 }
469 }
470
472 {
473 m_ItemPreview.Show( true );
474 m_ItemPreview.SetItem( EntityAI.Cast( m_Obj ) );
475 m_ItemPreview.SetModelOrientation( "0 0 0" );
476 m_ItemPreview.SetView( m_Obj.GetViewIndex() );
477 }
478
480 {
481 if( m_HasItemSize )
482 {
483 int size_x, size_y;
484 GetGame().GetInventoryItemSize( InventoryItem.Cast( m_Obj ), size_x, size_y );
485
486 m_ItemSizePanel.Show( true );
487 m_ItemSizeWidget.SetText( ( size_x * size_y ).ToString() );
488 }
489 }
490
491 void UpdateFlip( bool flipped )
492 {
493 if( !m_Reserved )
494 {
495 float x_content, y_content;
496 GetPanelWidget().GetScreenSize( x_content, y_content );
497 GetPanelWidget().SetSize( y_content, x_content );
498 }
499 }
500
501 void Init( EntityAI obj, bool reservation = false )
502 {
503 if( m_Obj != obj )
504 {
506 m_Obj = obj;
507 m_Item = ItemBase.Cast( m_Obj );
508 m_Obj.GetOnItemFlipped().Insert( UpdateFlip );
509 m_Obj.GetOnViewIndexChanged().Insert( SetItemPreview );
510 m_Reserved = reservation;
511 m_Container = null;
512
513 if(reservation)
514 {
516
517 m_IsWeapon = false;
518 m_IsMagazine = false;
519 m_HasTemperature = false;
520 m_HasQuantity = false;
521 m_HasItemSize = false;
522 }
523 else
524 {
530 }
531
532 m_ReservedWidget.Show(reservation);
533
535
536 m_GhostSlot.Show( false );
537 m_PanelWidget.Show( true );
538
539 Refresh();
540#ifdef PLATFORM_CONSOLE
541 if ( IsFocused() )
542 {
543 Inventory.GetInstance().UpdateConsoleToolbar();
544 }
545#endif
546 }
547 }
548
550 {
551 if (m_IsDragged)
552 {
554 Widget a = CancelWidgetDragging();
556 }
557 if (m_Obj)
558 {
559 m_Obj.GetOnItemFlipped().Remove( UpdateFlip );
560 m_Obj.GetOnViewIndexChanged().Remove( SetItemPreview );
561 HideOwnedTooltip();
562 }
563
564 m_Obj = null;
565 m_Item = null;
566 m_Container = null;
567
568 m_ItemPreview.Show( false );
569 m_ItemPreview.SetItem( null );
570
571 m_CurrQuantity = -1;
572 m_IsWeapon = false;
573 m_IsMagazine = false;
574 m_HasTemperature = false;
575 m_HasQuantity = false;
576 m_HasItemSize = false;
577
578 m_GhostSlot.Show( true );
579 m_AmmoIcon.Show( false );
580 m_PanelWidget.Show( false );
581 m_RadialIconPanel.Show( false );
582
583 m_QuantityPanel.Show( false );
584 if(GetSlotID() != -1)
585 {
586 int stack_max = InventorySlots.GetStackMaxForSlotId( GetSlotID() );
587 if(stack_max > 1)
588 {
589 m_QuantityPanel.Show( true );
590 m_QuantityItem.SetText( string.Format("0/%1", stack_max.ToString()) );
591 m_QuantityStack.Show( true );
592 m_QuantityProgress.Show( false );
593 m_PanelWidget.Show( true );
594 m_ItemPreview.Show( true );
595 }
596 }
597
598 m_ColWidget.Show( false );
599 m_MountedWidget.Show( false );
600 m_OutOfReachWidget.Show( false );
601 m_ReservedWidget.Show( false );
602
603 if( m_ItemSizePanel )
604 m_ItemSizePanel.Show( false );
605
606 if( m_ColorWidget )
607 m_ColorWidget.Show( false );
608
609 Refresh();
610 }
611
612 void Clear()
613 {
614 #ifdef PLATFORM_CONSOLE
615 m_SelectedPanel.Show(false);
616 #endif
617 m_CursorWidget.Show(false);
618 m_EmptySelectedPanel.Show(false);
619
621 }
622
624 {
625 Weapon_Base wpn = Weapon_Base.Cast(m_Obj);
626 if (wpn)
627 {
629 m_IsWeapon = true;
630 float posX = 0.0;
631 float width = 0.0, height = 0.0;
632 for (int i = 0; i < wpn.GetMuzzleCount(); i++)
633 {
634 if (i == 1)
635 {
636 m_AmmoIcons[0].GetSize(width,height);
637 }
638 posX += width;
639
640 m_AmmoIcon.SetPos(posX, 0.0, false);
641
642 AmmoData data = Magazine.GetAmmoData(wpn.GetChamberAmmoTypeName(i));
643 if (data)
644 {
645 CartridgeType cartridgeType = data.m_CartridgeType;
646 switch (cartridgeType)
647 {
648 case CartridgeType.Pistol:
649 {
650 m_AmmoIcon.LoadImageFile(0, "set:dayz_gui image:cartridge_pistol");
651 m_AmmoIcon.LoadImageFile(1, "set:dayz_gui image:shell_pistol");
652 m_AmmoIcon.LoadImageFile(2, "set:dayz_gui image:jam_pistol");
653 break;
654 }
655 case CartridgeType.Intermediate:
656 {
657 m_AmmoIcon.LoadImageFile(0, "set:dayz_gui image:cartridge_int");
658 m_AmmoIcon.LoadImageFile(1, "set:dayz_gui image:shell_int");
659 m_AmmoIcon.LoadImageFile(2, "set:dayz_gui image:jam_int");
660 break;
661 }
662 case CartridgeType.FullPower:
663 {
664 m_AmmoIcon.LoadImageFile(0, "set:dayz_gui image:cartridge_fp");
665 m_AmmoIcon.LoadImageFile(1, "set:dayz_gui image:shell_fp");
666 m_AmmoIcon.LoadImageFile(2, "set:dayz_gui image:jam_fp");
667 break;
668 }
669 case CartridgeType.Shell:
670 {
671 m_AmmoIcon.LoadImageFile(0, "set:dayz_gui image:cartridge_shell");
672 m_AmmoIcon.LoadImageFile(1, "set:dayz_gui image:shell_shell");
673 m_AmmoIcon.LoadImageFile(2, "set:dayz_gui image:jam_shell");
674 break;
675 }
676 //@note: Crossbows cant jam so we dont add a icon for the jam state
677 case CartridgeType.Arrow:
678 {
679 m_AmmoIcon.LoadImageFile(0, "set:dayz_gui image:arrow_int");
680 m_AmmoIcon.LoadImageFile(1, "set:dayz_gui image:arrow_int");
681 break;
682 }
683 }
684 }
685 m_AmmoIcons.Insert(m_AmmoIcon);
686 }
687 }
688 else
689 {
690 m_IsWeapon = false;
691 }
692 }
693
695 {
696 m_IsMagazine = ( Magazine.Cast( m_Obj ) != null );
697 }
698
700 {
701 if (m_Item)
702 {
703 m_HasTemperature = m_Item.CanHaveTemperature();
704 }
705 }
706
708 {
709 if( m_Item )
710 {
711 m_HasQuantity = ( QuantityConversions.HasItemQuantity( m_Item ) != QUANTITY_HIDDEN );
712 if( m_HasQuantity )
713 {
714 m_QuantityPanel.Show( true );
715 }
716 }
717 }
718
720 {
721 #ifdef PLATFORM_CONSOLE
722 string config = "CfgVehicles " + m_Obj.GetType() + " GUIInventoryAttachmentsProps";
723 m_HasItemSize = ( InventoryItem.Cast( m_Obj ) && !GetGame().ConfigIsExisting( config ) );
724 #else
725 m_HasItemSize = false;
726 #endif
727 }
728
730 {
731 bool oot = ( m_OutOfReachWidget.IsVisible() || m_MountedWidget.IsVisible() );
732 return oot;
733 }
734
735 bool MouseEnter(Widget w, int x, int y)
736 {
737 if( m_Reserved )
738 return MouseEnterGhostSlot(w, x, y);
739
740 PrepareOwnedTooltip( m_Item, x, y );
741 if( GetDragWidget() != m_PanelWidget && !IsOutOfReach() )
742 {
743 m_CursorWidget.Show( true );
744 }
745 return true;
746 }
747
748 bool MouseEnterGhostSlot(Widget w, int x, int y)
749 {
750 float pos_x, pos_y;
751 m_MainWidget.GetScreenPos(pos_x, pos_y);
752
753 x = pos_x;
754 y = pos_y;
755
756 PrepareOwnedSlotsTooltip( m_MainWidget, m_SlotDisplayName, m_SlotDesc, x, y );
757 if( GetDragWidget() != m_PanelWidget )
758 {
759 m_EmptySelectedPanel.Show( true );
760 }
761
762
763 return true;
764 }
765
766 bool MouseLeave( Widget w, Widget s, int x, int y )
767 {
768 if( m_Reserved )
769 return MouseLeaveGhostSlot(w, s, x, y);
770
771 HideOwnedTooltip();
772 if( GetDragWidget() != m_PanelWidget )
773 {
774 m_CursorWidget.Show( false );
775 }
776 return true;
777 }
778
779 bool MouseLeaveGhostSlot( Widget w, Widget s, int x, int y )
780 {
781 HideOwnedSlotsTooltip();
782
783 if( GetDragWidget() != m_PanelWidget )
784 {
785 m_EmptySelectedPanel.Show( false );
786 }
787
788 return true;
789 }
790
791 override void UpdateInterval()
792 {
793 if (m_Item)
794 {
797 if (m_IsWeapon)
799 if (m_HasQuantity)
800 SetQuantity();
801 if (m_HasItemSize)
802 SetItemSize();
803 }
804 }
805
806 void OnIconDrag( Widget w )
807 {
808 if(!m_Obj || !w)
809 {
810 return;
811 }
813 if( m_Obj.GetHierarchyRootPlayer() == GetGame().GetPlayer() )
814 {
815 ItemManager.GetInstance().GetRightDropzone().SetAlpha( 1 );
816 }
817 else
818 {
819 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
820 }
821
823 int icon_x, icon_y;
824 float icon_size, y;
825 int m_sizeX, m_sizeY;
826
827 if( m_Item )
828 {
829 GetGame().GetInventoryItemSize( m_Item, icon_x, icon_y );
830
831 CargoContainer c_parent = CargoContainer.Cast( m_Parent );
832 HandsPreview h_parent = HandsPreview.Cast( m_Parent );
833
834 if( GetRoot().m_MainWidget.FindAnyWidget( "HandsPanel" ) )
835 {
836 GetRoot().m_MainWidget.FindAnyWidget( "HandsPanel" ).GetScreenSize( icon_size, y );
837 }
838
839 icon_size = icon_size / 10;
840
841 w.SetFlags( WidgetFlags.EXACTSIZE );
842 m_ItemPreview.SetForceFlipEnable(false);
843
844 if( !m_Item.GetInventory().GetFlipCargo() )
845 {
846 w.SetSize( icon_x * icon_size , icon_y * icon_size );
847 }
848 else
849 {
850 w.SetSize( icon_y * icon_size , icon_x * icon_size );
851 }
852
853 m_ColWidget.Show( true );
854 m_CursorWidget.Show( true );
855
857 }
858 m_IsDragged = true;
859 }
860
861 void OnIconDrop( Widget w )
862 {
863 m_IsDragged = false;
866 w.ClearFlags( WidgetFlags.EXACTSIZE );
867 w.SetSize( 1, 1 );
868 m_ColWidget.Show( false );
869 m_CursorWidget.Show( false );
870 m_EmptySelectedPanel.Show( false );
871 m_CursorWidget.SetColor( ARGBF( 1, 1, 1, 1 ) );
872 m_ItemPreview.SetForceFlipEnable(true);
873 }
874
875 static int GetNormalWidth()
876 {
877 return m_NormalWidth;
878 }
879
880 static int GetNormalHeight()
881 {
882 return m_NormalHeight;
883 }
884
885 /*override void HideOwnedSlotsTooltip()
886 {
887 if (m_TooltipOwner)
888 {
889 ItemManager.GetInstance().HideTooltipSlot();
890 m_TooltipOwner = false;
891 }
892 }*/
893}
void Inventory(LayoutHolder parent)
Definition inventory.c:74
provides access to slot configuration
void SetTemperature(EntityAI item, Widget item_w)
Widget GetLeftDropzone()
void SetDraggedItem(EntityAI dragged_item)
Widget GetRightDropzone()
void HideDropzones()
void SetWidgetDraggable(Widget w, bool draggable)
void SetIsDragging(bool is_dragging)
static ItemManager GetInstance()
Definition enmath.c:7
Object GetObject()
Definition slotsicon.c:360
Widget m_OutOfReachWidget
Definition slotsicon.c:25
Widget m_ColWidget
Definition slotsicon.c:23
ref array< ImageWidget > m_AmmoIcons
Definition slotsicon.c:54
bool MouseEnter(Widget w, int x, int y)
Definition slotsicon.c:735
void ClearRemainSelected()
Definition slotsicon.c:549
override void SetLayoutName()
Definition slotsicon.c:340
Widget GetSelectedPanel()
Definition slotsicon.c:245
override void Refresh()
Definition slotsicon.c:345
void UpdateFlip(bool flipped)
Definition slotsicon.c:491
static int m_NormalWidth
Definition slotsicon.c:3
Container GetContainer()
Definition slotsicon.c:149
Widget GetPanelWidget()
Definition slotsicon.c:205
ItemPreviewWidget GetRender()
Definition slotsicon.c:230
void SetItemSize()
Definition slotsicon.c:479
void OnIconDrag(Widget w)
Definition slotsicon.c:806
bool IsFocused()
Definition slotsicon.c:315
EntityAI GetEntity()
Definition slotsicon.c:365
Widget GetMicromanagedPanel()
Definition slotsicon.c:255
Widget GetRadialIconClosed()
Definition slotsicon.c:305
void Init(EntityAI obj, bool reservation=false)
Definition slotsicon.c:501
Widget m_CursorWidget
Definition slotsicon.c:22
Container m_Container
Definition slotsicon.c:16
ItemBase m_Item
Definition slotsicon.c:14
ImageWidget m_AmmoIcon
Definition slotsicon.c:53
void SetSlotID(int slot_ID)
Definition slotsicon.c:195
ImageWidget GetAmmoIcon()
Definition slotsicon.c:295
Widget GetReservedWidget()
Definition slotsicon.c:220
Widget GetQuantityPanel()
Definition slotsicon.c:260
string GetSlotDisplayName()
Definition slotsicon.c:154
bool MouseLeave(Widget w, Widget s, int x, int y)
Definition slotsicon.c:766
static int m_NormalHeight
Definition slotsicon.c:4
bool m_HasTemperature
Definition slotsicon.c:8
TextWidget m_ItemSizeWidget
Definition slotsicon.c:45
bool MouseLeaveGhostSlot(Widget w, Widget s, int x, int y)
Definition slotsicon.c:779
bool m_IsDragged
Definition slotsicon.c:18
ProgressBarWidget m_QuantityProgress
Definition slotsicon.c:38
void CheckIsMagazine()
Definition slotsicon.c:694
bool IsOutOfReach()
Definition slotsicon.c:729
void SetSlotDesc(string text)
Definition slotsicon.c:159
bool m_IsMagazine
Definition slotsicon.c:7
Widget m_MicromanagedPanel
Definition slotsicon.c:34
void CheckHasTemperature()
Definition slotsicon.c:699
Widget m_ReservedWidget
Definition slotsicon.c:26
Widget GetQuantityStack()
Definition slotsicon.c:280
Widget m_SelectedPanel
Definition slotsicon.c:32
TextWidget GetQuantityItem()
Definition slotsicon.c:270
Widget m_RadialIcon
Definition slotsicon.c:49
bool m_IsWeapon
Definition slotsicon.c:6
EntityAI GetSlotParent()
Definition slotsicon.c:185
string m_SlotDesc
Definition slotsicon.c:42
EntityAI m_SlotParent
Definition slotsicon.c:15
Widget GetItemSizePanel()
Definition slotsicon.c:285
void SetSlotDisplayName(string text)
Definition slotsicon.c:144
Widget GetColorWidget()
Definition slotsicon.c:240
Widget GetCursorWidget()
Definition slotsicon.c:210
void OnIconDrop(Widget w)
Definition slotsicon.c:861
ItemPreviewWidget m_ItemPreview
Definition slotsicon.c:28
void SlotsIcon(LayoutHolder parent, Widget root, int index, EntityAI slot_parent)
Definition slotsicon.c:56
void CheckHasItemSize()
Definition slotsicon.c:719
static int GetNormalWidth()
Definition slotsicon.c:875
Widget m_RadialIconPanel
Definition slotsicon.c:47
override bool IsVisible()
Definition slotsicon.c:129
static int GetNormalHeight()
Definition slotsicon.c:880
EntityAI m_Obj
Definition slotsicon.c:13
Widget m_QuantityPanel
Definition slotsicon.c:36
bool IsReserved()
Definition slotsicon.c:200
bool m_HasItemSize
Definition slotsicon.c:10
Widget m_RadialIconClosed
Definition slotsicon.c:48
ProgressBarWidget GetQuantityProgress()
Definition slotsicon.c:275
ImageWidget m_GhostSlot
Definition slotsicon.c:29
void SetTemperature()
Definition slotsicon.c:355
Widget GetEmptySelectedPanel()
Definition slotsicon.c:250
string m_SlotDisplayName
Definition slotsicon.c:41
Widget GetRadialIcon()
Definition slotsicon.c:310
void RefreshMuzzleIcon()
Definition slotsicon.c:375
void SetSlotParent(EntityAI parent)
Definition slotsicon.c:134
float m_CurrQuantity
Definition slotsicon.c:11
Widget m_QuantityStack
Definition slotsicon.c:39
void SetQuantity()
Definition slotsicon.c:422
int m_SlotID
Definition slotsicon.c:17
void SetContainer(Container container)
Definition slotsicon.c:139
Widget m_EmptySelectedPanel
Definition slotsicon.c:33
Widget GetColWidget()
Definition slotsicon.c:215
int GetSlotID()
Definition slotsicon.c:190
bool m_HasQuantity
Definition slotsicon.c:9
Widget m_MountedWidget
Definition slotsicon.c:24
TextWidget m_QuantityItem
Definition slotsicon.c:37
void Clear()
Definition slotsicon.c:612
void CheckIsWeapon()
Definition slotsicon.c:623
override void UpdateInterval()
Definition slotsicon.c:791
Widget GetMountedWidget()
Definition slotsicon.c:225
override void SetActive(bool active)
Definition slotsicon.c:320
Widget m_PanelWidget
Definition slotsicon.c:20
Widget GetOutOfReachWidget()
Definition slotsicon.c:265
ItemBase GetItem()
Definition slotsicon.c:370
void SetItemPreview()
Definition slotsicon.c:471
bool MouseEnterGhostSlot(Widget w, int x, int y)
Definition slotsicon.c:748
void ~SlotsIcon()
Definition slotsicon.c:169
string GetSlotDesc()
Definition slotsicon.c:164
Widget GetRadialIconPanel()
Definition slotsicon.c:300
Widget m_ColorWidget
Definition slotsicon.c:31
TextWidget GetItemSizeWidget()
Definition slotsicon.c:290
Widget m_ItemSizePanel
Definition slotsicon.c:44
void CheckHasQuantity()
Definition slotsicon.c:707
bool m_Reserved
Definition slotsicon.c:51
ImageWidget GetGhostSlot()
Definition slotsicon.c:235
void RegisterOnMouseLeave(Widget w, Managed eventHandler, string functionName)
void RegisterOnDrag(Widget w, Managed eventHandler, string functionName)
void RegisterOnDrop(Widget w, Managed eventHandler, string functionName)
static WidgetEventHandler GetInstance()
void RegisterOnMouseEnter(Widget w, Managed eventHandler, string functionName)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString()
proto native CGame GetGame()
const int QUANTITY_PROGRESS
Definition constants.c:518
const int QUANTITY_COUNT
Definition constants.c:517
const int QUANTITY_HIDDEN
Definition constants.c:516
WidgetFlags
Definition enwidgets.c:58
Icon x
Icon y
CartridgeType
Definition magazine.c:4
PlayerBase GetPlayer()
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Definition proto.c:332
Widget m_Parent
Definition sizetochild.c:92
void SetActive()
Definition trapbase.c:414