Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
attachments.c
Go to the documentation of this file.
1const int ITEMS_IN_ROW = 8;
2
4{
5 protected Container m_Parent;
6 protected EntityAI m_Entity;
12
13 protected int m_RowIndex;
14 protected int m_AttachmentSlotID = -1;
15
16 void Attachments( Container parent, EntityAI entity )
17 {
18 m_Parent = parent;
19 m_Entity = entity;
24 m_Entity.GetOnItemAttached().Insert( AttachmentAdded );
25 m_Entity.GetOnItemDetached().Insert( AttachmentRemoved );
26 m_Entity.GetOnAttachmentSetLock().Insert( OnAttachmentReservationSet );
27 m_Entity.GetOnAttachmentReleaseLock().Insert( OnAttachmentReservationRelease );
28
29 }
30
32 {
33 if( m_Entity )
34 {
35 m_Entity.GetOnItemAttached().Remove( AttachmentAdded );
36 m_Entity.GetOnItemDetached().Remove( AttachmentRemoved );
37 m_Entity.GetOnAttachmentSetLock().Remove( OnAttachmentReservationSet );
38 m_Entity.GetOnAttachmentReleaseLock().Remove( OnAttachmentReservationRelease );
39 }
40
42 }
43
48
49 bool IsEmpty()
50 {
51 return m_AttachmentsContainer.IsEmpty();
52 }
53
55 {
56 ItemBase item = ItemBase.Cast( GetFocusedItem() );
57 if( !item )
58 {
59 return false;
60 }
61 return !IsEmpty() && ( !QuantityConversions.HasItemQuantity( item ) || ( QuantityConversions.HasItemQuantity( item ) && !item.CanBeSplit() ) );
62 }
63
65 {
66 ItemBase item = ItemBase.Cast( GetFocusedItem() );
67 if( !item )
68 {
69 return false;
70 }
71 return !IsEmpty() && QuantityConversions.HasItemQuantity( item ) && item.CanBeSplit();
72 }
73
75 {
76 m_AttachmentsContainer.UnfocusAll();
77 }
78
79 void SetDefaultFocus( bool while_micromanagment_mode = false )
80 {
81 m_AttachmentsContainer.SetDefaultFocus(while_micromanagment_mode);
82 }
83
85 {
86 m_AttachmentsContainer.SetLastActive();
87 }
88
89 void SetActive( bool active )
90 {
91 m_AttachmentsContainer.SetActive(active);
92 }
93
95 {
96 m_AttachmentsContainer.SetFirstActive();
97 }
98
100 {
101 return m_AttachmentsContainer.GetFocusedSlotsIcon();
102 }
103
105 {
106 return m_AttachmentsContainer.GetFocusedItem();
107 }
108
110 {
111 SlotsIcon icon = m_AttachmentsContainer.GetFocusedSlotsIcon();
112 if (icon)
113 return icon.GetSlotID();
114 return -1;
115 }
116
118 {
119 ItemBase item = ItemBase.Cast( GetFocusedItem() );
121
122 if (icon && !icon.IsOutOfReach())
123 {
124 if (item && item.CanPutIntoHands(null))
125 {
126 ItemManager.GetInstance().SetSelectedItemEx(item, null, icon);
127 }
128 else
129 {
130 ItemManager.GetInstance().SetSelectedItemEx(null, null, icon);
131 }
132 return true;
133 }
134 return false;
135 }
136
137 bool Select()
138 {
141 SlotsIcon focused_slot = GetFocusedSlotsIcon();
142 EntityAI focused_item = GetFocusedItem();
143 Man player = GetGame().GetPlayer();
144
145 if( focused_slot.IsReserved() || focused_item != selected_item && !(selected_slot && selected_slot.IsOutOfReach() ) )
146 {
147 if( selected_item )
148 {
149 if( selected_item.GetInventory().CanRemoveEntity() )
150 {
151 if( m_Entity.GetInventory().CanAddAttachmentEx( selected_item, focused_slot.GetSlotID() ) )
152 {
153 player.PredictiveTakeEntityToTargetAttachmentEx( m_Entity, selected_item, focused_slot.GetSlotID() );
154 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
155 return true;
156
157 }
158 else if( m_Entity.GetInventory().CanAddAttachment( selected_item ) )
159 {
160 player.PredictiveTakeEntityToTargetAttachment(m_Entity, selected_item);
161 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
162 return true;
163 }
164 }
165 }
166 else
167 {
168 if ( focused_item && !focused_slot.IsOutOfReach() )
169 {
170 EntityAI item_in_hands = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
172 focused_item.GetInventory().GetCurrentInventoryLocation( il );
173 bool reachable = AttachmentsOutOfReach.IsAttachmentReachable( m_Entity, "", il.GetSlot() );
174 if( reachable && focused_item.GetInventory().CanRemoveEntity() )
175 {
176 if( item_in_hands && item_in_hands.GetInventory().CanRemoveEntity() )
177 {
178 if( GameInventory.CanSwapEntitiesEx( item_in_hands, focused_item ) )
179 {
180 player.PredictiveSwapEntities( item_in_hands, focused_item );
181 return true;
182 }
183 }
184 else
185 {
186 if( player.GetHumanInventory().CanAddEntityInHands( focused_item ) )
187 {
188 player.PredictiveTakeEntityToHands( focused_item );
189 return true;
190 }
191 }
192 }
193 }
194 }
195 }
196 return false;
197 }
198
199 int GetRecipeCount( bool recipe_anywhere, EntityAI entity1, EntityAI entity2 )
200 {
201 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast( GetPlugin( PluginRecipesManager ) );
202 return plugin_recipes_manager.GetValidRecipes( ItemBase.Cast( entity1 ), ItemBase.Cast( entity2 ), null, PlayerBase.Cast( GetGame().GetPlayer() ) );
203 }
204
206 {
207 ItemBase ent = ItemBase.Cast( GetFocusedItem() );
208 ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
209
210 return ( ItemManager.GetCombinationFlags( item_in_hands, ent ) != 0 );
211 }
212
214 {
216 ItemBase ent = ItemBase.Cast( GetFocusedItem() );
217 ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
219 Class.CastTo(amc, m_player.GetActionManager());
220
221 return ( amc.CanPerformActionFromInventory( item_in_hands, ent ) );
222 }
223
224 bool CanEquip()
225 {
226 EntityAI entity = ItemBase.Cast( GetFocusedItem() );
228 if( !entity || entity.IsInherited( Magazine ) )
229 {
230 return false;
231 }
232 return GetGame().GetPlayer().GetInventory().FindFreeLocationFor( entity, FindInventoryLocationType.ATTACHMENT, il );
233 }
234
235 bool Combine()
236 {
237 ItemBase ent = ItemBase.Cast( GetFocusedItem() );
238 ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
240
241 if ( item_in_hands && ent && hands_icon )
242 {
243 return hands_icon.CombineItems( item_in_hands, ent );
244 }
245
246 return false;
247 }
248
250 {
251 ItemBase entity = ItemBase.Cast( GetFocusedItem() );
252 if( entity && !entity.IsInherited( Magazine ) && !GetFocusedSlotsIcon().IsOutOfReach() )
253 {
254 if( entity.HasQuantity() )
255 {
256 entity.OnRightClick();
257 return true;
258 }
259 }
260 return false;
261 }
262
264 {
265 ItemBase entity = ItemBase.Cast( GetFocusedItem() );
266 if( entity && !entity.IsInherited( Magazine ) && !GetFocusedSlotsIcon().IsOutOfReach() )
267 {
268 GetGame().GetPlayer().PredictiveTakeEntityToInventory( FindInventoryLocationType.ATTACHMENT, entity );
269 return true;
270 }
271 return false;
272 }
273
275 {
276 EntityAI entity = GetFocusedItem();
277 if( entity && !GetFocusedSlotsIcon().IsOutOfReach() )
278 {
279 GetGame().GetPlayer().PredictiveTakeEntityToInventory( FindInventoryLocationType.CARGO, entity );
280 return true;
281 }
282 return false;
283 }
284
286 {
287 EntityAI entity = GetFocusedItem();
288 if( entity )
289 {
290 m_Parent.InspectItem( entity );
291 return true;
292 }
293 return false;
294 }
295
297 {
298 ItemBase item = ItemBase.Cast(GetFocusedItem());
299 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer());
300 if (item && !GetFocusedSlotsIcon().IsOutOfReach() )
301 {
302 if (item.GetTargetQuantityMax() < item.GetQuantity())
303 item.SplitIntoStackMaxClient( null, -1 );
304 else
305 player.PhysicalPredictiveDropItem(item);
306 return true;
307 }
308 return false;
309 }
310
311 bool IsActive()
312 {
313 return m_Parent.GetMainWidget().FindAnyWidget("AttachmentsWrapper").GetAlpha() > 0;
314 }
315
317 {
318 return m_AttachmentsContainer.Count();
319 }
320
322 {
323 SlotsIcon icon;
324 int slot_id;
326 int i = 0;
327 for (i = m_AttachmentSlotNames.Count() - 1; i >=0; --i)
328 {
329 slot_id = InventorySlots.GetSlotIdFromString( m_AttachmentSlotNames[i] );
330 if (m_Entity.CanDisplayAttachmentSlot(slot_id))
331 {
333 }
334 else
335 {
336 icon = m_AttachmentSlots.Get( slot_id );
337 if (icon)
338 {
339 icon.GetMainWidget().Show( false );
340 if( GetFocusedSlotsIcon() == icon )
341 {
343 }
344 // radial icon (collabsable icon handling)
345 icon.UpdateInterval();
346 }
347 }
348
349 }
350
351 if ( m_AttachmentSlotDisplayable.Count() == 0 )
352 {
353 if (m_Parent)
354 {
356 //m_Parent.Close();
357 }
358 }
359
360 for (i = 0; i < m_AttachmentSlotDisplayable.Count(); ++i)
361 {
362 slot_id = InventorySlots.GetSlotIdFromString( m_AttachmentSlotDisplayable[i] );
363 icon = m_AttachmentSlots.Get( slot_id );
364 EntityAI item = icon.GetEntity();
365 icon.GetMainWidget().Show( true );
366 icon.UpdateInterval();
367 if ( item )
368 {
369 bool draggable = true;
370 if(icon.IsReserved())
371 {
372 draggable = false;
373 }
374
375 if( m_Entity.GetInventory().GetSlotLock( slot_id ) && ItemManager.GetInstance().GetDraggedItem() != item )
376 {
377 icon.GetMountedWidget().Show( true );
378 draggable = false;
379 }
380 else
381 {
382 icon.GetMountedWidget().Show( false );
383 }
384
385 PlayerBase p = PlayerBase.Cast( GetGame().GetPlayer() );
386 bool in_hands_condition = m_Entity.GetHierarchyRoot() && item.GetInventory().CanRemoveEntity();
387 bool in_vicinity_condition = !m_Entity.GetHierarchyRoot() && AttachmentsOutOfReach.IsAttachmentReachable( m_Entity, m_AttachmentSlotDisplayable[i] );
388 if( in_hands_condition || in_vicinity_condition )
389 {
390 icon.GetOutOfReachWidget().Show( false );
391 }
392 else
393 {
394 icon.GetOutOfReachWidget().Show( true );
395 draggable = false;
396 }
397
398 if( draggable )
399 {
400 icon.GetPanelWidget().SetFlags( WidgetFlags.DRAGGABLE );
401 }
402 else
403 {
404 icon.GetPanelWidget().ClearFlags( WidgetFlags.DRAGGABLE );
405 }
406 }
407 }
408 m_AttachmentsContainer.GetRootWidget().Update();
409 }
410
415
416 void AttachmentAdded(EntityAI item, string slot, EntityAI parent)
417 {
418 int slot_id = InventorySlots.GetSlotIdFromString(slot);
419 SlotsIcon icon = m_AttachmentSlots.Get(slot_id);
420 if (icon)
421 {
422 icon.SetSlotID(slot_id);
423 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
424 if (item)
425 {
426 icon.Init(item);
427 }
428 }
429 }
430
431 void AttachmentRemoved(EntityAI item, string slot, EntityAI parent)
432 {
433 int slot_id = InventorySlots.GetSlotIdFromString(slot);
434 SlotsIcon icon = m_AttachmentSlots.Get(slot_id);
435 if (icon)
436 {
437 icon.Clear();
438 }
439 }
440
441 void OnAttachmentReservationSet( EntityAI item, int slot_id )
442 {
443 SlotsIcon icon = m_AttachmentSlots.Get( slot_id );
444
445 if (item)
446 {
447 icon.Init( item, true );
448 }
449 }
450
451 void OnAttachmentReservationRelease( EntityAI item, int slot_id )
452 {
453 SlotsIcon icon = m_AttachmentSlots.Get( slot_id );
454 icon.Clear();
455 }
456
457
458 void InitAttachmentGrid( int att_row_index )
459 {
460 SlotsIcon icon;
461 int i;
462 m_RowIndex = att_row_index;
463
464 int number_of_rows = Math.Ceil( m_AttachmentSlotNames.Count() / ITEMS_IN_ROW );
465 string name = m_Entity.GetDisplayName();
466 name.ToUpper();
467
471 m_AttachmentsContainer.GetRootWidget().SetSort( att_row_index );
472 m_Parent.Insert( m_AttachmentsContainer, att_row_index );
473
474 for ( i = 0; i < number_of_rows; i++ )
475 {
477 m_AttachmentsContainer.Insert( ic );
478
479 if( i == ( number_of_rows - 1 ) && m_AttachmentSlotNames.Count() % ITEMS_IN_ROW != 0 )
480 {
481 ic.SetColumnCount( m_AttachmentSlotNames.Count() % ITEMS_IN_ROW );
482 }
483 else
484 {
485 ic.SetColumnCount( ITEMS_IN_ROW );
486 }
487
488 for( int j = 0; j < ITEMS_IN_ROW; j++ )
489 {
490 icon = ic.GetSlotIcon( j );
491 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetMainWidget(), m_Parent, "OnDropReceivedFromHeader2" );
492 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetGhostSlot(), m_Parent, "OnDropReceivedFromHeader2" );
493 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetPanelWidget(), m_Parent, "OnDropReceivedFromHeader2" );
494
495 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetMainWidget(), m_Parent, "DraggingOverHeader" );
498
499 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetMainWidget(), m_Parent, "MouseClick2" );
502 }
503 }
504
505 for ( i = 0; i < m_AttachmentSlotNames.Count(); i++ )
506 {
509
510 string path = "CfgSlots" + " Slot_" + m_AttachmentSlotNames[i];
511
512 //Show different magazine icon for firearms and pistols
513 if ( m_AttachmentSlotNames[i] == "magazine" )
514 {
515 if ( !m_Entity.IsInherited( Pistol_Base ) )
516 path = "CfgSlots" + " Slot_" + "magazine2";
517 }
518
519 string icon_name = ""; //icon_name must be in format "set:<setname> image:<imagename>"
520 if( GetGame().ConfigGetText( path + " ghostIcon", icon_name ) && icon_name != "" )
521 icon.GetGhostSlot().LoadImageFile( 0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY,icon_name) );
522 int slot_id = InventorySlots.GetSlotIdFromString( m_AttachmentSlotNames[i] );
523 m_AttachmentSlots.Insert( slot_id, icon );
524 m_AttachmentIDOrdered.Insert(slot_id);
525
526 icon.SetSlotID(slot_id);
527 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
528
529 EntityAI item = m_Entity.GetInventory().FindAttachment( slot_id );
530 if( item )
532 else
533 icon.Clear();
534
535 if (m_Entity.CanDisplayAttachmentSlot(slot_id))
536 {
537 icon.GetMainWidget().Show( true );
538 }
539 else
540 {
541 icon.GetMainWidget().Show( false );
542 }
543 }
544
545 if( m_AttachmentSlotNames.Count() > 0 )
546 {
547 int row_index = number_of_rows - 1;
548 SlotsContainer row_last = SlotsContainer.Cast( m_AttachmentsContainer.Get( row_index ) );
549 if( row_last )
550 {
551 for( int k = ((m_AttachmentSlotNames.Count() - 1) % ITEMS_IN_ROW) + 1; k < ITEMS_IN_ROW; k++ )
552 {
553 row_last.GetSlotIcon( k ).GetMainWidget().Show( false );
554 }
555 row_last.GetRootWidget().Update();
556 row_last.GetRootWidget().GetParent().Update();
557 }
558 }
559
560 m_AttachmentsContainer.RecomputeOpenedContainers();
561 }
562
564 {
565 TStringArray searching_in = new TStringArray;
566 searching_in.Insert( CFG_VEHICLESPATH );
567 searching_in.Insert( CFG_WEAPONSPATH );
568 searching_in.Insert( CFG_MAGAZINESPATH );
569
570 array<string> attachments_slots = new array<string>;
571 int i = 0;
572 for ( int s = 0; s < searching_in.Count(); ++s )
573 {
574 string cfg_name = searching_in.Get( s );
575 string path = cfg_name + " " + e.GetType();
576
577 if ( GetGame().ConfigIsExisting( path ) )
578 {
579 GetGame().ConfigGetTextArray( path + " attachments", attachments_slots );
580 if ( e.IsWeapon() && (!e.ConfigIsExisting("DisplayMagazine") || e.ConfigGetBool("DisplayMagazine")) )
581 {
582 attachments_slots.Insert( "magazine" );
583 }
584
585 return attachments_slots;
586 }
587 }
588 if ( e.IsWeapon() && (!e.ConfigIsExisting("DisplayMagazine") || e.ConfigGetBool("DisplayMagazine")) )
589 {
590 attachments_slots.Insert( "magazine" );
591 }
592
593 return attachments_slots;
594 }
595
600
605
610
611 void SetAttachmentSlotID(int slotID)
612 {
613 m_AttachmentSlotID = slotID;
614 }
615
617 {
618 return m_AttachmentSlotID;
619 }
620}
const int ITEMS_IN_ROW
Definition attachments.c:1
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
bool CanPerformActionFromInventory(ItemBase mainItem, ItemBase targetItem)
Container m_Parent
Definition attachments.c:5
void SetFalseAttachmentsHeaderText(string text)
void AttachmentRemoved(EntityAI item, string slot, EntityAI parent)
ref array< string > m_AttachmentSlotDisplayable
Definition attachments.c:9
ref array< string > m_AttachmentSlotNames
Definition attachments.c:8
ref AttachmentsWrapper m_AttachmentsContainer
Definition attachments.c:7
bool CanCombine()
void SetDefaultFocus(bool while_micromanagment_mode=false)
Definition attachments.c:79
void AttachmentAdded(EntityAI item, string slot, EntityAI parent)
void OnAttachmentReservationRelease(EntityAI item, int slot_id)
SlotsIcon GetFocusedSlotsIcon()
Definition attachments.c:99
bool TransferItem()
bool IsActive()
EntityAI m_Entity
Definition attachments.c:6
array< int > GetSlotsSorted()
void UnfocusAll()
Definition attachments.c:74
void SelFirstActive()
Definition attachments.c:94
array< string > GetItemSlots(EntityAI e)
bool CanCombineAmmo()
bool EquipItem()
bool TransferItemToVicinity()
int GetAttachmentSlotID()
int GetAttachmentHeight()
bool SplitItem()
void UpdateInterval()
void SetAttachmentSlotID(int slotID)
int m_AttachmentSlotID
Definition attachments.c:14
void ~Attachments()
Definition attachments.c:31
ref array< int > m_AttachmentIDOrdered
Definition attachments.c:11
bool IsEmpty()
Definition attachments.c:49
void SetActive(bool active)
Definition attachments.c:89
AttachmentsWrapper GetWrapper()
Definition attachments.c:44
void Attachments(Container parent, EntityAI entity)
Definition attachments.c:16
bool IsItemWithQuantityActive()
Definition attachments.c:64
bool IsItemActive()
Definition attachments.c:54
void OnAttachmentReservationSet(EntityAI item, int slot_id)
EntityAI GetFocusedItem()
ref map< int, SlotsIcon > m_AttachmentSlots
Definition attachments.c:10
int GetRecipeCount(bool recipe_anywhere, EntityAI entity1, EntityAI entity2)
int GetFocusedSlot()
TextWidget GetFalseHeaderTextWidget()
bool CanEquip()
bool InspectItem()
void SetLastActive()
Definition attachments.c:84
void InitAttachmentGrid(int att_row_index)
bool Combine()
bool SelectItem()
void ShowFalseAttachmentsHeader(bool show)
bool Select()
static bool IsAttachmentReachable(EntityAI e, string att_slot_name="", int slot_id=-1, float range=1.5)
void SetFalseAttachmentsHeaderText(string text)
void ShowFalseAttachmentsHeader(bool show)
TextWidget GetFalseHeaderTextWidget()
void SetParent(Attachments atts)
Super root of all classes in Enforce script.
Definition enscript.c:11
override void UpdateRadialIcon()
script counterpart to engine's class Inventory
Definition inventory.c:79
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition inventory.c:628
Definition icon.c:2
bool CombineItems(EntityAI entity1, EntityAI entity2)
Definition icon.c:731
InventoryLocation.
provides access to slot configuration
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
EntityAI GetDraggedItem()
void SetSelectedItemEx(EntityAI selected_item, Container selected_container, LayoutHolder selected_icon)
HandsPreview GetHandsPreview()
Definition itemmanager.c:75
SlotsIcon GetSelectedIcon()
EntityAI GetSelectedItem()
Definition itemmanager.c:85
static ItemManager GetInstance()
Definition enmath.c:7
base for semi auto weapons @NOTE name copies config base class
SlotsIcon GetSlotIcon(int index)
Widget GetPanelWidget()
Definition slotsicon.c:205
EntityAI GetEntity()
Definition slotsicon.c:365
void Init(EntityAI obj, bool reservation=false)
Definition slotsicon.c:501
void SetSlotID(int slot_ID)
Definition slotsicon.c:195
bool IsOutOfReach()
Definition slotsicon.c:729
void SetSlotDisplayName(string text)
Definition slotsicon.c:144
bool IsReserved()
Definition slotsicon.c:200
int GetSlotID()
Definition slotsicon.c:190
void Clear()
Definition slotsicon.c:612
override void UpdateInterval()
Definition slotsicon.c:791
Widget GetMountedWidget()
Definition slotsicon.c:225
Widget GetOutOfReachWidget()
Definition slotsicon.c:265
ImageWidget GetGhostSlot()
Definition slotsicon.c:235
void RegisterOnDropReceived(Widget w, Managed eventHandler, string functionName)
void RegisterOnDraggingOver(Widget w, Managed eventHandler, string functionName)
static WidgetEventHandler GetInstance()
void RegisterOnMouseButtonDown(Widget w, Managed eventHandler, string functionName)
void RegisterOnDoubleClick(Widget w, Managed eventHandler, string functionName)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
array< string > TStringArray
Definition enscript.c:709
const string CFG_VEHICLESPATH
Definition constants.c:220
const string CFG_WEAPONSPATH
Definition constants.c:221
const string CFG_MAGAZINESPATH
Definition constants.c:222
WidgetFlags
Definition enwidgets.c:58
FindInventoryLocationType
flags for searching locations in inventory
PlayerBase GetPlayer()
PluginBase GetPlugin(typename plugin_type)
DayZPlayer m_player