static void Postfix()
        {
            if (!GameplayManager.ShowHud || !RearView.Enabled)
            {
                return;
            }

            if (RearView.rearTex == null || RearView.rearCam == null || RearView.rearCam.gameObject == null)
            {
                RearView.Init();
            }

            if (GameManager.m_local_player.m_hitpoints <= 0)
            {
                RearView.Pause();
                return;
            }

            RearView.rearCam.enabled = true;
            var pos     = new Vector2(288f, 288f);
            var posTile = new Vector2(pos.x, pos.y - 0.01f);
            var size    = 100f;

            UIManager.DrawQuadUI(pos, size, size, UIManager.m_col_ui0, 1, 11);
            UIManager.SetTexture(RearView.rearTex);
            UIManager.PauseMainDrawing();
            UIManager.StartDrawing(UIManager.url[1], false, 750f);
            UIManager.DrawTile(posTile, size * 0.93f, size * 0.93f, new Color(0.8f, 0.8f, 0.8f, 1.0f), 1, 0, 0, 1, 1);
            UIManager.ResumeMainDrawing();
        }
Exemplo n.º 2
0
 static void Prefix(GameplayState new_state)
 {
     if (new_state != GameplayState.PLAYING)
     {
         RearView.Pause();
     }
     else if (new_state == GameplayState.PLAYING)
     {
         bool want = !NetworkManager.IsHeadless() && RearView.MPNetworkMatchEnabled &&
                     NetworkMatch.m_client_server_location != null && NetworkMatch.m_client_server_location.StartsWith("OLMOD ") &&
                     !GameManager.m_local_player.m_spectator;
         if (want != RearView.Enabled)
         {
             RearView.Enabled = want;
             if (RearView.Enabled)
             {
                 RearView.Init();
             }
             else
             {
                 RearView.Pause();
             }
         }
     }
 }
Exemplo n.º 3
0
 static void HandleRearViewToggle()
 {
     if (UIManager.m_menu_selection == 11)
     {
         RearView.Toggle();
         MenuManager.PlayCycleSound(1f, (float)UIManager.m_select_dir);
     }
 }
 public static void Toggle()
 {
     MenuManagerEnabled = !MenuManagerEnabled;
     if (MenuManagerEnabled)
     {
         if (RearView.rearTex == null || RearView.rearCam == null || RearView.rearCam.gameObject == null)
         {
             RearView.Init();
         }
     }
     else
     {
         Pause();
     }
 }
 static void Prefix(GameplayState new_state)
 {
     if (new_state != GameplayState.PLAYING)
     {
         RearView.Pause();
     }
     else if (new_state == GameplayState.PLAYING)
     {
         if (RearView.Enabled)
         {
             RearView.Init();
         }
         else
         {
             RearView.Pause();
         }
     }
 }
Exemplo n.º 6
0
 static void Prefix()
 {
     if (GameplayManager.IsMultiplayerActive)
     {
         return;
     }
     foreach (char c in Input.inputString)
     {
         if (code[codeIdx] == c)
         {
             if (++codeIdx < code.Length)
             {
                 continue;
             }
             else
             {
                 RearView.Toggle();
             }
         }
         codeIdx = 0;
     }
 }
Exemplo n.º 7
0
 public static void Toggle()
 {
     Enabled = !Enabled;
     if (Enabled)
     {
         GameManager.m_local_player.SetCheaterFlag(true);
         GameplayManager.AddHUDMessage("CHEATER! REAR VIEW ENABLED!");
     }
     else
     {
         GameplayManager.AddHUDMessage("REAR VIEW DISABLED!");
     }
     if (Enabled)
     {
         if (RearView.rearTex == null || RearView.rearCam == null || RearView.rearCam.gameObject == null)
         {
             RearView.Init();
         }
     }
     else
     {
         Pause();
     }
 }
Exemplo n.º 8
0
 static void Postfix()
 {
     RearView.Reset();
 }