DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ UpdateMousePos()

void ScriptConsoleSoundsTab::UpdateMousePos ( )
inlineprotected

См. определение в файле ScriptConsoleSoundsTab.c строка 122

123 {
124 if(!GetGame().GetPlayer())
125 return;
126 int x,y;
127 GetMousePos(x,y);
128 vector mousePos, worldPos;
129 mousePos[0] = x;
130 mousePos[1] = y;
131 worldPos = m_DebugMapWidget.ScreenToMap(mousePos);
132 vector playerPos = GetGame().GetPlayer().GetWorldPosition();
133 if (GetMapPos() != playerPos)
134 worldPos = GetMapPos();
135 worldPos[1] = GetGame().SurfaceY(worldPos[0], worldPos[2]);
136
137 if (m_MouseCurPos)
138 {
139 m_MouseCurPos.SetText("Mouse: "+ MiscGameplayFunctions.TruncateToS(worldPos[0]) +", "+ MiscGameplayFunctions.TruncateToS(worldPos[1]) +", "+ MiscGameplayFunctions.TruncateToS(worldPos[2]));
140 }
142 {
143 float dst = (worldPos - playerPos).Length();
144
145 m_MapDistWidget.SetText("Distance: " + MiscGameplayFunctions.TruncateToS(dst));
146 }
148 {
149 vector playerCamDir = GetGame().GetCurrentCameraDirection();
150 float heading = Math3D.AngleFromPosition(playerPos, playerCamDir, worldPos) * Math.RAD2DEG;
151 m_MapHeadingWidget.SetText("Heading:" +heading.ToString());
152 }
153 }
Icon x
Icon y
PlayerBase GetPlayer()
Определения ModifierBase.c:51
proto native float SurfaceY(float x, float z)
proto native DayZPlayer GetPlayer()
proto native vector GetCurrentCameraDirection()
TextWidget m_MapHeadingWidget
Определения ScriptConsoleSoundsTab.c:30
TextWidget m_MouseCurPos
Определения ScriptConsoleSoundsTab.c:29
MapWidget m_DebugMapWidget
Определения ScriptConsoleSoundsTab.c:27
vector GetMapPos()
Определения ScriptConsoleSoundsTab.c:294
TextWidget m_MapDistWidget
Определения ScriptConsoleSoundsTab.c:28
proto string ToString(bool simple=true)
proto native CGame GetGame()
proto void GetMousePos(out int x, out int y)

Перекрестные ссылки Math3D::AngleFromPosition(), CGame::GetCurrentCameraDirection(), GetGame(), GetMapPos(), GetMousePos(), CGame::GetPlayer(), GetPlayer(), m_DebugMapWidget, m_MapDistWidget, m_MapHeadingWidget, m_MouseCurPos, Math::RAD2DEG, CGame::SurfaceY(), float::ToString(), x и y.

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