コード例 #1
0
ファイル: ANPRInterface.cs プロジェクト: wowpanda/CameraTech
        private async Task drawingAsync()
        {
            while (true)
            {
                await Delay(0);

                if (MasterInterfaceToggle && (CameraTech.FixedANPRAlertsToggle || VehicleANPR.Active))
                {
                    //API.DrawRect(0.508f, 0.94f, 0.196f, 0.116f, 0, 0, 0, 150);
                    Rectangle rect = new Rectangle(new PointF(Screen.Width * 0.001f, Screen.Height * 0.5f), new SizeF(Screen.Width * 0.16f, Screen.Height * 0.126f), Color.FromArgb(150, 0, 0, 0));
                    Text      vehicleANPRHeader      = new Text("Vehicle ANPR - " + VehicleANPRHeaderString, new PointF(Screen.Width * 0.08f, Screen.Height * 0.501f), scale, Color.FromArgb(255, 0, 191, 255), Font.ChaletComprimeCologne, Alignment.Center);
                    Text      vehicleANPRInfoText    = new Text(VehicleANPRInfo, new PointF(Screen.Width * 0.08f, Screen.Height * 0.519f), scale, Color.FromArgb(255, 255, 255, 255), Font.ChaletComprimeCologne, Alignment.Center);
                    Text      vehicleANPRMarkersText = new Text(VehicleANPRMarkers, new PointF(Screen.Width * 0.08f, Screen.Height * 0.537f), scale, Color.FromArgb(255, 255, 255, 255), Font.ChaletComprimeCologne, Alignment.Center);
                    if (!VehicleANPR.Active)
                    {
                        vehicleANPRInfoText.Caption    = "~r~DISABLED";
                        vehicleANPRMarkersText.Caption = "";
                    }

                    string focussedString = "Fixed";
                    if (CameraTech.FocussedPlate != null)
                    {
                        focussedString = "Focussed";
                    }
                    Text fixedANPRHeader      = new Text(focussedString + " ANPR - " + FixedANPRHeaderString, new PointF(Screen.Width * 0.08f, Screen.Height * 0.555f), scale, Color.FromArgb(255, 0, 191, 255), Font.ChaletComprimeCologne, Alignment.Center);
                    Text fixedANPRInfoText    = new Text(FixedANPRInfo, new PointF(Screen.Width * 0.08f, Screen.Height * 0.573f), scale, Color.FromArgb(255, 255, 255, 255), Font.ChaletComprimeCologne, Alignment.Center);
                    Text fixedANPRMarkersText = new Text(FixedANPRMarkers, new PointF(Screen.Width * 0.08f, Screen.Height * 0.591f), scale, Color.FromArgb(255, 255, 255, 255), Font.ChaletComprimeCologne, Alignment.Center);
                    if (!CameraTech.FixedANPRAlertsToggle)
                    {
                        fixedANPRInfoText.Caption    = "~r~DISABLED";
                        fixedANPRMarkersText.Caption = "";
                    }

                    if (Game.Player != null && Game.Player.Character != null && Game.Player.Character.Exists() && Game.Player.Character.IsInVehicle() && Game.Player.Character.CurrentVehicle.Exists() &&
                        CameraTech.ANPRModels.Contains(Game.Player.Character.CurrentVehicle.Model))
                    {
                        rect.Draw();
                        vehicleANPRHeader.Draw();
                        vehicleANPRInfoText.Draw();
                        vehicleANPRMarkersText.Draw();
                        fixedANPRHeader.Draw();
                        fixedANPRInfoText.Draw();
                        fixedANPRMarkersText.Draw();
                    }
                }
            }
        }
コード例 #2
0
ファイル: HUD.cs プロジェクト: wowpanda/frfuel-plus
        public HUD()
        {
            PointF fuelBarBackdropPosition = basePosition;
            PointF fuelBarBackPosition     = new PointF(fuelBarBackdropPosition.X, fuelBarBackdropPosition.Y + 3f);
            PointF fuelBarPosition         = fuelBarBackPosition;

            fuelBarBackdropSize = new SizeF(fuelBarWidth(), 12f);
            fuelBarBackSize     = new SizeF(fuelBarWidth(), fuelBarHeight);
            fuelBarSize         = fuelBarBackSize;

            Color fuelBarBackdropColour = Color.FromArgb(100, 0, 0, 0);
            Color fuelBarBackColour     = Color.FromArgb(50, 255, 179, 0);

            /// Default colors will be changed in the <see cref="FRFuel.LoadConfig"/> function, by calling the <see cref="UpdateBarColors"/> function.
            fuelBarColourNormal  = Color.FromArgb(150, 255, 179, 0);
            fuelBarColourWarning = Color.FromArgb(255, 255, 245, 220);

            fuelBarBackdrop = new CitizenFX.Core.UI.Rectangle(fuelBarBackdropPosition, fuelBarBackdropSize, fuelBarBackdropColour);
            fuelBarBack     = new CitizenFX.Core.UI.Rectangle(fuelBarBackPosition, fuelBarBackSize, fuelBarBackColour);
            fuelBar         = new CitizenFX.Core.UI.Rectangle(fuelBarPosition, fuelBarSize, fuelBarColourNormal);
        }