DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
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
21
27
29 protected ImageWidget m_GhostSlot;
30
34
37 protected ProgressBarWidget m_QuantityProgress;
39
40 protected string m_SlotDisplayName;
41 protected string m_SlotDesc;
42
45
46 protected Widget m_AmmoIcon;
47
51
52 protected bool m_Reserved;
53
54 void SlotsIcon( LayoutHolder parent, Widget root, int index, EntityAI slot_parent )
55 {
56 m_MainWidget = root;
57
58 m_PanelWidget = m_MainWidget.FindAnyWidget( "PanelWidget" + index );
59
60 m_CursorWidget = m_MainWidget.FindAnyWidget( "Cursor" + index );
61 m_ColWidget = m_MainWidget.FindAnyWidget( "Col" + index );
62 m_MountedWidget = m_MainWidget.FindAnyWidget( "Mounted" + index );
63 m_OutOfReachWidget = m_MainWidget.FindAnyWidget( "OutOfReach" + index );
64
65 m_ItemPreview = ItemPreviewWidget.Cast( m_MainWidget.FindAnyWidget( "Render" + index ) );
68
69 m_GhostSlot = ImageWidget.Cast( m_MainWidget.FindAnyWidget( "GhostSlot" + index ) );
70
71 m_ColorWidget = m_MainWidget.FindAnyWidget( "Color" + index );
72 m_SelectedPanel = m_MainWidget.FindAnyWidget( "Selected" + index );
73 m_EmptySelectedPanel = m_MainWidget.FindAnyWidget( "EmptySelected" + index );
74
75 m_QuantityPanel = m_MainWidget.FindAnyWidget( "QuantityPanel" + index );
76 m_QuantityItem = TextWidget.Cast( m_MainWidget.FindAnyWidget( "Quantity" + index ) );
77 m_QuantityProgress = ProgressBarWidget.Cast( m_MainWidget.FindAnyWidget( "QuantityBar" + index ) );
78 m_QuantityStack = m_MainWidget.FindAnyWidget( "QuantityStackPanel" + index );
79
80 m_ItemSizePanel = m_MainWidget.FindAnyWidget( "ItemSizePanel" + index );
81 m_ItemSizeWidget = TextWidget.Cast( m_MainWidget.FindAnyWidget( "ItemSize" + index ) );
82
83 m_AmmoIcon = m_MainWidget.FindAnyWidget( "AmmoIcon" + index );
84
85 m_RadialIconPanel = m_MainWidget.FindAnyWidget( "RadialIconPanel" + index );
86 m_RadialIconClosed = m_MainWidget.FindAnyWidget( "RadialIconClosed" + index );
87 m_RadialIcon = m_MainWidget.FindAnyWidget( "RadialIcon" + index );
88
89 m_ReservedWidget = Widget.Cast( GetGame().GetWorkspace().CreateWidgets( "gui/layouts/inventory_new/reserved_icon.layout", m_MainWidget ) );
90 m_ReservedWidget.Show(false);
91
94
95 WidgetEventHandler.GetInstance().RegisterOnMouseEnter( m_GhostSlot, this, "MouseEnterGhostSlot" );
96 WidgetEventHandler.GetInstance().RegisterOnMouseLeave( m_GhostSlot, this, "MouseLeaveGhostSlot" );
97
100
103
104 //WidgetEventHandler.GetInstance().RegisterOnMouseEnter( m_ReservedWidget, this, "MouseEnter" );
105 //WidgetEventHandler.GetInstance().RegisterOnMouseLeave( m_ReservedWidget, this, "MouseLeave" );
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_QuantityPanel;
258 }
259
261 {
262 return m_OutOfReachWidget;
263 }
264
266 {
267 return m_QuantityItem;
268 }
269
270 ProgressBarWidget GetQuantityProgress()
271 {
272 return m_QuantityProgress;
273 }
274
276 {
277 return m_QuantityStack;
278 }
279
281 {
282 return m_ItemSizePanel;
283 }
284
286 {
287 return m_ItemSizeWidget;
288 }
289
291 {
292 return m_AmmoIcon;
293 }
294
296 {
297 return m_RadialIconPanel;
298 }
299
301 {
302 return m_RadialIconClosed;
303 }
304
306 {
307 return m_RadialIcon;
308 }
309
310 override void SetActive( bool active )
311 {
312 super.SetActive( active );
313 float x, y;
314 if( active && GetObject() )
315 {
316 GetMainWidget().GetScreenPos( x, y );
317 PrepareOwnedTooltip( EntityAI.Cast( GetObject() ), x, y );
318 }
319 else if (active)
320 {
321 GetMainWidget().GetScreenPos( x, y );
322 PrepareOwnedSlotsTooltip( GetMainWidget(), m_SlotDisplayName, m_SlotDesc, x, y );
323 }
324
325 m_SelectedPanel.Show( active );
326 }
327
328 override void SetLayoutName()
329 {
330 m_LayoutName = "";
331 }
332
333 override void Refresh()
334 {
335 if( m_HasTemperature )
337 if( m_IsWeapon )
339 if( m_HasQuantity )
340 SetQuantity();
341 }
342
344 {
345 ItemManager.GetInstance().SetIconTemperature( EntityAI.Cast( m_Obj ), m_MainWidget );
346 }
347
349 {
350 return m_Obj;
351 }
352
354 {
355 return EntityAI.Cast( m_Obj );
356 }
357
359 {
360 return m_Item;
361 }
362
364 {
365 Weapon_Base wpn = Weapon_Base.Cast( GetObject() );
366 if( wpn )
367 {
368 if( wpn.IsShowingChamberedBullet() )
369 {
370 int mi = wpn.GetCurrentMuzzle();
371 m_AmmoIcon.Show( wpn.IsChamberFull( mi ) );
372
373 }
374 else
375 {
376 m_AmmoIcon.Show( false );
377 }
378 }
379 }
380
382 {
383 if (m_Item)
384 {
385 int quantityType = QuantityConversions.HasItemQuantity(m_Item);
387 {
389
390 if (quantityType == QUANTITY_COUNT)
391 {
392 string q_text = QuantityConversions.GetItemQuantityText(m_Item, true);
393
394 if (QuantityConversions.GetItemQuantityMax(m_Item) == 1 || q_text == "")
395 {
396 m_QuantityStack.Show(false);
397 }
398 else
399 {
400 m_QuantityItem.SetText(q_text);
401 m_QuantityStack.Show(true);
402 }
403
404 m_QuantityProgress.Show(false);
405 }
406 else if (quantityType == QUANTITY_PROGRESS)
407 {
408 float progress_max = m_QuantityProgress.GetMax();
409 int max = m_Item.GetQuantityMax();
410 int count = m_Item.ConfigGetInt("count");
411 float quantity = m_CurrQuantity;
412
413 if (count > 0)
414 {
415 max = count;
416 }
417
418 if (max > 0)
419 {
420 float value = Math.Round((quantity / max) * 100);
421 m_QuantityProgress.SetCurrent(value);
422 }
423 m_QuantityStack.Show(false);
424 m_QuantityProgress.Show(true);
425 }
426 }
427 }
428 }
429
431 {
432 m_ItemPreview.Show( true );
435 m_ItemPreview.SetView( m_Obj.GetViewIndex() );
436 }
437
439 {
440 if( m_HasItemSize )
441 {
442 int size_x, size_y;
443 GetGame().GetInventoryItemSize( InventoryItem.Cast( m_Obj ), size_x, size_y );
444
445 m_ItemSizePanel.Show( true );
446 m_ItemSizeWidget.SetText( ( size_x * size_y ).ToString() );
447 }
448 }
449
450 void UpdateFlip( bool flipped )
451 {
452 if( !m_Reserved )
453 {
454 float x_content, y_content;
455 GetPanelWidget().GetScreenSize( x_content, y_content );
456 GetPanelWidget().SetSize( y_content, x_content );
457 }
458 }
459
460 void Init( EntityAI obj, bool reservation = false )
461 {
462 if( m_Obj != obj )
463 {
464 Clear();
465 m_Obj = obj;
466 m_Item = ItemBase.Cast( m_Obj );
467 m_Obj.GetOnItemFlipped().Insert( UpdateFlip );
468 m_Obj.GetOnViewIndexChanged().Insert( SetItemPreview );
469 m_Reserved = reservation;
470 m_Container = null;
471
472 if(reservation)
473 {
475
476 m_IsWeapon = false;
477 m_IsMagazine = false;
478 m_HasTemperature = false;
479 m_HasQuantity = false;
480 m_HasItemSize = false;
481 }
482 else
483 {
489 }
490
491 m_ReservedWidget.Show(reservation);
492
494
495 m_GhostSlot.Show( false );
496 m_PanelWidget.Show( true );
497
498 Refresh();
499 }
500 }
501
502 void Clear()
503 {
504 if (m_IsDragged)
505 {
509 }
510 if( m_Obj )
511 {
512 m_Obj.GetOnItemFlipped().Remove( UpdateFlip );
513 m_Obj.GetOnViewIndexChanged().Remove( SetItemPreview );
514 HideOwnedTooltip();
515 }
516
517 m_Obj = null;
518 m_Item = null;
519 m_Container = null;
520
521 m_ItemPreview.Show( false );
522 m_ItemPreview.SetItem( null );
523
524 m_CurrQuantity = -1;
525 m_IsWeapon = false;
526 m_IsMagazine = false;
527 m_HasTemperature = false;
528 m_HasQuantity = false;
529 m_HasItemSize = false;
530
531 m_GhostSlot.Show( true );
532 m_AmmoIcon.Show( false );
533 m_PanelWidget.Show( false );
534 m_RadialIconPanel.Show( false );
535
536 m_QuantityPanel.Show( false );
537 if(GetSlotID() != -1)
538 {
539 int stack_max = InventorySlots.GetStackMaxForSlotId( GetSlotID() );
540 if(stack_max > 1)
541 {
542 m_QuantityPanel.Show( true );
543 m_QuantityItem.SetText( string.Format("0/%1", stack_max.ToString()) );
544 m_QuantityStack.Show( true );
545 m_QuantityProgress.Show( false );
546 m_PanelWidget.Show( true );
547 m_ItemPreview.Show( true );
548 }
549 }
550
551 m_ColWidget.Show( false );
552 m_SelectedPanel.Show( false );
553 m_EmptySelectedPanel.Show( false );
554 m_MountedWidget.Show( false );
555 m_OutOfReachWidget.Show( false );
556 m_ReservedWidget.Show( false );
557
558 if( m_ItemSizePanel )
559 m_ItemSizePanel.Show( false );
560
561 if( m_ColorWidget )
562 m_ColorWidget.Show( false );
563
564 Refresh();
565 }
566
568 {
569 m_IsWeapon = ( Weapon_Base.Cast( m_Obj ) != null );
570 }
571
573 {
574 m_IsMagazine = ( Magazine.Cast( m_Obj ) != null );
575 }
576
578 {
579 if( m_Item )
580 {
581 m_HasTemperature = ( m_Item.GetTemperatureMax() != 0 && m_Item.GetTemperatureMin() != 0 );
582 }
583 }
584
586 {
587 if( m_Item )
588 {
590 if( m_HasQuantity )
591 {
592 m_QuantityPanel.Show( true );
593 }
594 }
595 }
596
598 {
599 #ifdef PLATFORM_CONSOLE
600 string config = "CfgVehicles " + m_Obj.GetType() + " GUIInventoryAttachmentsProps";
601 m_HasItemSize = ( InventoryItem.Cast( m_Obj ) && !GetGame().ConfigIsExisting( config ) );
602 #else
603 m_HasItemSize = false;
604 #endif
605 }
606
608 {
609 bool oot = ( m_OutOfReachWidget.IsVisible() || m_MountedWidget.IsVisible() );
610 return oot;
611 }
612
613 bool MouseEnter(Widget w, int x, int y)
614 {
615 if( m_Reserved )
616 return MouseEnterGhostSlot(w, x, y);
617
618 PrepareOwnedTooltip( m_Item, x, y );
620 {
621 m_SelectedPanel.Show( true );
622 }
623 return true;
624 }
625
626 bool MouseEnterGhostSlot(Widget w, int x, int y)
627 {
628 float pos_x, pos_y;
629 m_MainWidget.GetScreenPos(pos_x, pos_y);
630
631 x = pos_x;
632 y = pos_y;
633
634 PrepareOwnedSlotsTooltip( m_MainWidget, m_SlotDisplayName, m_SlotDesc, x, y );
636 {
637 m_EmptySelectedPanel.Show( true );
638 }
639
640
641 return true;
642 }
643
644 bool MouseLeave( Widget w, Widget s, int x, int y )
645 {
646 if( m_Reserved )
647 return MouseLeaveGhostSlot(w, s, x, y);
648
649 HideOwnedTooltip();
651 {
652 m_SelectedPanel.Show( false );
653 }
654 return true;
655 }
656
657 bool MouseLeaveGhostSlot( Widget w, Widget s, int x, int y )
658 {
659 HideOwnedSlotsTooltip();
660
662 {
663 m_EmptySelectedPanel.Show( false );
664 }
665
666 return true;
667 }
668
669 override void UpdateInterval()
670 {
671 if( m_Item )
672 {
673 if( m_HasTemperature )
675 if( m_IsWeapon )
677 if( m_HasQuantity )
678 SetQuantity();
679 if( m_HasItemSize )
680 SetItemSize();
681 }
682 }
683
685 {
686 if(!m_Obj || !w)
687 {
688 return;
689 }
691 if( m_Obj.GetHierarchyRootPlayer() == GetGame().GetPlayer() )
692 {
693 ItemManager.GetInstance().GetRightDropzone().SetAlpha( 1 );
694 }
695 else
696 {
697 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
698 }
699
701 int icon_x, icon_y;
702 float icon_size, y;
703 int m_sizeX, m_sizeY;
704
705 if( m_Item )
706 {
707 GetGame().GetInventoryItemSize( m_Item, icon_x, icon_y );
708
709 CargoContainer c_parent = CargoContainer.Cast( m_Parent );
710 HandsPreview h_parent = HandsPreview.Cast( m_Parent );
711
712 if( GetRoot().m_MainWidget.FindAnyWidget( "HandsPanel" ) )
713 {
714 GetRoot().m_MainWidget.FindAnyWidget( "HandsPanel" ).GetScreenSize( icon_size, y );
715 }
716
717 icon_size = icon_size / 10;
718
719 w.SetFlags( WidgetFlags.EXACTSIZE );
721
722 if( !m_Item.GetInventory().GetFlipCargo() )
723 {
724 w.SetSize( icon_x * icon_size , icon_y * icon_size );
725 }
726 else
727 {
728 w.SetSize( icon_y * icon_size , icon_x * icon_size );
729 }
730
731 m_ColWidget.Show( true );
732 m_SelectedPanel.Show( true );
733
735 }
736 m_IsDragged = true;
737 }
738
740 {
741 m_IsDragged = false;
744 w.ClearFlags( WidgetFlags.EXACTSIZE );
745 w.SetSize( 1, 1 );
746 m_ColWidget.Show( false );
747 m_SelectedPanel.Show( false );
748 m_EmptySelectedPanel.Show( false );
749 m_SelectedPanel.SetColor( ARGBF( 1, 1, 1, 1 ) );
751 }
752
753 static int GetNormalWidth()
754 {
755 return m_NormalWidth;
756 }
757
758 static int GetNormalHeight()
759 {
760 return m_NormalHeight;
761 }
762
763 /*override void HideOwnedSlotsTooltip()
764 {
765 if (m_TooltipOwner)
766 {
767 ItemManager.GetInstance().HideTooltipSlot();
768 m_TooltipOwner = false;
769 }
770 }*/
771}
proto string ToString()
Icon x
Icon y
PlayerBase GetPlayer()
protected Widget m_Parent
Definition SizeToChild.c:92
void SetActive()
Definition TrapBase.c:463
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
proto native bool ConfigIsExisting(string path)
provides access to slot configuration
static proto native int GetStackMaxForSlotId(int slot_Id)
Widget GetLeftDropzone()
void SetWidgetDraggable(Widget w, bool draggable)
void HideDropzones()
void SetDraggedItem(EntityAI dragged_item)
void SetIconTemperature(EntityAI item, Widget item_w)
Widget GetRightDropzone()
void SetIsDragging(bool is_dragging)
static ItemManager GetInstance()
proto native void SetView(int viewIndex)
proto native void SetForceFlip(bool value)
proto native void SetItem(EntityAI object)
proto native void SetForceFlipEnable(bool enable)
proto native void SetModelOrientation(vector vOrientation)
Definition EnMath.c:7
static float GetItemQuantityMax(InventoryItem item)
static string GetItemQuantityText(EntityAI item, bool showMax=false)
static int HasItemQuantity(notnull EntityAI item)
static float GetItemQuantity(InventoryItem item)
protected Widget m_RadialIconPanel
Definition SlotsIcon.c:48
string GetSlotDisplayName()
Definition SlotsIcon.c:154
Widget GetSelectedPanel()
Definition SlotsIcon.c:245
protected bool m_IsDragged
Definition SlotsIcon.c:18
string GetSlotDesc()
Definition SlotsIcon.c:164
Widget GetAmmoIcon()
Definition SlotsIcon.c:290
protected Widget m_ColWidget
Definition SlotsIcon.c:23
Widget GetRadialIconClosed()
Definition SlotsIcon.c:300
protected EntityAI m_SlotParent
Definition SlotsIcon.c:15
ItemBase GetItem()
Definition SlotsIcon.c:358
protected bool m_HasQuantity
Definition SlotsIcon.c:9
Widget GetEmptySelectedPanel()
Definition SlotsIcon.c:250
void CheckIsMagazine()
Definition SlotsIcon.c:572
protected bool m_IsWeapon
Definition SlotsIcon.c:6
Widget GetRadialIcon()
Definition SlotsIcon.c:305
void SetSlotDisplayName(string text)
Definition SlotsIcon.c:144
protected Container m_Container
Definition SlotsIcon.c:16
protected bool m_IsMagazine
Definition SlotsIcon.c:7
Widget GetColWidget()
Definition SlotsIcon.c:215
override void Refresh()
Definition SlotsIcon.c:333
Widget GetItemSizePanel()
Definition SlotsIcon.c:280
Widget GetRadialIconPanel()
Definition SlotsIcon.c:295
protected Widget m_SelectedPanel
Definition SlotsIcon.c:32
override void UpdateInterval()
Definition SlotsIcon.c:669
bool MouseLeave(Widget w, Widget s, int x, int y)
Definition SlotsIcon.c:644
void OnIconDrag(Widget w)
Definition SlotsIcon.c:684
bool MouseEnter(Widget w, int x, int y)
Definition SlotsIcon.c:613
EntityAI GetEntity()
Definition SlotsIcon.c:353
EntityAI GetSlotParent()
Definition SlotsIcon.c:185
protected ProgressBarWidget m_QuantityProgress
Definition SlotsIcon.c:37
protected Widget m_ReservedWidget
Definition SlotsIcon.c:26
Widget GetQuantityStack()
Definition SlotsIcon.c:275
protected Widget m_QuantityPanel
Definition SlotsIcon.c:35
void SlotsIcon(LayoutHolder parent, Widget root, int index, EntityAI slot_parent)
Definition SlotsIcon.c:54
int GetSlotID()
Definition SlotsIcon.c:190
static protected int m_NormalWidth
Definition SlotsIcon.c:3
Widget GetColorWidget()
Definition SlotsIcon.c:240
void SetItemPreview()
Definition SlotsIcon.c:430
void SetSlotDesc(string text)
Definition SlotsIcon.c:159
protected Widget m_ColorWidget
Definition SlotsIcon.c:31
TextWidget GetQuantityItem()
Definition SlotsIcon.c:265
void CheckIsWeapon()
Definition SlotsIcon.c:567
protected Widget m_PanelWidget
Definition SlotsIcon.c:20
ProgressBarWidget GetQuantityProgress()
Definition SlotsIcon.c:270
void CheckHasTemperature()
Definition SlotsIcon.c:577
protected ImageWidget m_GhostSlot
Definition SlotsIcon.c:29
ItemPreviewWidget GetRender()
Definition SlotsIcon.c:230
override void SetActive(bool active)
Definition SlotsIcon.c:310
protected bool m_HasItemSize
Definition SlotsIcon.c:10
void CheckHasItemSize()
Definition SlotsIcon.c:597
bool MouseLeaveGhostSlot(Widget w, Widget s, int x, int y)
Definition SlotsIcon.c:657
protected Widget m_ItemSizePanel
Definition SlotsIcon.c:43
protected Widget m_CursorWidget
Definition SlotsIcon.c:22
protected TextWidget m_QuantityItem
Definition SlotsIcon.c:36
Widget GetOutOfReachWidget()
Definition SlotsIcon.c:260
Widget GetReservedWidget()
Definition SlotsIcon.c:220
Widget GetQuantityPanel()
Definition SlotsIcon.c:255
static int GetNormalWidth()
Definition SlotsIcon.c:753
void ~SlotsIcon()
Definition SlotsIcon.c:169
protected bool m_Reserved
Definition SlotsIcon.c:52
protected Widget m_RadialIconClosed
Definition SlotsIcon.c:49
protected ItemPreviewWidget m_ItemPreview
Definition SlotsIcon.c:28
Widget GetMountedWidget()
Definition SlotsIcon.c:225
Container GetContainer()
Definition SlotsIcon.c:149
protected Widget m_EmptySelectedPanel
Definition SlotsIcon.c:33
void Clear()
Definition SlotsIcon.c:502
protected EntityAI m_Obj
Definition SlotsIcon.c:13
protected Widget m_AmmoIcon
Definition SlotsIcon.c:46
Object GetObject()
Definition SlotsIcon.c:348
protected bool m_HasTemperature
Definition SlotsIcon.c:8
void RefreshMuzzleIcon()
Definition SlotsIcon.c:363
protected TextWidget m_ItemSizeWidget
Definition SlotsIcon.c:44
void SetSlotParent(EntityAI parent)
Definition SlotsIcon.c:134
bool IsReserved()
Definition SlotsIcon.c:200
void SetItemSize()
Definition SlotsIcon.c:438
void CheckHasQuantity()
Definition SlotsIcon.c:585
void OnIconDrop(Widget w)
Definition SlotsIcon.c:739
static protected int m_NormalHeight
Definition SlotsIcon.c:4
protected Widget m_RadialIcon
Definition SlotsIcon.c:50
protected Widget m_QuantityStack
Definition SlotsIcon.c:38
void UpdateFlip(bool flipped)
Definition SlotsIcon.c:450
void SetQuantity()
Definition SlotsIcon.c:381
Widget GetPanelWidget()
Definition SlotsIcon.c:205
protected ItemBase m_Item
Definition SlotsIcon.c:14
ImageWidget GetGhostSlot()
Definition SlotsIcon.c:235
protected Widget m_OutOfReachWidget
Definition SlotsIcon.c:25
static int GetNormalHeight()
Definition SlotsIcon.c:758
protected float m_CurrQuantity
Definition SlotsIcon.c:11
protected string m_SlotDesc
Definition SlotsIcon.c:41
protected int m_SlotID
Definition SlotsIcon.c:17
void SetSlotID(int slot_ID)
Definition SlotsIcon.c:195
override void SetLayoutName()
Definition SlotsIcon.c:328
void Init(EntityAI obj, bool reservation=false)
Definition SlotsIcon.c:460
protected string m_SlotDisplayName
Definition SlotsIcon.c:40
void SetContainer(Container container)
Definition SlotsIcon.c:139
void SetTemperature()
Definition SlotsIcon.c:343
protected Widget m_MountedWidget
Definition SlotsIcon.c:24
override bool IsVisible()
Definition SlotsIcon.c:129
Widget GetCursorWidget()
Definition SlotsIcon.c:210
TextWidget GetItemSizeWidget()
Definition SlotsIcon.c:285
bool MouseEnterGhostSlot(Widget w, int x, int y)
Definition SlotsIcon.c:626
bool IsOutOfReach()
Definition SlotsIcon.c:607
override bool IsShowingChamberedBullet()
Definition Magnum.c:291
static WidgetEventHandler GetInstance()
void RegisterOnDrag(Widget w, Managed eventHandler, string functionName)
void RegisterOnDrop(Widget w, Managed eventHandler, string functionName)
void RegisterOnMouseEnter(Widget w, Managed eventHandler, string functionName)
void RegisterOnMouseLeave(Widget w, Managed eventHandler, string functionName)
proto native CGame GetGame()
const int QUANTITY_PROGRESS
Definition constants.c:468
const int QUANTITY_COUNT
Definition constants.c:467
const int QUANTITY_HIDDEN
Definition constants.c:466
static proto float Round(float f)
Returns mathematical round of value.
WidgetFlags
Definition EnWidgets.c:57
proto native Widget CancelWidgetDragging()
proto native Widget GetDragWidget()
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Definition proto.c:332