5 protected int m_CharacterRotationX;
6 protected int m_CharacterRotationY;
7 protected int m_CharacterScaleDelta;
8 protected vector m_CharacterOrientation;
9 protected bool m_IsHolding;
15 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown(
m_Parent.GetMainWidget().FindAnyWidget(
"CharacterPanel" ),
this,
"MouseButtonDown" );
16 WidgetEventHandler.GetInstance().RegisterOnMouseWheel(
m_Parent.GetMainWidget().FindAnyWidget(
"CharacterPanel" ),
this,
"MouseWheel" );
18 m_CharacterScaleDelta = 1;
20 m_CharacterPanelWidget.SetModelPosition(
"0 0 0.605" );
21 m_CharacterPanelWidget.SetSize( 1.34, 1.34 );
25 void RefreshPlayerPreview()
27 m_CharacterPanelWidget.Refresh();
30 void UpdateRotation(
int mouse_x,
int mouse_y,
bool is_dragging )
32 if ( m_CharacterPanelWidget )
34 vector orientation = m_CharacterOrientation;
35 orientation[1] = orientation[1] - ( m_CharacterRotationX - mouse_x );
37 m_CharacterPanelWidget.SetModelOrientation( orientation );
41 m_CharacterOrientation = orientation;
48 if ( m_CharacterPanelWidget )
51 m_CharacterPanelWidget.GetSize( w, h );
52 w = w + ( m_CharacterScaleDelta / 25 );
53 h = h + ( m_CharacterScaleDelta / 25 );
54 if ( w > 0.62 && w < 3 )
56 m_CharacterPanelWidget.SetSize( w, h );
60 m_CharacterPanelWidget.SetSize( 0.62, 0.62 );
64 m_CharacterPanelWidget.SetSize( 3, 3 );
69 bool MouseButtonDown(
Widget w,
int x,
int y,
int button)
71 GetMousePos( m_CharacterRotationX, m_CharacterRotationY );
76 bool MouseWheel(
Widget w,
int x,
int y,
int wheel)
78 m_CharacterScaleDelta = wheel;
83 override void UpdateInterval()
86 m_CharacterPanelWidget.UpdateItemInHands(
GetGame().
GetPlayer().GetHumanInventory().GetEntityInHands());
89 DayZPlayer dummyPlayer = m_CharacterPanelWidget.GetDummyPlayer();
90 if ( realPlayer && dummyPlayer )
95 if ( hca && realPlayer.m_InjuryHandler )
96 hca.SetInjured(realPlayer.m_InjuryHandler.GetInjuryAnimValue(), realPlayer.m_InjuryHandler.IsInjuryAnimEnabled());
108 UpdateRotation( mouse_x, mouse_y,
true );
112 UpdateRotation( mouse_x, mouse_y,
false );