Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс Icon
+ Граф наследования:Icon:

Защищенные члены

void Icon (LayoutHolder parent, bool hands_icon=false)
 
void ~Icon ()
 
Widget GetSelectedWidget ()
 
Widget GetCursorWidget ()
 
Widget GetMicromanagedPanel ()
 
bool IsDragged ()
 
override void SetActive (bool active)
 
override void SetParentWidget ()
 
int GetRelevantInventoryAction (int relevantActions)
 
void RefreshQuickbar ()
 
void DoubleClick (Widget w, int x, int y, int button)
 
void DraggingOverSwap (Widget w, int x, int y, Widget receiver)
 
void DraggingOverCombine (Widget w, int x, int y, Widget receiver)
 
bool MouseEnter (Widget w, int x, int y)
 
bool MouseLeave (Widget w, Widget s, int x, int y)
 
void DraggingOver (Widget w, int x, int y, Widget receiver)
 
void OnPerformCombination (int combinationFlags)
 
bool PerformCombination (EntityAI selectedEntity, EntityAI targetEntity, int combinationFlag, InventoryLocation ilSwapDst=null)
 
void UpdateFrameColor (EntityAI selectedEntity, EntityAI targetEntity, int combinationFlag, Widget w, InventoryLocation il=null)
 
void ShowActionMenuCombine (EntityAI entity1, EntityAI entity2, int combinationFlags, Widget w, bool color_test)
 
void OnPerformRecipe (int id)
 
void Combine (Widget w, int x, int y, Widget receiver)
 
bool CombineItems (EntityAI entity1, EntityAI entity2)
 
bool FlagAction (EntityAI entity1, EntityAI entity2, int combinationFlags)
 
void MouseClick (Widget w, int x, int y, int button)
 
void DropReceivedFromMain (Widget w, int x, int y, Widget receiver)
 
void Swap (Widget w, int x, int y, Widget receiver)
 
void ToRefresh (Icon icon, Icon icon2)
 
override void SetLayoutName ()
 
void SetSize (int x, int y)
 
void SetPos (int x, int y)
 
int GetCargoPos ()
 
void SetCargoPos (int x)
 
void DestroyWhiteBackground ()
 
void CreateWhiteBackground ()
 
void OnDraggingOverBackground (Widget w, int x, int y, Widget reciever)
 
void DropReceivedFromBackground (Widget w, int x, int y, Widget reciever)
 
void RevertToOriginalFlip ()
 
override void Refresh ()
 
void SetTemperature ()
 
void RefreshIconPos ()
 
void FullScreen ()
 
void RefreshPos (int row, int column)
 
Object GetObject ()
 
void RefreshMuzzleIcon ()
 
void SetQuantity ()
 
void SetSort (int index)
 
int GetSort ()
 
void SetItemPreviewEx (bool refresh=true)
 
void SetItemPreview ()
 
void SetItemSizeEx (bool refresh=true)
 
void SetItemSize ()
 
void UpdateFlip (bool flipped)
 
void InitLock (EntityAI parent, EntityAI obj, int x_pos, int y_pos, bool flip)
 
void InitEx (EntityAI obj, bool refresh=true)
 
void Init (EntityAI obj)
 
void CheckIsWeapon ()
 
void CheckIsMagazineEx (bool refresh=true)
 
void CheckIsMagazine ()
 
void CheckHasTemperature ()
 
void CheckHasQuantityEx (bool refresh=true)
 
void CheckHasQuantity ()
 
void SetPosX (int x)
 
void SetPosY (int y)
 
void SetSizeX (int x)
 
void SetSizeY (int y)
 
int GetPosX ()
 
int GetPosY ()
 
int GetSizeX ()
 
int GetSizeY ()
 
void SetPosEx (bool refresh=true)
 
void SetPos ()
 
void SetSize ()
 
override void UpdateInterval ()
 

Защищенные данные

int m_SizeX
 
int m_SizeY
 
int m_PosX
 
int m_PosY
 
EntityAI m_Lock
 
bool m_IsWeapon = false
 
bool m_IsMagazine = false
 
bool m_HasTemperature = false
 
bool m_HasQuantity = false
 
float m_CurrQuantity = -1
 
EntityAI m_Obj
 
ItemBase m_Item
 
bool m_HandsIcon
 
int m_CargoPos
 
bool m_IsDragged
 
bool m_PreviousFlipOrientation
 
const int NUMBER_OF_TIMERS = 2
 
ItemPreviewWidget m_ItemPreview
 
Widget m_ColorWidget
 
Widget m_SelectedPanel
 
Widget m_MicromanagedPanel
 
Widget m_CursorWidget
 
Widget m_QuantityPanel
 
TextWidget m_QuantityItem
 
ProgressBarWidget m_QuantityProgress
 
Widget m_QuantityStack
 
Widget m_ItemSizePanel
 
TextWidget m_ItemSizeWidget
 
ref array< ImageWidgetm_AmmoIcons
 
ImageWidget m_AmmoTypeIcon
 

Дополнительные унаследованные члены

- Закрытые члены унаследованные от LayoutHolder
void OnDropReceivedFromHeader (Widget w, int x, int y, Widget receiver)
 
void DraggingOver (Widget w, int x, int y, Widget receiver)
 
void DraggingOverHeader (Widget w, int x, int y, Widget receiver)
 
void UpdateSpacer ()
 
Header GetHeader ()
 
void SetHeader (Header header)
 
void CheckHeaderDragability ()
 
void Container (LayoutHolder parent)
 
Container GetFocusedContainer ()
 
Container GetContainer (int index)
 
void SetFocusedContainer (Container cont)
 
SlotsIcon GetFocusedSlotsIcon ()
 
int GetActiveIndex ()
 
void SetActiveIndex (int index)
 
ScrollWidget GetScrollWidget ()
 
void UpdateRadialIcon ()
 
void SetSlotIcon (SlotsIcon icon)
 
void SetDefaultFocus (bool while_micromanagment_mode=false)
 
void SetLastFocus ()
 
void Unfocus ()
 
void MoveGridCursor (int direction)
 
void ScrollToActiveContainer ()
 
void CheckScrollbarVisibility ()
 
void Open ()
 
void Close ()
 
bool IsOpened ()
 
void SetOpenForSlotIcon (bool open, SlotsIcon icon=null)
 
void Toggle ()
 
float GetFocusedContainerHeight (bool contents=false)
 
float GetFocusedContainerYPos (bool contents=false)
 
float GetFocusedContainerYScreenPos (bool contents=false)
 
int Count ()
 
bool SelectItem ()
 
bool Select ()
 
bool OnSelectButton ()
 
bool Combine ()
 
bool TransferItemToVicinity ()
 
bool TransferItem ()
 
bool InspectItem ()
 
bool SplitItem ()
 
bool EquipItem ()
 
bool CanOpenCloseContainer ()
 
bool CanOpenCloseContainerEx (EntityAI focusedEntity)
 
bool CanSplit ()
 
bool CanSplitEx (EntityAI focusedEntity)
 
bool CanDrop ()
 
bool CanDropEx (EntityAI focusedEntity)
 
bool CanSwapOrTakeToHands ()
 
bool CanSwapOrTakeToHandsEx (EntityAI focusedEntity)
 
bool CanEquip ()
 
bool CanEquipEx (EntityAI focusedEntity)
 
bool CanTakeToInventory ()
 
bool CanTakeToInventoryEx (EntityAI focusedEntity)
 
bool CanCombine ()
 
bool CanCombineEx (EntityAI focusedEntity)
 
bool CanCombineAmmo ()
 
bool CanAddToQuickbarEx (EntityAI focusedEntity)
 
bool AddItemToQuickbarRadial (EntityAI itemToAssign)
 
bool IsEmpty ()
 
bool IsItemActive ()
 
bool IsItemWithQuantityActive ()
 
EntityAI GetFocusedItem ()
 
EntityAI GetFocusedContainerEntity ()
 
int GetColumnCount ()
 
void SetColumnCount (int count)
 
int GetFocusedColumn ()
 
void SetFocusedColumn (int column)
 
override void UpdateInterval ()
 
override void SetLastActive ()
 
override void SetFirstActive ()
 
override void SetActive (bool active)
 
void UnfocusAll ()
 
void UnfocusGrid ()
 
bool IsLastIndex ()
 
bool IsFirstIndex ()
 
bool IsFirstContainerFocused ()
 
bool IsLastContainerFocused ()
 
void ResetFocusedContainer ()
 
void SetNextActive ()
 
void SetPreviousActive (bool force=false)
 
void SetNextRightActive ()
 
void SetNextLeftActive ()
 
void SetSameLevelNextActive ()
 
void SetSameLevelPreviousActive ()
 
void RecomputeOpenedContainers ()
 
override void SetLayoutName ()
 
void Insert (LayoutHolder container, int pos=-1, bool immedUpdate=true)
 
void Remove (LayoutHolder container)
 
LayoutHolder Get (int x)
 
override void Refresh ()
 
void UpdateBodySpacers ()
 
void HideContent (bool force_hide=false)
 
void ShowContent (bool force_show=false)
 
void SetForceShow (bool value)
 
override void UpdateSelectionIcons ()
 
void ExpandCollapseContainer ()
 
- Закрытые данные унаследованные от LayoutHolder
ref array< ref LayoutHolderm_Body
 
ref array< LayoutHolderm_OpenedContainers
 
int m_ActiveIndex = 0
 
bool m_LastIndex
 
bool m_Closed
 
Container m_FocusedContainer
 
float m_PrevAlpha
 
const int ITEMS_IN_ROW = 8
 
int m_ColumnCount
 
int m_FocusedColumn = 0
 
bool m_ForcedHide
 
bool m_ForcedShow
 
SlotsIcon m_SlotIcon
 
EntityAI m_Entity
 
const int SORT_ATTACHMENTS_OWN = 1
 
const int SORT_CARGO_OWN = 2
 
const int SORT_ATTACHMENTS_NEXT_OFFSET = 2
 
const int SORT_CARGO_NEXT_OFFSET = 3
 

Подробное описание

Конструктор(ы)

◆ Icon()

void Icon ( LayoutHolder parent,
bool hands_icon = false )
inlineprotected
43 {
45 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
46
47 m_ItemPreview = ItemPreviewWidget.Cast( GetMainWidget().FindAnyWidget( "Render" ));
48
49 m_ColorWidget = GetMainWidget().FindAnyWidget( "Color" );
50 m_SelectedPanel = GetMainWidget().FindAnyWidget( "Selected" );
51 m_MicromanagedPanel = GetMainWidget().FindAnyWidget( "Micromanaged" );
52 m_CursorWidget = GetMainWidget().FindAnyWidget( "Cursor" );
53
54 m_QuantityPanel = GetMainWidget().FindAnyWidget( "QuantityPanel" );
55 m_QuantityItem = TextWidget.Cast( GetMainWidget().FindAnyWidget( "Quantity" ) );
56 m_QuantityProgress = ProgressBarWidget.Cast( GetMainWidget().FindAnyWidget( "QuantityBar" ) );
57 m_QuantityStack = GetMainWidget().FindAnyWidget( "QuantityStackPanel" );
58
59 m_ItemSizePanel = GetMainWidget().FindAnyWidget( "ItemSizePanel" );
60 m_ItemSizeWidget = TextWidget.Cast( GetMainWidget().FindAnyWidget( "ItemSize" ) );
61
62 m_AmmoTypeIcon = ImageWidget.Cast( GetMainWidget().FindAnyWidget( "AmmoTypeIcon" ) );
63 SetActive( false );
64 }
void SetActive()
Definition TrapBase.c:437
ItemPreviewWidget m_ItemPreview
Definition Icon.c:24
Widget m_ColorWidget
Definition Icon.c:26
Widget m_CursorWidget
Definition Icon.c:29
TextWidget m_ItemSizeWidget
Definition Icon.c:37
ImageWidget m_AmmoTypeIcon
Definition Icon.c:40
ProgressBarWidget m_QuantityProgress
Definition Icon.c:33
Widget m_QuantityPanel
Definition Icon.c:31
TextWidget m_QuantityItem
Definition Icon.c:32
Widget m_SelectedPanel
Definition Icon.c:27
Widget m_QuantityStack
Definition Icon.c:34
Widget m_MicromanagedPanel
Definition Icon.c:28
Widget m_ItemSizePanel
Definition Icon.c:36
bool m_HandsIcon
Definition Icon.c:17
Definition ItemManager.c:2
static ItemManager GetInstance()
Definition ItemManager.c:283
Definition gameplay.c:276
Definition EntityAI.c:95
Definition EnWidgets.c:220
proto native Widget FindAnyWidget(string pathname)

Перекрестные ссылки FindAnyWidget(), ItemManager::GetInstance(), m_AmmoTypeIcon, m_ColorWidget, m_CursorWidget, m_HandsIcon, m_ItemPreview, m_ItemSizePanel, m_ItemSizeWidget, m_MicromanagedPanel, m_QuantityItem, m_QuantityPanel, m_QuantityProgress, m_QuantityStack, m_SelectedPanel и SetActive().

◆ ~Icon()

void ~Icon ( )
inlineprotected
67 {
68 if (m_Obj)
69 {
70 m_Obj.GetOnItemFlipped().Remove(UpdateFlip);
71 m_Obj.GetOnViewIndexChanged().Remove(SetItemPreview);
72 }
73
74 if (m_IsDragged)
75 {
77 ItemManager.GetInstance().HideDropzones();
78 ItemManager.GetInstance().SetIsDragging(false);
79 m_IsDragged = false;
80 }
81 }
bool m_IsDragged
Definition Icon.c:19
void SetItemPreview()
Definition Icon.c:1452
void RevertToOriginalFlip()
Definition Icon.c:1204
EntityAI m_Obj
Definition Icon.c:15
void UpdateFlip(bool flipped)
Definition Icon.c:1475

Перекрестные ссылки ItemManager::GetInstance(), m_IsDragged, m_Obj, RevertToOriginalFlip(), SetItemPreview() и UpdateFlip().

Методы

◆ CheckHasQuantity()

void CheckHasQuantity ( )
inlineprotected
1696 {
1698 }
void CheckHasQuantityEx(bool refresh=true)
Definition Icon.c:1684

Перекрестные ссылки CheckHasQuantityEx().

◆ CheckHasQuantityEx()

void CheckHasQuantityEx ( bool refresh = true)
inlineprotected
1685 {
1686 if (m_Item)
1687 {
1689
1690 if (m_HasQuantity)
1691 m_QuantityPanel.Show(true, refresh);
1692 }
1693 }
bool m_HasQuantity
Definition Icon.c:12
ItemBase m_Item
Definition Icon.c:16
Definition QuantityConversions.c:2
static int HasItemQuantity(notnull EntityAI item)
Definition QuantityConversions.c:143
const int QUANTITY_HIDDEN
Definition constants.c:482

Перекрестные ссылки QuantityConversions::HasItemQuantity(), m_HasQuantity, m_Item, m_QuantityPanel и QUANTITY_HIDDEN.

Используется в CheckHasQuantity() и InitEx().

◆ CheckHasTemperature()

void CheckHasTemperature ( )
inlineprotected
1677 {
1678 if (m_Item)
1679 {
1680 m_HasTemperature = (m_Item.GetTemperatureMax() != 0 && m_Item.GetTemperatureMin() != 0);
1681 }
1682 }
bool m_HasTemperature
Definition Icon.c:11

Перекрестные ссылки m_HasTemperature и m_Item.

Используется в InitEx().

◆ CheckIsMagazine()

void CheckIsMagazine ( )
inlineprotected
1672 {
1674 }
void CheckIsMagazineEx(bool refresh=true)
Definition Icon.c:1633

Перекрестные ссылки CheckIsMagazineEx().

◆ CheckIsMagazineEx()

void CheckIsMagazineEx ( bool refresh = true)
inlineprotected
1634 {
1635 Magazine mag = Magazine.Cast(m_Obj);
1636 if (mag)
1637 {
1638 m_IsMagazine = true;
1639 AmmoData data = Magazine.GetAmmoData(mag.ClassName());
1640 if (data)
1641 {
1642 ProjectileType p_type = data.m_ProjectileType;
1643 switch (p_type)
1644 {
1645 case ProjectileType.None:
1646 {
1647 m_AmmoTypeIcon.Show(false, refresh);
1648 break;
1649 }
1650 case ProjectileType.Tracer:
1651 {
1652 m_AmmoTypeIcon.LoadImageFile(0, "set:dayz_gui image:tracer");
1653 m_AmmoTypeIcon.Show(true, refresh);
1654 break;
1655 }
1656 case ProjectileType.AP:
1657 {
1658 m_AmmoTypeIcon.LoadImageFile(0, "set:dayz_gui image:armor_piercing");
1659 m_AmmoTypeIcon.Show(true, refresh);
1660 break;
1661 }
1662 }
1663 }
1664 }
1665 else
1666 {
1667 m_IsMagazine = false;
1668 }
1669 }
bool m_IsMagazine
Definition Icon.c:10

Перекрестные ссылки m_AmmoTypeIcon, m_IsMagazine и m_Obj.

Используется в CheckIsMagazine() и InitEx().

◆ CheckIsWeapon()

void CheckIsWeapon ( )
inlineprotected
1567 {
1569 if (wpn)
1570 {
1572 m_IsWeapon = true;
1573 float posX = 0.0;
1574 float widht = 0.0, height = 0.0;
1575 for (int i = 0; i < wpn.GetMuzzleCount(); i++)
1576 {
1577 if (i == 1)
1578 {
1579 m_AmmoIcons[0].GetSize(widht,height);
1580 }
1581 posX += widht;
1582
1583 Widget ammoIcon = Widget.Cast(GetGame().GetWorkspace().CreateWidgets( "gui/layouts/inventory_new/ammo_icon.layout", GetMainWidget() ));
1584 ammoIcon.SetPos(posX, 0.0, false);
1585
1586 ImageWidget ammoIconImg = ImageWidget.Cast(ammoIcon.GetChildren());
1587
1588 AmmoData data = Magazine.GetAmmoData(wpn.GetChamberAmmoTypeName(i));
1589 if (data)
1590 {
1591 CartridgeType c_type = data.m_CartridgeType;
1592 switch (c_type)
1593 {
1594 case CartridgeType.Pistol:
1595 {
1596 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_pistol");
1597 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_pistol");
1598 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_pistol");
1599 break;
1600 }
1601 case CartridgeType.Intermediate:
1602 {
1603 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_int");
1604 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_int");
1605 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_int");
1606 break;
1607 }
1608 case CartridgeType.FullPower:
1609 {
1610 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_fp");
1611 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_fp");
1612 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_fp");
1613 break;
1614 }
1615 case CartridgeType.Shell:
1616 {
1617 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_shell");
1618 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_shell");
1619 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_shell");
1620 break;
1621 }
1622 }
1623 }
1624 m_AmmoIcons.Insert(ammoIconImg);
1625 }
1626 }
1627 else
1628 {
1629 m_IsWeapon = false;
1630 }
1631 }
CartridgeType
Definition Magazine.c:4
ref array< ImageWidget > m_AmmoIcons
Definition Icon.c:39
bool m_IsWeapon
Definition Icon.c:9
shorthand
Definition BoltActionRifle_Base.c:6
Definition EnWidgets.c:190
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_AmmoIcons, m_IsWeapon и m_Obj.

Используется в InitEx().

◆ Combine()

void Combine ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
712 {
713 ItemManager.GetInstance().HideDropzones();
714 ItemManager.GetInstance().SetIsDragging(false);
715 ItemPreviewWidget selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
716 if (!selectedIpw)
717 {
718 string name = w.GetName();
719 name.Replace("PanelWidget", "Render");
720 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( name ));
721 }
722 if (!selectedIpw)
723 {
725 }
726 if (!selectedIpw.GetItem())
727 {
728 return;
729 }
731 EntityAI targetEntity = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
733
736 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Definition Building.c:6
bool PerformCombination(EntityAI selectedEntity, EntityAI targetEntity, int combinationFlag, InventoryLocation ilSwapDst=null)
Definition Icon.c:512
Definition InventoryCombinationFlags.c:2
static const int ADD_AS_CARGO
Definition InventoryCombinationFlags.c:5
static const int PERFORM_ACTION
Definition InventoryCombinationFlags.c:15
static const int ADD_AS_ATTACHMENT
Definition InventoryCombinationFlags.c:4
static const int COMBINE_QUANTITY2
Definition InventoryCombinationFlags.c:13
static const int SET_ACTION
Definition InventoryCombinationFlags.c:19
static int GetChosenCombinationFlag(EntityAI selectedEntity, EntityAI targetEntity, int relevantFlags, out InventoryLocation dst=null)
Definition ItemManager.c:723

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, InventoryCombinationFlags::COMBINE_QUANTITY2, ItemManager::GetChosenCombinationFlag(), GetGame(), ItemManager::GetInstance(), name, InventoryCombinationFlags::PERFORM_ACTION, PerformCombination() и InventoryCombinationFlags::SET_ACTION.

◆ CombineItems()

bool CombineItems ( EntityAI entity1,
EntityAI entity2 )
inlineprotected
739 {
741 return FlagAction( entity1, entity2, flags );
742 }
bool FlagAction(EntityAI entity1, EntityAI entity2, int combinationFlags)
Definition Icon.c:744
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
Definition ItemManager.c:804

Перекрестные ссылки FlagAction() и ItemManager::GetCombinationFlags().

◆ CreateWhiteBackground()

void CreateWhiteBackground ( )
inlineprotected
1123 {
1124 m_PreviousFlipOrientation = m_Item.GetInventory().GetFlipCargo();
1125 ItemManager.GetInstance().SetDraggedIcon(this);
1126 ItemManager.GetInstance().SetDraggedItem(m_Item);
1127 m_IsDragged = true;
1128 ItemManager.GetInstance().SetIsDragging(true);
1129 int ww, hh;
1130 GetGame().GetInventoryItemSize(m_Item, ww, hh);
1131 if (m_Item.GetInventory().GetFlipCargo())
1132 SetSize(hh, ww);
1133 else
1134 SetSize(ww, hh);
1135
1136 SetSize();
1137
1138 if (!m_HandsIcon)
1139 {
1140 Refresh();
1141 }
1142 else
1143 {
1146 m_ColorWidget.SetAlpha(0.1);
1147 }
1148
1149 m_CursorWidget.Show(true);
1150 }
Definition ColorManager.c:2
static int BASE_COLOR
Definition ColorManager.c:15
override void Refresh()
Definition Icon.c:1221
bool m_PreviousFlipOrientation
Definition Icon.c:20
void SetSize()
Definition Icon.c:1779
proto native void SetForceFlipEnable(bool enable)

Перекрестные ссылки ColorManager::BASE_COLOR, GetGame(), ItemManager::GetInstance(), m_ColorWidget, m_CursorWidget, m_HandsIcon, m_IsDragged, m_Item, m_ItemPreview, m_PreviousFlipOrientation, Refresh(), ItemPreviewWidget::SetForceFlipEnable() и SetSize().

◆ DestroyWhiteBackground()

void DestroyWhiteBackground ( )
inlineprotected
1098 {
1099 ItemManager.GetInstance().HideDropzones();
1100 ItemManager.GetInstance().SetIsDragging( false );
1101 m_IsDragged = false;
1102
1104
1105 if (m_HandsIcon)
1106 {
1109 Refresh();
1110 FullScreen();
1111 }
1112
1113 m_CursorWidget.SetColor( ARGBF( 1, 1, 1, 1 ) );
1114 m_CursorWidget.Show( false );
1115
1116 InventoryMenu menu = InventoryMenu.Cast(GetGame().GetUIManager().FindMenu( MENU_INVENTORY ));
1117
1118 if (menu)
1119 menu.RefreshQuickbar();
1120 }
void InventoryMenu()
Definition InventoryMenu.c:20
void FullScreen()
Definition Icon.c:1249
proto native void SetForceFlip(bool value)
const int MENU_INVENTORY
Definition constants.c:170
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Definition proto.c:332

Перекрестные ссылки ARGBF(), FullScreen(), GetGame(), ItemManager::GetInstance(), InventoryMenu(), m_CursorWidget, m_HandsIcon, m_IsDragged, m_ItemPreview, MENU_INVENTORY, Refresh(), RevertToOriginalFlip(), ItemPreviewWidget::SetForceFlip() и ItemPreviewWidget::SetForceFlipEnable().

◆ DoubleClick()

void DoubleClick ( Widget w,
int x,
int y,
int button )
inlineprotected
156 {
157 if (button == MouseState.LEFT && !g_Game.IsLeftCtrlDown())
158 {
160 if (controlledPlayer.GetInventory().HasInventoryReservation(m_Obj, null) || controlledPlayer.GetInventory().IsInventoryLocked() || controlledPlayer.IsItemsToDelete())
161 return;
162
163 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
164 if (!targetIpw)
165 {
166 string name = w.GetName();
167 name.Replace("PanelWidget", "Render");
168 targetIpw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
169 }
170
171 if (!targetIpw)
173
174 EntityAI targetEntity = targetIpw.GetItem();
175 if (targetIpw)
176 {
177 if (!targetEntity.GetInventory().CanRemoveEntity())
178 return;
179
180 if (m_HandsIcon)
181 {
182 if (controlledPlayer.GetHumanInventory().CanRemoveEntityInHands())
183 controlledPlayer.PredictiveMoveItemFromHandsToInventory();
184
186
187 return;
188 }
189
190 EntityAI entityInHands = controlledPlayer.GetHumanInventory().GetEntityInHands();
191 EntityAI entityRootParent = targetEntity.GetHierarchyRoot();
192
193 if (controlledPlayer.GetInventory().HasEntityInInventory(targetEntity) && controlledPlayer.GetHumanInventory().CanAddEntityInHands(targetEntity))
194 {
195 controlledPlayer.PredictiveTakeEntityToHands(targetEntity);
196 }
198 {
200 int index = controlledPlayer.GetHumanInventory().FindUserReservedLocationIndex(entityInHands);
201 if (index >= 0)
202 controlledPlayer.GetHumanInventory().GetUserReservedLocation(index, inventoryLocation);
203
204 if (controlledPlayer.GetInventory().CanForceSwapEntitiesEx(targetEntity, null, entityInHands, inventoryLocation))
205 {
206 controlledPlayer.PredictiveForceSwapEntities(targetEntity, entityInHands, inventoryLocation);
207 }
208 else if (controlledPlayer.GetInventory().CanSwapEntitiesEx(targetEntity, entityInHands ))
209 {
210 controlledPlayer.PredictiveSwapEntities(targetEntity, entityInHands);
211 }
212 else
213 {
214 controlledPlayer.GetInventory().FindFreeLocationFor(targetEntity, FindInventoryLocationType.ANY, inventoryLocation);
215 if (inventoryLocation.IsValid() && controlledPlayer.GetInventory().LocationCanAddEntity(inventoryLocation))
217 }
218 }
219 else
220 {
221 bool found = false;
222 if (targetEntity.GetInventory().CanRemoveEntity())
223 {
225 found = controlledPlayer.GetInventory().FindFreeLocationFor(targetEntity, FindInventoryLocationType.ANY, i2);
226 if (found)
227 {
228 if (i2.GetType() == FindInventoryLocationType.ATTACHMENT)
229 {
230 if (i2.GetParent() != controlledPlayer)
231 found = false;
232 }
233 }
234 }
235
236 if (found)
237 {
238 if (controlledPlayer.GetHumanInventory().CanAddEntityToInventory(targetEntity))
239 controlledPlayer.PredictiveTakeEntityToInventory(FindInventoryLocationType.ANY, targetEntity);
240 }
241 else
242 {
243 if (controlledPlayer.GetHumanInventory().CanAddEntityInHands(targetEntity))
244 controlledPlayer.PredictiveTakeEntityToHands(targetEntity);
245 }
246 }
247
249 }
250 }
251 }
DayZGame g_Game
Definition DayZGame.c:3746
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:16
PlayerBase GetPlayer()
Definition ModifierBase.c:47
void RefreshQuickbar()
Definition Icon.c:145
InventoryLocation.
Definition InventoryLocation.c:28
Definition PlayerBaseClient.c:2
Definition SplitItemUtils.c:2
static void TakeOrSplitToInventoryLocation(notnull PlayerBase player, notnull InventoryLocation dst)
Definition SplitItemUtils.c:34
MouseState
Definition EnSystem.c:311

Перекрестные ссылки g_Game, GetGame(), GetPlayer(), m_HandsIcon, m_Obj, name, RefreshQuickbar() и SplitItemUtils::TakeOrSplitToInventoryLocation().

◆ DraggingOver()

void DraggingOver ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
364 {
365 ItemManager.GetInstance().HideDropzones();
366
367 if (w == null)
368 {
369 return;
370 }
371 string name = w.GetName();
372 name.Replace("PanelWidget", "Render");
373
374 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(receiver.FindAnyWidget( "Render" ));
375 if (m_HandsIcon)
376 {
377 targetIpw = ItemPreviewWidget.Cast(receiver.GetParent().FindAnyWidget( "Render" ));
378 }
379
380 ItemPreviewWidget selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( name ));
381 if (selectedIpw == null)
382 {
383 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( "Render" ));
384 }
385 if (selectedIpw == null)
386 {
387 return;
388 }
389
395 {
396 return;
397 }
398
399 if (m_Lock)
400 {
402 {
404 ItemManager.GetInstance().GetRightDropzone().SetAlpha( 1 );
405 }
406 else
407 {
408 CargoContainer parentContainer = CargoContainer.Cast(m_Parent);
409
410 float parentX;
411 float parentY;
412
413 parentContainer.GetRootWidget().GetScreenPos(parentX, parentY);
414
415 float iconSize = parentContainer.GetIconSize();
416 float spaceSize = parentContainer.GetSpaceSize();
417
418 int PosX = (x - parentX) / (iconSize + spaceSize);
419 int PosY = (y - parentY) / (iconSize + spaceSize);
420
421 EntityAI parent = m_Lock;
422 CargoBase targetCargo = parent.GetInventory().GetCargo();
423
424 ilDst = new InventoryLocation();
425 ilDst.SetCargoAuto(targetCargo, selectedEntity, PosY, PosX, selectedEntity.GetInventory().GetFlipCargo());
426
427 if (parent.GetInventory().LocationCanAddEntity(ilDst))
428 {
430 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
431 }
432 else
433 {
435 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
436 }
437 }
438 }
439 else
440 {
442
445 }
446 }
Icon x
Icon y
Widget m_Parent
Definition SizeToChild.c:92
represents base for cargo storage for entities
Definition Cargo.c:7
static int GREEN_COLOR
Definition ColorManager.c:17
static ColorManager GetInstance()
Definition ColorManager.c:27
static int RED_COLOR
Definition ColorManager.c:16
static int SWAP_COLOR
Definition ColorManager.c:18
void UpdateFrameColor(EntityAI selectedEntity, EntityAI targetEntity, int combinationFlag, Widget w, InventoryLocation il=null)
Definition Icon.c:575
EntityAI m_Lock
Definition Icon.c:8
static const int FSWAP
Definition InventoryCombinationFlags.c:7
static const int SWAP
Definition InventoryCombinationFlags.c:6
static const int SWAP_MAGAZINE
Definition InventoryCombinationFlags.c:10
Definition ItemBase.c:14

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, InventoryCombinationFlags::COMBINE_QUANTITY2, InventoryCombinationFlags::FSWAP, ItemManager::GetChosenCombinationFlag(), GetGame(), ColorManager::GetInstance(), ItemManager::GetInstance(), GetPlayer(), ColorManager::GREEN_COLOR, m_HandsIcon, m_Lock, m_Parent, name, ColorManager::RED_COLOR, InventoryCombinationFlags::SWAP, ColorManager::SWAP_COLOR, InventoryCombinationFlags::SWAP_MAGAZINE, UpdateFrameColor(), x и y.

◆ DraggingOverCombine()

void DraggingOverCombine ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected

◆ DraggingOverSwap()

void DraggingOverSwap ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
254 {
255 if (w == null)
256 {
257 return;
258 }
259
260 string name = w.GetName();
261 name.Replace("PanelWidget", "Render");
262
263 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(receiver.FindAnyWidget( "Render" ));
264 if (m_HandsIcon)
265 {
266 targetIpw = ItemPreviewWidget.Cast(receiver.GetParent().FindAnyWidget( "Render" ));
267 }
268
270 if (selectedIpw == null)
271 {
272 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
273 }
274
275 if (selectedIpw == null)
276 {
277 return;
278 }
279
283 {
284 return;
285 }
286
289 int index = player.GetHumanInventory().FindUserReservedLocationIndex(m_Item);
290
291 if (index >= 0)
292 {
293 player.GetHumanInventory().GetUserReservedLocation(index, il);
294
296 {
298 ItemManager.GetInstance().HideDropzones();
299 ItemManager.GetInstance().ShowSourceDropzone(il.GetParent());
300 return;
301 }
302 }
304
307 }
static int FSWAP_COLOR
Definition ColorManager.c:19
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
Definition Inventory.c:665

Перекрестные ссылки GameInventory::CanForceSwapEntitiesEx(), InventoryCombinationFlags::FSWAP, ColorManager::FSWAP_COLOR, ItemManager::GetChosenCombinationFlag(), GetGame(), ColorManager::GetInstance(), ItemManager::GetInstance(), GetPlayer(), m_HandsIcon, m_Item, name, InventoryCombinationFlags::SWAP и UpdateFrameColor().

◆ DropReceivedFromBackground()

void DropReceivedFromBackground ( Widget w,
int x,
int y,
Widget reciever )
inlineprotected
1188 {
1189 Pos pa;
1190 if (reciever)
1191 {
1192 reciever.GetUserData(pa);
1193 if (m_Parent)
1194 {
1195 ContainerWithCargo item = ContainerWithCargo.Cast(m_Parent.m_Parent);
1196 if (item)
1197 {
1198 item.DropReceived(w, m_PosY + pa.y, m_PosX + pa.x);
1199 }
1200 }
1201 }
1202 }
void Pos(int _x, int _y)
Definition Icon.c:1829
int m_PosX
Definition Icon.c:5
int m_PosY
Definition Icon.c:6

Перекрестные ссылки m_Parent, m_PosX, m_PosY и Pos().

◆ DropReceivedFromMain()

void DropReceivedFromMain ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
895 {
896 ItemManager.GetInstance().HideDropzones();
897 ItemManager.GetInstance().SetIsDragging(false);
898 string name = w.GetName();
899 name.Replace("PanelWidget", "Render");
901
902 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(receiver.FindAnyWidget( "Render" ));
903 if (m_HandsIcon)
904 {
905 targetIpw = ItemPreviewWidget.Cast(receiver.GetParent().FindAnyWidget( "Render" ));
906 }
907
908 ItemPreviewWidget selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( name ));
909 if (selectedIpw == null)
910 {
911 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( "Render" ));
912 }
913 if (selectedIpw == null)
914 {
915 return;
916 }
917
920 if (!selectedEntity)
921 {
922 return;
923 }
924 int index;
928 {
929 index = player.GetHumanInventory().FindUserReservedLocationIndex(m_Item);
930 ilSrc = new InventoryLocation();
931 ilDst = new InventoryLocation();
932
933 m_Item.GetInventory().GetCurrentInventoryLocation(ilSrc);
934 player.GetHumanInventory().GetUserReservedLocation(index, ilDst);
935
936 if (ilDst.GetParent().GetInventory().LocationCanAddEntity(ilDst))
937 {
938
939 player.GetHumanInventory().ClearUserReservedLocation(m_Item);
940 player.PredictiveTakeToDst(ilSrc, ilDst);
941 m_Item.GetOnReleaseLock().Invoke(m_Item);
942 }
943 }
944 else if (m_Lock)
945 {
946 CargoContainer parentCargo = CargoContainer.Cast(m_Parent);
947
948 float parentX;
949 float parentY;
950
951 parentCargo.GetRootWidget().GetScreenPos(parentX, parentY);
952
953 float iconSize = parentCargo.GetIconSize();
954 float spaceSize = parentCargo.GetSpaceSize();
955
956 int PosX = (x-parentX) / (iconSize + spaceSize);
957 int PosY = (y-parentY) / (iconSize + spaceSize);
958
959 EntityAI parent = m_Lock;
960 CargoBase targetCargo = parent.GetInventory().GetCargo();
961
962 ilDst = new InventoryLocation();
963 ilDst.SetCargoAuto(targetCargo, selectedEntity, PosY, PosX, selectedEntity.GetInventory().GetFlipCargo());
964
965 if (parent.GetInventory().LocationCanAddEntity(ilDst))
966 {
967 player.GetHumanInventory().ClearUserReservedLocation(m_Item);
968 m_Item.GetOnReleaseLock().Invoke(m_Item);
969
971 }
972 }
973 else
974 {
975 ilDst = new InventoryLocation();
977
980 }
981 }

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, InventoryCombinationFlags::COMBINE_QUANTITY2, InventoryCombinationFlags::FSWAP, ItemManager::GetChosenCombinationFlag(), GetGame(), ItemManager::GetInstance(), GetPlayer(), m_HandsIcon, m_Item, m_Lock, m_Parent, name, PerformCombination(), InventoryCombinationFlags::SWAP, InventoryCombinationFlags::SWAP_MAGAZINE, SplitItemUtils::TakeOrSplitToInventoryLocation(), x и y.

◆ FlagAction()

bool FlagAction ( EntityAI entity1,
EntityAI entity2,
int combinationFlags )
inlineprotected
745 {
746 int current_flag;
747 ContextMenu cmenu = ContextMenu.Cast(GetGame().GetUIManager().GetMenu().GetContextMenu());
748 m_am_entity1 = entity1;
749 m_am_entity2 = entity2;
750 cmenu.Hide();
751 cmenu.Clear();
752 int id = -1;
753
755 {
757 entity.CombineItemsClient( ItemBase.Cast( entity2 ) );
758 return false;
759 }
760
762 return true;
763
765 {
767 cmenu.Add( "#inv_context_add_as_attachment", this, "OnPerformCombination", new Param1<int>( current_flag ) );
768 }
769 /*if (combinationFlags & InventoryCombinationFlags.LOAD_CHAMBER )
770 {
771 current_flag = InventoryCombinationFlags.LOAD_CHAMBER;
772 cmenu.Add( "#inv_context_load_chamber", this, "OnPerformCombination", new Param1<int>( current_flag ) );
773 }*/
775 {
777 cmenu.Add("#inv_context_attach_magazine", this, "OnPerformCombination", new Param1<int>( current_flag ) );
778 }
779
781 {
783 cmenu.Add( "#inv_context_add_as_cargo", this, "OnPerformCombination", new Param1<int>( current_flag ) );
784 }
785
787 {
789 cmenu.Add( "#inv_context_swap", this, "OnPerformCombination", new Param1<int>( current_flag ) );
790 }
791
793 {
795 cmenu.Add( "#inv_context_combine", this, "OnPerformCombination", new Param1<int>( current_flag ) );
796 }
797
799 {
801 cmenu.Add("#inv_context_attach_magazine", this, "OnPerformCombination", new Param1<int>( current_flag ) );
802 }
803
805 {
807 cmenu.Add("Perform Action2", this, "OnPerformCombination", new Param1<int>( current_flag ) );
808 }
809
812 m_am_Pos_x -= 5;
813 m_am_Pos_y -= 5;
814
815 MissionGameplay mission = MissionGameplay.Cast( GetGame().GetMission() );
816 /*if (combinationFlags & InventoryCombinationFlags.RECIPE_HANDS || combinationFlags & InventoryCombinationFlags.RECIPE_ANYWHERE )
817 {
818 OnPerformRecipe( id );
819 return true;
820 }
821 else /*if (cmenu.Count() == 1 )*/
822 //{
824 return true;
825 //}
826 /*else
827 {
828 cmenu.Show( m_am_Pos_x, m_am_Pos_y );
829 return true;
830 }*/
831 }
Mission mission
Definition DisplayStatus.c:28
override ContextMenu GetContextMenu()
Definition InventoryMenu.c:80
void OnPerformCombination(int combinationFlags)
Definition Icon.c:448
static const int ATTACH_MAGAZINE
Definition InventoryCombinationFlags.c:18
static const int NONE
Definition InventoryCombinationFlags.c:3
Definition InventoryItem.c:731
proto void GetMousePos(out int x, out int y)

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, InventoryCombinationFlags::ATTACH_MAGAZINE, InventoryCombinationFlags::COMBINE_QUANTITY2, GetContextMenu(), GetGame(), GetMousePos(), mission, InventoryCombinationFlags::NONE, OnPerformCombination(), InventoryCombinationFlags::PERFORM_ACTION, InventoryCombinationFlags::SET_ACTION и InventoryCombinationFlags::SWAP.

Используется в CombineItems().

◆ FullScreen()

void FullScreen ( )
inlineprotected
1250 {
1251 if (m_IsDragged)
1252 {
1253 return;
1254 }
1255 GetRootWidget().ClearFlags(WidgetFlags.HEXACTSIZE + WidgetFlags.VEXACTSIZE);
1256 GetRootWidget().SetSize(1, 1);
1257 m_ColorWidget.SetColor(ARGB( 0, 0, 0, 0 ));
1258 }
WidgetFlags
Definition EnWidgets.c:58
int ARGB(int a, int r, int g, int b)
Definition proto.c:322

Перекрестные ссылки ARGB(), m_ColorWidget и m_IsDragged.

Используется в DestroyWhiteBackground().

◆ GetCargoPos()

int GetCargoPos ( )
inlineprotected
1087 {
1088 return m_CargoPos;
1089 }
int m_CargoPos
Definition Icon.c:18

Перекрестные ссылки m_CargoPos.

◆ GetCursorWidget()

Widget GetCursorWidget ( )
inlineprotected
89 {
90 return m_CursorWidget;
91 }

Перекрестные ссылки m_CursorWidget.

◆ GetMicromanagedPanel()

Widget GetMicromanagedPanel ( )
inlineprotected
94 {
96 }

Перекрестные ссылки m_MicromanagedPanel.

◆ GetObject()

Object GetObject ( )
inlineprotected
1272 {
1273 return m_Obj;
1274 }

Перекрестные ссылки m_Obj.

Используется в RefreshMuzzleIcon() и SetActive().

◆ GetPosX()

int GetPosX ( )
inlineprotected
1721 {
1722 return m_PosX;
1723 }

Перекрестные ссылки m_PosX.

Используется в SetPosEx().

◆ GetPosY()

int GetPosY ( )
inlineprotected
1726 {
1727 return m_PosY;
1728 }

Перекрестные ссылки m_PosY.

Используется в SetPosEx().

◆ GetRelevantInventoryAction()

int GetRelevantInventoryAction ( int relevantActions)
inlineprotected
140 {
141 return 0;
142
143 }

◆ GetSelectedWidget()

Widget GetSelectedWidget ( )
inlineprotected
84 {
85 return m_SelectedPanel;
86 }

Перекрестные ссылки m_SelectedPanel.

◆ GetSizeX()

int GetSizeX ( )
inlineprotected
1731 {
1732 return m_SizeX;
1733 }
int m_SizeX
Definition Icon.c:3

Перекрестные ссылки m_SizeX.

◆ GetSizeY()

int GetSizeY ( )
inlineprotected
1736 {
1737 return m_SizeY;
1738 }
int m_SizeY
Definition Icon.c:4

Перекрестные ссылки m_SizeY.

◆ GetSort()

int GetSort ( )
inlineprotected
1440 {
1441 return GetMainWidget().GetSort();
1442 }

◆ Init()

void Init ( EntityAI obj)
inlineprotected
1562 {
1563 InitEx(obj);
1564 }
void InitEx(EntityAI obj, bool refresh=true)
Definition Icon.c:1509

Перекрестные ссылки InitEx().

◆ InitEx()

void InitEx ( EntityAI obj,
bool refresh = true )
inlineprotected
1510 {
1511 if (obj != m_Obj)
1512 {
1513 if (m_Obj)
1514 {
1515 m_Obj.GetOnItemFlipped().Remove(UpdateFlip );
1516 m_Obj.GetOnViewIndexChanged().Remove(SetItemPreview);
1517 }
1518 if (obj)
1519 {
1520 obj.GetOnItemFlipped().Insert(UpdateFlip);
1521 obj.GetOnViewIndexChanged().Insert(SetItemPreview);
1522 }
1523 }
1524
1525 if (m_HandsIcon)
1526 {
1529 }
1530
1531 m_Obj = obj;
1532 m_Item = ItemBase.Cast(m_Obj);
1533 m_Lock = null;
1534
1536
1537 WidgetEventHandler.GetInstance().RegisterOnDrag( GetMainWidget(), this, "CreateWhiteBackground" );
1538 WidgetEventHandler.GetInstance().RegisterOnDrop( GetMainWidget(), this, "DestroyWhiteBackground" );
1539 WidgetEventHandler.GetInstance().RegisterOnDropReceived( GetMainWidget(), this, "DropReceivedFromMain" );
1540 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( GetMainWidget(), this, "MouseClick" );
1541 WidgetEventHandler.GetInstance().RegisterOnDropReceived( GetMainWidget().FindAnyWidget( "Swap" ), this, "Swap" );
1542 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( GetMainWidget().FindAnyWidget( "Swap" ), this, "DraggingOverSwap" );
1543 WidgetEventHandler.GetInstance().RegisterOnDropReceived( GetMainWidget().FindAnyWidget( "Combine" ), this, "Combine" );
1544 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( GetMainWidget().FindAnyWidget( "Combine" ), this, "DraggingOverCombine" );
1545 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( GetMainWidget(), this, "DraggingOver" );
1546 WidgetEventHandler.GetInstance().RegisterOnMouseEnter( GetMainWidget(), this, "MouseEnter" );
1547 WidgetEventHandler.GetInstance().RegisterOnMouseLeave( GetMainWidget(), this, "MouseLeave" );
1548 WidgetEventHandler.GetInstance().RegisterOnDoubleClick( GetMainWidget(), this, "DoubleClick" );
1549
1551 CheckIsWeapon();
1555 m_RootWidget.FindAnyWidget("Reserved").Show(false, refresh);
1556
1557 if (refresh)
1558 Refresh();
1559 }
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Definition PluginRemotePlayerDebugClient.c:14
void SetItemPreviewEx(bool refresh=true)
Definition Icon.c:1444
void SetItemSizeEx(bool refresh=true)
Definition Icon.c:1457
void CheckIsWeapon()
Definition Icon.c:1566
void CheckHasTemperature()
Definition Icon.c:1676
Definition WidgetEventHandler.c:2
static WidgetEventHandler GetInstance()
Definition WidgetEventHandler.c:22

Перекрестные ссылки CheckHasQuantityEx(), CheckHasTemperature(), CheckIsMagazineEx(), CheckIsWeapon(), FindAnyWidget(), WidgetEventHandler::GetInstance(), m_HandsIcon, m_Item, m_ItemPreview, m_Lock, m_Obj, m_RootWidget, Refresh(), ItemPreviewWidget::SetForceFlip(), ItemPreviewWidget::SetForceFlipEnable(), SetItemPreview(), SetItemPreviewEx(), SetItemSizeEx() и UpdateFlip().

Используется в Init().

◆ InitLock()

void InitLock ( EntityAI parent,
EntityAI obj,
int x_pos,
int y_pos,
bool flip )
inlineprotected
1489 {
1490 m_Lock = parent;
1491 m_Obj = obj;
1492 m_Item = ItemBase.Cast(m_Obj);
1493
1494 SetPos(x_pos, y_pos);
1495 UpdateFlip( flip );
1496
1497 ItemManager.GetInstance().SetWidgetDraggable( GetMainWidget(), false );
1498 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( GetMainWidget(), this, "MouseClick" );
1499 WidgetEventHandler.GetInstance().RegisterOnDropReceived( GetMainWidget(), this, "DropReceivedFromMain" );
1500 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( GetMainWidget(), this, "DraggingOver" );
1501
1502 m_RootWidget.FindAnyWidget( "Reserved" ).Show( true );
1506 Refresh();
1507 }
void SetPos()
Definition Icon.c:1774

Перекрестные ссылки ItemManager::GetInstance(), WidgetEventHandler::GetInstance(), m_Item, m_ItemPreview, m_Lock, m_Obj, m_RootWidget, Refresh(), ItemPreviewWidget::SetForceFlip(), ItemPreviewWidget::SetForceFlipEnable(), SetItemPreview(), SetPos() и UpdateFlip().

◆ IsDragged()

bool IsDragged ( )
inlineprotected
99 {
100 return m_IsDragged;
101 }

Перекрестные ссылки m_IsDragged.

◆ MouseClick()

void MouseClick ( Widget w,
int x,
int y,
int button )
inlineprotected
834 {
835 if (button == MouseState.RIGHT)
836 {
837 if (m_Lock)
838 {
839 GetGame().GetPlayer().GetHumanInventory().ClearUserReservedLocationSynced(m_Item);
840 }
841 else
842 {
843 if (m_Item && m_Item.IsItemBase())
844 {
845 m_Item.OnRightClick();
846
847 if (m_HasQuantity)
848 SetQuantity();
849 #ifdef DIAG_DEVELOPER
850 if (GetDayZGame().IsLeftCtrlDown())
851 ShowActionMenu(m_Item);
852 #endif
853 }
854 }
855
856 }
857 else if (!m_Lock)
858 {
859 switch (button)
860 {
861 case MouseState.MIDDLE:
863 break;
864
865 case MouseState.LEFT:
867 if (g_Game.IsLeftCtrlDown())
868 {
869 if (controlledPlayer.CanDropEntity(m_Item))
870 {
871 if (m_Item.GetTargetQuantityMax() < m_Item.GetQuantity())
872 m_Item.SplitIntoStackMaxClient(null, -1);
873 else
874 controlledPlayer.PhysicalPredictiveDropItem(m_Item);
875
876 ItemManager.GetInstance().SetWidgetDraggable(w, false);
877 }
878 }
879 else
880 {
882 m_Obj.GetInventory().GetCurrentInventoryLocation(il);
883
884 bool draggable = !controlledPlayer.GetInventory().HasInventoryReservation(m_Obj, null) && !controlledPlayer.GetInventory().IsInventoryLocked() && !controlledPlayer.IsItemsToDelete();
885 draggable = draggable && (m_Obj.GetHierarchyRoot() && m_Obj.GetInventory().CanRemoveEntity() || !m_Obj.GetHierarchyRoot() && AttachmentsOutOfReach.IsAttachmentReachable(m_Obj, "", il.GetSlot()));
886
887 ItemManager.GetInstance().SetWidgetDraggable(w, draggable);
888 }
889 break;
890 }
891 }
892 }
DayZGame GetDayZGame()
Definition DayZGame.c:3748
Definition AttachmentsOutOfReach.c:2
static bool IsAttachmentReachable(EntityAI e, string att_slot_name="", int slot_id=-1, float range=1.5)
Definition AttachmentsOutOfReach.c:5
void SetQuantity()
Definition Icon.c:1384
bool InspectItem()
Definition Container.c:351

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

◆ MouseEnter()

bool MouseEnter ( Widget w,
int x,
int y )
inlineprotected
343 {
344 if (!m_IsDragged)
345 {
346 PrepareOwnedTooltip(m_Obj, x, y);
347 m_CursorWidget.Show(true);
348 }
349
350 return true;
351 }

Перекрестные ссылки m_CursorWidget, m_IsDragged, m_Obj, x и y.

◆ MouseLeave()

bool MouseLeave ( Widget w,
Widget s,
int x,
int y )
inlineprotected
354 {
355 HideOwnedTooltip();
356 if (!m_IsDragged)
357 {
358 m_CursorWidget.Show(false);
359 }
360 return true;
361 }

Перекрестные ссылки m_CursorWidget и m_IsDragged.

◆ OnDraggingOverBackground()

void OnDraggingOverBackground ( Widget w,
int x,
int y,
Widget reciever )
inlineprotected
1153 {
1154 ItemManager.GetInstance().HideDropzones();
1155 EntityAI entity = EntityAI.Cast( m_Obj );
1156 EntityAI parent = entity.GetHierarchyParent();
1157 if (parent && parent.GetHierarchyRootPlayer() == GetGame().GetPlayer())
1158 {
1159 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
1160 }
1161 else if (!m_HandsIcon)
1162 {
1163 ItemManager.GetInstance().GetLeftDropzone().SetAlpha(1);
1164 }
1165
1166 if (w == null || reciever == null)
1167 {
1168 return;
1169 }
1170 Pos pa;
1171 reciever.GetUserData(pa);
1172 if (m_Parent)
1173 {
1174 ContainerWithCargo item = ContainerWithCargo.Cast(m_Parent.m_Parent);
1175 if (item)
1176 {
1177 item.DraggingOverGrid(w, m_PosY + pa.y, m_PosX + pa.x, reciever);
1178 }
1180 if (hands_item)
1181 {
1182 hands_item.DraggingOverGrid(w, m_PosY + pa.y, m_PosX + pa.x, reciever, null);
1183 }
1184 }
1185 }
Definition HandsContainer.c:2

Перекрестные ссылки GetGame(), ItemManager::GetInstance(), GetPlayer(), m_HandsIcon, m_Obj, m_Parent, m_PosX, m_PosY и Pos().

◆ OnPerformCombination()

void OnPerformCombination ( int combinationFlags)
inlineprotected
449 {
451 if (m_am_entity1 == null || m_am_entity2 == null) return;
452
454
457
459 {
461 Class.CastTo(amc, player.GetActionManager());
462
463 if (m_am_entity1 == player.GetHumanInventory().GetEntityInHands())
464 {
465 amc.PerformActionFromInventory(ItemBase.Cast( m_am_entity1 ),ItemBase.Cast( m_am_entity2 ));
466 }
467 else
468 {
469 amc.PerformActionFromInventory(ItemBase.Cast( m_am_entity2 ),ItemBase.Cast( m_am_entity1 ));
470 }
471 }
473 {
475 Class.CastTo(amc2, player.GetActionManager());
476
477 if (m_am_entity1 == player.GetHumanInventory().GetEntityInHands())
478 {
479 amc2.SetActionFromInventory(ItemBase.Cast( m_am_entity1 ), ItemBase.Cast( m_am_entity2 ));
480 }
481 else
482 {
483 amc2.SetActionFromInventory(ItemBase.Cast( m_am_entity2 ), ItemBase.Cast( m_am_entity1 ));
484 }
485 }
487 {
488 ItemBase entity = ItemBase.Cast(m_am_entity1);
489 entity.CombineItemsClient(ItemBase.Cast( m_am_entity2 ));
490 }
492 {
493 float stackable = m_am_entity2.GetTargetQuantityMax(-1);
494
495 if (stackable == 0 || stackable >= m_am_entity2.GetQuantity())
496 {
497 player.PredictiveTakeEntityToTargetAttachment(m_am_entity1, m_am_entity2);
498 }
499 else
500 {
502 m_am_entity1.GetInventory().FindFreeLocationFor(m_am_entity2, FindInventoryLocationType.ATTACHMENT, il);
503 ItemBase.Cast(m_am_entity2).SplitIntoStackMaxToInventoryLocationClient(il);
504 }
505 }
507 {
508 SplitItemUtils.TakeOrSplitToInventory(player, m_am_entity1, m_am_entity2);
509 }
510 }
Definition ActionManagerClient.c:5
Super root of all classes in Enforce script.
Definition EnScript.c:11
static void TakeOrSplitToInventory(notnull PlayerBase player, notnull EntityAI target, notnull EntityAI item)
Definition SplitItemUtils.c:3
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, Class::CastTo(), InventoryCombinationFlags::COMBINE_QUANTITY2, GetGame(), GetPlayer(), InventoryCombinationFlags::NONE, InventoryCombinationFlags::PERFORM_ACTION, InventoryCombinationFlags::SET_ACTION и SplitItemUtils::TakeOrSplitToInventory().

Используется в FlagAction() и ShowActionMenuCombine().

◆ OnPerformRecipe()

void OnPerformRecipe ( int id)
inlineprotected
703 {
704 if ( m_am_entity1 == null || m_am_entity2 == null ) return;
705
706 Debug.Log("OnPerformRecipe called for id:"+id.ToString(),"recipes");
708 player.GetCraftingManager().SetInventoryCraft( id, ItemBase.Cast(m_am_entity1), ItemBase.Cast(m_am_entity2));
709 }
proto string ToString()
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136

Перекрестные ссылки GetGame(), GetPlayer(), Debug::Log() и ToString().

◆ PerformCombination()

bool PerformCombination ( EntityAI selectedEntity,
EntityAI targetEntity,
int combinationFlag,
InventoryLocation ilSwapDst = null )
inlineprotected
513 {
516
517 switch (combinationFlag)
518 {
520 float stackable = targetEntity.GetTargetQuantityMax(-1);
521
522 if (stackable == 0 || stackable >= targetEntity.GetQuantity())
523 {
524 return player.PredictiveTakeEntityToTargetAttachment(targetEntity, selectedEntity);
525 }
526 else
527 {
529 targetEntity.GetInventory().FindFreeLocationFor(selectedEntity, FindInventoryLocationType.ATTACHMENT, il);
530 ItemBase.Cast(selectedEntity).SplitIntoStackMaxToInventoryLocationClient(il);
531 return true;
532 }
533 break;
536 return true;
538 targetEntity.CombineItemsClient(selectedEntity);
539 return true;
541 Class.CastTo(amc, player.GetActionManager());
542 if (targetEntity == player.GetHumanInventory().GetEntityInHands())
543 {
544 amc.SetActionFromInventory(ItemBase.Cast(targetEntity), ItemBase.Cast(selectedEntity));
545 }
546 else
547 {
548 amc.SetActionFromInventory(ItemBase.Cast(selectedEntity), ItemBase.Cast(targetEntity));
549 }
550 return true;
552 Class.CastTo(amc, player.GetActionManager());
553 if (targetEntity == player.GetHumanInventory().GetEntityInHands())
554 {
555 amc.PerformActionFromInventory(ItemBase.Cast(targetEntity), ItemBase.Cast(selectedEntity));
556 }
557 else
558 {
559 amc.PerformActionFromInventory(ItemBase.Cast(selectedEntity), ItemBase.Cast(targetEntity));
560 }
561 return true;
563 return player.GetWeaponManager().SwapMagazine(Magazine.Cast(selectedEntity));
565 return player.PredictiveSwapEntities(targetEntity, selectedEntity);
567 return player.PredictiveForceSwapEntities(selectedEntity, targetEntity, ilSwapDst);
568 default:
569 return false;
570 }
571
572 return false;
573 }

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, Class::CastTo(), InventoryCombinationFlags::COMBINE_QUANTITY2, InventoryCombinationFlags::FSWAP, GetGame(), GetPlayer(), InventoryCombinationFlags::PERFORM_ACTION, InventoryCombinationFlags::SET_ACTION, InventoryCombinationFlags::SWAP, InventoryCombinationFlags::SWAP_MAGAZINE и SplitItemUtils::TakeOrSplitToInventory().

Используется в Combine(), DropReceivedFromMain() и Swap().

◆ Refresh()

override void Refresh ( )
inlineprotected
1222 {
1223 super.Refresh();
1224
1225 if (!m_HandsIcon)
1226 SetPos();
1227
1228 if (m_HasTemperature)
1230
1231 if (m_IsWeapon)
1233
1234 if (m_HasQuantity)
1235 SetQuantity();
1236 }
void RefreshMuzzleIcon()
Definition Icon.c:1276
void SetTemperature()
Definition Icon.c:1238

Перекрестные ссылки m_HandsIcon, m_HasQuantity, m_HasTemperature, m_IsWeapon, RefreshMuzzleIcon(), SetPos(), SetQuantity() и SetTemperature().

Используется в CreateWhiteBackground(), DestroyWhiteBackground(), InitEx(), InitLock() и RefreshIconPos().

◆ RefreshIconPos()

void RefreshIconPos ( )
inlineprotected
1244 {
1245 Refresh();
1246 GetMainWidget().Update();
1247 }

Перекрестные ссылки Refresh().

Используется в RefreshPos().

◆ RefreshMuzzleIcon()

void RefreshMuzzleIcon ( )
inlineprotected
1277 {
1279 if (wpn)
1280 {
1281 int i;
1283 if (!wpn.IsShowingChamberedBullet())
1284 {
1285 for (i = 0; i < m_AmmoIcons.Count(); i++)
1286 {
1287 ammoIcon = m_AmmoIcons.Get(i);
1288 ammoIcon.Show(false);
1289 }
1290 /* int bullet_count = 0;
1291 int fireout_count = 0;
1292
1293 for ( i = 0; i < wpn.GetMuzzleCount(); i++ )
1294 {
1295 if (wpn.IsChamberFull(i))
1296 {
1297 if (wpn.IsChamberFiredOut(i))
1298 {
1299 fireout_count++;
1300 }
1301 else
1302 {
1303 bullet_count++;
1304 }
1305 }
1306 }
1307
1308 int j;
1309 i = 0;
1310 for ( j= 0; j < bullet_count; j++ )
1311 {
1312 if ( i > m_AmmoIcons.Count() )
1313 {
1314 //add plus ammo
1315 break;
1316 }
1317
1318 ammoIcon = m_AmmoIcons.Get(i);
1319 ammoIcon.Show( true );
1320 ammoIcon.SetImage( 0 );
1321 i++;
1322 }
1323
1324 for ( j= 0; j < fireout_count; j++ )
1325 {
1326 if ( i > m_AmmoIcons.Count() )
1327 {
1328 //add plus ammo
1329 break;
1330 }
1331
1332 ammoIcon = m_AmmoIcons.Get(i);
1333 ammoIcon.Show( true );
1334 ammoIcon.SetImage( 1 );
1335 i++;
1336 }
1337
1338 for (j = i; j < m_AmmoIcons.Count(); j++)
1339 {
1340 ammoIcon = m_AmmoIcons.Get(j);
1341 ammoIcon.Show(false);
1342 }*/
1343 }
1344 else
1345 {
1346 //TODO MW - add more conplex logic
1347 for (i = 0; i < wpn.GetMuzzleCount(); i++)
1348 {
1349 if ( i > m_AmmoIcons.Count() )
1350 {
1351 //add plus ammo
1352 break;
1353 }
1354
1355 ammoIcon = m_AmmoIcons.Get(i);
1356
1357 if (wpn.IsChamberFull(i))
1358 {
1359 if (wpn.IsJammed())
1360 {
1361 ammoIcon.Show(true);
1362 ammoIcon.SetImage(2);
1363 }
1364 else if (wpn.IsChamberFiredOut(i))
1365 {
1366 ammoIcon.Show(true);
1367 ammoIcon.SetImage(1);
1368 }
1369 else
1370 {
1371 ammoIcon.Show( true );
1372 ammoIcon.SetImage( 0 );
1373 }
1374 }
1375 else
1376 {
1377 ammoIcon.Show(false);
1378 }
1379 }
1380 }
1381 }
1382 }
Object GetObject()
Definition Icon.c:1271

Перекрестные ссылки GetObject() и m_AmmoIcons.

Используется в Refresh() и UpdateInterval().

◆ RefreshPos()

void RefreshPos ( int row,
int column )
inlineprotected
1261 {
1262 if (row != m_PosY || column != m_PosX)
1263 {
1264 m_PosX = column;
1265 m_PosY = row;
1266 SetPos();
1268 }
1269 }
void RefreshIconPos()
Definition Icon.c:1243

Перекрестные ссылки m_PosX, m_PosY, RefreshIconPos() и SetPos().

◆ RefreshQuickbar()

void RefreshQuickbar ( )
inlineprotected
146 {
147 InventoryMenu menu = InventoryMenu.Cast(GetGame().GetUIManager().FindMenu(MENU_INVENTORY));
148 HideOwnedTooltip();
149 if (menu)
150 {
151 menu.RefreshQuickbar();
152 }
153 }

Перекрестные ссылки GetGame(), InventoryMenu() и MENU_INVENTORY.

Используется в DoubleClick().

◆ RevertToOriginalFlip()

void RevertToOriginalFlip ( )
inlineprotected
1205 {
1206 if (m_Item)
1207 {
1208 m_Item.GetInventory().SetFlipCargo(m_PreviousFlipOrientation);
1209 int ww, hh;
1210 GetGame().GetInventoryItemSize(m_Item, ww, hh);
1211
1213 SetSize(hh, ww);
1214 else
1215 SetSize(ww, hh);
1216
1217 SetSize();
1218 }
1219 }

Перекрестные ссылки GetGame(), m_Item, m_PreviousFlipOrientation и SetSize().

Используется в DestroyWhiteBackground() и ~Icon().

◆ SetActive()

override void SetActive ( bool active)
inlineprotected
104 {
105 super.SetActive(active);
106 if (active && GetObject())
107 {
108 float x, y;
109 GetMainWidget().GetScreenPos(x, y);
110 PrepareOwnedTooltip(EntityAI.Cast( GetObject() ), -1, y);
111 }
112
114 }

Перекрестные ссылки GetObject(), m_SelectedPanel, x и y.

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

◆ SetCargoPos()

void SetCargoPos ( int x)
inlineprotected
1092 {
1093 GetMainWidget().SetSort( x );
1094 m_CargoPos = x;
1095 }

Перекрестные ссылки m_CargoPos и x.

◆ SetItemPreview()

void SetItemPreview ( )
inlineprotected
1453 {
1455 }

Перекрестные ссылки SetItemPreviewEx().

Используется в InitEx(), InitLock() и ~Icon().

◆ SetItemPreviewEx()

void SetItemPreviewEx ( bool refresh = true)
inlineprotected
1445 {
1446 m_ItemPreview.Show(true, refresh);
1449 m_ItemPreview.SetView(m_Obj.GetViewIndex());
1450 }
proto native void SetView(int viewIndex)
proto native void SetItem(EntityAI object)
proto native void SetModelOrientation(vector vOrientation)

Перекрестные ссылки m_ItemPreview, m_Obj, ItemPreviewWidget::SetItem(), ItemPreviewWidget::SetModelOrientation() и ItemPreviewWidget::SetView().

Используется в InitEx() и SetItemPreview().

◆ SetItemSize()

void SetItemSize ( )
inlineprotected
1471 {
1472 SetItemSizeEx();
1473 }

Перекрестные ссылки SetItemSizeEx().

◆ SetItemSizeEx()

void SetItemSizeEx ( bool refresh = true)
inlineprotected
1458 {
1459 #ifdef PLATFORM_CONSOLE
1460 m_ItemSizePanel.Show(true, refresh);
1461 m_ItemSizeWidget.Show(true, refresh);
1462
1463 int sizeX, sizeY;
1464 GetGame().GetInventoryItemSize(m_Item, sizeX, sizeY);
1465 int capacity = sizeX * sizeY;
1466 m_ItemSizeWidget.SetText(capacity.ToString());
1467 #endif
1468 }

Перекрестные ссылки GetGame(), m_Item, m_ItemSizePanel и m_ItemSizeWidget.

Используется в InitEx() и SetItemSize().

◆ SetLayoutName()

override void SetLayoutName ( )
inlineprotected
1048 {
1049 #ifdef PLATFORM_CONSOLE
1050 m_LayoutName = WidgetLayoutName.IconXbox;
1051 #else
1052 switch (InventoryMenu.GetWidthType())
1053 {
1054 case ScreenWidthType.NARROW:
1055 {
1056 m_LayoutName = WidgetLayoutName.IconNarrow;
1057 break;
1058 }
1059 case ScreenWidthType.MEDIUM:
1060 {
1061 m_LayoutName = WidgetLayoutName.IconMedium;
1062 break;
1063 }
1064 case ScreenWidthType.WIDE:
1065 {
1066 m_LayoutName = WidgetLayoutName.IconWide;
1067 break;
1068 }
1069 }
1070 #endif
1071
1072 }
ScreenWidthType
Definition InventoryMenu.c:2
Definition WidgetLayoutName.c:2
const string IconXbox
Definition WidgetLayoutName.c:31
const string IconNarrow
Definition WidgetLayoutName.c:28
const string IconMedium
Definition WidgetLayoutName.c:29
const string IconWide
Definition WidgetLayoutName.c:30

Перекрестные ссылки WidgetLayoutName::IconMedium, WidgetLayoutName::IconNarrow, WidgetLayoutName::IconWide, WidgetLayoutName::IconXbox и InventoryMenu().

◆ SetParentWidget()

override void SetParentWidget ( )
inlineprotected
117 {
118 #ifndef PLATFORM_CONSOLE
119 if (m_Parent.IsInherited(HandsPreview))
120 {
121 super.SetParentWidget();
122 }
123 else
124 {
125 if (m_Parent != null)
126 {
127 CargoContainer gridContainer = CargoContainer.Cast(m_Parent);
128 if (gridContainer)
129 {
130 m_ParentWidget = gridContainer.GetMainWidget();
131 }
132 }
133 }
134 #else
135 super.SetParentWidget();
136 #endif
137 }
Widget m_ParentWidget
Definition UiHintPanel.c:318
Definition HandsPreview.c:2

Перекрестные ссылки m_Parent и m_ParentWidget.

◆ SetPos() [1/2]

void SetPos ( )
inlineprotected
1775 {
1776 SetPosEx();
1777 }
void SetPosEx(bool refresh=true)
Definition Icon.c:1740

Перекрестные ссылки SetPosEx().

Используется в InitLock(), Refresh() и RefreshPos().

◆ SetPos() [2/2]

void SetPos ( int x,
int y )
inlineprotected
1081 {
1082 m_PosX = x;
1083 m_PosY = y;
1084 }

Перекрестные ссылки m_PosX, m_PosY, x и y.

◆ SetPosEx()

void SetPosEx ( bool refresh = true)
inlineprotected
1741 {
1742 CargoContainer parentContainer = CargoContainer.Cast(m_Parent);
1744 Widget rootWidget = GetRootWidget();
1745 float iconSize, spaceSize;
1746 if (parentContainer)
1747 {
1748 iconSize = parentContainer.GetIconSize();
1749 spaceSize = parentContainer.GetSpaceSize();
1750 }
1751 else if (parentHPrevContainer)
1752 {
1753 iconSize = parentHPrevContainer.GetIconSize();
1754 if (rootWidget)
1755 {
1756 rootWidget.SetFlags(WidgetFlags.EXACTSIZE, refresh);
1757 }
1758 }
1759
1760 if (rootWidget)
1761 {
1762 #ifndef PLATFORM_CONSOLE
1763 rootWidget.SetPos(iconSize * GetPosX() + ( GetPosX() + 1 ) * spaceSize, iconSize * GetPosY() + ( GetPosY() + 1 ) * spaceSize, refresh);
1765 #else
1766 int row = m_CargoPos / 5;
1767 int column = m_CargoPos % 5;
1770 #endif
1771 }
1772 }
int GetPosY()
Definition Icon.c:1725
int GetPosX()
Definition Icon.c:1720

Перекрестные ссылки GetPosX(), GetPosY(), m_CargoPos, m_Parent, m_SizeX и m_SizeY.

Используется в SetPos().

◆ SetPosX()

void SetPosX ( int x)
inlineprotected
1701 {
1702 m_PosX = x;
1703 }

Перекрестные ссылки m_PosX и x.

◆ SetPosY()

void SetPosY ( int y)
inlineprotected
1706 {
1707 m_PosY = y;
1708 }

Перекрестные ссылки m_PosY и y.

◆ SetQuantity()

void SetQuantity ( )
inlineprotected
1385 {
1386 if (m_Item)
1387 {
1390 {
1392
1394 {
1396
1398 {
1399 m_QuantityStack.Show(false);
1400 }
1401 else
1402 {
1404 m_QuantityStack.Show(true);
1405 }
1406
1407 m_QuantityProgress.Show(false);
1408 }
1409 else if (quantityType == QUANTITY_PROGRESS)
1410 {
1411 int max = m_Item.GetQuantityMax();
1412 int count = m_Item.ConfigGetInt("count");
1413 float quantity = m_CurrQuantity;
1414
1415 if (count > 0)
1416 {
1417 max = count;
1418 }
1419
1420 if (max > 0)
1421 {
1422 float value = Math.Round((quantity / max) * 100);
1423 m_QuantityProgress.SetCurrent(value);
1424 }
1425
1426 m_QuantityStack.Show(false);
1427 m_QuantityProgress.Show(true);
1428 }
1429 }
1430 }
1431 }
float m_CurrQuantity
Definition Icon.c:13
Definition EnMath.c:7
static float GetItemQuantityMax(InventoryItem item)
Definition QuantityConversions.c:96
static string GetItemQuantityText(EntityAI item, bool showMax=false)
Definition QuantityConversions.c:3
static float GetItemQuantity(InventoryItem item)
Definition QuantityConversions.c:72
const int QUANTITY_PROGRESS
Definition constants.c:484
const int QUANTITY_COUNT
Definition constants.c:483
static proto float Round(float f)
Returns mathematical round of value.

Перекрестные ссылки QuantityConversions::GetItemQuantity(), QuantityConversions::GetItemQuantityMax(), QuantityConversions::GetItemQuantityText(), QuantityConversions::HasItemQuantity(), m_CurrQuantity, m_Item, m_QuantityItem, m_QuantityProgress, m_QuantityStack, QUANTITY_COUNT, QUANTITY_HIDDEN, QUANTITY_PROGRESS и Math::Round().

Используется в MouseClick(), Refresh() и UpdateInterval().

◆ SetSize() [1/2]

void SetSize ( )
inlineprotected
1780 {
1781 CargoContainer parentContainer = CargoContainer.Cast(m_Parent);
1783 float iconSize, spaceSize;
1784 Widget rootWidget = GetRootWidget();
1785 if (parentContainer)
1786 {
1787 iconSize = parentContainer.GetIconSize();
1788 spaceSize = parentContainer.GetSpaceSize();
1789 }
1790 else if (parentHPrevContainer)
1791 {
1792 iconSize = parentHPrevContainer.GetIconSize();
1793 if (rootWidget)
1794 {
1795 GetRootWidget().SetFlags(WidgetFlags.EXACTSIZE);
1796 }
1797 }
1798
1799 if (rootWidget)
1800 {
1801 #ifndef PLATFORM_CONSOLE
1802 GetRootWidget().SetSize(iconSize * m_SizeX + ( m_SizeX ) * spaceSize, iconSize * m_SizeY + ( m_SizeY ) * spaceSize);
1803 #else
1804 GetRootWidget().SetSize(iconSize, iconSize);
1805 #endif
1806 }
1807 }

Перекрестные ссылки m_Parent, m_SizeX и m_SizeY.

Используется в CreateWhiteBackground(), RevertToOriginalFlip() и UpdateFlip().

◆ SetSize() [2/2]

void SetSize ( int x,
int y )
inlineprotected
1075 {
1076 m_SizeX = x;
1077 m_SizeY = y;
1078 }

Перекрестные ссылки m_SizeX, m_SizeY, x и y.

◆ SetSizeX()

void SetSizeX ( int x)
inlineprotected
1711 {
1712 m_SizeX = x;
1713 }

Перекрестные ссылки m_SizeX и x.

◆ SetSizeY()

void SetSizeY ( int y)
inlineprotected
1716 {
1717 m_SizeY = y;
1718 }

Перекрестные ссылки m_SizeY и y.

◆ SetSort()

void SetSort ( int index)
inlineprotected
1434 {
1435 GetMainWidget().SetSort(index);
1436 GetMainWidget().Update();
1437 }

◆ SetTemperature()

void SetTemperature ( )
inlineprotected
1239 {
1240 ItemManager.GetInstance().SetIconTemperature(EntityAI.Cast( m_Obj ), m_RootWidget);
1241 }

Перекрестные ссылки ItemManager::GetInstance(), m_Obj и m_RootWidget.

Используется в Refresh() и UpdateInterval().

◆ ShowActionMenuCombine()

void ShowActionMenuCombine ( EntityAI entity1,
EntityAI entity2,
int combinationFlags,
Widget w,
bool color_test )
inlineprotected
624 {
625 int lastFlag = 0;
626 ContextMenu cmenu = ContextMenu.Cast(GetGame().GetUIManager().GetMenu().GetContextMenu());
627 m_am_entity1 = entity1;
628 m_am_entity2 = entity2;
629 cmenu.Hide();
630 cmenu.Clear();
631 int id = -1;
632
633 if ( entity1 == null || entity2 == null ) return;
634
636 {
637 if ( color_test )
638 {
640 ItemManager.GetInstance().ShowSourceDropzone( entity2 );
641 }
642 return;
643 }
644
646 {
648 cmenu.Add( "#inv_context_add_as_cargo", this, "OnPerformCombination", new Param1<int>( lastFlag ) );
649 }
651 {
653 cmenu.Add( "#inv_context_add_as_attachment", this, "OnPerformCombination", new Param1<int>( lastFlag ));
654 }
655
657 {
659 cmenu.Add("#inv_context_combine_quantity", this, "OnPerformCombination", new Param1<int>( lastFlag ));
660 }
661
663 {
665 cmenu.Add("#inv_context_attach_magazine", this, "OnPerformCombination", new Param1<int>( lastFlag ));
666 }
667
669 {
671 cmenu.Add("Perform action", this, "OnPerformCombination", new Param1<int>( lastFlag ));
672 }
673
674 if (color_test)
675 {
676 if (lastFlag == 0)
677 {
678 ItemManager.GetInstance().HideDropzones();
679 ItemManager.GetInstance().GetCenterDropzone().SetAlpha( 1 );
681 }
683 {
684 ItemManager.GetInstance().HideDropzones();
685 ItemManager.GetInstance().GetCenterDropzone().SetAlpha( 1 );
687 }
688 else
689 {
690 ItemManager.GetInstance().HideDropzones();
691 ItemManager.GetInstance().GetCenterDropzone().SetAlpha( 1 );
693 }
694 }
695 else if (cmenu.Count() >= 1)
696 {
698 return;
699 }
700 }
static int COMBINE_COLOR
Definition ColorManager.c:20

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, ColorManager::COMBINE_COLOR, InventoryCombinationFlags::COMBINE_QUANTITY2, GetContextMenu(), GetGame(), ColorManager::GetInstance(), ItemManager::GetInstance(), ColorManager::GREEN_COLOR, InventoryCombinationFlags::NONE, OnPerformCombination(), InventoryCombinationFlags::PERFORM_ACTION, ColorManager::RED_COLOR и InventoryCombinationFlags::SET_ACTION.

◆ Swap()

void Swap ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
984 {
985 ItemManager.GetInstance().HideDropzones();
986 ItemManager.GetInstance().SetIsDragging(false);
987 string name = w.GetName();
988 name.Replace("PanelWidget", "Render");
989
990 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(receiver.FindAnyWidget( "Render" ));
991 if (m_HandsIcon)
992 {
993 targetIpw = ItemPreviewWidget.Cast(receiver.GetParent().FindAnyWidget( "Render" ));
994 }
995
996 ItemPreviewWidget selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( name ));
997 if (selectedIpw == null)
998 {
999 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( "Render" ));
1000 }
1001 if (selectedIpw == null)
1002 {
1003 return;
1004 }
1005
1009 {
1010 return;
1011 }
1012
1014 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
1015
1018 targetEntity.GetInventory().GetCurrentInventoryLocation(ilSrc);
1019 Icon icon = ItemManager.GetInstance().GetDraggedIcon();
1020
1021 int index = player.GetHumanInventory().FindUserReservedLocationIndex(targetEntity);
1022 if (index>=0)
1023 {
1024 player.GetHumanInventory().GetUserReservedLocation(index, ilDst);
1025
1027 {
1028 if (m_HandsIcon && !player.GetInventory().HasInventoryReservation(itemInHands, null) && !player.IsItemsToDelete())
1029 {
1030 GetGame().GetPlayer().PredictiveForceSwapEntities(selectedEntity, targetEntity, ilDst);
1031 return;
1032 }
1033 }
1034 }
1036
1039 }
Definition Icon.c:2

Перекрестные ссылки GameInventory::CanForceSwapEntitiesEx(), InventoryCombinationFlags::FSWAP, ItemManager::GetChosenCombinationFlag(), GetGame(), ItemManager::GetInstance(), GetPlayer(), m_HandsIcon, name, PerformCombination() и InventoryCombinationFlags::SWAP.

◆ ToRefresh()

void ToRefresh ( Icon icon,
Icon icon2 )
inlineprotected
1042 {
1043 ( IconsContainer.Cast( m_Parent ) ).RemoveItem( icon );
1044 ( IconsContainer.Cast( m_Parent ) ).RemoveItem( icon2 );
1045 }
Definition IconsContainer.c:2

Перекрестные ссылки m_Parent.

◆ UpdateFlip()

void UpdateFlip ( bool flipped)
inlineprotected
1476 {
1477 int sizeX, sizeY;
1478 GetGame().GetInventoryItemSize(m_Item, sizeX, sizeY);
1479
1480 if (flipped)
1482 else
1484
1485 SetSize();
1486 }

Перекрестные ссылки GetGame(), m_Item и SetSize().

Используется в InitEx(), InitLock() и ~Icon().

◆ UpdateFrameColor()

void UpdateFrameColor ( EntityAI selectedEntity,
EntityAI targetEntity,
int combinationFlag,
Widget w,
InventoryLocation il = null )
inlineprotected
576 {
577 int color;
579
580 ItemManager.GetInstance().HideDropzones();
581 switch (combinationFlag)
582 {
586 ItemManager.GetInstance().ShowSourceDropzone(targetEntity);
587 break;
592 ItemManager.GetInstance().ShowSourceDropzone(targetEntity);
593 break;
596 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
597 break;
600 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
601 break;
604 if (il)
605 {
606 ItemManager.GetInstance().ShowSourceDropzone(il.GetParent());
607 }
608 else
609 {
610 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
611 }
612 break;
613 default:
615 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
616 }
617
618 ColorManager.GetInstance().SetColor( w, color );
619 }

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, ColorManager::COMBINE_COLOR, InventoryCombinationFlags::COMBINE_QUANTITY2, InventoryCombinationFlags::FSWAP, ColorManager::FSWAP_COLOR, ColorManager::GetInstance(), ItemManager::GetInstance(), ColorManager::GREEN_COLOR, InventoryCombinationFlags::PERFORM_ACTION, ColorManager::RED_COLOR, InventoryCombinationFlags::SET_ACTION, InventoryCombinationFlags::SWAP, ColorManager::SWAP_COLOR и InventoryCombinationFlags::SWAP_MAGAZINE.

Используется в DraggingOver(), DraggingOverCombine() и DraggingOverSwap().

◆ UpdateInterval()

override void UpdateInterval ( )
inlineprotected
1810 {
1811 if (m_Item)
1812 {
1813 if (m_HasTemperature)
1815
1816 if (m_IsWeapon)
1818
1819 if (m_HasQuantity)
1820 SetQuantity();
1821 }
1822 }

Перекрестные ссылки m_HasQuantity, m_HasTemperature, m_IsWeapon, m_Item, RefreshMuzzleIcon(), SetQuantity() и SetTemperature().

Поля

◆ m_AmmoIcons

ref array<ImageWidget> m_AmmoIcons
protected

Используется в CheckIsWeapon() и RefreshMuzzleIcon().

◆ m_AmmoTypeIcon

ImageWidget m_AmmoTypeIcon
protected

Используется в CheckIsMagazineEx() и Icon().

◆ m_CargoPos

int m_CargoPos
protected

Используется в GetCargoPos(), SetCargoPos() и SetPosEx().

◆ m_ColorWidget

Widget m_ColorWidget
protected

Используется в CreateWhiteBackground(), FullScreen() и Icon().

◆ m_CurrQuantity

float m_CurrQuantity = -1
protected

Используется в SetQuantity().

◆ m_CursorWidget

Widget m_CursorWidget
protected

◆ m_HandsIcon

◆ m_HasQuantity

bool m_HasQuantity = false
protected

Используется в CheckHasQuantityEx(), MouseClick(), Refresh() и UpdateInterval().

◆ m_HasTemperature

bool m_HasTemperature = false
protected

Используется в CheckHasTemperature(), Refresh() и UpdateInterval().

◆ m_IsDragged

◆ m_IsMagazine

bool m_IsMagazine = false
protected

Используется в CheckIsMagazineEx().

◆ m_IsWeapon

bool m_IsWeapon = false
protected

Используется в CheckIsWeapon(), Refresh() и UpdateInterval().

◆ m_Item

◆ m_ItemPreview

◆ m_ItemSizePanel

Widget m_ItemSizePanel
protected

Используется в Icon() и SetItemSizeEx().

◆ m_ItemSizeWidget

TextWidget m_ItemSizeWidget
protected

Используется в Icon() и SetItemSizeEx().

◆ m_Lock

EntityAI m_Lock
protected

◆ m_MicromanagedPanel

Widget m_MicromanagedPanel
protected

Используется в GetMicromanagedPanel() и Icon().

◆ m_Obj

◆ m_PosX

◆ m_PosY

◆ m_PreviousFlipOrientation

bool m_PreviousFlipOrientation
protected

Используется в CreateWhiteBackground() и RevertToOriginalFlip().

◆ m_QuantityItem

TextWidget m_QuantityItem
protected

Используется в Icon() и SetQuantity().

◆ m_QuantityPanel

Widget m_QuantityPanel
protected

Используется в CheckHasQuantityEx() и Icon().

◆ m_QuantityProgress

ProgressBarWidget m_QuantityProgress
protected

Используется в Icon() и SetQuantity().

◆ m_QuantityStack

Widget m_QuantityStack
protected

Используется в Icon() и SetQuantity().

◆ m_SelectedPanel

Widget m_SelectedPanel
protected

Используется в GetSelectedWidget(), Icon() и SetActive().

◆ m_SizeX

int m_SizeX
protected

Используется в GetSizeX(), SetPosEx(), SetSize(), SetSize() и SetSizeX().

◆ m_SizeY

int m_SizeY
protected

Используется в GetSizeY(), SetPosEx(), SetSize(), SetSize() и SetSizeY().

◆ NUMBER_OF_TIMERS

const int NUMBER_OF_TIMERS = 2
protected

Объявления и описания членов класса находятся в файле: