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

◆ DoubleClick()

void AttachmentCategoriesRow::DoubleClick ( Widget w,
int x,
int y,
int button )
inlineprotected

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

789 {
790 if (button == MouseState.LEFT && !g_Game.IsLeftCtrlDown())
791 {
792 ItemPreviewWidget iw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
793 if (!iw)
794 {
795 string name = w.GetName();
796 name.Replace("PanelWidget", "Render");
797 iw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
798 }
799
800 if (!iw)
801 iw = ItemPreviewWidget.Cast(w);
802
803 SlotsIcon icon;
804 w.GetUserData(icon);
805
806 if (icon && m_Entity.GetInventory().GetSlotLock(iw.GetUserID()))
807 return;
808
809 if (icon.IsOutOfReach())
810 return;
811
812 ItemBase item = ItemBase.Cast(iw.GetItem());
813 if (item)
814 {
815 if (!item.GetInventory().CanRemoveEntity())
816 return;
817
818 PlayerBase controlledPlayer = PlayerBase.Cast(g_Game.GetPlayer());
819 if (controlledPlayer.GetInventory().HasEntityInInventory(item) && controlledPlayer.GetHumanInventory().CanAddEntityInHands(item))
820 {
821 controlledPlayer.PredictiveTakeEntityToHands(item);
822 }
823 else
824 {
825 if (controlledPlayer.GetInventory().CanAddEntityToInventory(item) && item.GetInventory().CanRemoveEntity())
826 {
827 if (item.GetTargetQuantityMax() < item.GetQuantity())
828 item.SplitIntoStackMaxClient(controlledPlayer, -1);
829 else
830 controlledPlayer.PredictiveTakeEntityToInventory(FindInventoryLocationType.ANY, item);
831 }
832 else
833 {
834 if (controlledPlayer.GetHumanInventory().CanAddEntityInHands(item))
835 {
836 if (item.GetTargetQuantityMax() < item.GetQuantity())
837 item.SplitIntoStackMaxHandsClient(controlledPlayer);
838 else
839 controlledPlayer.PredictiveTakeEntityToHands(item);
840 }
841 }
842 }
843
844 HideOwnedTooltip();
845
846 name = w.GetName();
847 name.Replace("PanelWidget", "Temperature");
848 w.FindAnyWidget(name).Show(false);
849 }
850 }
851 }
Entity m_Entity
Определения CachedEquipmentStorageBase.c:16
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:4074
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
proto native GameInventory GetInventory()
proto native bool GetSlotLock(int slot)
proto native EntityAI GetItem()
bool IsOutOfReach()
Определения SlotsIconBase.c:700
MouseState
Определения EnSystem.c:311

Перекрестные ссылки g_Game, ItemPreviewWidget::GetItem(), SlotsIconBase::IsOutOfReach(), m_Entity, name, x и y.