DayZ 1.26
DayZ 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:419
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:1386
void RevertToOriginalFlip()
Definition Icon.c:1195
EntityAI m_Obj
Definition Icon.c:15
void UpdateFlip(bool flipped)
Definition Icon.c:1409

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

Методы

◆ CheckHasQuantity()

void CheckHasQuantity ( )
inlineprotected
1631 {
1633 }
void CheckHasQuantityEx(bool refresh=true)
Definition Icon.c:1619

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

◆ CheckHasQuantityEx()

void CheckHasQuantityEx ( bool refresh = true)
inlineprotected
1620 {
1621 if (m_Item)
1622 {
1624
1625 if (m_HasQuantity)
1626 m_QuantityPanel.Show(true, refresh);
1627 }
1628 }
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:493

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

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

◆ CheckHasTemperature()

void CheckHasTemperature ( )
inlineprotected
1612 {
1613 if (m_Item)
1614 {
1615 m_HasTemperature = m_Item.CanHaveTemperature();
1616 }
1617 }
bool m_HasTemperature
Definition Icon.c:11

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

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

◆ CheckIsMagazine()

void CheckIsMagazine ( )
inlineprotected
1607 {
1609 }
void CheckIsMagazineEx(bool refresh=true)
Definition Icon.c:1568

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

◆ CheckIsMagazineEx()

void CheckIsMagazineEx ( bool refresh = true)
inlineprotected
1569 {
1570 Magazine mag = Magazine.Cast(m_Obj);
1571 if (mag)
1572 {
1573 m_IsMagazine = true;
1574 AmmoData data = Magazine.GetAmmoData(mag.ClassName());
1575 if (data)
1576 {
1577 ProjectileType p_type = data.m_ProjectileType;
1578 switch (p_type)
1579 {
1580 case ProjectileType.None:
1581 {
1582 m_AmmoTypeIcon.Show(false, refresh);
1583 break;
1584 }
1585 case ProjectileType.Tracer:
1586 {
1587 m_AmmoTypeIcon.LoadImageFile(0, "set:dayz_gui image:tracer");
1588 m_AmmoTypeIcon.Show(true, refresh);
1589 break;
1590 }
1591 case ProjectileType.AP:
1592 {
1593 m_AmmoTypeIcon.LoadImageFile(0, "set:dayz_gui image:armor_piercing");
1594 m_AmmoTypeIcon.Show(true, refresh);
1595 break;
1596 }
1597 }
1598 }
1599 }
1600 else
1601 {
1602 m_IsMagazine = false;
1603 }
1604 }
bool m_IsMagazine
Definition Icon.c:10

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

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

◆ CheckIsWeapon()

void CheckIsWeapon ( )
inlineprotected
1502 {
1504 if (wpn)
1505 {
1507 m_IsWeapon = true;
1508 float posX = 0.0;
1509 float width = 0.0, height = 0.0;
1510 for (int i = 0; i < wpn.GetMuzzleCount(); i++)
1511 {
1512 if (i == 1)
1513 {
1514 m_AmmoIcons[0].GetSize(width, height);
1515 }
1516 posX += width;
1517
1518 Widget ammoIcon = Widget.Cast(GetGame().GetWorkspace().CreateWidgets("gui/layouts/inventory_new/ammo_icon.layout", GetMainWidget()));
1519 ammoIcon.SetPos(posX, 0.0, false);
1520
1521 ImageWidget ammoIconImg = ImageWidget.Cast(ammoIcon.GetChildren());
1522
1523 AmmoData data = Magazine.GetAmmoData(wpn.GetChamberAmmoTypeName(i));
1524 if (data)
1525 {
1526 CartridgeType cartridgeType = data.m_CartridgeType;
1527 switch (cartridgeType)
1528 {
1529 case CartridgeType.Pistol:
1530 {
1531 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_pistol");
1532 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_pistol");
1533 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_pistol");
1534 break;
1535 }
1536 case CartridgeType.Intermediate:
1537 {
1538 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_int");
1539 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_int");
1540 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_int");
1541 break;
1542 }
1543 case CartridgeType.FullPower:
1544 {
1545 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_fp");
1546 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_fp");
1547 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_fp");
1548 break;
1549 }
1550 case CartridgeType.Shell:
1551 {
1552 ammoIconImg.LoadImageFile(0, "set:dayz_gui image:cartridge_shell");
1553 ammoIconImg.LoadImageFile(1, "set:dayz_gui image:shell_shell");
1554 ammoIconImg.LoadImageFile(2, "set:dayz_gui image:jam_shell");
1555 break;
1556 }
1557 }
1558 }
1559 m_AmmoIcons.Insert(ammoIconImg);
1560 }
1561 }
1562 else
1563 {
1564 m_IsWeapon = false;
1565 }
1566 }
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
701 {
702 ItemManager.GetInstance().HideDropzones();
703 ItemManager.GetInstance().SetIsDragging(false);
704 ItemPreviewWidget selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
705 if (!selectedIpw)
706 {
707 string name = w.GetName();
708 name.Replace("PanelWidget", "Render");
709 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( name ));
710 }
711 if (!selectedIpw)
712 {
714 }
715 if (!selectedIpw.GetItem())
716 {
717 return;
718 }
720 EntityAI targetEntity = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
722
725 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Definition Building.c:6
bool PerformCombination(EntityAI selectedEntity, EntityAI targetEntity, int combinationFlag, InventoryLocation ilSwapDst=null)
Definition Icon.c:514
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:712

Перекрестные ссылки 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
728 {
730 return FlagAction( entity1, entity2, flags );
731 }
bool FlagAction(EntityAI entity1, EntityAI entity2, int combinationFlags)
Definition Icon.c:733
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
Definition ItemManager.c:793

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

◆ CreateWhiteBackground()

void CreateWhiteBackground ( )
inlineprotected
1114 {
1115 m_PreviousFlipOrientation = m_Item.GetInventory().GetFlipCargo();
1116 ItemManager.GetInstance().SetDraggedIcon(this);
1117 ItemManager.GetInstance().SetDraggedItem(m_Item);
1118 m_IsDragged = true;
1119 ItemManager.GetInstance().SetIsDragging(true);
1120 int ww, hh;
1121 GetGame().GetInventoryItemSize(m_Item, ww, hh);
1122 if (m_Item.GetInventory().GetFlipCargo())
1123 SetSize(hh, ww);
1124 else
1125 SetSize(ww, hh);
1126
1127 SetSize();
1128
1129 if (!m_HandsIcon)
1130 {
1131 Refresh();
1132 }
1133 else
1134 {
1137 }
1139
1140 m_CursorWidget.Show(true);
1141 }
Definition ColorManager.c:2
static int BASE_COLOR
Definition ColorManager.c:15
override void Refresh()
Definition Icon.c:1212
bool m_PreviousFlipOrientation
Definition Icon.c:20
void SetSize()
Definition Icon.c:1714
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
1087 {
1088 ItemManager.GetInstance().HideDropzones();
1089 ItemManager.GetInstance().SetIsDragging( false );
1090 m_IsDragged = false;
1091
1093
1094 if (m_HandsIcon)
1095 {
1098 Refresh();
1099 FullScreen();
1100 }
1101
1102 m_ColorWidget.Show(false);
1103
1104 m_CursorWidget.SetColor( ARGBF( 1, 1, 1, 1 ) );
1105 m_CursorWidget.Show( false );
1106
1107 InventoryMenu menu = InventoryMenu.Cast(GetGame().GetUIManager().FindMenu( MENU_INVENTORY ));
1108
1109 if (menu)
1110 menu.RefreshQuickbar();
1111 }
void InventoryMenu()
Definition InventoryMenu.c:20
void FullScreen()
Definition Icon.c:1240
proto native void SetForceFlip(bool value)
const int MENU_INVENTORY
Definition constants.c:178
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_ColorWidget, 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 {
201 entityInHands.GetInventory().GetCurrentInventoryLocation(handsItemLocation);
202 int index = controlledPlayer.GetHumanInventory().FindUserReservedLocationIndex(entityInHands);
203 if (index >= 0)
204 controlledPlayer.GetHumanInventory().GetUserReservedLocation(index, targetItemLocation);
205
206 if (controlledPlayer.GetInventory().CanForceSwapEntitiesEx(targetEntity, targetItemLocation, entityInHands, handsItemLocation))
207 {
208 controlledPlayer.PredictiveForceSwapEntities(targetEntity, entityInHands, targetItemLocation);
209 }
210 else if (controlledPlayer.GetInventory().CanSwapEntitiesEx(targetEntity, entityInHands ))
211 {
212 controlledPlayer.PredictiveSwapEntities(targetEntity, entityInHands);
213 }
214 else
215 {
216 controlledPlayer.GetInventory().FindFreeLocationFor(targetEntity, FindInventoryLocationType.ANY, targetItemLocation);
217 if (targetItemLocation.IsValid() && controlledPlayer.GetInventory().LocationCanAddEntity(targetItemLocation))
219 }
220 }
221 else
222 {
223 bool found = false;
224 if (targetEntity.GetInventory().CanRemoveEntity())
225 {
227 found = controlledPlayer.GetInventory().FindFreeLocationFor(targetEntity, FindInventoryLocationType.ANY, i2);
228 if (found)
229 {
230 if (i2.GetType() == FindInventoryLocationType.ATTACHMENT)
231 {
232 if (i2.GetParent() != controlledPlayer)
233 found = false;
234 }
235 }
236 }
237
238 if (found)
239 {
240 if (controlledPlayer.GetHumanInventory().CanAddEntityToInventory(targetEntity))
241 controlledPlayer.PredictiveTakeEntityToInventory(FindInventoryLocationType.ANY, targetEntity);
242 }
243 else
244 {
245 if (controlledPlayer.GetHumanInventory().CanAddEntityInHands(targetEntity))
246 controlledPlayer.PredictiveTakeEntityToHands(targetEntity);
247 }
248 }
249
251 }
252 }
253 }
DayZGame g_Game
Definition DayZGame.c:3815
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17
PlayerBase GetPlayer()
Definition ModifierBase.c:51
void RefreshQuickbar()
Definition Icon.c:145
InventoryLocation.
Definition InventoryLocation.c:29
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
366 {
367 ItemManager.GetInstance().HideDropzones();
368
369 if (w == null)
370 {
371 return;
372 }
373 string name = w.GetName();
374 name.Replace("PanelWidget", "Render");
375
376 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(receiver.FindAnyWidget( "Render" ));
377 if (m_HandsIcon)
378 {
379 targetIpw = ItemPreviewWidget.Cast(receiver.GetParent().FindAnyWidget( "Render" ));
380 }
381
382 ItemPreviewWidget selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( name ));
383 if (selectedIpw == null)
384 {
385 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( "Render" ));
386 }
387 if (selectedIpw == null)
388 {
389 return;
390 }
391
397 {
398 return;
399 }
400
401 if (m_Lock)
402 {
404 {
406 ItemManager.GetInstance().GetRightDropzone().SetAlpha( 1 );
407 }
408 else
409 {
410 CargoContainer parentContainer = CargoContainer.Cast(m_Parent);
411
412 float parentX;
413 float parentY;
414
415 parentContainer.GetRootWidget().GetScreenPos(parentX, parentY);
416
417 float iconSize = parentContainer.GetIconSize();
418 float spaceSize = parentContainer.GetSpaceSize();
419
420 int PosX = (x - parentX) / (iconSize + spaceSize);
421 int PosY = (y - parentY) / (iconSize + spaceSize);
422
423 EntityAI parent = m_Lock;
424 CargoBase targetCargo = parent.GetInventory().GetCargo();
425
426 ilDst = new InventoryLocation();
427 ilDst.SetCargoAuto(targetCargo, selectedEntity, PosY, PosX, selectedEntity.GetInventory().GetFlipCargo());
428
429 if (parent.GetInventory().LocationCanAddEntity(ilDst))
430 {
432 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
433 }
434 else
435 {
437 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
438 }
439 }
440 }
441 else
442 {
444
447 }
448 }
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:564
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:15

Перекрестные ссылки 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
256 {
257 if (w == null)
258 {
259 return;
260 }
261
262 string name = w.GetName();
263 name.Replace("PanelWidget", "Render");
264
265 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(receiver.FindAnyWidget( "Render" ));
266 if (m_HandsIcon)
267 {
268 targetIpw = ItemPreviewWidget.Cast(receiver.GetParent().FindAnyWidget( "Render" ));
269 }
270
272 if (selectedIpw == null)
273 {
274 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
275 }
276
277 if (selectedIpw == null)
278 {
279 return;
280 }
281
285 {
286 return;
287 }
288
291 int index = player.GetHumanInventory().FindUserReservedLocationIndex(m_Item);
292
293 if (index >= 0)
294 {
295 player.GetHumanInventory().GetUserReservedLocation(index, il);
296
298 {
300 ItemManager.GetInstance().HideDropzones();
301 ItemManager.GetInstance().ShowSourceDropzone(il.GetParent());
302 return;
303 }
304 }
306
309 }
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:664

Перекрестные ссылки 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
1179 {
1180 Pos pa;
1181 if (reciever)
1182 {
1183 reciever.GetUserData(pa);
1184 if (m_Parent)
1185 {
1186 ContainerWithCargo item = ContainerWithCargo.Cast(m_Parent.m_Parent);
1187 if (item)
1188 {
1189 item.DropReceived(w, m_PosY + pa.y, m_PosX + pa.x);
1190 }
1191 }
1192 }
1193 }
void Pos(int _x, int _y)
Definition Icon.c:1764
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
884 {
885 ItemManager.GetInstance().HideDropzones();
886 ItemManager.GetInstance().SetIsDragging(false);
887 string name = w.GetName();
888 name.Replace("PanelWidget", "Render");
890
891 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(receiver.FindAnyWidget( "Render" ));
892 if (m_HandsIcon)
893 {
894 targetIpw = ItemPreviewWidget.Cast(receiver.GetParent().FindAnyWidget( "Render" ));
895 }
896
897 ItemPreviewWidget selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( name ));
898 if (selectedIpw == null)
899 {
900 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( "Render" ));
901 }
902 if (selectedIpw == null)
903 {
904 return;
905 }
906
909 if (!selectedEntity)
910 {
911 return;
912 }
913 int index;
917 {
918 index = player.GetHumanInventory().FindUserReservedLocationIndex(m_Item);
919 ilSrc = new InventoryLocation();
920 ilDst = new InventoryLocation();
921
922 m_Item.GetInventory().GetCurrentInventoryLocation(ilSrc);
923 player.GetHumanInventory().GetUserReservedLocation(index, ilDst);
924
925 if (ilDst.GetParent().GetInventory().LocationCanAddEntity(ilDst))
926 {
927
928 player.GetHumanInventory().ClearUserReservedLocation(m_Item);
929 player.PredictiveTakeToDst(ilSrc, ilDst);
930 m_Item.GetOnReleaseLock().Invoke(m_Item);
931 }
932 }
933 else if (m_Lock)
934 {
935 CargoContainer parentCargo = CargoContainer.Cast(m_Parent);
936
937 float parentX;
938 float parentY;
939
940 parentCargo.GetRootWidget().GetScreenPos(parentX, parentY);
941
942 float iconSize = parentCargo.GetIconSize();
943 float spaceSize = parentCargo.GetSpaceSize();
944
945 int PosX = (x-parentX) / (iconSize + spaceSize);
946 int PosY = (y-parentY) / (iconSize + spaceSize);
947
948 EntityAI parent = m_Lock;
949 CargoBase targetCargo = parent.GetInventory().GetCargo();
950
951 ilDst = new InventoryLocation();
952 ilDst.SetCargoAuto(targetCargo, selectedEntity, PosY, PosX, selectedEntity.GetInventory().GetFlipCargo());
953
954 if (parent.GetInventory().LocationCanAddEntity(ilDst))
955 {
956 player.GetHumanInventory().ClearUserReservedLocation(m_Item);
957 m_Item.GetOnReleaseLock().Invoke(m_Item);
958
960 }
961 }
962 else
963 {
964 ilDst = new InventoryLocation();
966
969 }
970 }

Перекрестные ссылки 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
734 {
735 int current_flag;
736 ContextMenu cmenu = ContextMenu.Cast(GetGame().GetUIManager().GetMenu().GetContextMenu());
737 m_am_entity1 = entity1;
738 m_am_entity2 = entity2;
739 cmenu.Hide();
740 cmenu.Clear();
741 int id = -1;
742
744 {
746 entity.CombineItemsClient( ItemBase.Cast( entity2 ) );
747 return false;
748 }
749
751 return true;
752
754 {
756 cmenu.Add( "#inv_context_add_as_attachment", this, "OnPerformCombination", new Param1<int>( current_flag ) );
757 }
758 /*if (combinationFlags & InventoryCombinationFlags.LOAD_CHAMBER )
759 {
760 current_flag = InventoryCombinationFlags.LOAD_CHAMBER;
761 cmenu.Add( "#inv_context_load_chamber", this, "OnPerformCombination", new Param1<int>( current_flag ) );
762 }*/
764 {
766 cmenu.Add("#inv_context_attach_magazine", this, "OnPerformCombination", new Param1<int>( current_flag ) );
767 }
768
770 {
772 cmenu.Add( "#inv_context_add_as_cargo", this, "OnPerformCombination", new Param1<int>( current_flag ) );
773 }
774
776 {
778 cmenu.Add( "#inv_context_swap", this, "OnPerformCombination", new Param1<int>( current_flag ) );
779 }
780
782 {
784 cmenu.Add( "#inv_context_combine", this, "OnPerformCombination", new Param1<int>( current_flag ) );
785 }
786
788 {
790 cmenu.Add("#inv_context_attach_magazine", this, "OnPerformCombination", new Param1<int>( current_flag ) );
791 }
792
794 {
796 cmenu.Add("Perform Action2", this, "OnPerformCombination", new Param1<int>( current_flag ) );
797 }
798
801 m_am_Pos_x -= 5;
802 m_am_Pos_y -= 5;
803
804 MissionGameplay mission = MissionGameplay.Cast( GetGame().GetMission() );
805 /*if (combinationFlags & InventoryCombinationFlags.RECIPE_HANDS || combinationFlags & InventoryCombinationFlags.RECIPE_ANYWHERE )
806 {
807 OnPerformRecipe( id );
808 return true;
809 }
810 else /*if (cmenu.Count() == 1 )*/
811 //{
813 return true;
814 //}
815 /*else
816 {
817 cmenu.Show( m_am_Pos_x, m_am_Pos_y );
818 return true;
819 }*/
820 }
Mission mission
Definition DisplayStatus.c:28
override ContextMenu GetContextMenu()
Definition InventoryMenu.c:80
void OnPerformCombination(int combinationFlags)
Definition Icon.c:450
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
1241 {
1242 if (m_IsDragged)
1243 {
1244 return;
1245 }
1246 GetRootWidget().ClearFlags(WidgetFlags.HEXACTSIZE + WidgetFlags.VEXACTSIZE);
1247 GetRootWidget().SetSize(1, 1);
1248 m_ColorWidget.SetColor(ARGB( 0, 0, 0, 0 ));
1249 }
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
1076 {
1077 return m_CargoPos;
1078 }
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
1263 {
1264 return m_Obj;
1265 }

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

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

◆ GetPosX()

int GetPosX ( )
inlineprotected
1656 {
1657 return m_PosX;
1658 }

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

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

◆ GetPosY()

int GetPosY ( )
inlineprotected
1661 {
1662 return m_PosY;
1663 }

Перекрестные ссылки 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
1666 {
1667 return m_SizeX;
1668 }
int m_SizeX
Definition Icon.c:3

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

◆ GetSizeY()

int GetSizeY ( )
inlineprotected
1671 {
1672 return m_SizeY;
1673 }
int m_SizeY
Definition Icon.c:4

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

◆ GetSort()

int GetSort ( )
inlineprotected
1374 {
1375 return GetMainWidget().GetSort();
1376 }

◆ Init()

void Init ( EntityAI obj)
inlineprotected
1497 {
1498 InitEx(obj);
1499 }
void InitEx(EntityAI obj, bool refresh=true)
Definition Icon.c:1443

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

◆ InitEx()

void InitEx ( EntityAI obj,
bool refresh = true )
inlineprotected
1444 {
1445 if (obj != m_Obj)
1446 {
1447 if (m_Obj)
1448 {
1449 m_Obj.GetOnItemFlipped().Remove(UpdateFlip );
1450 m_Obj.GetOnViewIndexChanged().Remove(SetItemPreview);
1451 }
1452 if (obj)
1453 {
1454 obj.GetOnItemFlipped().Insert(UpdateFlip);
1455 obj.GetOnViewIndexChanged().Insert(SetItemPreview);
1456 }
1457 }
1458
1459 if (m_HandsIcon)
1460 {
1463 }
1464
1465 m_Obj = obj;
1466 m_Item = ItemBase.Cast(m_Obj);
1467 m_Lock = null;
1468
1470
1471 WidgetEventHandler.GetInstance().RegisterOnDrag( GetMainWidget(), this, "CreateWhiteBackground" );
1472 WidgetEventHandler.GetInstance().RegisterOnDrop( GetMainWidget(), this, "DestroyWhiteBackground" );
1473 WidgetEventHandler.GetInstance().RegisterOnDropReceived( GetMainWidget(), this, "DropReceivedFromMain" );
1474 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( GetMainWidget(), this, "MouseClick" );
1475 WidgetEventHandler.GetInstance().RegisterOnDropReceived( GetMainWidget().FindAnyWidget( "Swap" ), this, "Swap" );
1476 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( GetMainWidget().FindAnyWidget( "Swap" ), this, "DraggingOverSwap" );
1477 WidgetEventHandler.GetInstance().RegisterOnDropReceived( GetMainWidget().FindAnyWidget( "Combine" ), this, "Combine" );
1478 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( GetMainWidget().FindAnyWidget( "Combine" ), this, "DraggingOverCombine" );
1479 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( GetMainWidget(), this, "DraggingOver" );
1480 WidgetEventHandler.GetInstance().RegisterOnMouseEnter( GetMainWidget(), this, "MouseEnter" );
1481 WidgetEventHandler.GetInstance().RegisterOnMouseLeave( GetMainWidget(), this, "MouseLeave" );
1482 WidgetEventHandler.GetInstance().RegisterOnDoubleClick( GetMainWidget(), this, "DoubleClick" );
1483
1485 CheckIsWeapon();
1489 m_RootWidget.FindAnyWidget("Reserved").Show(false, refresh);
1490
1491 m_ColorWidget.Show(false);
1492 if (refresh)
1493 Refresh();
1494 }
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Definition PluginRemotePlayerDebugClient.c:14
void SetItemPreviewEx(bool refresh=true)
Definition Icon.c:1378
void SetItemSizeEx(bool refresh=true)
Definition Icon.c:1391
void CheckIsWeapon()
Definition Icon.c:1501
void CheckHasTemperature()
Definition Icon.c:1611
Definition WidgetEventHandler.c:2
static WidgetEventHandler GetInstance()
Definition WidgetEventHandler.c:22

Перекрестные ссылки CheckHasQuantityEx(), CheckHasTemperature(), CheckIsMagazineEx(), CheckIsWeapon(), FindAnyWidget(), WidgetEventHandler::GetInstance(), m_ColorWidget, 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
1423 {
1424 m_Lock = parent;
1425 m_Obj = obj;
1426 m_Item = ItemBase.Cast(m_Obj);
1427
1428 SetPos(x_pos, y_pos);
1429 UpdateFlip( flip );
1430
1431 ItemManager.GetInstance().SetWidgetDraggable( GetMainWidget(), false );
1432 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( GetMainWidget(), this, "MouseClick" );
1433 WidgetEventHandler.GetInstance().RegisterOnDropReceived( GetMainWidget(), this, "DropReceivedFromMain" );
1434 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( GetMainWidget(), this, "DraggingOver" );
1435
1436 m_RootWidget.FindAnyWidget( "Reserved" ).Show( true );
1440 Refresh();
1441 }
void SetPos()
Definition Icon.c:1709

Перекрестные ссылки 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
823 {
824 if (button == MouseState.RIGHT)
825 {
826 if (m_Lock)
827 {
828 GetGame().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:
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 {
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 GetDayZGame()
Definition DayZGame.c:3817
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:1318
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
345 {
346 if (!m_IsDragged)
347 {
348 PrepareOwnedTooltip(m_Obj, x, y);
349 m_CursorWidget.Show(true);
350 }
351
352 return true;
353 }

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

◆ MouseLeave()

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

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

◆ OnDraggingOverBackground()

void OnDraggingOverBackground ( Widget w,
int x,
int y,
Widget reciever )
inlineprotected
1144 {
1145 ItemManager.GetInstance().HideDropzones();
1146 EntityAI entity = EntityAI.Cast( m_Obj );
1147 EntityAI parent = entity.GetHierarchyParent();
1148 if (parent && parent.GetHierarchyRootPlayer() == GetGame().GetPlayer())
1149 {
1150 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
1151 }
1152 else if (!m_HandsIcon)
1153 {
1154 ItemManager.GetInstance().GetLeftDropzone().SetAlpha(1);
1155 }
1156
1157 if (w == null || reciever == null)
1158 {
1159 return;
1160 }
1161 Pos pa;
1162 reciever.GetUserData(pa);
1163 if (m_Parent)
1164 {
1165 ContainerWithCargo item = ContainerWithCargo.Cast(m_Parent.m_Parent);
1166 if (item)
1167 {
1168 item.DraggingOverGrid(w, m_PosY + pa.y, m_PosX + pa.x, reciever);
1169 }
1171 if (hands_item)
1172 {
1173 hands_item.DraggingOverGrid(w, m_PosY + pa.y, m_PosX + pa.x, reciever, null);
1174 }
1175 }
1176 }
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
451 {
453 if (m_am_entity1 == null || m_am_entity2 == null) return;
454
456
459
461 {
463 Class.CastTo(amc, player.GetActionManager());
464
465 if (m_am_entity1 == player.GetHumanInventory().GetEntityInHands())
466 {
467 amc.PerformActionFromInventory(ItemBase.Cast( m_am_entity1 ),ItemBase.Cast( m_am_entity2 ));
468 }
469 else
470 {
471 amc.PerformActionFromInventory(ItemBase.Cast( m_am_entity2 ),ItemBase.Cast( m_am_entity1 ));
472 }
473 }
475 {
477 Class.CastTo(amc2, player.GetActionManager());
478
479 if (m_am_entity1 == player.GetHumanInventory().GetEntityInHands())
480 {
481 amc2.SetActionFromInventory(ItemBase.Cast( m_am_entity1 ), ItemBase.Cast( m_am_entity2 ));
482 }
483 else
484 {
485 amc2.SetActionFromInventory(ItemBase.Cast( m_am_entity2 ), ItemBase.Cast( m_am_entity1 ));
486 }
487 }
489 {
490 ItemBase entity = ItemBase.Cast(m_am_entity1);
491 entity.CombineItemsClient(ItemBase.Cast( m_am_entity2 ));
492 }
494 {
495 float stackable = m_am_entity2.GetTargetQuantityMax(-1);
496
497 if (stackable == 0 || stackable >= m_am_entity2.GetQuantity())
498 {
499 player.PredictiveTakeEntityToTargetAttachment(m_am_entity1, m_am_entity2);
500 }
501 else
502 {
504 m_am_entity1.GetInventory().FindFreeLocationFor(m_am_entity2, FindInventoryLocationType.ATTACHMENT, il);
505 ItemBase.Cast(m_am_entity2).SplitIntoStackMaxToInventoryLocationClient(il);
506 }
507 }
509 {
510 SplitItemUtils.TakeOrSplitToInventory(player, m_am_entity1, m_am_entity2);
511 }
512 }
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
692 {
693 if ( m_am_entity1 == null || m_am_entity2 == null ) return;
694
695 Debug.Log("OnPerformRecipe called for id:"+id.ToString(),"recipes");
697 player.GetCraftingManager().SetInventoryCraft( id, ItemBase.Cast(m_am_entity1), ItemBase.Cast(m_am_entity2));
698 }
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
515 {
518
519 switch (combinationFlag)
520 {
522 return player.PredictiveTakeEntityToTargetAttachment(targetEntity, selectedEntity);
525 return true;
527 targetEntity.CombineItemsClient(selectedEntity);
528 return true;
530 Class.CastTo(amc, player.GetActionManager());
531 if (targetEntity == player.GetHumanInventory().GetEntityInHands())
532 {
533 amc.SetActionFromInventory(ItemBase.Cast(targetEntity), ItemBase.Cast(selectedEntity));
534 }
535 else
536 {
537 amc.SetActionFromInventory(ItemBase.Cast(selectedEntity), ItemBase.Cast(targetEntity));
538 }
539 return true;
541 Class.CastTo(amc, player.GetActionManager());
542 if (targetEntity == player.GetHumanInventory().GetEntityInHands())
543 {
544 amc.PerformActionFromInventory(ItemBase.Cast(targetEntity), ItemBase.Cast(selectedEntity));
545 }
546 else
547 {
548 amc.PerformActionFromInventory(ItemBase.Cast(selectedEntity), ItemBase.Cast(targetEntity));
549 }
550 return true;
552 return player.GetWeaponManager().SwapMagazine(Magazine.Cast(selectedEntity));
554 return player.PredictiveSwapEntities(targetEntity, selectedEntity);
556 return player.PredictiveForceSwapEntities(selectedEntity, targetEntity, ilSwapDst);
557 default:
558 return false;
559 }
560
561 return false;
562 }

Перекрестные ссылки 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
1213 {
1214 super.Refresh();
1215
1216 if (!m_HandsIcon)
1217 SetPos();
1218
1219 if (m_HasTemperature)
1221
1222 if (m_IsWeapon)
1224
1225 if (m_HasQuantity)
1226 SetQuantity();
1227 }
void RefreshMuzzleIcon()
Definition Icon.c:1267
void SetTemperature()
Definition Icon.c:1229

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

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

◆ RefreshIconPos()

void RefreshIconPos ( )
inlineprotected
1235 {
1236 Refresh();
1237 GetMainWidget().Update();
1238 }

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

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

◆ RefreshMuzzleIcon()

void RefreshMuzzleIcon ( )
inlineprotected
1268 {
1270 if (wpn)
1271 {
1272 int i;
1274 if (!wpn.IsShowingChamberedBullet())
1275 {
1276 for (i = 0; i < m_AmmoIcons.Count(); i++)
1277 {
1278 ammoIcon = m_AmmoIcons.Get(i);
1279 ammoIcon.Show(false);
1280 }
1281 }
1282 else
1283 {
1284 for (i = 0; i < wpn.GetMuzzleCount(); i++)
1285 {
1286 if (i > m_AmmoIcons.Count())
1287 break;
1288
1289 ammoIcon = m_AmmoIcons.Get(i);
1290
1291 if (wpn.IsChamberFull(i))
1292 {
1293 if (wpn.IsJammed())
1294 {
1295 ammoIcon.Show(true);
1296 ammoIcon.SetImage(2);
1297 }
1298 else if (wpn.IsChamberFiredOut(i))
1299 {
1300 ammoIcon.Show(true);
1301 ammoIcon.SetImage(1);
1302 }
1303 else
1304 {
1305 ammoIcon.Show(true);
1306 ammoIcon.SetImage(0);
1307 }
1308 }
1309 else
1310 {
1311 ammoIcon.Show(false);
1312 }
1313 }
1314 }
1315 }
1316 }
Object GetObject()
Definition Icon.c:1262

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

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

◆ RefreshPos()

void RefreshPos ( int row,
int column )
inlineprotected
1252 {
1253 if (row != m_PosY || column != m_PosX)
1254 {
1255 m_PosX = column;
1256 m_PosY = row;
1257 SetPos();
1259 }
1260 }
void RefreshIconPos()
Definition Icon.c:1234

Перекрестные ссылки 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
1196 {
1197 if (m_Item)
1198 {
1199 m_Item.GetInventory().SetFlipCargo(m_PreviousFlipOrientation);
1200 int ww, hh;
1201 GetGame().GetInventoryItemSize(m_Item, ww, hh);
1202
1204 SetSize(hh, ww);
1205 else
1206 SetSize(ww, hh);
1207
1208 SetSize();
1209 }
1210 }

Перекрестные ссылки 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
1081 {
1082 GetMainWidget().SetSort( x );
1083 m_CargoPos = x;
1084 }

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

◆ SetItemPreview()

void SetItemPreview ( )
inlineprotected
1387 {
1389 }

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

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

◆ SetItemPreviewEx()

void SetItemPreviewEx ( bool refresh = true)
inlineprotected
1379 {
1380 m_ItemPreview.Show(true, refresh);
1383 m_ItemPreview.SetView(m_Obj.GetViewIndex());
1384 }
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
1405 {
1406 SetItemSizeEx();
1407 }

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

◆ SetItemSizeEx()

void SetItemSizeEx ( bool refresh = true)
inlineprotected
1392 {
1393 #ifdef PLATFORM_CONSOLE
1394 m_ItemSizePanel.Show(true, refresh);
1395 m_ItemSizeWidget.Show(true, refresh);
1396
1397 int sizeX, sizeY;
1398 GetGame().GetInventoryItemSize(m_Item, sizeX, sizeY);
1399 int capacity = sizeX * sizeY;
1400 m_ItemSizeWidget.SetText(capacity.ToString());
1401 #endif
1402 }

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

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

◆ SetLayoutName()

override void SetLayoutName ( )
inlineprotected
1037 {
1038 #ifdef PLATFORM_CONSOLE
1039 m_LayoutName = WidgetLayoutName.IconXbox;
1040 #else
1041 switch (InventoryMenu.GetWidthType())
1042 {
1043 case ScreenWidthType.NARROW:
1044 {
1045 m_LayoutName = WidgetLayoutName.IconNarrow;
1046 break;
1047 }
1048 case ScreenWidthType.MEDIUM:
1049 {
1050 m_LayoutName = WidgetLayoutName.IconMedium;
1051 break;
1052 }
1053 case ScreenWidthType.WIDE:
1054 {
1055 m_LayoutName = WidgetLayoutName.IconWide;
1056 break;
1057 }
1058 }
1059 #endif
1060
1061 }
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
1710 {
1711 SetPosEx();
1712 }
void SetPosEx(bool refresh=true)
Definition Icon.c:1675

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

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

◆ SetPos() [2/2]

void SetPos ( int x,
int y )
inlineprotected
1070 {
1071 m_PosX = x;
1072 m_PosY = y;
1073 }

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

◆ SetPosEx()

void SetPosEx ( bool refresh = true)
inlineprotected
1676 {
1677 CargoContainer parentContainer = CargoContainer.Cast(m_Parent);
1679 Widget rootWidget = GetRootWidget();
1680 float iconSize, spaceSize;
1681 if (parentContainer)
1682 {
1683 iconSize = parentContainer.GetIconSize();
1684 spaceSize = parentContainer.GetSpaceSize();
1685 }
1686 else if (parentHPrevContainer)
1687 {
1688 iconSize = parentHPrevContainer.GetIconSize();
1689 if (rootWidget)
1690 {
1691 rootWidget.SetFlags(WidgetFlags.EXACTSIZE, refresh);
1692 }
1693 }
1694
1695 if (rootWidget)
1696 {
1697 #ifndef PLATFORM_CONSOLE
1698 rootWidget.SetPos(iconSize * GetPosX() + ( GetPosX() + 1 ) * spaceSize, iconSize * GetPosY() + ( GetPosY() + 1 ) * spaceSize, refresh);
1700 #else
1701 int row = m_CargoPos / 5;
1702 int column = m_CargoPos % 5;
1705 #endif
1706 }
1707 }
int GetPosY()
Definition Icon.c:1660
int GetPosX()
Definition Icon.c:1655

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

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

◆ SetPosX()

void SetPosX ( int x)
inlineprotected
1636 {
1637 m_PosX = x;
1638 }

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

◆ SetPosY()

void SetPosY ( int y)
inlineprotected
1641 {
1642 m_PosY = y;
1643 }

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

◆ SetQuantity()

void SetQuantity ( )
inlineprotected
1319 {
1320 if (m_Item)
1321 {
1324 {
1326
1328 {
1330
1332 {
1333 m_QuantityStack.Show(false);
1334 }
1335 else
1336 {
1338 m_QuantityStack.Show(true);
1339 }
1340
1341 m_QuantityProgress.Show(false);
1342 }
1343 else if (quantityType == QUANTITY_PROGRESS)
1344 {
1345 int max = m_Item.GetQuantityMax();
1346 int count = m_Item.ConfigGetInt("count");
1347 float quantity = m_CurrQuantity;
1348
1349 if (count > 0)
1350 {
1351 max = count;
1352 }
1353
1354 if (max > 0)
1355 {
1356 float value = Math.Round((quantity / max) * 100);
1357 m_QuantityProgress.SetCurrent(value);
1358 }
1359
1360 m_QuantityStack.Show(false);
1361 m_QuantityProgress.Show(true);
1362 }
1363 }
1364 }
1365 }
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:495
const int QUANTITY_COUNT
Definition constants.c:494
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
1715 {
1716 CargoContainer parentContainer = CargoContainer.Cast(m_Parent);
1718 float iconSize, spaceSize;
1719 Widget rootWidget = GetRootWidget();
1720 if (parentContainer)
1721 {
1722 iconSize = parentContainer.GetIconSize();
1723 spaceSize = parentContainer.GetSpaceSize();
1724 }
1725 else if (parentHPrevContainer)
1726 {
1727 iconSize = parentHPrevContainer.GetIconSize();
1728 if (rootWidget)
1729 {
1730 GetRootWidget().SetFlags(WidgetFlags.EXACTSIZE);
1731 }
1732 }
1733
1734 if (rootWidget)
1735 {
1736 #ifndef PLATFORM_CONSOLE
1737 GetRootWidget().SetSize(iconSize * m_SizeX + ( m_SizeX ) * spaceSize, iconSize * m_SizeY + ( m_SizeY ) * spaceSize);
1738 #else
1739 GetRootWidget().SetSize(iconSize, iconSize);
1740 #endif
1741 }
1742 }

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

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

◆ SetSize() [2/2]

void SetSize ( int x,
int y )
inlineprotected
1064 {
1065 m_SizeX = x;
1066 m_SizeY = y;
1067 }

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

◆ SetSizeX()

void SetSizeX ( int x)
inlineprotected
1646 {
1647 m_SizeX = x;
1648 }

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

◆ SetSizeY()

void SetSizeY ( int y)
inlineprotected
1651 {
1652 m_SizeY = y;
1653 }

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

◆ SetSort()

void SetSort ( int index)
inlineprotected
1368 {
1369 GetMainWidget().SetSort(index);
1370 GetMainWidget().Update();
1371 }

◆ SetTemperature()

void SetTemperature ( )
inlineprotected
1230 {
1231 ItemManager.GetInstance().SetIconTemperature(EntityAI.Cast( m_Obj ), m_RootWidget);
1232 }

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

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

◆ ShowActionMenuCombine()

void ShowActionMenuCombine ( EntityAI entity1,
EntityAI entity2,
int combinationFlags,
Widget w,
bool color_test )
inlineprotected
613 {
614 int lastFlag = 0;
615 ContextMenu cmenu = ContextMenu.Cast(GetGame().GetUIManager().GetMenu().GetContextMenu());
616 m_am_entity1 = entity1;
617 m_am_entity2 = entity2;
618 cmenu.Hide();
619 cmenu.Clear();
620 int id = -1;
621
622 if ( entity1 == null || entity2 == null ) return;
623
625 {
626 if ( color_test )
627 {
629 ItemManager.GetInstance().ShowSourceDropzone( entity2 );
630 }
631 return;
632 }
633
635 {
637 cmenu.Add( "#inv_context_add_as_cargo", this, "OnPerformCombination", new Param1<int>( lastFlag ) );
638 }
640 {
642 cmenu.Add( "#inv_context_add_as_attachment", this, "OnPerformCombination", new Param1<int>( lastFlag ));
643 }
644
646 {
648 cmenu.Add("#inv_context_combine_quantity", this, "OnPerformCombination", new Param1<int>( lastFlag ));
649 }
650
652 {
654 cmenu.Add("#inv_context_attach_magazine", this, "OnPerformCombination", new Param1<int>( lastFlag ));
655 }
656
658 {
660 cmenu.Add("Perform action", this, "OnPerformCombination", new Param1<int>( lastFlag ));
661 }
662
663 if (color_test)
664 {
665 if (lastFlag == 0)
666 {
667 ItemManager.GetInstance().HideDropzones();
668 ItemManager.GetInstance().GetCenterDropzone().SetAlpha( 1 );
670 }
672 {
673 ItemManager.GetInstance().HideDropzones();
674 ItemManager.GetInstance().GetCenterDropzone().SetAlpha( 1 );
676 }
677 else
678 {
679 ItemManager.GetInstance().HideDropzones();
680 ItemManager.GetInstance().GetCenterDropzone().SetAlpha( 1 );
682 }
683 }
684 else if (cmenu.Count() >= 1)
685 {
687 return;
688 }
689 }
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
973 {
974 ItemManager.GetInstance().HideDropzones();
975 ItemManager.GetInstance().SetIsDragging(false);
976 string name = w.GetName();
977 name.Replace("PanelWidget", "Render");
978
979 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(receiver.FindAnyWidget( "Render" ));
980 if (m_HandsIcon)
981 {
982 targetIpw = ItemPreviewWidget.Cast(receiver.GetParent().FindAnyWidget( "Render" ));
983 }
984
985 ItemPreviewWidget selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( name ));
986 if (selectedIpw == null)
987 {
988 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( "Render" ));
989 }
990 if (selectedIpw == null)
991 {
992 return;
993 }
994
998 {
999 return;
1000 }
1001
1003 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
1004
1007 targetEntity.GetInventory().GetCurrentInventoryLocation(ilSrc);
1008 Icon icon = ItemManager.GetInstance().GetDraggedIcon();
1009
1010 int index = player.GetHumanInventory().FindUserReservedLocationIndex(targetEntity);
1011 if (index>=0)
1012 {
1013 player.GetHumanInventory().GetUserReservedLocation(index, ilDst);
1014
1016 {
1017 if (m_HandsIcon && !player.GetInventory().HasInventoryReservation(itemInHands, null) && !player.IsItemsToDelete())
1018 {
1019 GetGame().GetPlayer().PredictiveForceSwapEntities(selectedEntity, targetEntity, ilDst);
1020 return;
1021 }
1022 }
1023 }
1025
1028 }
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
1031 {
1032 ( IconsContainer.Cast( m_Parent ) ).RemoveItem( icon );
1033 ( IconsContainer.Cast( m_Parent ) ).RemoveItem( icon2 );
1034 }
Definition IconsContainer.c:2

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

◆ UpdateFlip()

void UpdateFlip ( bool flipped)
inlineprotected
1410 {
1411 int sizeX, sizeY;
1412 GetGame().GetInventoryItemSize(m_Item, sizeX, sizeY);
1413
1414 if (flipped)
1416 else
1418
1419 SetSize();
1420 }

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

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

◆ UpdateFrameColor()

void UpdateFrameColor ( EntityAI selectedEntity,
EntityAI targetEntity,
int combinationFlag,
Widget w,
InventoryLocation il = null )
inlineprotected
565 {
566 int color;
568
569 ItemManager.GetInstance().HideDropzones();
570 switch (combinationFlag)
571 {
575 ItemManager.GetInstance().ShowSourceDropzone(targetEntity);
576 break;
581 ItemManager.GetInstance().ShowSourceDropzone(targetEntity);
582 break;
585 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
586 break;
589 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
590 break;
593 if (il)
594 {
595 ItemManager.GetInstance().ShowSourceDropzone(il.GetParent());
596 }
597 else
598 {
599 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
600 }
601 break;
602 default:
604 ItemManager.GetInstance().ShowSourceDropzone(selectedEntity);
605 }
606
607 ColorManager.GetInstance().SetColor( w, color );
608 }

Перекрестные ссылки 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
1745 {
1746 if (m_Item)
1747 {
1748 if (m_HasTemperature)
1750
1751 if (m_IsWeapon)
1753
1754 if (m_HasQuantity)
1755 SetQuantity();
1756 }
1757 }

Перекрестные ссылки 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

◆ 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

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