DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ItemAttached()

void ZombieContainer::ItemAttached ( EntityAI item,
string slot_name )
inlineprotected

См. определение в файле ZombieContainer.c строка 245

246 {
247 int slot = InventorySlots.GetSlotIdFromString( slot_name );
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
281 ClosableContainer conta = ClosableContainer.Cast( m_ShowedItems.Get( item ) );
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 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native bool ConfigIsExisting(string path)
override bool IsOpened()
Определения ContainerWithCargo.c:102
override void Refresh()
Определения CollapsibleContainer.c:31
void ClosableContainer(LayoutHolder parent, int sort=-1)
Определения ClosableContainer.c:6
Widget GetPanelWidget()
Определения SlotsIcon.c:205
Widget GetRadialIconClosed()
Определения SlotsIcon.c:305
void Init(EntityAI obj, bool reservation=false)
Определения SlotsIcon.c:501
Widget GetRadialIcon()
Определения SlotsIcon.c:310
Widget GetRadialIconPanel()
Определения SlotsIcon.c:300
ref map< EntityAI, ref Container > m_ShowedItems
Определения ZombieContainer.c:6
ref map< int, SlotsIcon > m_InventorySlots
Определения ZombieContainer.c:5
proto native CGame GetGame()
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки Container::ClosableContainer(), CGame::ConfigIsExisting(), GetGame(), WidgetEventHandler::GetInstance(), SlotsIcon::GetPanelWidget(), SlotsIcon::GetRadialIcon(), SlotsIcon::GetRadialIconClosed(), SlotsIcon::GetRadialIconPanel(), InventorySlots::GetSlotIdFromString(), SlotsIcon::Init(), ClosableContainer::IsOpened(), m_InventorySlots, m_ShowedItems, name, CollapsibleContainer::Refresh() и WidgetEventHandler::RegisterOnMouseButtonUp().

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