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

◆ UpdateInterval()

void Attachments::UpdateInterval ( )
inlineprotected

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

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 {
355 m_Parent.UpdateRadialIcon();
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 }
class LogManager EntityAI
PlayerBase GetPlayer()
Определения ModifierBase.c:51
Container m_Parent
Определения Attachments.c:5
ref array< string > m_AttachmentSlotDisplayable
Определения Attachments.c:9
ref array< string > m_AttachmentSlotNames
Определения Attachments.c:8
ref AttachmentsWrapper m_AttachmentsContainer
Определения Attachments.c:7
void SetDefaultFocus(bool while_micromanagment_mode=false)
Определения Attachments.c:79
SlotsIcon GetFocusedSlotsIcon()
Определения Attachments.c:99
EntityAI m_Entity
Определения Attachments.c:6
ref map< int, SlotsIcon > m_AttachmentSlots
Определения Attachments.c:10
Widget GetPanelWidget()
Определения SlotsIcon.c:205
EntityAI GetEntity()
Определения SlotsIcon.c:365
bool IsReserved()
Определения SlotsIcon.c:200
override void UpdateInterval()
Определения SlotsIcon.c:791
Widget GetMountedWidget()
Определения SlotsIcon.c:225
Widget GetOutOfReachWidget()
Определения SlotsIcon.c:265
proto native CGame GetGame()
WidgetFlags
Определения EnWidgets.c:58

Перекрестные ссылки ItemManager::GetDraggedItem(), SlotsIcon::GetEntity(), GetFocusedSlotsIcon(), GetGame(), ItemManager::GetInstance(), SlotsIcon::GetMountedWidget(), SlotsIcon::GetOutOfReachWidget(), SlotsIcon::GetPanelWidget(), GetPlayer(), InventorySlots::GetSlotIdFromString(), AttachmentsOutOfReach::IsAttachmentReachable(), SlotsIcon::IsReserved(), m_AttachmentsContainer, m_AttachmentSlotDisplayable, m_AttachmentSlotNames, m_AttachmentSlots, m_Entity, m_Parent, SetDefaultFocus() и SlotsIcon::UpdateInterval().

Используется в HandsContainer::AttachmentAdded().