DayZ 1.24
Loading...
Searching...
No Matches
PlayerPreview Class Reference
Inheritance diagram for PlayerPreview:
[legend]
Collaboration diagram for PlayerPreview:
[legend]

Protected Member Functions

void PlayerPreview (LayoutHolder parent)
 
void RefreshPlayerPreview ()
 
void UpdateRotation (int mouse_x, int mouse_y, bool is_dragging)
 
void UpdateScale ()
 
bool MouseButtonDown (Widget w, int x, int y, int button)
 
bool MouseWheel (Widget w, int x, int y, int wheel)
 
override void UpdateInterval ()
 

Protected Attributes

ref PlayerPreviewWidget m_CharacterPanelWidget
 
int m_CharacterRotationX
 
int m_CharacterRotationY
 
int m_CharacterScaleDelta
 
vector m_CharacterOrientation
 
bool m_IsHolding
 

Additional Inherited Members

- Private Member Functions inherited from 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 ()
 
- Private Attributes inherited from 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
 

Detailed Description

Definition at line 1 of file PlayerPreview.c.

Constructor & Destructor Documentation

◆ PlayerPreview()

void PlayerPreview::PlayerPreview ( LayoutHolder parent)
inlineprotected

Definition at line 11 of file PlayerPreview.c.

12 {
13 m_CharacterPanelWidget = PlayerPreviewWidget.Cast(m_Parent.GetMainWidget().FindAnyWidget("CharacterPanelWidget"));
14
15 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown(m_Parent.GetMainWidget().FindAnyWidget("CharacterPanel"), this, "MouseButtonDown");
16 WidgetEventHandler.GetInstance().RegisterOnMouseWheel(m_Parent.GetMainWidget().FindAnyWidget("CharacterPanel"), this, "MouseWheel");
17
20 m_CharacterPanelWidget.SetModelPosition("0 0 0.605");
21 m_CharacterPanelWidget.SetSize(1.34, 1.34); // default scale
23 }
PlayerBase GetPlayer()
Widget m_Parent
Definition SizeToChild.c:86
ref PlayerPreviewWidget m_CharacterPanelWidget
int m_CharacterScaleDelta
static WidgetEventHandler GetInstance()
proto native CGame GetGame()

References GetGame(), WidgetEventHandler::GetInstance(), GetPlayer(), m_CharacterPanelWidget, m_CharacterScaleDelta, m_Parent, and UpdateScale().

Member Function Documentation

◆ MouseButtonDown()

bool PlayerPreview::MouseButtonDown ( Widget w,
int x,
int y,
int button )
inlineprotected

Definition at line 61 of file PlayerPreview.c.

62 {
64 m_IsHolding = true;
65 return true;
66 }
int m_CharacterRotationY
int m_CharacterRotationX
proto void GetMousePos(out int x, out int y)

References GetMousePos(), m_CharacterRotationX, m_CharacterRotationY, and m_IsHolding.

◆ MouseWheel()

bool PlayerPreview::MouseWheel ( Widget w,
int x,
int y,
int wheel )
inlineprotected

Definition at line 68 of file PlayerPreview.c.

69 {
72 return true;
73 }

References m_CharacterScaleDelta, and UpdateScale().

◆ RefreshPlayerPreview()

void PlayerPreview::RefreshPlayerPreview ( )
inlineprotected

Definition at line 25 of file PlayerPreview.c.

26 {
27 m_CharacterPanelWidget.Refresh();
28 }

References m_CharacterPanelWidget.

◆ UpdateInterval()

override void PlayerPreview::UpdateInterval ( )
inlineprotected

Definition at line 75 of file PlayerPreview.c.

76 {
77 // item in hands update
78 m_CharacterPanelWidget.UpdateItemInHands(GetGame().GetPlayer().GetHumanInventory().GetEntityInHands());
79
83 {
84 // injury animation update
85 HumanCommandAdditives hca = dummyPlayer.GetCommandModifier_Additives();
86 //dummyPlayer.UpdateDummyPlayerProxyVisibility(realPlayer.FindAttachmentBySlotName("Shoulder"), realPlayer.FindAttachmentBySlotName("Melee"));
87 if (hca && realPlayer.m_InjuryHandler)
88 hca.SetInjured(realPlayer.m_InjuryHandler.GetInjuryAnimValue(), realPlayer.m_InjuryHandler.IsInjuryAnimEnabled());
89 }
90
91 if (m_IsHolding)
92 {
93 int mouse_x;
94 int mouse_y;
95
97
98 if (GetMouseState(MouseState.LEFT) & 0x80000000)
100 else
101 {
103 m_IsHolding = false;
104 }
105 }
106 }
void UpdateRotation(int mouse_x, int mouse_y, bool is_dragging)
MouseState
Definition EnSystem.c:311
proto native int GetMouseState(MouseState index)
class HumanCommandWeapons HumanCommandAdditives()
Definition human.c:1086

References GetGame(), GetMousePos(), GetMouseState(), GetPlayer(), HumanCommandAdditives(), m_CharacterPanelWidget, m_IsHolding, and UpdateRotation().

◆ UpdateRotation()

void PlayerPreview::UpdateRotation ( int mouse_x,
int mouse_y,
bool is_dragging )
inlineprotected

◆ UpdateScale()

void PlayerPreview::UpdateScale ( )
inlineprotected

Definition at line 44 of file PlayerPreview.c.

45 {
47 {
48 float w, h;
49 m_CharacterPanelWidget.GetSize(w, h);
50 w = w + (m_CharacterScaleDelta / 25);
51 h = h + (m_CharacterScaleDelta / 25);
52 if (w > 0.62 && w < 3)
53 m_CharacterPanelWidget.SetSize(w, h);
54 else if (w < 0.62)
55 m_CharacterPanelWidget.SetSize(0.62, 0.62);
56 else if (w > 3)
57 m_CharacterPanelWidget.SetSize(3, 3);
58 }
59 }

References m_CharacterPanelWidget, and m_CharacterScaleDelta.

Referenced by MouseWheel(), and PlayerPreview().

Member Data Documentation

◆ m_CharacterOrientation

vector PlayerPreview::m_CharacterOrientation
protected

Definition at line 8 of file PlayerPreview.c.

Referenced by UpdateRotation().

◆ m_CharacterPanelWidget

ref PlayerPreviewWidget PlayerPreview::m_CharacterPanelWidget
protected

◆ m_CharacterRotationX

int PlayerPreview::m_CharacterRotationX
protected

Definition at line 5 of file PlayerPreview.c.

Referenced by MouseButtonDown(), and UpdateRotation().

◆ m_CharacterRotationY

int PlayerPreview::m_CharacterRotationY
protected

Definition at line 6 of file PlayerPreview.c.

Referenced by MouseButtonDown().

◆ m_CharacterScaleDelta

int PlayerPreview::m_CharacterScaleDelta
protected

Definition at line 7 of file PlayerPreview.c.

Referenced by MouseWheel(), PlayerPreview(), and UpdateScale().

◆ m_IsHolding

bool PlayerPreview::m_IsHolding
protected

Definition at line 9 of file PlayerPreview.c.

Referenced by MouseButtonDown(), and UpdateInterval().


The documentation for this class was generated from the following file: