public override void PostSetupContent()
        {
            SplashTexts = new List <ModTranslation>();

            // In post-setup content to allow other mods to register localizations
            // following the same format, if they wish to register their own
            // (https://github.com/Steviegt6/SteviesModRedux/wiki/Splash-Text)
            foreach (Mod mod in ModLoader.Mods)
            {
                ICollection <ModTranslation> modTranslations = (typeof(Mod)
                                                                .GetField("translations", ReflectionUtilities.AllFlags)
                                                                ?.GetValue(mod) as IDictionary <string, ModTranslation>)?.Values;

                if (modTranslations == null)
                {
                    continue;
                }

                foreach (ModTranslation translation in modTranslations.Where(x => x.Key.Contains(".Splashes.")))
                {
                    SplashTexts.Add(translation);
                }
            }

            ModMenuSplashTextSystem.CycleText();
        }
Exemplo n.º 2
0
        public override void PostSetupContent()
        {
            SplashTexts = new List <ModTranslation>();

            // In post-setup content to allow other mods to register localizations
            // following the same format, if they wish to register their own
            // (https://github.com/Steviegt6/SteviesModRedux/wiki/Splash-Text)
            ICollection <ModTranslation> modTranslations = typeof(LocalizationLoader)
                                                           .GetCachedField("translations")
                                                           .GetValue <IDictionary <string, ModTranslation> >(null).Values;

            foreach (ModTranslation translation in modTranslations.Where(x => x.Key.Contains(".Splashes.")))
            {
                SplashTexts.Add(translation);
            }

            ModMenuSplashTextSystem.CycleText();
        }