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

◆ MouseClick()

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

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

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

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