Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ItemManager

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

void ItemManager (Widget root)
 
void SetItemMicromanagmentMode (bool item_micromanagment_mode)
 
bool IsMicromanagmentMode ()
 
HandsPreview GetHandsPreview ()
 
void SetHandsPreview (HandsPreview hansd_preview)
 
EntityAI GetSelectedItem ()
 
Container GetSelectedContainer ()
 
Widget GetSelectedWidget ()
 
SlotsIcon GetSelectedIcon ()
 
void SetSelectedItem (EntityAI selected_item, Container selected_container, Widget selected_widget, SlotsIcon selected_icon)
 
void SetSelectedItemEx (EntityAI selected_item, Container selected_container, LayoutHolder selected_icon)
 
void ClearDefaultOpenStates ()
 
void ClearDefaultHeaderOpenStates ()
 
void SetDefaultOpenState (string type, bool is_opened)
 
void SetDefaultHeaderOpenState (string type, bool is_opened)
 
void SetDefaultOpenStateHands (bool is_opened)
 
bool GetDefaultOpenStateHands ()
 
void SerializeDefaultHeaderOpenStates ()
 
void DeserializeDefaultHeaderOpenStates ()
 
void SerializeDefaultOpenStates ()
 
void DeserializeDefaultOpenStates ()
 
bool GetDefaultOpenState (string type)
 
bool GetDefaultHeaderOpenState (string type)
 
void HideDropzones ()
 
void ShowSourceDropzone (EntityAI item)
 
Widget GetLeftDropzone ()
 
Widget GetRightDropzone ()
 
Widget GetCenterDropzone ()
 
EntityAI GetHoveredItem ()
 
void SetDraggedItem (EntityAI dragged_item)
 
EntityAI GetDraggedItem ()
 
void SetDraggedIcon (Icon dragged_icon)
 
Icon GetDraggedIcon ()
 
void SetIsDragging (bool is_dragging)
 
bool IsDragging ()
 
void HideTooltip ()
 
void HideTooltipSlot ()
 
void SetTemperature (EntityAI item, Widget item_w)
 
void SetIconTemperature (EntityAI item, Widget item_w)
 
void PrepareTooltip (EntityAI item, int x=0, int y=0)
 
void PrepareSlotsTooltip (string name, string desc, int x=0, int y=0)
 position is currentlycalculated from the owning 'm_TooltipSourceWidget' directly
 
void CalculateTooltipSlotPosition (int x=0, int y=0)
 
void UpdateTooltipSlotPosition ()
 
void SetTooltipWidget (Widget w)
 
bool EvaluateContainerDragabilityDefault (EntityAI entity)
 
void SetWidgetDraggable (Widget w, bool draggable)
 
void ShowTooltip ()
 
void ShowTooltipSlot ()
 

Защищенные статические члены

static ItemManager GetInstance ()
 
static int GetItemHealthColor (int pHealthLevel)
 
static int GetItemHealthColor (EntityAI item, string zone="")
 
static int ColorFromFloat (float fraction)
 
static int GetChosenCombinationFlag (EntityAI selectedEntity, EntityAI targetEntity, int relevantFlags, out InventoryLocation dst=null)
 
static int GetCombinationFlags (EntityAI entity1, EntityAI entity2)
 
static int GetRecipeCount (bool recipe_anywhere, EntityAI entity1, EntityAI entity2)
 

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

bool m_IsDragging
 
EntityAI m_HoveredItem
 
bool m_SlotInfoShown
 
EntityAI m_DraggedItem
 
Icon m_DraggedIcon
 
ref Widget m_TooltipWidget
 
ref Widget m_TooltipSlotWidget
 
ref Widget m_TooltipCategoryWidget
 
ItemPreviewWidget m_ItemPreviewWidget
 
Widget m_RootWidget
 
ref map< string, boolm_DefautOpenStates
 
ref map< string, boolm_DefautHeaderOpenStates
 
int m_HandsDefaultOpenState
 
ref Timer m_ToolTipTimer
 
ref Timer m_TooltipSlotTimer
 
EntityAI m_SelectedItem
 
Container m_SelectedContainer
 
Widget m_SelectedWidget
 
SlotsIcon m_SelectedIcon
 
LayoutHolder m_SelectedBaseIcon
 
HandsPreview m_HandsPreview
 
bool m_ItemMicromanagmentMode
 
Widget m_LeftDropzone
 
Widget m_CenterDropzone
 
Widget m_RightDropzone
 
int m_TooltipPosX
 
int m_TooltipPosY
 
Widget m_TooltipSourceWidget
 
const float TOOLTIP_DELAY = 0.25
 

Закрытые статические данные

static ref ItemManager m_Instance
 

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

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

◆ ItemManager()

void ItemManager ( Widget root)
inlineprotected
45 {
46 m_Instance = this;
50 m_SlotInfoShown = false;
51
52 #ifdef PLATFORM_CONSOLE
53 m_TooltipWidget = GetGame().GetWorkspace().CreateWidgets("gui/layouts/inventory_new/day_z_inventory_new_tooltip_xbox.layout", root );
54 m_TooltipSlotWidget = GetGame().GetWorkspace().CreateWidgets("gui/layouts/inventory_new/day_z_inventory_new_tooltip_slot_xbox.layout", root );
55 #else
56 m_TooltipWidget = GetGame().GetWorkspace().CreateWidgets("gui/layouts/inventory_new/day_z_inventory_new_tooltip.layout", root );
57 m_TooltipSlotWidget = GetGame().GetWorkspace().CreateWidgets("gui/layouts/inventory_new/day_z_inventory_new_tooltip_slot.layout", root );
58 #endif
59 m_TooltipWidget.Show( false );
60 m_TooltipSlotWidget.Show( false );
61 }
ref Widget m_TooltipSlotWidget
Definition ItemManager.c:10
bool m_SlotInfoShown
Definition ItemManager.c:6
static ref ItemManager m_Instance
Definition ItemManager.c:3
ref Widget m_TooltipWidget
Definition ItemManager.c:9
ref map< string, bool > m_DefautOpenStates
Definition ItemManager.c:14
Widget m_RootWidget
Definition ItemManager.c:13
ref map< string, bool > m_DefautHeaderOpenStates
Definition ItemManager.c:15
Definition EntityAI.c:95
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_DefautHeaderOpenStates, m_DefautOpenStates, m_Instance, m_RootWidget, m_SlotInfoShown, m_TooltipSlotWidget и m_TooltipWidget.

Методы

◆ CalculateTooltipSlotPosition()

void CalculateTooltipSlotPosition ( int x = 0,
int y = 0 )
inlineprotected
605 {
606 int screen_w, screen_h;
607 float w, h;
609 //m_TooltipSlotWidget.GetScreenSize(w,h);
610 m_TooltipSlotWidget.GetSize(w,h);
613 //minimal edge distance adjustments..
614 screen_w -= 10;
615 screen_h -= 10;
616
617#ifndef PLATFORM_CONSOLE
618 x += 5;
619 y += slot_normal_h + 5;
620#else
621 x += 5;
622 y += 15;
623#endif
625 while (scrollerWidget)
626 {
628 {
629 break;
630 }
631 else
632 {
633 scrollerWidget = scrollerWidget.GetParent();
634 }
635 }
636
637 int rightEdge = x + w;
638 if (rightEdge > screen_w)
639 {
640 x = screen_w - w;
641 }
642
643 int bottomEdge = y + h;
644 if (scrollerWidget)
645 {
647 scrollerWidget.GetScreenPos(scrollerX,scrollerY);
649
652 {
654 bottomEdge = y + h;
655 }
656 }
657 /*else
658 {
659 ErrorEx("No scroller widget! | m_TooltipSourceWidget: " + m_TooltipSourceWidget);
660 }*/
661
662 if (bottomEdge > screen_h) //should mostly never proc now
663 {
664 y = screen_h - h;
665 }
666
669 }
Icon x
Icon y
int m_TooltipPosX
Definition ItemManager.c:34
int m_TooltipPosY
Definition ItemManager.c:35
Widget m_TooltipSourceWidget
Definition ItemManager.c:36
Definition SlotsIcon.c:2
static int GetNormalWidth()
Definition SlotsIcon.c:782
static int GetNormalHeight()
Definition SlotsIcon.c:787
Definition EnWidgets.c:190
proto void GetScreenSize(out int x, out int y)

Перекрестные ссылки SlotsIcon::GetNormalHeight(), SlotsIcon::GetNormalWidth(), GetScreenSize(), m_TooltipPosX, m_TooltipPosY, m_TooltipSlotWidget, m_TooltipSourceWidget, x и y.

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

◆ ClearDefaultHeaderOpenStates()

void ClearDefaultHeaderOpenStates ( )
inlineprotected
163 {
165 }

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

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

◆ ClearDefaultOpenStates()

void ClearDefaultOpenStates ( )
inlineprotected
158 {
159 m_DefautOpenStates.Clear();
160 }

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

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

◆ ColorFromFloat()

static int ColorFromFloat ( float fraction)
inlinestaticprotected
456 {
457 if( fraction > 1 || fraction < 0 )
458 return 0x00FFFFFF;
459 else if( fraction > 0.80 )
460 return Colors.COLOR_PRISTINE;
461 else if( fraction > 0.6 )
462 return Colors.COLOR_WORN;
463 else if( fraction > 0.4 )
464 return Colors.COLOR_DAMAGED;
465 else if( fraction > 0.2 )
467 else
468 return Colors.COLOR_RUINED;
469 }
Definition Colors.c:4
const int COLOR_BADLY_DAMAGED
Definition Colors.c:21
const int COLOR_PRISTINE
Definition Colors.c:24
const int COLOR_WORN
Definition Colors.c:23
const int COLOR_DAMAGED
Definition Colors.c:22
const int COLOR_RUINED
Definition Colors.c:20

Перекрестные ссылки Colors::COLOR_BADLY_DAMAGED, Colors::COLOR_DAMAGED, Colors::COLOR_PRISTINE, Colors::COLOR_RUINED и Colors::COLOR_WORN.

◆ DeserializeDefaultHeaderOpenStates()

void DeserializeDefaultHeaderOpenStates ( )
inlineprotected
211 {
213
215 GetGame().GetProfileStringList( "defaultHeaderOpenStates", serialized_types );
216
217 for( int i = 0; i < serialized_types.Count(); i++ )
218 {
220 serialized_types.Get( i ).Split( ",", strs );
221 bool is_opened = strs.Get( 1 ).ToInt();
223 }
224 }
void SetDefaultHeaderOpenState(string type, bool is_opened)
Definition ItemManager.c:172
void ClearDefaultHeaderOpenStates()
Definition ItemManager.c:162
array< string > TStringArray
Definition EnScript.c:685

Перекрестные ссылки ClearDefaultHeaderOpenStates(), GetGame() и SetDefaultHeaderOpenState().

◆ DeserializeDefaultOpenStates()

void DeserializeDefaultOpenStates ( )
inlineprotected
244 {
246
248 GetGame().GetProfileStringList( "defaultOpenStates", serialized_types );
249
250 for( int i = 0; i < serialized_types.Count(); i++ )
251 {
253 serialized_types.Get( i ).Split( ",", strs );
254 bool is_opened = strs.Get( 1 ).ToInt();
256 }
257 }
void ClearDefaultOpenStates()
Definition ItemManager.c:157
void SetDefaultOpenState(string type, bool is_opened)
Definition ItemManager.c:167

Перекрестные ссылки ClearDefaultOpenStates(), GetGame() и SetDefaultOpenState().

◆ EvaluateContainerDragabilityDefault()

bool EvaluateContainerDragabilityDefault ( EntityAI entity)
inlineprotected
684 {
685 if ( !ItemBase.Cast( entity ) )
686 return false;
687
688 bool draggable;
690 draggable = !player.GetInventory().HasInventoryReservation( entity, null ) && !player.IsItemsToDelete();
691 draggable = draggable && entity.CanPutIntoHands( GetGame().GetPlayer() );
692 draggable = draggable && entity.GetInventory().CanRemoveEntity();
693
694 return draggable;
695 }
PlayerBase GetPlayer()
Definition ModifierBase.c:47
Definition InventoryItem.c:731
Definition PlayerBaseClient.c:2

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

◆ GetCenterDropzone()

Widget GetCenterDropzone ( )
inlineprotected
345 {
346 if( !m_CenterDropzone )
347 m_CenterDropzone = m_RootWidget.FindAnyWidget("HandsPanel").FindAnyWidget("DropzoneX");
348 return m_CenterDropzone;
349 }
Widget m_CenterDropzone
Definition ItemManager.c:31

Перекрестные ссылки m_CenterDropzone и m_RootWidget.

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

◆ GetChosenCombinationFlag()

static int GetChosenCombinationFlag ( EntityAI selectedEntity,
EntityAI targetEntity,
int relevantFlags,
out InventoryLocation dst = null )
inlinestaticprotected
724 {
726
729
732
733 //EntityAI itemInHands = m_player.GetHumanInventory().GetEntityInHands();
734 ActionManagerClient amc = ActionManagerClient.Cast(player.GetActionManager());
735
737 {
738 if (amc.CanPerformActionFromInventory(targetItem, selectedItem))
740 }
741
743 {
744 if (amc.CanSetActionFromInventory(targetItem, selectedItem))
746 }
747
749 {
750 if (targetEntity.CanBeCombined(selectedEntity))
751 {
753 }
754 }
755
757 {
758 if (targetEntity.GetInventory().CanAddAttachment(selectedEntity))
759 {
761 }
762 }
763
765 {
766 if (!targetEntity.GetInventory().HasEntityInInventory(selectedEntity) && targetEntity.GetInventory().CanAddEntityInCargo( selectedEntity, selectedEntity.GetInventory().GetFlipCargo() ))
767 {
769 }
770 }
771
773 {
775 Weapon_Base wpn = Weapon_Base.Cast(targetEntity.GetHierarchyParent());
776 if (wpn && mag)
777 {
778 if (player.GetWeaponManager().CanSwapMagazine(wpn, Magazine.Cast(selectedEntity)))
779 {
781 }
782 }
783 }
784
786 {
788 {
790 }
791 }
792
794 {
796 {
798 }
799 }
800
802 }
Definition ActionManagerClient.c:5
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
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:628
Definition InventoryCombinationFlags.c:2
static const int FSWAP
Definition InventoryCombinationFlags.c:7
static const int ADD_AS_CARGO
Definition InventoryCombinationFlags.c:5
static const int PERFORM_ACTION
Definition InventoryCombinationFlags.c:15
static const int SWAP
Definition InventoryCombinationFlags.c:6
static const int NONE
Definition InventoryCombinationFlags.c:3
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 const int SWAP_MAGAZINE
Definition InventoryCombinationFlags.c:10
shorthand
Definition BoltActionRifle_Base.c:6

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, GameInventory::CanForceSwapEntitiesEx(), GameInventory::CanSwapEntitiesEx(), InventoryCombinationFlags::COMBINE_QUANTITY2, InventoryCombinationFlags::FSWAP, GetGame(), GetPlayer(), InventoryCombinationFlags::NONE, InventoryCombinationFlags::PERFORM_ACTION, InventoryCombinationFlags::SET_ACTION, InventoryCombinationFlags::SWAP и InventoryCombinationFlags::SWAP_MAGAZINE.

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

◆ GetCombinationFlags()

static int GetCombinationFlags ( EntityAI entity1,
EntityAI entity2 )
inlinestaticprotected
805 {
806 int flags = 0;
808
809 if (!entity1 || !entity2)
810 return flags;
811
812 if (entity1.IsInherited( ItemBase ) && entity2.IsInherited( ItemBase ))
813 {
814 ItemBase ent1 = ItemBase.Cast( entity1 );
815 if (ent1.CanBeCombined( ItemBase.Cast( entity2 ) )) flags = flags | InventoryCombinationFlags.COMBINE_QUANTITY2;
816 }
817
818 if (entity1.GetInventory().CanAddAttachment( entity2 ))
819 {
820 if (!entity1.IsInherited( ZombieBase ) && !entity1.IsInherited( Car ) && !entity2.IsInherited( ZombieBase ) && !entity2.IsInherited( Car ))
821 {
823 }
824 }
825 if (!entity1.GetInventory().HasEntityInInventory(entity2) && entity1.GetInventory().CanAddEntityInCargo( entity2, entity2.GetInventory().GetFlipCargo() )) flags = flags | InventoryCombinationFlags.ADD_AS_CARGO;
826
827 if (entity1 == m_player.GetHumanInventory().GetEntityInHands() || entity2 == m_player.GetHumanInventory().GetEntityInHands())
828 {
830 Class.CastTo(amc, m_player.GetActionManager());
831 if (entity1 == m_player.GetHumanInventory().GetEntityInHands())
832 {
833 if (amc.CanPerformActionFromInventory( ItemBase.Cast(entity1), ItemBase.Cast(entity2) ))
834 {
836 }
837 else if (amc.CanSetActionFromInventory( ItemBase.Cast(entity1), ItemBase.Cast(entity2) ))
838 {
840 }
841 }
842 else
843 {
844 if (amc.CanPerformActionFromInventory( ItemBase.Cast(entity2), ItemBase.Cast(entity1) ))
845 {
847 }
848 else if (amc.CanSetActionFromInventory( ItemBase.Cast(entity2), ItemBase.Cast(entity1) ))
849 {
851 }
852 }
853 }
854 return flags;
855 }
DayZPlayer m_player
Definition RandomGeneratorSyncManager.c:15
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition ZombieFemaleBase.c:2
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(), m_player, InventoryCombinationFlags::PERFORM_ACTION и InventoryCombinationFlags::SET_ACTION.

Используется в Attachments::CanCombine(), LayoutHolder::CanCombineEx() и Icon::CombineItems().

◆ GetDefaultHeaderOpenState()

bool GetDefaultHeaderOpenState ( string type)
inlineprotected
272 {
273 if( m_DefautHeaderOpenStates.Contains( type ) )
274 {
275 return m_DefautHeaderOpenStates.Get( type );
276 }
277 else
278 {
279 return true;
280 }
281 }

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

◆ GetDefaultOpenState()

bool GetDefaultOpenState ( string type)
inlineprotected
260 {
261 if( m_DefautOpenStates.Contains( type ) )
262 {
263 return m_DefautOpenStates.Get( type );
264 }
265 else
266 {
267 return true;
268 }
269 }

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

◆ GetDefaultOpenStateHands()

bool GetDefaultOpenStateHands ( )
inlineprotected
186 {
187 string value;
188 GetGame().GetProfileString( "defaultOpenStateHands", value );
191 }
int m_HandsDefaultOpenState
Definition ItemManager.c:16

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

◆ GetDraggedIcon()

Icon GetDraggedIcon ( )
inlineprotected
372 {
373 return m_DraggedIcon;
374 }
Icon m_DraggedIcon
Definition ItemManager.c:8

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

◆ GetDraggedItem()

EntityAI GetDraggedItem ( )
inlineprotected
362 {
363 return m_DraggedItem;
364 }
EntityAI m_DraggedItem
Definition ItemManager.c:7

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

◆ GetHandsPreview()

HandsPreview GetHandsPreview ( )
inlineprotected
75 {
76 return m_HandsPreview;
77 }
HandsPreview m_HandsPreview
Definition ItemManager.c:26

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

◆ GetHoveredItem()

EntityAI GetHoveredItem ( )
inlineprotected
352 {
353 return m_HoveredItem;
354 }
EntityAI m_HoveredItem
Definition ItemManager.c:5

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

◆ GetInstance()

static ItemManager GetInstance ( )
inlinestaticprotected
284 {
285 return m_Instance;
286 }

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

Используется в LayoutHolder::CanAddToQuickbarEx(), LayoutHolder::CanCombineEx(), LayoutHolder::CanDropEx(), LayoutHolder::CanEquipEx(), LayoutHolder::CanOpenCloseContainer(), LayoutHolder::CanSplitEx(), LayoutHolder::CanSwapOrTakeToHandsEx(), LayoutHolder::CanTakeToInventoryEx(), SlotsIcon::ClearRemainSelected(), Container::Close(), ClosableContainer::Close(), VicinityContainer::CollapseButtonOnMouseButtonDown(), Attachments::Combine(), PlayerContainer::Combine(), VicinitySlotsContainer::Combine(), Icon::Combine(), Icon::CreateWhiteBackground(), Deserialize(), Icon::DestroyWhiteBackground(), DisableMicromanagement(), Icon::DraggingOver(), ClosableContainer::DraggingOver(), PlayerContainer::DraggingOver(), DraggingOverCenterPanel(), ClosableContainer::DraggingOverGrid(), HandsContainer::DraggingOverGrid(), ClosableContainer::DraggingOverGrid(), HandsArea::DraggingOverHandsPanel(), DraggingOverHandsPanel(), HandsContainer::DraggingOverHeader(), AttachmentCategoriesContainer::DraggingOverHeader(), AttachmentCategoriesRow::DraggingOverHeader(), ClosableContainer::DraggingOverHeader(), PlayerContainer::DraggingOverHeader(), VicinityContainer::DraggingOverHeader(), VicinityContainer::DraggingOverIcon(), Icon::DraggingOverSwap(), ClosableContainer::DropReceived(), HandsContainer::DropReceived(), ClosableContainer::DropReceived(), Icon::DropReceivedFromMain(), EnableMicromanagement(), ColorManager::GetItemColor(), HandsContainer::HandsContainer(), ScriptedWidgetEventHandler::HideOwnedSlotsTooltip(), ScriptedWidgetEventHandler::HideOwnedTooltip(), Icon::Icon(), SlotsIcon::Init(), Icon::InitLock(), CollapsibleContainer::LoadDefaultState(), VicinitySlotsContainer::MouseButtonDown(), Icon::MouseClick(), AttachmentCategoriesRow::MouseClick(), PlayerContainer::MouseClick(), ZombieContainer::MouseClick(), HandsContainer::MouseClick2(), ClosableContainer::MouseClick2(), MoveFocusByArea(), Icon::OnDraggingOverBackground(), ClosableHeader::OnDragHeader(), ClosableHeader::OnDropHeader(), PlayerContainer::OnDropReceivedFromGhostArea(), AttachmentCategoriesRow::OnDropReceivedFromHeader(), VicinityContainer::OnDropReceivedFromHeader(), VicinityContainer::OnDropReceivedFromIcon(), OnHide(), SlotsIcon::OnIconDrag(), SlotsIcon::OnIconDrop(), InventoryGridController::OnItemDrop(), InventoryGridController::OnItemDropReceived(), HandsContainer::OnSelectButton(), OnShow(), MissionBase::OnUpdate(), Container::Open(), ClosableContainer::Open(), ScriptedWidgetEventHandler::PrepareOwnedSlotsTooltip(), ScriptedWidgetEventHandler::PrepareOwnedTooltip(), AttachmentCategoriesRow::RefreshSlot(), Attachments::Select(), Container::Select(), HandsPreview::Select(), AttachmentCategoriesRow::Select(), PlayerContainer::Select(), VicinitySlotsContainer::Select(), ZombieContainer::Select(), Attachments::SelectItem(), Container::SelectItem(), HandsPreview::SelectItem(), SlotsContainer::SelectItem(), Serialize(), Container::SetOpenState(), Icon::SetTemperature(), SlotsIcon::SetTemperature(), Icon::ShowActionMenuCombine(), VicinitySlotsContainer::ShowItemsInContainers(), Icon::Swap(), HandsContainer::TakeAsAttachment(), ClosableContainer::TakeAsAttachment(), PlayerContainer::ToggleWidget(), UpdateConsoleToolbar(), Icon::UpdateFrameColor(), VicinityContainer::UpdateHeader(), Attachments::UpdateInterval(), HandsPreview::UpdateInterval(), ClosableContainer::UpdateInterval(), UpdateInterval(), IconsContainer::UpdateItemsTemperature(), Icon::~Icon() и SlotsIcon::~SlotsIcon().

◆ GetItemHealthColor() [1/2]

static int GetItemHealthColor ( EntityAI item,
string zone = "" )
inlinestaticprotected
432 {
433 if (item)
434 {
435 switch (item.GetHealthLevel(zone))
436 {
437 case -1:
438 break;
440 return Colors.COLOR_PRISTINE;
442 return Colors.COLOR_WORN;
444 return Colors.COLOR_DAMAGED;
448 return Colors.COLOR_RUINED;
449 }
450 }
451
452 return 0x00FFFFFF;
453 }
Definition constants.c:615
const int STATE_RUINED
Definition constants.c:760
const int STATE_BADLY_DAMAGED
Definition constants.c:761
const int STATE_DAMAGED
Definition constants.c:762
const int STATE_PRISTINE
Definition constants.c:764
const int STATE_WORN
Definition constants.c:763

Перекрестные ссылки Colors::COLOR_BADLY_DAMAGED, Colors::COLOR_DAMAGED, Colors::COLOR_PRISTINE, Colors::COLOR_RUINED, Colors::COLOR_WORN, GameConstants::STATE_BADLY_DAMAGED, GameConstants::STATE_DAMAGED, GameConstants::STATE_PRISTINE, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.

◆ GetItemHealthColor() [2/2]

◆ GetLeftDropzone()

Widget GetLeftDropzone ( )
inlineprotected
330 {
331 if (!m_LeftDropzone)
332 m_LeftDropzone = m_RootWidget.FindAnyWidget("LeftPanel").FindAnyWidget("DropzoneX");
333
334 return m_LeftDropzone;
335 }
Widget m_LeftDropzone
Definition ItemManager.c:30

Перекрестные ссылки m_LeftDropzone и m_RootWidget.

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

◆ GetRecipeCount()

static int GetRecipeCount ( bool recipe_anywhere,
EntityAI entity1,
EntityAI entity2 )
inlinestaticprotected
858 {
859 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(GetPlugin( PluginRecipesManager ));
860 return plugin_recipes_manager.GetValidRecipes( ItemBase.Cast( entity1 ), ItemBase.Cast( entity2 ), NULL, PlayerBase.Cast( GetGame().GetPlayer() ) );
861 }
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316

Перекрестные ссылки GetGame(), GetPlayer() и GetPlugin().

◆ GetRightDropzone()

Widget GetRightDropzone ( )
inlineprotected
338 {
339 if( !m_RightDropzone )
340 m_RightDropzone = m_RootWidget.FindAnyWidget("RightPanel").FindAnyWidget("DropzoneX");
341 return m_RightDropzone;
342 }
Widget m_RightDropzone
Definition ItemManager.c:32

Перекрестные ссылки m_RightDropzone и m_RootWidget.

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

◆ GetSelectedContainer()

Container GetSelectedContainer ( )
inlineprotected
90 {
91 return m_SelectedContainer;
92 }
Container m_SelectedContainer
Definition ItemManager.c:21

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

◆ GetSelectedIcon()

SlotsIcon GetSelectedIcon ( )
inlineprotected
100 {
101 return m_SelectedIcon;
102 }
SlotsIcon m_SelectedIcon
Definition ItemManager.c:23

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

◆ GetSelectedItem()

EntityAI GetSelectedItem ( )
inlineprotected
85 {
86 return m_SelectedItem;
87 }
EntityAI m_SelectedItem
Definition ItemManager.c:20

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

◆ GetSelectedWidget()

Widget GetSelectedWidget ( )
inlineprotected
95 {
96 return m_SelectedWidget;
97 }
Widget m_SelectedWidget
Definition ItemManager.c:22

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

◆ HideDropzones()

void HideDropzones ( )
inlineprotected
289 {
290 GetRightDropzone().SetAlpha( 0 );
291 GetLeftDropzone().SetAlpha( 0 );
292 GetCenterDropzone().SetAlpha( 0 );
293 }
Widget GetCenterDropzone()
Definition ItemManager.c:344
Widget GetLeftDropzone()
Definition ItemManager.c:329
Widget GetRightDropzone()
Definition ItemManager.c:337

Перекрестные ссылки GetCenterDropzone(), GetLeftDropzone() и GetRightDropzone().

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

◆ HideTooltip()

void HideTooltip ( )
inlineprotected
392 {
393 m_TooltipWidget.Show( false );
395 delete m_ToolTipTimer;
396
398 }
void HideTooltipSlot()
Definition ItemManager.c:400
ref Timer m_ToolTipTimer
Definition ItemManager.c:17

Перекрестные ссылки HideTooltipSlot(), m_HoveredItem, m_ToolTipTimer и m_TooltipWidget.

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

◆ HideTooltipSlot()

void HideTooltipSlot ( )
inlineprotected
401 {
402 if ( m_SlotInfoShown )
403 {
404 m_TooltipSlotWidget.Show( false );
405 m_SlotInfoShown = false;
406 delete m_TooltipSlotTimer;
407 }
408 }
ref Timer m_TooltipSlotTimer
Definition ItemManager.c:18

Перекрестные ссылки m_SlotInfoShown, m_TooltipSlotTimer и m_TooltipSlotWidget.

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

◆ IsDragging()

bool IsDragging ( )
inlineprotected
387 {
388 return m_IsDragging;
389 }
bool m_IsDragging
Definition ItemManager.c:4

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

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

◆ IsMicromanagmentMode()

bool IsMicromanagmentMode ( )
inlineprotected
70 {
72 }
bool m_ItemMicromanagmentMode
Definition ItemManager.c:28

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

◆ PrepareSlotsTooltip()

void PrepareSlotsTooltip ( string name,
string desc,
int x = 0,
int y = 0 )
inlineprotected

position is currentlycalculated from the owning 'm_TooltipSourceWidget' directly

590 {
591 InspectMenuNew.UpdateSlotInfo( m_TooltipSlotWidget, name, desc );
592
593 HideTooltip();
594
595 if (name != "")
596 {
597 m_SlotInfoShown = true;
598 //CalculateTooltipSlotPosition(x,y);
600 m_TooltipSlotTimer.Run( TOOLTIP_DELAY, this, "ShowTooltipSlot" );
601 }
602 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
const float TOOLTIP_DELAY
Definition ItemManager.c:39
void HideTooltip()
Definition ItemManager.c:391
Definition DayZPlayerImplement.c:63

Перекрестные ссылки HideTooltip(), m_SlotInfoShown, m_TooltipSlotTimer, m_TooltipSlotWidget, name и TOOLTIP_DELAY.

◆ PrepareTooltip()

void PrepareTooltip ( EntityAI item,
int x = 0,
int y = 0 )
inlineprotected
527 {
528 if( IsDragging() || !item )
529 {
530 return;
531 }
532
533 if ( item.IsInherited( InventoryItem ) )
534 {
535 HideTooltip();
536
538 InspectMenuNew.UpdateItemInfo( m_TooltipWidget, item );
539
540 int screen_w, screen_h;
541 float w, h;
543 m_TooltipWidget.GetScreenSize(w,h);
544
545 if (x == -1)//set by icon focusing
546 {
547 x = screen_w/2 - w/2;
548 float x1,y1;
549 m_RootWidget.FindAnyWidget("InventoryFrameWidget").GetScreenPos(x1,y1); //allign to the same height
550 y = y1;
551 }
552 else if (x == 0 && y == 0 && GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer())
553 {
554 GetMousePos(x,y);
555 }
556
557 //minimal edge distance adjustments..
558 screen_w -= 10;
559 screen_h -= 10;
560
561 int rightEdge = x + w;
562 if (rightEdge > screen_w)
563 {
564 x = screen_w - w;
565 }
566
567 int bottomEdge = y + h;
568 if (bottomEdge > screen_h)
569 {
570 y = screen_h - h;
571 }
572
573 m_TooltipWidget.SetPos(x, y);
574
575 m_ToolTipTimer = new Timer();
576 m_ToolTipTimer.Run( TOOLTIP_DELAY, this, "ShowTooltip" );
577
578 Widget preview_frame = m_TooltipWidget.FindAnyWidget("ItemFrameWidget");
579 if (preview_frame)
580 {
583 m_ItemPreviewWidget.SetView( item.GetViewIndex() );
584 }
585 }
586 }
ActionInput GetInput()
Definition ActionBase.c:1066
Definition ItemBase.c:14
ItemPreviewWidget m_ItemPreviewWidget
Definition ItemManager.c:12
bool IsDragging()
Definition ItemManager.c:386
Definition gameplay.c:276
proto native void SetView(int viewIndex)
proto native void SetItem(EntityAI object)
proto void GetMousePos(out int x, out int y)

Перекрестные ссылки GetGame(), GetInput(), GetMousePos(), GetScreenSize(), HideTooltip(), IsDragging(), m_HoveredItem, m_ItemPreviewWidget, m_RootWidget, m_ToolTipTimer, m_TooltipWidget, ItemPreviewWidget::SetItem(), ItemPreviewWidget::SetView(), TOOLTIP_DELAY, x и y.

◆ SerializeDefaultHeaderOpenStates()

void SerializeDefaultHeaderOpenStates ( )
inlineprotected
194 {
196
197 for ( int i = 0; i < m_DefautHeaderOpenStates.Count(); i++ )
198 {
199 int is_opened = m_DefautHeaderOpenStates.GetElement( i ); //from bool to int for easier parsing
200 serialized_types.Insert( m_DefautHeaderOpenStates.GetKey( i ) + "," + is_opened );
201 }
202
203 if( serialized_types.Count() > 0 )
204 {
205 GetGame().SetProfileStringList( "defaultHeaderOpenStates", serialized_types );
206 }
207 GetGame().SaveProfile();
208 }

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

◆ SerializeDefaultOpenStates()

void SerializeDefaultOpenStates ( )
inlineprotected
227 {
229
230 for ( int i = 0; i < m_DefautOpenStates.Count(); i++ )
231 {
232 int is_opened = m_DefautOpenStates.GetElement( i ); //from bool to int for easier parsing
233 serialized_types.Insert( m_DefautOpenStates.GetKey( i ) + "," + is_opened );
234 }
235
236 if( serialized_types.Count() > 0 )
237 {
238 GetGame().SetProfileStringList( "defaultOpenStates", serialized_types );
239 }
240 GetGame().SaveProfile();
241 }

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

◆ SetDefaultHeaderOpenState()

void SetDefaultHeaderOpenState ( string type,
bool is_opened )
inlineprotected
173 {
175 }

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

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

◆ SetDefaultOpenState()

void SetDefaultOpenState ( string type,
bool is_opened )
inlineprotected
168 {
169 m_DefautOpenStates.Set( type, is_opened );
170 }

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

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

◆ SetDefaultOpenStateHands()

void SetDefaultOpenStateHands ( bool is_opened)
inlineprotected
178 {
180 int hands_default_open_state = m_HandsDefaultOpenState; //from bool to int for easier parsing
181 GetGame().SetProfileString( "defaultOpenStateHands", hands_default_open_state.ToString() );
182 GetGame().SaveProfile();
183 }

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

◆ SetDraggedIcon()

void SetDraggedIcon ( Icon dragged_icon)
inlineprotected
367 {
369 }

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

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

◆ SetDraggedItem()

void SetDraggedItem ( EntityAI dragged_item)
inlineprotected
357 {
359 }

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

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

◆ SetHandsPreview()

void SetHandsPreview ( HandsPreview hansd_preview)
inlineprotected
80 {
82 }

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

◆ SetIconTemperature()

void SetIconTemperature ( EntityAI item,
Widget item_w )
inlineprotected
503 {
504 if ( item_w )
505 {
506 if ( item && item.IsInherited( ItemBase ) )
507 {
508 int color = ColorManager.GetInstance().GetItemColor( ItemBase.Cast( item ) );
509
510 if ( color )
511 {
512 Widget color_widget = item_w.FindAnyWidget( "Color" );
513 if( color != -1 )
514 {
515 color_widget.SetColor( color );
516 }
517 else
518 {
520 }
521 }
522 }
523 }
524 }
Definition ColorManager.c:2
static ColorManager GetInstance()
Definition ColorManager.c:27
static int BASE_COLOR
Definition ColorManager.c:15

Перекрестные ссылки ColorManager::BASE_COLOR и ColorManager::GetInstance().

◆ SetIsDragging()

void SetIsDragging ( bool is_dragging)
inlineprotected
377 {
379 if( !is_dragging )
380 {
383 }
384 }
void SetDraggedIcon(Icon dragged_icon)
Definition ItemManager.c:366
void SetDraggedItem(EntityAI dragged_item)
Definition ItemManager.c:356

Перекрестные ссылки m_IsDragging, SetDraggedIcon() и SetDraggedItem().

◆ SetItemMicromanagmentMode()

void SetItemMicromanagmentMode ( bool item_micromanagment_mode)
inlineprotected
64 {
66 Inventory.GetInstance().UpdateConsoleToolbar();
67 }
void Inventory(LayoutHolder parent)
Definition Inventory.c:76

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

◆ SetSelectedItem()

void SetSelectedItem ( EntityAI selected_item,
Container selected_container,
Widget selected_widget,
SlotsIcon selected_icon )
inlineprotected

◆ SetSelectedItemEx()

void SetSelectedItemEx ( EntityAI selected_item,
Container selected_container,
LayoutHolder selected_icon )
inlineprotected
113 {
115 Icon icon;
116
119
121 {
124 if (sIcon)
125 {
126 sIcon.GetMicromanagedPanel().Show(false);
127 }
128 else if (icon)
129 {
130 icon.GetMicromanagedPanel().Show(false);
131 }
132 }
133
134 if (selected_icon)
135 {
137 icon = Icon.Cast(selected_icon);
138
139 if (sIcon)
140 {
141 m_SelectedWidget = sIcon.GetCursorWidget();
142 sIcon.GetMicromanagedPanel().Show(true);
143 }
144 else if (icon)
145 {
146 m_SelectedWidget = icon.GetCursorWidget();
147 icon.GetMicromanagedPanel().Show(true);
148 }
149 }
150 else
151 {
153 }
155 }
Definition Icon.c:2
LayoutHolder m_SelectedBaseIcon
Definition ItemManager.c:24

Перекрестные ссылки m_SelectedBaseIcon, m_SelectedContainer, m_SelectedItem и m_SelectedWidget.

◆ SetTemperature()

void SetTemperature ( EntityAI item,
Widget item_w )
inlineprotected
472 {
473 if ( item_w )
474 {
475 if ( true/*show_temperature */ )
476 {
477 if ( item && item.IsInherited( ItemBase ) )
478 {
479 int color = ColorManager.GetInstance().GetItemColor( ItemBase.Cast( item ) ); // !!!!!
480 if ( color )
481 {
482 string name = item_w.GetName();
483 name.Replace("Render", "Temperature");
484 Widget temperature_widget = item_w.GetParent().FindAnyWidget( name );
485 if ( color != -1 )
486 {
487 temperature_widget.Show( true );
488 temperature_widget.SetColor( color );
489 }
490 else
491 {
492 temperature_widget.Show( false );
493 }
494
495 temperature_widget.SetAlpha( 0.3 );
496 }
497 }
498 }
499 }
500 }

Перекрестные ссылки ColorManager::GetInstance() и name.

◆ SetTooltipWidget()

void SetTooltipWidget ( Widget w)
inlineprotected
679 {
681 }

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

◆ SetWidgetDraggable()

void SetWidgetDraggable ( Widget w,
bool draggable )
inlineprotected
698 {
699 if (w)
700 {
701 if ( draggable )
702 w.SetFlags( WidgetFlags.DRAGGABLE );
703 else
704 w.ClearFlags( WidgetFlags.DRAGGABLE );
705 }
706 }
WidgetFlags
Definition EnWidgets.c:58

◆ ShowSourceDropzone()

void ShowSourceDropzone ( EntityAI item)
inlineprotected
296 {
297 EntityAI owner = item.GetHierarchyParent();
299
300 if (item == player)
301 {
302 GetRightDropzone().SetAlpha(1);
303 }
304 else if (owner && owner != player)
305 {
307 }
308 else
309 {
311 item.GetInventory().GetCurrentInventoryLocation(inv_loc_src);
312 int loc_type = inv_loc_src.GetType();
314 if (loc_type == InventoryLocationType.GROUND)
315 {
316 GetLeftDropzone().SetAlpha(1);
317 }
318 else if (loc_type == InventoryLocationType.HANDS)
319 {
320 GetCenterDropzone().SetAlpha(1);
321 }
322 else
323 {
324 GetRightDropzone().SetAlpha(1);
325 }
326 }
327 }
InventoryLocationType
types of Inventory Location
Definition InventoryLocation.c:4
Definition Building.c:6
InventoryLocation.
Definition InventoryLocation.c:28
void ShowSourceDropzone(EntityAI item)
Definition ItemManager.c:295
void HideDropzones()
Definition ItemManager.c:288

Перекрестные ссылки GetCenterDropzone(), GetGame(), GetLeftDropzone(), GetPlayer(), GetRightDropzone(), HideDropzones() и ShowSourceDropzone().

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

◆ ShowTooltip()

void ShowTooltip ( )
inlineprotected
709 {
711 {
712 m_TooltipWidget.Show( true );
713 }
714 }

Перекрестные ссылки m_ItemPreviewWidget и m_TooltipWidget.

◆ ShowTooltipSlot()

void ShowTooltipSlot ( )
inlineprotected
717 {
720 m_TooltipSlotWidget.Show( true );
721 }
void UpdateTooltipSlotPosition()
Definition ItemManager.c:671

Перекрестные ссылки m_TooltipPosX, m_TooltipPosY, m_TooltipSlotWidget и UpdateTooltipSlotPosition().

◆ UpdateTooltipSlotPosition()

void UpdateTooltipSlotPosition ( )
inlineprotected
672 {
673 float x, y;
674 m_TooltipSourceWidget.GetScreenPos(x,y);
676 }
void CalculateTooltipSlotPosition(int x=0, int y=0)
Definition ItemManager.c:604

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

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

Поля

◆ m_CenterDropzone

Widget m_CenterDropzone
protected

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

◆ m_DefautHeaderOpenStates

◆ m_DefautOpenStates

◆ m_DraggedIcon

Icon m_DraggedIcon
protected

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

◆ m_DraggedItem

EntityAI m_DraggedItem
protected

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

◆ m_HandsDefaultOpenState

int m_HandsDefaultOpenState
protected

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

◆ m_HandsPreview

HandsPreview m_HandsPreview
protected

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

◆ m_HoveredItem

EntityAI m_HoveredItem
protected

Используется в GetHoveredItem(), HideTooltip() и PrepareTooltip().

◆ m_Instance

ref ItemManager m_Instance
staticprivate

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

◆ m_IsDragging

bool m_IsDragging
protected

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

◆ m_ItemMicromanagmentMode

bool m_ItemMicromanagmentMode
protected

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

◆ m_ItemPreviewWidget

ItemPreviewWidget m_ItemPreviewWidget
protected

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

◆ m_LeftDropzone

Widget m_LeftDropzone
protected

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

◆ m_RightDropzone

Widget m_RightDropzone
protected

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

◆ m_RootWidget

Widget m_RootWidget
protected

◆ m_SelectedBaseIcon

LayoutHolder m_SelectedBaseIcon
protected

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

◆ m_SelectedContainer

Container m_SelectedContainer
protected

◆ m_SelectedIcon

SlotsIcon m_SelectedIcon
protected

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

◆ m_SelectedItem

EntityAI m_SelectedItem
protected

Используется в GetSelectedItem(), SetSelectedItem() и SetSelectedItemEx().

◆ m_SelectedWidget

Widget m_SelectedWidget
protected

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

◆ m_SlotInfoShown

bool m_SlotInfoShown
protected

Используется в HideTooltipSlot(), ItemManager() и PrepareSlotsTooltip().

◆ m_TooltipCategoryWidget

ref Widget m_TooltipCategoryWidget
protected

◆ m_TooltipPosX

int m_TooltipPosX
protected

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

◆ m_TooltipPosY

int m_TooltipPosY
protected

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

◆ m_TooltipSlotTimer

ref Timer m_TooltipSlotTimer
protected

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

◆ m_TooltipSlotWidget

ref Widget m_TooltipSlotWidget
protected

◆ m_TooltipSourceWidget

Widget m_TooltipSourceWidget
protected

◆ m_ToolTipTimer

ref Timer m_ToolTipTimer
protected

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

◆ m_TooltipWidget

ref Widget m_TooltipWidget
protected

Используется в HideTooltip(), ItemManager(), PrepareTooltip() и ShowTooltip().

◆ TOOLTIP_DELAY

const float TOOLTIP_DELAY = 0.25
protected

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


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