DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
VicinityContainer.c
Go to the documentation of this file.
2{
8 protected bool m_IsProcessing = false; // Prevents refreshing every time a child is added while it is still processing
9
10 const float DISTANCE_TO_ENTITIES = 1.0;
11 const float DISTANCE_TO_THE_REST = 0.5;
12
13 void VicinityContainer( LayoutHolder parent, int sort = -1 )
14 {
16 m_Body.Insert( m_VicinityIconsContainer );
17 m_VicinityIconsContainer.GetRootWidget().SetColor(166 << 24 | 120 << 16 | 120 << 8 | 120);
18 m_MainWidget = m_RootWidget.FindAnyWidget( "body" );
19 WidgetEventHandler.GetInstance().RegisterOnChildAdd( m_MainWidget, this, "OnChildAdd" );
20 WidgetEventHandler.GetInstance().RegisterOnChildRemove( m_MainWidget, this, "OnChildRemove" );
21
22 RecomputeOpenedContainers();
23 m_CollapsibleHeader.SetName("#container_vicinity");
25 }
26
28 {
29 return m_VicinityIconsContainer.IsActive();
30 }
31
33 {
35 }
36
38 {
39 return ( ContainerWithCargo.Cast( GetFocusedContainer() ) != null );
40 }
41
43 {
44 return ( ContainerWithCargoAndAttachments.Cast( GetFocusedContainer() ) != null );
45 }
46
48 {
49 return ( AttachmentCategoriesContainer.Cast( GetFocusedContainer() ) != null );
50 }
51
53 {
54 map<string, bool> serialized_types = new map<string, bool>();
55 for ( int i = 0; i < m_ShowedItems.Count(); i++ )
56 {
57 EntityAI entity = m_ShowedItems.GetKey( i );
58 Container container = m_ShowedItems.GetElement( i );
59 string type = entity.GetType();
60 if ( container.IsInherited( ContainerWithCargo ) )
61 {
62 if ( !serialized_types.Contains( type ) )
63 {
64 ContainerWithCargo item_with_cargo = ContainerWithCargo.Cast( container );
65 serialized_types.Insert( type, item_with_cargo.IsOpened() );
66 }
67 }
68 }
69
70 if ( serialized_types.Count() > 0 )
71 {
72 FileSerializer file = new FileSerializer();
73 if ( file.Open( "inventory_state.save", FileMode.APPEND ) )
74 {
75 file.Write( serialized_types.Count() );
76
77 for ( i = 0; i < serialized_types.Count(); i++ )
78 {
79 file.Write( serialized_types.GetKey( i ) );
80 file.Write( serialized_types.GetElement( i ) );
81 }
82 }
83 file.Close();
84 }
85 }
86
87 override void DraggingOverHeader( Widget w, int x, int y, Widget receiver )
88 {
89 if ( w == null )
90 {
91 return;
92 }
93
94 ItemPreviewWidget ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
95 if ( !ipw )
96 {
97 string name = w.GetName();
98 name.Replace( "PanelWidget", "Render" );
99 ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( name ) );
100 }
101
102 if ( !ipw && ItemPreviewWidget.Cast( w ) )
103 {
104 ipw = ItemPreviewWidget.Cast( w );
105 }
106
107 if ( !ipw || !ipw.GetItem() )
108 {
109 return;
110 }
111
112 if ( ipw.GetItem() && GetGame().GetPlayer().CanDropEntity( ipw.GetItem() ) && ipw.GetItem().GetInventory().CanRemoveEntity() && m_ShowedItemIcons.Find( ipw.GetItem() ) == -1 )
113 {
116 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
117 }
118 else
119 {
122 }
123 }
124
125 void DraggingOverIcon( Widget w, int x, int y, Widget receiver )
126 {
127 string name = receiver.GetName();
128 name.Replace("PanelWidget", "Render");
129 ItemPreviewWidget receiver_iw = ItemPreviewWidget.Cast( receiver.FindAnyWidget(name) );
130 EntityAI receiver_item = receiver_iw.GetItem();
131
132 ItemPreviewWidget ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
133 if ( !ipw )
134 {
135 name = w.GetName();
136 name.Replace( "PanelWidget", "Render" );
137 ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( name ) );
138 }
139
140 if ( !ipw && ItemPreviewWidget.Cast( w ) )
141 {
142 ipw = ItemPreviewWidget.Cast( w );
143 }
144
145 if (!ipw)
146 {
147 return;
148 }
149
150 if ( !ItemBase.Cast( receiver_item ) || !ipw.GetItem() )
151 {
152 return;
153 }
154
155 if ( ipw.GetItem().GetInventory().CanRemoveEntity() || m_ShowedItemIcons.Find( ipw.GetItem() ) > -1 )
156 {
157 if ( ( ItemBase.Cast( receiver_item ) ).CanBeCombined( ItemBase.Cast( ipw.GetItem() ) ) )
158 {
161 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
162 return;
163 }
164 else if ( GameInventory.CanSwapEntitiesEx( receiver_item, ipw.GetItem() ) )
165 {
168 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
169 return;
170 }
171 /*else if( GetGame().GetPlayer().CanDropEntity( ipw.GetItem() ) )
172 {
173 ColorManager.GetInstance().SetColor( w, ColorManager.GREEN_COLOR );
174 ItemManager.GetInstance().HideDropzones();
175 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
176 return;
177 }*/
178 }
179
182 }
183
184 void OnDropReceivedFromIcon( Widget w, int x, int y, Widget receiver )
185 {
186 string name = receiver.GetName();
187 name.Replace("PanelWidget", "Render");
188 ItemPreviewWidget receiver_iw = ItemPreviewWidget.Cast( receiver.FindAnyWidget(name) );
189 EntityAI receiver_item = receiver_iw.GetItem();
190
191 ItemPreviewWidget ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
192 if ( !ipw )
193 {
194 name = w.GetName();
195 name.Replace( "PanelWidget", "Render" );
196 ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( name ) );
197 }
198
199 if ( !ItemBase.Cast( receiver_item ) || !ipw.GetItem() )
200 {
201 return;
202 }
203
204 EntityAI item = ipw.GetItem();
205 bool equal_typed = item.GetType() == receiver_item.GetType();
206 if ( !receiver_item.IsInherited( ItemBase ) || item == null )
207 {
208 return;
209 }
210
211 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
212
213 if ( !item.GetInventory().CanRemoveEntity() )
214 return;
215
216 if ( ( ItemBase.Cast( receiver_item ) ).CanBeCombined( ItemBase.Cast( item ) ) )
217 {
218 ( ItemBase.Cast( receiver_item ) ).CombineItemsClient( ItemBase.Cast( item ) );
219 }
220 else if( GameInventory.CanSwapEntitiesEx( receiver_item, item ) )
221 {
224 receiver_item.GetInventory().GetCurrentInventoryLocation( il1 );
225 item.GetInventory().GetCurrentInventoryLocation( il2 );
226
227 if( !receiver_item.GetInventory().CanRemoveEntity() || ( il1.GetType() == InventoryLocationType.GROUND && il2.GetType() == InventoryLocationType.GROUND ) )
228 return;
229 player.PredictiveSwapEntities( item, receiver_item );
230 }
231
234 PrepareOwnedTooltip(item);
235
236 InventoryMenu menu = InventoryMenu.Cast( GetGame().GetUIManager().FindMenu( MENU_INVENTORY ) );
237 if ( menu )
238 {
239 menu.RefreshQuickbar();
240 }
241 }
242
243 void OnLeftPanelDropReceived( Widget w, int x, int y, Widget receiver )
244 {
245 OnDropReceivedFromHeader( w, x, y, receiver );
246 }
247
248 void OnDropReceivedFromEmptySpace( Widget w, int x, int y, Widget receiver )
249 {
250 OnDropReceivedFromHeader( w, x, y, receiver );
251 }
252
253 override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
254 {
255 if (!w)
256 return;
257
260
261 ItemPreviewWidget ipw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
262
263 if (!ipw)
264 {
265 string name = w.GetName();
266 name.Replace("PanelWidget", "Render");
267 ipw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
268 }
269
270 if (!ipw)
271 {
272 ipw = ItemPreviewWidget.Cast(w);
273 if (!ipw)
274 return;
275 }
276
277 EntityAI item = ipw.GetItem();
278 if (!ipw.IsInherited(ItemPreviewWidget) || !item)
279 return;
280
281 if (!item.GetInventory().CanRemoveEntity() || m_ShowedItemIcons.Find(item) > -1)
282 return;
283
284 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
285 if (player.CanDropEntity(item))
286 {
287 ItemBase itemBase = ItemBase.Cast(item);
288 if (itemBase)
289 {
290 if (itemBase.GetTargetQuantityMax() < itemBase.GetQuantity())
291 itemBase.SplitIntoStackMaxClient(null, -1);
292 else
293 player.PhysicalPredictiveDropItem(itemBase);
294 }
295 }
296
297 InventoryMenu menu = InventoryMenu.Cast( GetGame().GetUIManager().FindMenu( MENU_INVENTORY ) );
298 if ( menu )
299 {
300 menu.RefreshQuickbar();
301 }
302 }
303
304 override void UpdateInterval()
305 {
306 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
307
308 if (!player)
309 return;
310
311 super.UpdateInterval();
312
313 EntityAI eai;
314 vector pos = player.GetPosition();
315 ref array<EntityAI> objects;
316
317 VicinityItemManager.GetInstance().Update( player.GetDeltaT() );
319
320 //GetItemsShowableInInventory
321 array<EntityAI> showable_items = new array<EntityAI>;
322 int m_OldShowedItemIconsCount = m_ShowedItemIcons.Count();
323 m_ShowedItemIcons.Clear();
324
325 GameInventory game_inventory = player.GetInventory();
326 for ( int i = 0; i < objects.Count(); i++ )
327 {
328 eai = objects.Get( i );
329 if ( eai == null || game_inventory.IsPlaceholderEntity( eai ) )
330 continue; // noproxy: ignore body placeholder
331
332 BaseBuildingBase base_building = BaseBuildingBase.Cast(eai);
333 if (base_building && !base_building.IsPlayerInside(player,""))
334 continue;
335
336 if ( eai.IsInventoryVisible() )
337 {
338 showable_items.Insert( eai );
339
340 if ( !eai.IsInherited( DayZInfected ) && !eai.IsInherited( PlayerBase ) && !eai.IsInherited( AnimalBase ) && !eai.DisableVicinityIcon() )
341 {
342 m_ShowedItemIcons.Insert( eai );
343 }
344 }
345 }
346
347
348 //MW HOTFIX - old containers must be removed before new one are added (part of initialize are refreshed whole structure - need proper fix to avoid it)
349 ref map<EntityAI, ref Container> new_showed_items = new ref map<EntityAI, ref Container>;
350 Container con;
351
352 for ( i = 0; i < showable_items.Count(); i++ )
353 {
354 new_showed_items.Insert(showable_items[i],null);
355 }
356
357
358 bool need_update_focus = false;
359 for ( i = 0; i < m_ShowedItems.Count(); i++ )
360 {
361 EntityAI ent = m_ShowedItems.GetKey( i );
362 m_ShowedItems.GetElement( i ).UpdateInterval();
363 con = m_ShowedItems.GetElement( i );
364 if ( !new_showed_items.Contains( ent ) )
365 {
366 GetMainWidget().Update();
367 if ( con.IsActive() )
368 need_update_focus = true;
369 Container.Cast( GetParent() ).Remove( con );
370 Remove( con );
371 }
372 else
373 {
374 UpdateHeader(ent,con,player); //squeezed here, the map is iterated over enough already..
375 }
376 }
378
379
380 //ref map<EntityAI, ref Container> new_showed_items = new ref map<EntityAI, ref Container>;
381 new_showed_items.Clear();
382 ref map<int, ref Container> showed_items_IDs = new ref map<int, ref Container>;
383 for ( i = 0; i < showable_items.Count(); i++ )
384 {
385 EntityAI entity = showable_items.Get( i );
386 if ( entity )
387 {
388 if ( game_inventory && !m_ShowedItems.Contains( entity ) )
389 {
390 string config = "CfgVehicles " + entity.GetType() + " GUIInventoryAttachmentsProps";
391
392 if ( GetGame().ConfigIsExisting( config ) )
393 {
395 ac.SetEntity( entity );
396 new_showed_items.Insert( entity, ac );
397 showed_items_IDs.Insert( entity.GetID(), ac);
398 }
399 else if ( entity.GetSlotsCountCorrect() > 0 && entity.GetInventory().GetCargo() )
400 {
401 if ( entity.IsInherited( DayZInfected ) )
402 {
403 if ( entity.IsAlive() )
404 {
405 continue;
406 }
407 ZombieContainer zmb_cnt = new ZombieContainer( m_Parent, -1 );
408 zmb_cnt.SetEntity( entity );
409 new_showed_items.Insert( entity, zmb_cnt );
410 showed_items_IDs.Insert( entity.GetID(), zmb_cnt );
411 Container.Cast( GetParent() ).Insert( zmb_cnt );
412 }
413 else
414 {
415 ContainerWithCargoAndAttachments iwca = new ContainerWithCargoAndAttachments( this, -1 );
416 iwca.SetEntity( entity, false );
417 new_showed_items.Insert( entity, iwca );
418 showed_items_IDs.Insert( entity.GetID(), iwca );
419 }
420 }
421 else if ( entity.GetInventory().GetCargo() )
422 {
423 ContainerWithCargo iwc = new ContainerWithCargo( this, -1 );
424 iwc.SetEntity( entity, 0, false );
425 new_showed_items.Insert( entity, iwc );
426 showed_items_IDs.Insert( entity.GetID(), iwc );
427 iwc.UpdateInterval();
428 }
429 else if ( entity.GetSlotsCountCorrect() > 0 )
430 {
431 if ( entity.HasEnergyManager() )
432 {
434 iwem.SetEntity( entity, false );
435 new_showed_items.Insert( entity, iwem );
436 showed_items_IDs.Insert( entity.GetID(), iwem );
437 }
438 else
439 {
440 if ( entity.IsInherited( PlayerBase ) )
441 {
442 if ( !PlayerBase.DEBUG_INVENTORY_ACCESS && entity.IsAlive() && ( !PlayerBase.Cast( entity ).IsUnconscious() && !PlayerBase.Cast( entity ).IsRestrained() ) )
443 {
444 continue;
445 }
446
447 PlayerContainer plyr_cnt = new PlayerContainer( m_Parent, false );
448 plyr_cnt.SetPlayer( PlayerBase.Cast( entity ) );
449 Container.Cast( GetParent() ).Insert( plyr_cnt );
450 ( Container.Cast( m_Parent ) ).Refresh();
451 new_showed_items.Insert( entity, plyr_cnt );
452 showed_items_IDs.Insert( entity.GetID(), plyr_cnt);
453 }
454 else
455 {
456 ContainerWithCargoAndAttachments iwcas = new ContainerWithCargoAndAttachments( this, -1 );
457 iwcas.SetEntity( entity, false );
458 new_showed_items.Insert( entity, iwcas );
459 showed_items_IDs.Insert( entity.GetID(), iwcas );
460 iwcas.UpdateInterval();
461 }
462 }
463 }
464 }
465 else
466 {
467 //TODO MW: remove old containers on one spot (hotfix)
468 con = m_ShowedItems.Get( entity );
469 if ( con )
470 {
471 if ( entity.IsInherited( PlayerBase ) )
472 {
473 if ( !PlayerBase.DEBUG_INVENTORY_ACCESS && entity.IsAlive() && ( !PlayerBase.Cast( entity ).IsUnconscious() && !PlayerBase.Cast( entity ).IsRestrained() ) )
474 {
475 GetMainWidget().Update();
476 if ( con.IsActive() )
477 need_update_focus = true;
478 Container.Cast( GetParent() ).Remove( con );
479 Remove( con );
480 continue;
481 }
482 }
483
484 if ( entity.IsInherited( BaseBuildingBase ) )
485 {
486 if ( !BaseBuildingBase.Cast(entity).IsPlayerInside(player,""))
487 {
488 GetMainWidget().Update();
489 if ( con.IsActive() )
490 need_update_focus = true;
491 Container.Cast( GetParent() ).Remove( con );
492 Remove( con );
493 continue;
494 }
495 }
496
497 new_showed_items.Insert( entity, m_ShowedItems.Get( entity ) );
498 showed_items_IDs.Insert( entity.GetID(), m_ShowedItemsIDs.Get( entity.GetID() ) );
499 }
500 }
501 }
502 }
503
504 ref map<CargoBase, ref Container> new_showed_cargos = new ref map<CargoBase, ref Container>;
506 for ( i = 0; i < cargoes.Count(); i++ )
507 {
508 CargoBase cgo = cargoes.Get( i );
509 if ( cgo )
510 {
511 if (game_inventory && !m_ShowedCargos.Contains( cgo ) )
512 {
513 ContainerWithCargo pxc = new ContainerWithCargo( this, -1 );
514 pxc.SetEntity( cgo.GetCargoOwner(), cgo.GetOwnerCargoIndex(), false );
515 new_showed_cargos.Insert( cgo, pxc );
516 pxc.UpdateInterval();
517 }
518 else
519 {
520 if ( m_ShowedCargos.Get( cgo ) )
521 {
522 new_showed_cargos.Insert( cgo, m_ShowedCargos.Get( cgo ) );
523 }
524 }
525 }
526 }
527
528 for ( int ic = 0; ic < m_ShowedCargos.Count(); ic++ )
529 {
530 CargoBase cgo2 = m_ShowedCargos.GetKey( ic );
531 m_ShowedCargos.GetElement( ic ).UpdateInterval();
532 if ( !new_showed_cargos.Contains( cgo2 ) )
533 {
534 Container con2 = m_ShowedCargos.GetElement( ic );
535 if( con2.IsActive() )
536 need_update_focus = true;
537 GetMainWidget().Update();
538 Container.Cast( GetParent() ).Remove( con2 );
539 Remove( con2 );
540 }
541 }
542
543 m_ShowedItems = new_showed_items;
544 m_ShowedItemsIDs = showed_items_IDs;
545 m_ShowedCargos = new_showed_cargos;
546 //Because WTF (zombie container)
547 Container.Cast( GetParent() ).RecomputeOpenedContainers();
548 if (need_update_focus)
549 SetFirstActive();
550 //RecomputeOpenedContainers();
553
554 if ( m_ShowedItemIcons.Count() != m_OldShowedItemIconsCount )
555 {
556 Inventory in = Inventory.Cast( GetRoot() );
557 if ( in )
558 in.UpdateConsoleToolbar();
559 }
560 }
561
563 {
564 SlotsIcon slots_icon;
565 Container c;
566 w.GetUserData(slots_icon);
567
568 if ( item )
569 {
570 c = Container.Cast( m_ShowedItems.Get( item ) );
571 }
572
573 if (c)
574 {
576 }
577 }
578
579 override bool CanOpenCloseContainerEx(EntityAI focusedEntity)
580 {
581 if (focusedEntity)
582 {
583 ClosableContainer c = ClosableContainer.Cast( m_ShowedItems.Get( focusedEntity ) );
584 if (c && c.IsDisplayable())
585 {
586 return true;
587 }
588 }
589 return false;
590 }
591
592 //Call from ExpandCollapseContainer - not call
593 void ToggleContainer( notnull Container conta )
594 {
595 conta.Toggle();
596 }
597
599 {
600 EntityAI item = GetFocusedItem();
601 Container conta;
602
603 if (m_ShowedItems && item)
604 {
605 conta = m_ShowedItems.Get( item );
606 if (conta)
607 {
608 ToggleContainer( conta );
609 }
610 }
611 }
612
613 override bool OnChildRemove( Widget w, Widget child )
614 {
615 w.Update();
616 float x, y;
617 w.GetScreenSize( x, y );
618 if ( w == GetMainWidget() )
619 {
620 GetMainWidget().Update();
621 m_Parent.OnChildRemove( w, child );
622 }
623 return true;
624 }
625
626 override bool OnChildAdd( Widget w, Widget child )
627 {
628 if ( w == GetMainWidget() )
629 {
630 GetMainWidget().Update();
631 m_Parent.OnChildAdd( w, child );
632 }
633 return true;
634 }
635
637 {
638 super.CollapseButtonOnMouseButtonDown(w);
640 }
641
643 void UpdateHeader(EntityAI entity, Container cont, PlayerBase player)
644 {
646
647 if (cont.GetHeader())
648 {
649 if (GetDragWidget() == cont.GetHeader())
650 {
652 }
653 ItemManager.GetInstance().SetWidgetDraggable(cont.GetHeader().GetMainWidget(),draggable);
654 }
655 }
656
657 override bool SplitItem()
658 {
659 ItemBase item = ItemBase.Cast(GetFocusedItem());
660 if (item)
661 {
662 if (item.HasQuantity() && item.CanBeSplit())
663 {
664 item.OnRightClick();
665 }
666 }
667 return false;
668 }
669}
void Inventory(LayoutHolder parent)
Definition Inventory.c:75
Icon x
Icon y
InventoryLocationType
types of Inventory Location
void InventoryMenu()
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
Definition ItemBase.c:5444
PlayerBase GetPlayer()
string name
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
protected Widget m_Parent
Definition SizeToChild.c:92
override bool IsPlayerInside(PlayerBase player, string selection)
Definition Fence.c:615
represents base for cargo storage for entities
Definition Cargo.c:7
proto native int GetOwnerCargoIndex()
proto native EntityAI GetCargoOwner()
get the entity that owns the cargo
override bool IsDisplayable()
protected ref CollapsibleHeader m_CollapsibleHeader
override void Remove(LayoutHolder container)
static int GREEN_COLOR
static ColorManager GetInstance()
static int RED_COLOR
static int SWAP_COLOR
static int COMBINE_COLOR
void SetColor(Widget w, int color)
override Header GetHeader()
override EntityAI GetFocusedItem()
override void SetEntity(EntityAI entity, bool immedUpdate=true)
override bool IsInventoryVisible()
Definition Building.c:41
Serializer API implementation for File IO. See Serializer for more info. usage:
Definition Serializer.c:104
proto native void Close()
proto native bool Open(string path, FileMode mode=FileMode.READ)
script counterpart to engine's class Inventory
Definition Inventory.c:77
proto native bool IsPlaceholderEntity(notnull Object e)
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:601
void SetName(string name)
Definition Header.c:33
InventoryLocation.
proto native int GetType()
returns type of InventoryLocation
void ShowSourceDropzone(EntityAI item)
Widget GetLeftDropzone()
void SetWidgetDraggable(Widget w, bool draggable)
void HideDropzones()
void SetDefaultHeaderOpenState(string type, bool is_opened)
bool EvaluateContainerDragabilityDefault(EntityAI entity)
void SetIsDragging(bool is_dragging)
static ItemManager GetInstance()
proto native EntityAI GetItem()
void SetPlayer(PlayerBase player)
proto bool Write(void value_out)
ref map< int, ref Container > m_ShowedItemsIDs
ref map< EntityAI, ref Container > m_ShowedItems
override bool OnChildAdd(Widget w, Widget child)
protected bool m_IsProcessing
void OnDropReceivedFromIcon(Widget w, int x, int y, Widget receiver)
void DraggingOverIcon(Widget w, int x, int y, Widget receiver)
const float DISTANCE_TO_ENTITIES
void ToggleContainer(Widget w, EntityAI item)
override void UpdateInterval()
void OnDropReceivedFromEmptySpace(Widget w, int x, int y, Widget receiver)
void UpdateHeader(EntityAI entity, Container cont, PlayerBase player)
Updates header dragability to be consistent with current 'icon' behaviour.
void OnLeftPanelDropReceived(Widget w, int x, int y, Widget receiver)
override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
VicinitySlotsContainer GetVicinityIconsContainer()
ref VicinitySlotsContainer m_VicinityIconsContainer
override bool CanOpenCloseContainerEx(EntityAI focusedEntity)
override bool OnChildRemove(Widget w, Widget child)
void ToggleContainer(notnull Container conta)
void VicinityContainer(LayoutHolder parent, int sort=-1)
const float DISTANCE_TO_THE_REST
override void ExpandCollapseContainer()
override void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
ref map< CargoBase, ref Container > m_ShowedCargos
override void CollapseButtonOnMouseButtonDown(Widget w)
ref array< EntityAI > m_ShowedItemIcons
bool IsVicinityContainerIconsActive()
override bool SplitItem()
array< EntityAI > GetVicinityItems()
static VicinityItemManager GetInstance()
void Update(float delta_time)
array< CargoBase > GetVicinityCargos()
void ShowItemsInContainers(array< EntityAI > items)
static WidgetEventHandler GetInstance()
void RegisterOnChildRemove(Widget w, Managed eventHandler, string functionName)
void RegisterOnChildAdd(Widget w, Managed eventHandler, string functionName)
void SetEntity(EntityAI zombie_entity)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
FileMode
Definition EnSystem.c:383
const int MENU_INVENTORY
Definition constants.c:158
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:396
proto native Widget CancelWidgetDragging()
proto native Widget GetDragWidget()