Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ZombieContainer
+ Граф наследования:ZombieContainer:

Защищенные члены

void ZombieContainer (LayoutHolder parent, int sort=-1)
 
void ~ZombieContainer ()
 
void SetEntity (EntityAI zombie_entity)
 
override void UpdateRadialIcon ()
 
override bool IsItemWithQuantityActive ()
 
bool IsContainerWithCargoActive ()
 
bool IsItemWithAttachmentsActive ()
 
bool IsZombieEquipmentActive ()
 
bool IsItemWithContainerActive ()
 
bool IsEmptyItemActive ()
 
override void ExpandCollapseContainer ()
 
override void OnDropReceivedFromHeader (Widget w, int x, int y, Widget receiver)
 
override void DraggingOverHeader (Widget w, int x, int y, Widget receiver)
 
void OnDropReceivedFromGhostArea (Widget w, int x, int y, Widget receiver)
 
void SetHeaderName ()
 
void ItemAttached (EntityAI item, string slot_name)
 
void ItemDetached (EntityAI item, string slot_name)
 
override bool CanOpenCloseContainerEx (EntityAI focusedEntity)
 
void ToggleContainer (Widget w)
 
void MouseClick (Widget w, int x, int y, int button)
 
SlotsIcon GetSlotsIcon (int row, int column)
 
void InitGhostSlots ()
 
void AddSlotsContainer (int row_count)
 
Widget GetWidgetSlot (int slot_number)
 
void DoubleClick (Widget w, int x, int y, int button)
 
override void CollapseButtonOnMouseButtonDown (Widget w)
 
override bool SplitItem ()
 
override bool EquipItem ()
 
override bool TransferItem ()
 
override bool Select ()
 
override bool TransferItemToVicinity ()
 

Защищенные данные

ref AttachmentsGroupContainer m_Container
 
ref ContainerWithCargo m_CargoGrid
 
ref map< int, SlotsIconm_InventorySlots
 
ref map< EntityAI, ref Containerm_ShowedItems = new ref map<EntityAI, ref Container>
 
EntityAI m_ZombieEntity
 

Дополнительные унаследованные члены

- Закрытые члены унаследованные от CollapsibleContainer
void CollapsibleContainer (LayoutHolder parent, int sort=-1)
 
override void SetLayoutName ()
 
EntityAI GetEntity ()
 
override void OnDropReceivedFromHeader (Widget w, int x, int y, Widget receiver)
 
override void Refresh ()
 
override void OnShow ()
 
override void OnHide ()
 
override void Insert (LayoutHolder container, int pos=-1, bool immedUpdate=true)
 
override void Remove (LayoutHolder container)
 
bool CanDisplayAnyCategory ()
 
void UpdateCollapseButtons ()
 
void LoadDefaultState ()
 
bool IsHidden ()
 
void CollapseButtonOnMouseButtonDown (Widget w)
 
override void Toggle ()
 
override bool OnChildRemove (Widget w, Widget child)
 
override bool OnChildAdd (Widget w, Widget child)
 
override Header GetHeader ()
 
override void SetHeader (Header header)
 
void SetCollapsibleHeaderArrowState (bool open)
 
- Закрытые данные унаследованные от CollapsibleContainer
ref CollapsibleHeader m_CollapsibleHeader
 
bool m_Hidden
 

Подробное описание

Конструктор(ы)

◆ ZombieContainer()

void ZombieContainer ( LayoutHolder parent,
int sort = -1 )
inlineprotected
10 {
13
14 m_Container.SetHeader(GetHeader());
17 m_Body.Insert( m_Container );
18
19 m_MainWidget = m_RootWidget.FindAnyWidget( "body" );
20
21 WidgetEventHandler.GetInstance().RegisterOnChildAdd( m_MainWidget, this, "OnChildAdd" );
22 WidgetEventHandler.GetInstance().RegisterOnChildRemove( m_MainWidget, this, "OnChildRemove" );
23
24
25 RecomputeOpenedContainers();
26 }
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Definition PluginRemotePlayerDebugClient.c:14
Definition AttachmentsGroupContainer.c:2
override Header GetHeader()
Definition CollapsibleContainer.c:176
override void SetHeader(Header header)
Definition CollapsibleContainer.c:181
Definition EntityAI.c:95
Definition WidgetEventHandler.c:2
static WidgetEventHandler GetInstance()
Definition WidgetEventHandler.c:22
ref AttachmentsGroupContainer m_Container
Definition ZombieContainer.c:3
void SetHeaderName()
Definition ZombieContainer.c:240
ref map< int, SlotsIcon > m_InventorySlots
Definition ZombieContainer.c:5

Перекрестные ссылки CollapsibleContainer::GetHeader(), WidgetEventHandler::GetInstance(), m_Container, m_InventorySlots, m_RootWidget, CollapsibleContainer::SetHeader() и SetHeaderName().

◆ ~ZombieContainer()

void ~ZombieContainer ( )
inlineprotected
29 {
30 if( m_ZombieEntity )
31 {
32 m_ZombieEntity.GetOnItemAttached().Remove(ItemAttached);
33 m_ZombieEntity.GetOnItemDetached().Remove(ItemDetached);
34 }
35 }
EntityAI m_ZombieEntity
Definition ZombieContainer.c:7
void ItemAttached(EntityAI item, string slot_name)
Definition ZombieContainer.c:245
void ItemDetached(EntityAI item, string slot_name)
Definition ZombieContainer.c:297

Перекрестные ссылки ItemAttached(), ItemDetached() и m_ZombieEntity.

Методы

◆ AddSlotsContainer()

void AddSlotsContainer ( int row_count)
inlineprotected
521 {
523 s_cont.SetColumnCount( row_count );
524 m_Container.Insert( s_cont );
525 }
Definition SlotsContainer.c:2

Перекрестные ссылки m_Container и m_ZombieEntity.

Используется в InitGhostSlots().

◆ CanOpenCloseContainerEx()

override bool CanOpenCloseContainerEx ( EntityAI focusedEntity)
inlineprotected
322 {
324 if (focusedEntity)
325 {
327 }
328 else
329 {
330 SlotsIcon icon = GetFocusedSlotsIcon();
331 if (icon)
332 {
333 c = ClosableContainer.Cast(icon.GetContainer());
334 }
335 }
336
337 if (c && c.IsDisplayable())
338 {
339 return true;
340 }
341
342 return false;
343 }
Definition ContainerWithCargo.c:2
Definition SlotsIcon.c:2
ref map< EntityAI, ref Container > m_ShowedItems
Definition ZombieContainer.c:6

Перекрестные ссылки m_ShowedItems.

◆ CollapseButtonOnMouseButtonDown()

override void CollapseButtonOnMouseButtonDown ( Widget w)
inlineprotected
605 {
606 super.CollapseButtonOnMouseButtonDown(w);
607 }

◆ DoubleClick()

void DoubleClick ( Widget w,
int x,
int y,
int button )
inlineprotected
536 {
537 if( button == MouseState.LEFT && !g_Game.IsLeftCtrlDown())
538 {
539 if( w == null )
540 {
541 return;
542 }
543 ItemPreviewWidget iw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
544 if( !iw )
545 {
546 string name = w.GetName();
547 name.Replace( "PanelWidget", "Render" );
548 iw = ItemPreviewWidget.Cast( w.FindAnyWidget( name ) );
549 }
550
551 if( !iw )
552 {
553 iw = ItemPreviewWidget.Cast( w );
554 }
555
556 ItemBase item = ItemBase.Cast( iw.GetItem() );
557 if( !item )
558 {
559 return;
560 }
561
563
564 if( player.GetInventory().HasInventoryReservation( item, null ) || player.IsItemsToDelete() )
565 {
566 return;
567 }
568
569 if( !item.GetInventory().CanRemoveEntity() )
570 return;
571
572 if ( player.GetInventory().HasEntityInInventory( item ) && GetGame().GetPlayer().GetHumanInventory().CanAddEntityInHands( item ) )
573 {
574 player.PredictiveTakeEntityToHands( item );
575 }
576 else
577 {
579 if( player.GetInventory().FindFreeLocationFor( item, FindInventoryLocationType.ANY, il) )
580 {
581 if( item.GetTargetQuantityMax(il.GetSlot()) < item.GetQuantity() )
582 item.SplitIntoStackMaxToInventoryLocationClient( il );
583 else
584 player.PredictiveTakeEntityToInventory( FindInventoryLocationType.ANY, item );
585 }
586 else if( GetGame().GetPlayer().GetHumanInventory().CanAddEntityInHands( item ) )
587 {
588 if( item.GetTargetQuantityMax() < item.GetQuantity() )
589 item.SplitIntoStackMaxHandsClient( player );
590 else
591 player.PredictiveTakeEntityToHands( item );
592 }
593 }
594
595 HideOwnedTooltip();
596 InventoryMenu menu = InventoryMenu.Cast( GetGame().GetUIManager().FindMenu( MENU_INVENTORY ) );
597 if( menu )
598 {
599 menu.RefreshQuickbar();
600 }
601 }
602 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Definition DayZGame.c:3746
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:16
void InventoryMenu()
Definition InventoryMenu.c:20
PlayerBase GetPlayer()
Definition ModifierBase.c:47
InventoryLocation.
Definition InventoryLocation.c:28
Definition InventoryItem.c:731
Definition gameplay.c:276
Definition PlayerBaseClient.c:2
proto native CGame GetGame()
const int MENU_INVENTORY
Definition constants.c:170
MouseState
Definition EnSystem.c:311

Перекрестные ссылки g_Game, GetGame(), GetPlayer(), InventoryMenu(), MENU_INVENTORY и name.

◆ DraggingOverHeader()

override void DraggingOverHeader ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
135 {
136 ItemPreviewWidget ipw = ItemPreviewWidget.Cast(w.FindAnyWidget( "Render" ));
137 string name = receiver.GetName();
138 name.Replace("PanelWidget", "Render");
141 if (receiver_iw)
142 {
143 receiver_item = receiver_iw.GetItem();
144 }
145
146 if(!ipw)
147 {
148 name = w.GetName();
149 name.Replace("PanelWidget", "Render");
150 ipw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
151 }
152 if(!ipw)
153 {
154 ipw = ItemPreviewWidget.Cast(w);
155 }
156
157 if( !ipw.IsInherited(ItemPreviewWidget))
158 {
159 return;
160 }
161
162 EntityAI item = ipw.GetItem();
164
165 if(!item.GetInventory().CanRemoveEntity())
166 return;
167 }
Definition Building.c:6

Перекрестные ссылки GetGame(), GetPlayer() и name.

◆ EquipItem()

override bool EquipItem ( )
inlineprotected
622 {
623 if (CanEquip())
624 {
625 if ( GetFocusedContainer().IsInherited( ContainerWithCargo ) || GetFocusedContainer().IsInherited( ContainerWithCargoAndAttachments ) )
626 {
627 return GetFocusedContainer().EquipItem();
628 }
629 else
630 {
632 if( item )
633 {
634 GetGame().GetPlayer().PredictiveTakeEntityToInventory( FindInventoryLocationType.ATTACHMENT, item );
635 return true;
636 }
637 }
638 }
639 return false;
640 }
override EntityAI GetFocusedItem()
Definition CargoContainer.c:720

Перекрестные ссылки Container::GetFocusedItem() и GetGame().

◆ ExpandCollapseContainer()

override void ExpandCollapseContainer ( )
inlineprotected
94 {
96 {
97 ItemPreviewWidget item_preview = GetFocusedSlotsIcon().GetRender();
98 ToggleContainer( item_preview.GetParent() );
99 }
100 }
void ToggleContainer(Widget w)
Definition ZombieContainer.c:346
bool IsZombieEquipmentActive()
Definition ZombieContainer.c:77

Перекрестные ссылки IsZombieEquipmentActive() и ToggleContainer().

◆ GetSlotsIcon()

SlotsIcon GetSlotsIcon ( int row,
int column )
inlineprotected
410 {
411 return SlotsContainer.Cast( m_Container.Get( row ) ).GetSlotIcon( column );
412 }
SlotsIcon GetSlotIcon(int index)
Definition SlotsContainer.c:207

Перекрестные ссылки SlotsContainer::GetSlotIcon() и m_Container.

Используется в InitGhostSlots().

◆ GetWidgetSlot()

Widget GetWidgetSlot ( int slot_number)
inlineprotected
528 {
531
532 return m_Container.Get( row ).GetMainWidget().FindAnyWidget( "Render" + column );
533 }
const int ITEMS_IN_ROW
Definition Attachments.c:1

Перекрестные ссылки ITEMS_IN_ROW и m_Container.

◆ InitGhostSlots()

void InitGhostSlots ( )
inlineprotected
415 {
416 int row, column;
418 bool has_cargo = m_ZombieEntity.GetInventory().GetCargo() != null;
419
420 string config_path_ghosts_slots = "CfgVehicles ZombieBase InventoryEquipment playerSlots";
423
424 for ( int i = 0; i < player_ghosts_slots.Count(); i++ )
425 {
426 string slot_name = player_ghosts_slots.Get ( i );
427 string path = "CfgSlots" + " " + slot_name;
428
429 if ( GetGame().ConfigIsExisting( path ) )
430 {
431 string icon_name; //icon_name must be in format "set:<setname> image:<imagename>"
432 GetGame().ConfigGetText( path + " ghostIcon", icon_name );
434
435 //START - GetWidgetSlot
436 row = i / ITEMS_IN_ROW;
437 if( row >= m_Container.Count() )
438 {
439 if ( has_cargo )
440 {
441 if( row < ( (player_ghosts_slots.Count() + 1 )/ ITEMS_IN_ROW ) )
443 else
445
446 }
447 else
448 {
449 if ( row < ( player_ghosts_slots.Count() / ITEMS_IN_ROW ) )
451 else
453 }
454
455 }
456
458
459 icon.GetMainWidget().Show( true );
460 icon.Clear();
461
462 WidgetEventHandler.GetInstance().RegisterOnDoubleClick( icon.GetPanelWidget(), this, "DoubleClick" );
463
464 //END - GetWidgetSlot
465 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetPanelWidget(), this, "OnDropReceivedFromGhostArea" );
466 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetGhostSlot(), this, "OnDropReceivedFromGhostArea" );
467 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetPanelWidget(), this, "DraggingOver" );
468 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetGhostSlot(), this, "DraggingOver" );
469 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetPanelWidget(), this, "DraggingOver" );
470 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetPanelWidget(), this, "MouseClick" );
471
473 //END - LoadIconIntoWidgetSlot
474
475 GetGame().ConfigGetText( path + " name", slot_name );
477 icon.SetSlotID( slot_id );
478 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
480
482 ItemBase item = ItemBase.Cast( m_ZombieEntity.GetInventory().FindAttachment( slot ) );
483
484 if( item )
486 }
487 }
488
489 if( m_ZombieEntity.GetInventory().GetCargo() )
490 {
493 if( row >= m_Container.Count() )
494 {
495 if( row < ( player_ghosts_slots.Count() + 1 / ITEMS_IN_ROW ) )
497 else
499 }
500
502 icon.GetMainWidget().Show( true );
503 icon.Clear();
504 icon.GetGhostSlot().LoadImageFile( 0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY,m_ZombieEntity.ConfigGetString("GUIInventoryCargoIcon")) );
505 icon.SetSlotDisplayName( m_ZombieEntity.ConfigGetString("GUIInventoryCargoName") );
506 icon.GetRadialIconPanel().Show( true );
507 icon.GetRadialIcon().Show( true );
508
509 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp( icon.GetGhostSlot(), this, "ToggleContainer" );
510 m_CargoGrid = new ContainerWithCargo( this, false );
511 m_CargoGrid.SetEntity( m_ZombieEntity );
512 m_CargoGrid.GetHeader().GetMainWidget().ClearFlags( WidgetFlags.DRAGGABLE );
514 icon.SetContainer(m_CargoGrid);
515 }
516
517 RecomputeOpenedContainers();
518 }
string path
Definition OptionSelectorMultistate.c:135
provides access to slot configuration
Definition InventorySlots.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
static proto native owned string GetSlotDisplayName(int id)
converts slot_id to string
Definition StaticGUIUtils.c:2
static const int IMAGESETGROUP_INVENTORY
Definition StaticGUIUtils.c:3
static string VerifyIconImageString(int imageset_group=IMAGESETGROUP_INVENTORY, string icon_name="")
Checks for improperly formated, legacy image names and corrects them to default format.
Definition StaticGUIUtils.c:7
ref ContainerWithCargo m_CargoGrid
Definition ZombieContainer.c:4
SlotsIcon GetSlotsIcon(int row, int column)
Definition ZombieContainer.c:409
void AddSlotsContainer(int row_count)
Definition ZombieContainer.c:520
WidgetFlags
Definition EnWidgets.c:58

Перекрестные ссылки AddSlotsContainer(), GetGame(), WidgetEventHandler::GetInstance(), InventorySlots::GetSlotDisplayName(), InventorySlots::GetSlotIdFromString(), GetSlotsIcon(), StaticGUIUtils::IMAGESETGROUP_INVENTORY, ItemAttached(), ITEMS_IN_ROW, m_CargoGrid, m_Container, m_InventorySlots, m_ShowedItems, m_ZombieEntity, path и StaticGUIUtils::VerifyIconImageString().

Используется в SetEntity().

◆ IsContainerWithCargoActive()

bool IsContainerWithCargoActive ( )
inlineprotected
68 {
69 return GetFocusedContainer().IsInherited( ContainerWithCargo );
70 }

◆ IsEmptyItemActive()

bool IsEmptyItemActive ( )
inlineprotected
89 {
90 return !GetFocusedItem();
91 }

Перекрестные ссылки Container::GetFocusedItem().

◆ IsItemWithAttachmentsActive()

bool IsItemWithAttachmentsActive ( )
inlineprotected
73 {
74 return GetFocusedContainer().IsInherited( ContainerWithCargoAndAttachments );
75 }

◆ IsItemWithContainerActive()

bool IsItemWithContainerActive ( )
inlineprotected
83 {
85 return ent && ( ent.GetInventory().GetCargo() || ent.GetSlotsCountCorrect() > 0 );
86 }

Перекрестные ссылки Container::GetFocusedItem().

◆ IsItemWithQuantityActive()

override bool IsItemWithQuantityActive ( )
inlineprotected
62 {
64 return ent && QuantityConversions.HasItemQuantity( ent ) && ent.CanBeSplit();
65 }
Definition QuantityConversions.c:2
static int HasItemQuantity(notnull EntityAI item)
Definition QuantityConversions.c:143

Перекрестные ссылки Container::GetFocusedItem() и QuantityConversions::HasItemQuantity().

◆ IsZombieEquipmentActive()

bool IsZombieEquipmentActive ( )
inlineprotected
78 {
79 return GetFocusedContainer() == m_Container;
80 }

Перекрестные ссылки m_Container.

Используется в ExpandCollapseContainer().

◆ ItemAttached()

void ItemAttached ( EntityAI item,
string slot_name )
inlineprotected
246 {
248 SlotsIcon icon = m_InventorySlots.Get( slot );
249 if( icon )
250 {
251 icon.Init( item );
252
253 if( m_ShowedItems.Contains( item ) == false )
254 {
255 string name;
256
257 if( item.GetSlotsCountCorrect() > 0 )
258 {
259 ContainerWithCargoAndAttachments iwca = new ContainerWithCargoAndAttachments( this, false );
260 iwca.SetEntity( item );
261 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp( icon.GetPanelWidget(), this, "ToggleContainer" );
262
263 icon.GetRadialIconPanel().Show( true );
264 m_ShowedItems.Insert( item, iwca );
265
266 Refresh();
267 }
268 else if( item.GetInventory().GetCargo() )
269 {
270 ContainerWithCargo iwc = new ContainerWithCargo( this, false );
271 iwc.SetEntity( item );
272 iwc.UpdateInterval();
273 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp( icon.GetPanelWidget(), this, "ToggleContainer" );
274 m_ShowedItems.Insert( item, iwc );
275 icon.GetRadialIconPanel().Show(true);
276
277 Refresh();
278 }
279 }
280
282 string config = "CfgVehicles " + item.GetType() + " GUIInventoryAttachmentsProps";
283 if( conta && conta.IsInherited( ClosableContainer ) )
284 {
285 bool show_radial_icon = ( item.GetInventory().GetCargo() || item.GetSlotsCountCorrect() > 0 ) && !GetGame().ConfigIsExisting( config );
286 Widget rip = icon.GetRadialIconPanel();
287 Widget icon_open = icon.GetRadialIcon();
288 Widget icon_closed = icon.GetRadialIconClosed();
289 rip.Show( show_radial_icon );
290 icon_open.Show( conta.IsOpened() );
291 icon_closed.Show( !conta.IsOpened() );
292 }
293 RecomputeOpenedContainers();
294 }
295 }
override void Refresh()
Definition CollapsibleContainer.c:31
Definition EnWidgets.c:190

Перекрестные ссылки GetGame(), WidgetEventHandler::GetInstance(), InventorySlots::GetSlotIdFromString(), m_InventorySlots, m_ShowedItems, name и CollapsibleContainer::Refresh().

Используется в InitGhostSlots(), SetEntity() и ~ZombieContainer().

◆ ItemDetached()

void ItemDetached ( EntityAI item,
string slot_name )
inlineprotected
298 {
300 SlotsIcon icon = m_InventorySlots.Get( slot );
301
302 if( icon )
303 {
305 if( con )
306 {
307 ( Container.Cast( con.m_Parent ) ).Remove( con );
308 RecomputeOpenedContainers();
309 GetMainWidget().Update();
310 Refresh();
311 m_ShowedItems.Remove( item );
312 }
313
314 icon.Clear();
315 Inventory in = Inventory.Cast( GetRoot() );
316 if( in )
317 in.UpdateConsoleToolbar();
318 }
319 }
void Inventory(LayoutHolder parent)
Definition Inventory.c:76
override void Remove(LayoutHolder container)
Definition CollapsibleContainer.c:79
Definition CargoContainer.c:3

Перекрестные ссылки InventorySlots::GetSlotIdFromString(), Inventory(), m_InventorySlots, m_ShowedItems, CollapsibleContainer::Refresh() и CollapsibleContainer::Remove().

Используется в SetEntity() и ~ZombieContainer().

◆ MouseClick()

void MouseClick ( Widget w,
int x,
int y,
int button )
inlineprotected
368 {
371 w.GetUserData(icon);
372 if (icon)
373 selectedItem = ItemBase.Cast(icon.GetEntity());
374
375 if (selectedItem)
376 {
377 switch (button)
378 {
379 case MouseState.RIGHT:
380 #ifdef DIAG_DEVELOPER
381 if (GetDayZGame().IsLeftCtrlDown())
382 ShowActionMenu(selectedItem);
383 #endif
384 break;
385
386 case MouseState.MIDDLE:
387 InspectItem(selectedItem);
388 break;
389
390 case MouseState.LEFT:
391 if (g_Game.IsLeftCtrlDown())
392 {
394 if (controlledPlayer.CanDropEntity(selectedItem))
395 {
396 if (selectedItem.GetTargetQuantityMax() < selectedItem.GetQuantity())
397 selectedItem.SplitIntoStackMaxClient(null, -1);
398 else
399 controlledPlayer.PhysicalPredictiveDropItem(selectedItem);
400
401 ItemManager.GetInstance().SetWidgetDraggable(w, false);
402 }
403 }
404 break;
405 }
406 }
407 }
DayZGame GetDayZGame()
Definition DayZGame.c:3748
Definition ItemManager.c:2
static ItemManager GetInstance()
Definition ItemManager.c:283

Перекрестные ссылки g_Game, GetDayZGame(), GetGame(), ItemManager::GetInstance() и GetPlayer().

◆ OnDropReceivedFromGhostArea()

void OnDropReceivedFromGhostArea ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
170 {
171 ItemPreviewWidget ipw = ItemPreviewWidget.Cast( w.FindAnyWidget("Render"));
172 string name = receiver.GetName();
173 name.Replace("PanelWidget", "Render");
176 if (receiver_iw)
177 {
178 receiver_item = receiver_iw.GetItem();
179 }
180
181 if( !ipw )
182 {
183 name = w.GetName();
184 name.Replace( "PanelWidget", "Render" );
185 ipw = ItemPreviewWidget.Cast( w.FindAnyWidget(name));
186 }
187 if(!ipw)
188 {
189 ipw = ItemPreviewWidget.Cast(w);
190 }
191
192 if(!ipw.IsInherited(ItemPreviewWidget))
193 {
194 return;
195 }
196
197 EntityAI item = ipw.GetItem();
199
200 if(!item.GetInventory().CanRemoveEntity())
201 {
202 return;
203 }
204
205 if(receiver_item)
206 {
207 if(receiver_item.GetInventory().CanAddAttachment(item))
208 {
209 player.PredictiveTakeEntityToTargetAttachment(receiver_item, item);
210 return;
211 }
212 else if(receiver_item.GetInventory().CanAddEntityInCargo(item, item.GetInventory().GetFlipCargo()) && !receiver_item.GetInventory().HasEntityInCargo(item))
213 {
214 player.PredictiveTakeEntityToTargetInventory(receiver_item, FindInventoryLocationType.ANY, item);
215 return;
216 }
217 }
218
219 if(item)
220 {
221 if(m_ZombieEntity.GetInventory().CanAddAttachment(item))
222 {
223 player.PredictiveTakeEntityToTargetAttachment(m_ZombieEntity, item);
224 }
225 else if(m_ZombieEntity.GetInventory().CanAddEntityToInventory(item))
226 {
227 player.PredictiveTakeEntityToTargetInventory(m_ZombieEntity, FindInventoryLocationType.ANY, item);
228 }
229 }
230
231 if( item )
232 {
233 if( m_ZombieEntity.GetInventory().CanAddEntityInto(item, FindInventoryLocationType.CARGO ))
234 {
235 player.PredictiveTakeEntityToTargetInventory(m_ZombieEntity, FindInventoryLocationType.CARGO, item);
236 }
237 }
238 }

Перекрестные ссылки GetGame(), GetPlayer(), m_ZombieEntity и name.

◆ OnDropReceivedFromHeader()

override void OnDropReceivedFromHeader ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
103 {
104 ItemPreviewWidget ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
105 if( !ipw )
106 {
107 string name = w.GetName();
108 name.Replace( "PanelWidget", "Render" );
109 ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( name ) );
110 }
111 if( !ipw )
112 {
113 ipw = ItemPreviewWidget.Cast( w );
114 }
115
116 if( !ipw.IsInherited( ItemPreviewWidget ) )
117 {
118 return;
119 }
120
121 EntityAI item = ipw.GetItem();
122
123 if( !item.GetInventory().CanRemoveEntity() )
124 return;
125
126 if (m_ZombieEntity.GetInventory().CanAddEntityInCargo( item, item.GetInventory().GetFlipCargo() ))
127 GetGame().GetPlayer().PredictiveTakeEntityToTargetCargo( m_ZombieEntity, item );
128 else if( m_ZombieEntity.GetInventory().CanAddEntityToInventory( item ) )
129 {
130 GetGame().GetPlayer().PredictiveTakeEntityToTargetInventory( m_ZombieEntity, FindInventoryLocationType.CARGO, item );
131 }
132 }

Перекрестные ссылки GetGame(), m_ZombieEntity и name.

◆ Select()

override bool Select ( )
inlineprotected
682 {
683 if( GetFocusedContainer().IsInherited( ContainerWithCargo ) || GetFocusedContainer().IsInherited( ContainerWithCargoAndAttachments ) )
684 {
685 return GetFocusedContainer().Select();
686 }
687 else
688 {
689 SlotsIcon selected_slot = ItemManager.GetInstance().GetSelectedIcon();
691 EntityAI selected_item = ItemManager.GetInstance().GetSelectedItem();
692 if( !(selected_slot && selected_slot.IsOutOfReach() ) )
693 {
694 if( selected_item )
695 {
697 {
698 if( selected_item.GetInventory().CanRemoveEntity() )
699 {
700 GetGame().GetPlayer().PredictiveTakeEntityToTargetInventory( m_ZombieEntity, FindInventoryLocationType.ANY, selected_item );
701 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
702 return true;
703 }
704 }
705 }
706 else
707 {
708 if( focused_item && focused_item.GetInventory().CanRemoveEntity() )
709 {
710 EntityAI item_in_hands = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
711 if( item_in_hands && item_in_hands.GetInventory().CanRemoveEntity() )
712 {
714 {
715 GetGame().GetPlayer().PredictiveSwapEntities( item_in_hands, focused_item );
716 return true;
717 }
718 else
719 {
721 if( GetGame().GetPlayer().GetHumanInventory().FindFreeLocationFor( item_in_hands, FindInventoryLocationType.ANY, il_hands_dst ) )
722 {
724
725 if ( GetGame().GetPlayer().NeedInventoryJunctureFromServer(item_in_hands, item_in_hands.GetHierarchyParent(), il_hands_dst.GetParent()) || GetGame().GetPlayer().NeedInventoryJunctureFromServer(focused_item, focused_item.GetHierarchyParent(), GetGame().GetPlayer()) )
726 invMode = InventoryMode.JUNCTURE;
727
728 GetGame().GetPlayer().GetHumanInventory().ForceSwapEntities( InventoryMode.JUNCTURE, focused_item, item_in_hands, il_hands_dst );
729 return true;
730 }
731 }
732 }
733 else
734 {
735 if( GetGame().GetPlayer().GetHumanInventory().CanAddEntityInHands( focused_item ) )
736 {
737 GetGame().GetPlayer().PredictiveTakeEntityToHands( focused_item );
738 return true;
739 }
740 }
741 }
742 }
743 }
744 }
745 return false;
746 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:628

Перекрестные ссылки GameInventory::CanSwapEntitiesEx(), Container::GetFocusedItem(), GetGame(), ItemManager::GetInstance(), GetPlayer() и m_ZombieEntity.

◆ SetEntity()

void SetEntity ( EntityAI zombie_entity)
inlineprotected
38 {
40 m_ZombieEntity.GetOnItemAttached().Insert(ItemAttached);
41 m_ZombieEntity.GetOnItemDetached().Insert(ItemDetached);
43 m_Parent.Refresh();
44 }
Widget m_Parent
Definition SizeToChild.c:92
void InitGhostSlots()
Definition ZombieContainer.c:414

Перекрестные ссылки InitGhostSlots(), ItemAttached(), ItemDetached(), m_Parent и m_ZombieEntity.

◆ SetHeaderName()

void SetHeaderName ( )
inlineprotected
241 {
242 m_CollapsibleHeader.SetName( "#container_inventory" );
243 }
ref CollapsibleHeader m_CollapsibleHeader
Definition CollapsibleContainer.c:3

Перекрестные ссылки CollapsibleContainer::m_CollapsibleHeader.

Используется в ZombieContainer().

◆ SplitItem()

override bool SplitItem ( )
inlineprotected
610 {
611 if ( CanSplit() )
612 {
613 if ( GetFocusedContainer().IsInherited( ContainerWithCargo ) || GetFocusedContainer().IsInherited( ContainerWithCargoAndAttachments ) )
614 {
615 return GetFocusedContainer().SplitItem();
616 }
617 }
618 return false;
619 }

◆ ToggleContainer()

void ToggleContainer ( Widget w)
inlineprotected
347 {
351 w.GetUserData(icon);
352 if (icon)
353 item = icon.GetEntity();
354
355 if (item)
357 else
358 c = ClosableContainer.Cast(icon.GetContainer());
359
360
361 if (c)
362 c.Toggle();
363
364 RecomputeOpenedContainers();
365 }

Перекрестные ссылки m_ShowedItems.

Используется в ExpandCollapseContainer().

◆ TransferItem()

override bool TransferItem ( )
inlineprotected
643 {
646 if (CanTakeToInventory())
647 {
648
649 if (left_area)
650 {
651 if (GetFocusedContainer().IsInherited( ContainerWithCargo ) || GetFocusedContainer().IsInherited( ContainerWithCargoAndAttachments ))
652 {
653 return GetFocusedContainer().TransferItem();
654 }
655 else
656 {
658 if( item )
659 {
660 GetGame().GetPlayer().PredictiveTakeEntityToInventory( FindInventoryLocationType.CARGO, item );
661 return true;
662 }
663 }
664 }
665 else
666 {
667 if (!GetFocusedContainer().IsInherited( ContainerWithCargo ) && !GetFocusedContainer().IsInherited( ContainerWithCargoAndAttachments ))
668 {
670 if (item)
671 {
672 GetGame().GetPlayer().PredictiveTakeEntityToInventory( FindInventoryLocationType.CARGO, item );
673 return true;
674 }
675 }
676 }
677 }
678 return false;
679 }
Definition LeftArea.c:2
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:405

Перекрестные ссылки Container::GetFocusedItem(), GetGame() и GetParent().

◆ TransferItemToVicinity()

override bool TransferItemToVicinity ( )
inlineprotected
749 {
750 if (CanDrop())
751 {
752 if ( GetFocusedContainer().IsInherited( ContainerWithCargo ) || GetFocusedContainer().IsInherited( ContainerWithCargoAndAttachments ) )
753 {
754 return GetFocusedContainer().TransferItemToVicinity();
755 }
756 else
757 {
758 Man player = GetGame().GetPlayer();
760 if( item && player.CanDropEntity( item ) )
761 {
762 if( item.GetTargetQuantityMax() < item.GetQuantity() )
763 item.SplitIntoStackMaxClient( null, -1 );
764 else
765 player.PhysicalPredictiveDropItem( item );
766 return true;
767 }
768 }
769 }
770 return false;
771 }

Перекрестные ссылки Container::GetFocusedItem() и GetGame().

◆ UpdateRadialIcon()

override void UpdateRadialIcon ( )
inlineprotected
47 {
48 if ( m_SlotIcon )
49 {
52 Widget rip = m_SlotIcon.GetRadialIconPanel();
53 Widget icon_open = m_SlotIcon.GetRadialIcon();
54 Widget icon_closed = m_SlotIcon.GetRadialIconClosed();
55 rip.Show( !m_ZombieEntity.GetInventory().IsInventoryLockedForLockType( HIDE_INV_FROM_SCRIPT ) && m_ZombieEntity.CanDisplayCargo());
58 }
59 }
bool IsHidden()
Definition CollapsibleContainer.c:126

Перекрестные ссылки CollapsibleContainer::IsHidden() и m_ZombieEntity.

Поля

◆ m_CargoGrid

ref ContainerWithCargo m_CargoGrid
protected

Используется в InitGhostSlots().

◆ m_Container

◆ m_InventorySlots

ref map<int, SlotsIcon> m_InventorySlots
protected

◆ m_ShowedItems

◆ m_ZombieEntity


Объявления и описания членов класса находятся в файле: