Exemplo n.º 1
0
        public new void Load()
        {
            base.Load();

            if (!Contains("Locale"))
            {
                MessageBox.Show(@"There is no locale value. You must set it to something.", @"CloneCAD", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(1);
            }

            Locale = new LocaleConfig(this["Locale"]);

            if (this["IP"] == "changeme")
            {
                MessageBox.Show(Locale["ChangeMeIP"], @"CloneCAD", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(1);
            }

            if (!int.TryParse(this["Port"], out int port) || port < 1024 || port > 65536)
            {
                MessageBox.Show(Locale["InvalidPort"], @"CloneCAD", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(1);
            }
            else
            {
                Port = port;
            }
        }
Exemplo n.º 2
0
 public string GetVal()
 {
     if (content != null)
     {
         return(content);
     }
     return(LocaleConfig.Get(id));
 }
Exemplo n.º 3
0
 public string SetParams(params object[] param)
 {
     content = LocaleConfig.Get(id, param);
     if (target != null)
     {
         target.text = content;
     }
     return(content);
 }
Exemplo n.º 4
0
        private void LoadLocale(LocaleConfig locale)
        {
            Text = locale["DispatchText"];

            IDBox.Hint    = locale["CivilianIDHint"];
            PlateBox.Hint = locale["LicensePlateHint"];
            NameBox.Hint  = locale["FullNameHint"];

            LaunchBtn.Text = locale["ViewCivilianButton"];
        }
Exemplo n.º 5
0
        private void LoadLocale(LocaleConfig locale)
        {
            Text = locale["CivilianSelectorText"];

            columnHeader1.Text = locale["IDColumn"];
            columnHeader2.Text = locale["NameColumn"];

            create.Text = locale["CreateButton"];
            delete.Text = locale["DeleteButton"];
        }
Exemplo n.º 6
0
 public static void FloatMessage(string message, bool notOverColor = true)
 {
     if (notOverColor)
     {
         _FloatMessage(message);
     }
     else
     {
         _FloatMessage(LocaleConfig.Get(104033, message));
     }
 }
Exemplo n.º 7
0
        private void LoadLocale(LocaleConfig locale)
        {
            Text = locale["MainMenuText"];

            LaunchBtn.Text = locale["LaunchButton"];

            CloseCheckbox.Text = locale["CloseOnLaunchCheckbox"];

            CivilianRadial.Text = locale["CivilianSelectorText"];
            PoliceRadial.Text   = locale["PoliceText"];
            DispatchRadial.Text = locale["DispatchText"];
        }
Exemplo n.º 8
0
        private void LoadLocale(LocaleConfig locale)
        {
            Text = locale["PoliceText"];

            FixItRadial.Text    = locale["FixItTicket"];
            WarningRadial.Text  = locale["WarningTicket"];
            CitationRadial.Text = locale["CitationTicket"];
            TicketRadial.Text   = locale["TicketTicket"];

            IDBox.Hint          = locale["CivilianIDHint"];
            PriceBox.Hint       = locale["TicketPriceHint"];
            DescriptionBox.Hint = locale["TicketDescriptionHint"];
        }
Exemplo n.º 9
0
        public Log(string fileName, LocaleConfig locale, AliasDictionary aliases)
        {
            Aliases = aliases;
            Locale  = locale;
            Handler = new ErrorHandler(locale);

            try
            {
                Writer = new StreamWriter(fileName)
                {
                    AutoFlush = true
                };
            }
            catch (IOException)
            {
                Handler.Error("LogFileInUseMsg", 1);
            }
        }
Exemplo n.º 10
0
        private void LoadLocale(LocaleConfig locale)
        {
            Text = locale["CivilianRecordReadOnlyText"];

            IDLabel.Text = locale["IDTextExec", ""];

            NameBox.Hint     = locale["FullNameHint"];
            BusinessBox.Hint = locale["AssociatedBusinessHint"];
            PlateBox.Hint    = locale["LicensePlateHint"];

            SyncBtn.Text = locale["SyncButton"];

            SyncCheck.Text = locale["SyncedCheckbox"];

            columnHeader1.Text = locale["PriceColumn"];
            columnHeader2.Text = locale["TypeColumn"];
            columnHeader3.Text = locale["IDColumn"];
            columnHeader4.Text = locale["DescriptionColumn"];
        }
Exemplo n.º 11
0
        public new void Load()
        {
            base.Load();

            Locale  = new LocaleConfig(base["Locale"]);
            Handler = new ErrorHandler(Locale);

            if (!int.TryParse(base["Port"], out int port) || port < 1024 || port > 65536)
            {
                Handler.Error("InvalidPortMsg", 1, base["Port"]);
            }

            Port = port;


            if (!int.TryParse(base["Filter"], out int filter) || filter < 0 || filter > 2)
            {
                Handler.Error("InvalidFilterTypeMsg", 1, base["Filter"]);
            }

            Filter = (FilterType)filter;


            FilteredCivIPs = string.IsNullOrWhiteSpace(base["FilteredCivIPs"]) ? new string[0] : base["FilteredCivIPs"].Split(',').Select(x => x.Trim()).ToArray();


            FilteredPoliceIPs = string.IsNullOrWhiteSpace(base["FilteredPoliceIPs"]) ? new string[0] : base["FilteredPoliceIPs"].Split(',').Select(x => x.Trim()).ToArray();


            FilteredDispatchIPs = string.IsNullOrWhiteSpace(base["FilteredDispatchIPs"]) ? new string[0] : base["FilteredDispatchIPs"].Split(',').Select(x => x.Trim()).ToArray();


            Aliases = string.IsNullOrWhiteSpace(base["Aliases"]) ? new AliasDictionary(Locale) : new AliasDictionary(Locale, base["Aliases"]);

            Log = new Log(base["Log"], Locale, Aliases);
        }
Exemplo n.º 12
0
        private void GunshotWoundInit()
        {
            _ecsWorld = new EcsWorld();

            _mainConfig = EcsFilterSingle <MainConfig> .Create(_ecsWorld);

            _localeConfig = EcsFilterSingle <LocaleConfig> .Create(_ecsWorld);

            _gswWorld = EcsFilterSingle <GswWorld> .Create(_ecsWorld);

            _gswWorld.GswPeds = new Dictionary <Ped, int>();

            try
            {
                TryToLoadConfigsFromXml();
                _configLoaded = true;
            }
            catch (Exception e)
            {
                LoadDefaultConfigs();
                _configLoaded = false;

#if DEBUG
                UI.Notify(e.ToString());
#endif
            }

            try
            {
                TryToLoadLocalization();
                _localizationLoaded = true;
            }
            catch (Exception e)
            {
                LoadDefaultLocalization();
                _localizationReason = e.Message;
                _localizationLoaded = false;

#if DEBUG
                UI.Notify(e.ToString());
#endif
            }

            _everyFrameSystems = new EcsSystems(_ecsWorld);
            _commonSystems     = new MultiTickEcsSystems(_ecsWorld, MultiTickEcsSystems.RestrictionModes.MILLISECONDS, 10);

            if (_mainConfig.NpcConfig.AddingPedRange > MINIMAL_RANGE_FOR_WOUNDED_PEDS)
            {
                _commonSystems
                .Add(new NpcFindSystem())
                .Add(new ConvertPedToNpcGswPedSystem())
                .Add(new RemoveWoundedPedSystem());
            }

            if (_mainConfig.PlayerConfig.WoundedPlayerEnabled)
            {
                _everyFrameSystems
                .Add(new PlayerSystem())
                .Add(new SpecialAbilityLockSystem());

                if (_mainConfig.PlayerConfig.MaximalSlowMo < 1f)
                {
                    _everyFrameSystems
                    .Add(new AdrenalineSystem());
                }
            }

            _everyFrameSystems
            .Add(new InstantHealSystem())
            .Add(new HelmetRequestSystem())

            .Add(new RagdollSystem())
            .Add(new SwitchAnimationSystem())

            .Add(new DebugInfoSystem())

            .Add(new CameraShakeSystem())
            .Add(new FlashSystem())

            .Add(new PainRecoverySystem())
            .Add(new BleedingSystem())
            .Add(new BandageSystem())
            .Add(new SelfHealingSystem());

            _commonSystems
            .Add(new ArmorSystem())
            .AddHitDetectSystems()
            .AddDamageProcessingSystems()
            .AddWoundSystems()
            .AddPainStateSystems()
            .Add(new CheckSystem())
            .Add(new NotificationSystem());

            _everyFrameSystems.Initialize();
            _commonSystems.Initialize();

            Tick  += OnTick;
            KeyUp += OnKeyUp;

            _isPaused = false;
        }
Exemplo n.º 13
0
        private void GunshotWoundInit()
        {
            Function.Call(Hash._SET_CAM_EFFECT, 0);
            _ecsWorld = new EcsWorld();

            _mainConfig = EcsFilterSingle <MainConfig> .Create(_ecsWorld);

            _localeConfig = EcsFilterSingle <LocaleConfig> .Create(_ecsWorld);

            _gswWorld = EcsFilterSingle <GswWorld> .Create(_ecsWorld);

            _gswWorld.GswPeds = new Dictionary <Ped, int>();

            (_configLoaded, _configReason)             = MainConfig.TryToLoadFromXml(_mainConfig);
            (_localizationLoaded, _localizationReason) = LocaleConfig.TryToLoadLocalization(_localeConfig, _mainConfig.Language);

            _everyFrameSystems = new EcsSystems(_ecsWorld);
            _commonSystems     = new MultiTickEcsSystems(_ecsWorld, MultiTickEcsSystems.RestrictionModes.MILLISECONDS, 10);

            if (_mainConfig.NpcConfig.AddingPedRange > MinimalRangeForWoundedPeds)
            {
                _commonSystems
                .Add(new NpcFindSystem())
                .Add(new ConvertPedToNpcGswPedSystem())
                .Add(new RemoveWoundedPedSystem());
            }

            if (_mainConfig.PlayerConfig.WoundedPlayerEnabled)
            {
                _everyFrameSystems
                .Add(new PlayerSystem())
                .Add(new SpecialAbilityLockSystem());

                if (_mainConfig.PlayerConfig.MaximalSlowMo < 1f)
                {
                    _everyFrameSystems.Add(new AdrenalineSystem());
                }
            }

            _everyFrameSystems
            .Add(new InstantHealSystem())
            .Add(new HelmetRequestSystem())
            .Add(new RagdollSystem())
            .Add(new MoveSetSwitchSystem())
            .Add(new DebugInfoSystem())
            .Add(new CameraShakeSystem())
            .Add(new FlashSystem())
            .Add(new PainRecoverySystem())
            .Add(new BleedingSystem())
            .Add(new BandageSystem())
            .Add(new SelfHealingSystem());

            _commonSystems
            .Add(new ArmorSystem())
            .AddHitDetectSystems()
            .AddDamageProcessingSystems()
            .AddWoundSystems()
            .AddPainStateSystems()
            .Add(new CheckSystem())
            .Add(new NotificationSystem());

            _everyFrameSystems.Initialize();
            _commonSystems.Initialize();

            Tick  += OnTick;
            KeyUp += OnKeyUp;

            _isPaused = false;
        }
Exemplo n.º 14
0
 public ErrorHandler(LocaleConfig locale) =>
Exemplo n.º 15
0
 public RegWeaponMenu(LocaleConfig locale)
 {
     InitializeComponent();
     LoadLocale(locale);
 }
Exemplo n.º 16
0
 public void LoadLocale(LocaleConfig locale) =>
 WeaponName.Hint = locale["WeaponNameHint"];
Exemplo n.º 17
0
 public AliasDictionary(LocaleConfig locale) : base()
 {
     Locale  = locale;
     Handler = new ErrorHandler(locale);
 }
Exemplo n.º 18
0
 public AliasDictionary(LocaleConfig locale, string list) : this(locale) =>