Example #1
0
        public virtual void Draw()
        {
            ShowTalking();

            if (ActiveGame.isTimed)
            {
                DrawGameTimer();
            }
            if (GoalTextTime - GetGameTimer() > 0)
            {
                GoalText.Draw();
            }
        }
Example #2
0
        public virtual void DrawHealth()
        {
            HideHudAndRadarThisFrame();

            if (ActiveGame.Team == 0)
            {
                return;
            }

            HealthText.Caption = Game.Player.Character.Health.ToString();
            AmmoText.Caption   = Game.PlayerPed.Weapons.Current.AmmoInClip + " / " + Game.PlayerPed.Weapons.Current.Ammo;

            DrawRectangle(0.025f, 0.9f, 0.12f, 0.03f, 0, 0, 0, 200);
            float healthPercent = (float)Game.Player.Character.Health / Game.Player.Character.MaxHealth;

            if (healthPercent < 0)
            {
                healthPercent = 0;
            }
            if (healthPercent > 1)
            {
                healthPercent = 1;
            }
            DrawRectangle(0.025f, 0.9f, healthPercent * 0.12f, 0.03f, 200, 0, 0, 200);

            float ammoPercent = (float)Game.PlayerPed.Weapons.Current.AmmoInClip / Game.PlayerPed.Weapons.Current.MaxAmmoInClip;

            DrawRectangle(0.025f, 0.94f, 0.12f, 0.03f, 0, 0, 0, 200);

            DrawRectangle(0.025f, 0.94f, ammoPercent * 0.12f, 0.03f, 230, 230, 0, 200);

            HealthText.Draw();
            AmmoText.Draw();
        }
Example #3
0
        public void DrawGameTimer()
        {
            TimeSpan time = TimeSpan.FromMilliseconds(ActiveGame.GameTime - GetGameTimer());

            GameTimeText.Caption = string.Format("{0:00}:{1:00}", Math.Ceiling(time.TotalMinutes - 1), time.Seconds);

            GameTimeText.Draw();
        }
Example #4
0
        public override void Draw()
        {
            if (DetectiveTracing > -1)
            {
                ShowDNA();
            }

            if (isRadarActive)
            {
                ShowRadar();
            }

            if (ActiveTTT.Team == (int)TTT.Teams.Traitors)
            {
                DrawRectangle(0.025f, 0.86f, 0.07f, 0.03f, 200, 0, 0, 200);
            }
            if (ActiveTTT.Team == (int)TTT.Teams.Detectives)
            {
                DrawRectangle(0.025f, 0.86f, 0.07f, 0.03f, 0, 0, 200, 200);
            }
            if (ActiveTTT.Team == (int)TTT.Teams.Innocents)
            {
                DrawRectangle(0.025f, 0.86f, 0.07f, 0.03f, 0, 200, 0, 200);
            }

            TeamText.Draw();

            DrawHealth();
            DrawWeaponSwitch();
            ShowNames();

            HideReticle();

            if (lastLooked + 300 > GetGameTimer())
            {
                HUDText.Draw();
            }

            if (ActiveTTT.Team == (int)TTT.Teams.Traitors)
            {
                ShowTraitors();
            }

            if (ActiveTTT.isDisguised)
            {
                DisguisedText.Draw();
            }

            base.Draw();
        }
 public void Draw()
 {
     if (Texture == "")
     {
         DrawRect(Position.X, Position.Y, Size.X, Size.Y, Colour.R, Colour.G, Colour.B, Colour.A);
         ButtonText.Draw();
     }
     else
     {
         if (HasStreamedTextureDictLoaded("saltyTextures"))
         {
             DrawSprite("saltyTextures", Texture, Position.X, Position.Y, Size.X, Size.Y, Rotation, Colour.R, Colour.G, Colour.B, Colour.A);
         }
     }
 }
Example #6
0
        public void DrawScore()
        {
            ScoreText.Draw();
            float time = showScoreTimer - GetGameTimer();

            if (time >= 0)
            {
                if (time <= (showScoreLength / 2))
                {
                    float percent = time / (showScoreLength / 2);
                    AddScoreText.Scale = percent * 0.3f;
                }
                else
                {
                    float percent = (time - (showScoreLength / 2)) / (showScoreLength / 2);
                    AddScoreText.Scale = 0.3f - (percent * 0.3f);
                }
                AddScoreText.Draw();
            }
        }