415 {
416 int row, column;
417 SlotsIcon icon;
418 bool has_cargo =
m_ZombieEntity.GetInventory().GetCargo() != null;
419
420 string config_path_ghosts_slots = "CfgVehicles ZombieBase InventoryEquipment playerSlots";
421 array<string> player_ghosts_slots = new array<string>();
422 g_Game.ConfigGetTextArray( config_path_ghosts_slots, player_ghosts_slots );
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
430 {
431 string icon_name;
432 g_Game.ConfigGetText(
path +
" ghostIcon", icon_name );
434
435
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 );
461
462 WidgetEventHandler.GetInstance().RegisterOnDoubleClick( icon.
GetPanelWidget(),
this,
"DoubleClick" );
463
464
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
472 icon.
GetGhostSlot().LoadImageFile( 0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY,icon_name) );
473
474
475 g_Game.ConfigGetText(
path +
" name", slot_name );
476 int slot_id = InventorySlots.GetSlotIdFromString( slot_name );
480
481 int slot = InventorySlots.GetSlotIdFromString( slot_name );
483
484 if( item )
486 }
487 }
488
490 {
494 {
495 if( row < ( player_ghosts_slots.Count() + 1 /
ITEMS_IN_ROW ) )
497 else
499 }
500
502 icon.GetMainWidget().Show( true );
504 icon.
GetGhostSlot().LoadImageFile( 0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY,
m_ZombieEntity.ConfigGetString(
"GUIInventoryCargoIcon")) );
508
509 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp( icon.
GetGhostSlot(),
this,
"ToggleContainer" );
510 m_CargoGrid =
new ContainerWithCargo(
this,
false );
515 }
516
517 RecomputeOpenedContainers();
518 }
class GP5GasMask extends MaskBase ItemBase
void SetSlotID(int slot_ID)
void SetSlotDisplayName(string text)
void SetContainer(Container container)
Widget GetRadialIconPanel()
ImageWidget GetGhostSlot()
ref map< EntityAI, ref Container > m_ShowedItems
ref AttachmentsGroupContainer m_Container
void ItemAttached(EntityAI item, string slot_name)
ref ContainerWithCargo m_CargoGrid
void AddSlotsContainer(int row_count)
SlotsIcon GetSlotsIcon(int row, int column)
ref map< int, SlotsIcon > m_InventorySlots