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

◆ MouseClick()

void Icon::MouseClick ( Widget w,
int x,
int y,
int button )
inlineprotected

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

827 {
828 if (button == MouseState.RIGHT)
829 {
830 if (m_Lock)
831 {
832 GetGame().GetPlayer().GetHumanInventory().ClearUserReservedLocationSynced(m_Item);
833 }
834 else if (m_Item)
835 {
836 #ifdef DIAG_DEVELOPER
837 if (GetDayZGame().IsLeftCtrlDown())
838 ShowActionMenu(m_Item);
839 else
840 #endif
841 {
842 m_Item.OnRightClick();
843
844 if (m_HasQuantity)
845 SetQuantity();
846 }
847 }
848
849 }
850 else if (!m_Lock)
851 {
852 switch (button)
853 {
854 case MouseState.MIDDLE:
856 break;
857
858 case MouseState.LEFT:
859 PlayerBase controlledPlayer = PlayerBase.Cast(GetGame().GetPlayer());
860 if (g_Game.IsLeftCtrlDown())
861 {
862 if (controlledPlayer.CanDropEntity(m_Item))
863 {
864 if (m_Item.GetTargetQuantityMax() < m_Item.GetQuantity())
865 m_Item.SplitIntoStackMaxClient(null, -1);
866 else
867 controlledPlayer.PhysicalPredictiveDropItem(m_Item);
868
869 ItemManager.GetInstance().SetWidgetDraggable(w, false);
870 }
871 }
872 else
873 {
874 InventoryLocation il = new InventoryLocation();
875 m_Obj.GetInventory().GetCurrentInventoryLocation(il);
876
877 bool draggable = !controlledPlayer.GetInventory().HasInventoryReservation(m_Obj, null) && !controlledPlayer.GetInventory().IsInventoryLocked() && !controlledPlayer.IsItemsToDelete();
878 draggable = draggable && (m_Obj.GetHierarchyRoot() && m_Obj.GetInventory().CanRemoveEntity() || !m_Obj.GetHierarchyRoot() && AttachmentsOutOfReach.IsAttachmentReachable(m_Obj, "", il.GetSlot()));
879
880 ItemManager.GetInstance().SetWidgetDraggable(w, draggable);
881 }
882 break;
883 }
884 }
885 }
DayZGame g_Game
Определения DayZGame.c:3868
DayZGame GetDayZGame()
Определения DayZGame.c:3870
PlayerBase GetPlayer()
Определения ModifierBase.c:51
proto native DayZPlayer GetPlayer()
ItemBase m_Item
Определения Icon.c:16
bool m_HasQuantity
Определения Icon.c:12
EntityAI m_Obj
Определения Icon.c:15
void SetQuantity()
Определения Icon.c:1322
EntityAI m_Lock
Определения Icon.c:8
proto native int GetSlot()
returns slot id if current type is Attachment
bool InspectItem()
Определения Container.c:387
proto native CGame GetGame()
MouseState
Определения EnSystem.c:311

Перекрестные ссылки g_Game, GetDayZGame(), GetGame(), ItemManager::GetInstance(), CGame::GetPlayer(), GetPlayer(), InventoryLocation::GetSlot(), LayoutHolder::InspectItem(), AttachmentsOutOfReach::IsAttachmentReachable(), m_HasQuantity, m_Item, m_Lock, m_Obj, SetQuantity(), ItemManager::SetWidgetDraggable(), x и y.