map window works when there is no local ped

This commit is contained in:
in0finite 2019-07-11 19:09:20 +02:00
parent b7a09ee1eb
commit c58421be3c
3 changed files with 13 additions and 11 deletions

View file

@ -347,8 +347,6 @@ namespace SanAndreasUnity.UI {
if (null == MiniMap.Instance)
return;
if (null == Ped.Instance)
return;
int uiSize = (int) this.windowRect.width;
@ -547,10 +545,13 @@ namespace SanAndreasUnity.UI {
// second row - info
GUILayout.BeginHorizontal (GUILayout.MaxWidth (infoAreaRect.width));
GUILayout.Label ("Player world pos: " + Ped.Instance.transform.position);
GUILayout.Space (5);
GUILayout.Label ("Player minimap pos: " + MiniMap.WorldPosToMapPos (Ped.Instance.transform.position));
GUILayout.Space (5);
if (Ped.Instance != null)
{
GUILayout.Label ("Player world pos: " + Ped.Instance.transform.position);
GUILayout.Space (5);
GUILayout.Label ("Player minimap pos: " + MiniMap.WorldPosToMapPos (Ped.Instance.transform.position));
GUILayout.Space (5);
}
GUILayout.Label ("Focus pos: " + this.GetFocusPosition ());
GUILayout.Space (5);
Vector2 cursorMapPos;
@ -592,9 +593,10 @@ namespace SanAndreasUnity.UI {
onDrawMapItems();
// draw player pointer
this.DrawItemOnMapRotated( MiniMap.Instance.PlayerBlip, Ped.Instance.transform.position, Ped.Instance.transform.forward, (int) m_playerPointerSize );
// this.DrawItemOnMapRotated( MiniMap.Instance.PlayerBlip, Player.Instance.transform.position, Player.Instance.transform.forward, 10 );
// this.DrawItemOnMap( blackPixel, Player.Instance.transform.position, 50 );
if (Ped.Instance != null)
{
this.DrawItemOnMapRotated( MiniMap.Instance.PlayerBlip, Ped.Instance.transform.position, Ped.Instance.transform.forward, (int) m_playerPointerSize );
}
// draw all zones
if (m_drawZones) {

View file

@ -12,8 +12,6 @@
- shooting is inaccurate - clients should send fire event with fire pos and fire dir
- add dates to logs
- remove spamming logs:
- sometimes, current vehicle is null on client

View file

@ -24,6 +24,8 @@
- Check how much RAM textures use
- Map window: increase buttons' height ; add shortcut for teleport (key 'T') ; draw vehicles ;
- Script execution order: HUD before pause menu and windows ; fps counter after all ;
- Add option to change fixed delta time ?