internal void Construct(HSVConfig hsvConfig, ConfigProvider configProvider)
        {
            _hsvConfig      = hsvConfig;
            _configProvider = configProvider;

            SetMigrationButtonColors();
        }
        internal ConfigProvider(SiraLog siraLog, HSVConfig hsvConfig)
        {
            _siraLog   = siraLog;
            _hsvConfig = hsvConfig;

            _jsonSerializerSettings = new JsonSerializerSettings
            {
                DefaultValueHandling = DefaultValueHandling.Include,
                NullValueHandling    = NullValueHandling.Ignore,
                Formatting           = Formatting.Indented,
                Converters           = new List <JsonConverter> {
                    new Vector3Converter()
                },
                ContractResolver = ShouldNotSerializeContractResolver.Instance
            };
            _hsvConfigsFolderPath       = Path.Combine(UnityGame.UserDataPath, nameof(HitScoreVisualizer));
            _hsvConfigsBackupFolderPath = Path.Combine(_hsvConfigsFolderPath, "Backups");

            _migrationActions = new Dictionary <Version, Func <Configuration, bool> >
            {
                { new Version(2, 0, 0), RunMigration2_0_0 },
                { new Version(2, 1, 0), RunMigration2_1_0 },
                { new Version(2, 2, 3), RunMigration2_2_3 },
                { new Version(3, 2, 0), RunMigration3_2_0 }
            };

            _minimumMigratableVersion      = _migrationActions.Keys.Min();
            _maximumMigrationNeededVersion = _migrationActions.Keys.Max();
        }
        public BloomFontProvider(HSVConfig hsvConfig)
        {
            _hsvConfig = hsvConfig;

            _cachedTekoFont = new Lazy <TMP_FontAsset>(() => Resources.FindObjectsOfTypeAll <TMP_FontAsset>().First(x => x.name.Contains("Teko-Medium SDF")),
                                                       LazyThreadSafetyMode.ExecutionAndPublication);

            _bloomTekoFont = new Lazy <TMP_FontAsset>(() =>
            {
                var distanceFieldShader       = Resources.FindObjectsOfTypeAll <Shader>().First(x => x.name.Contains("TextMeshPro/Distance Field"));
                var bloomTekoFont             = TMP_FontAsset.CreateFontAsset(_cachedTekoFont.Value.sourceFontFile);
                bloomTekoFont.name            = "Teko-Medium SDF (Bloom)";
                bloomTekoFont.material.shader = distanceFieldShader;

                return(bloomTekoFont);
            }, LazyThreadSafetyMode.ExecutionAndPublication);
        }
        public ConfigProvider(HSVConfig hsvConfig)
        {
            _hsvConfig = hsvConfig;

            _jsonSerializerSettings = new JsonSerializerSettings {
                DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, Formatting = Formatting.Indented
            };
            _hsvConfigsFolderPath = Path.Combine(IPA.Utilities.UnityGame.UserDataPath, nameof(HitScoreVisualizer));

            _migrationActions = new Dictionary <Version, Func <Configuration, bool> >
            {
                { new Version(2, 0, 0), RunMigration2_0_0 },
                { new Version(2, 1, 0), RunMigration2_1_0 },
                { new Version(2, 2, 3), RunMigration2_2_3 }
            };

            MinimumMigratableVersion      = _migrationActions.Keys.Min();
            MaximumMigrationNeededVersion = _migrationActions.Keys.Max();
        }
Esempio n. 5
0
 internal void Construct(SiraLog siraLog, HSVConfig hsvConfig, ConfigProvider configProvider)
 {
     _siraLog        = siraLog;
     _hsvConfig      = hsvConfig;
     _configProvider = configProvider;
 }
 internal HsvAppInstaller(HSVConfig hsvConfig)
 {
     _hsvConfig = hsvConfig;
 }