예제 #1
0
			/// <summary>
			/// Applied before Initialize runs.
			/// </summary>
			internal static void Prefix() {
#if DEBUG
				ModUtil.RegisterForTranslation(typeof(SweepByTypeStrings));
#else
				Localization.RegisterForTranslation(typeof(SweepByTypeStrings));
#endif
			}
예제 #2
0
        // Token: 0x06000003 RID: 3 RVA: 0x000020DC File Offset: 0x000002DC
        public static void Prefix()
        {
            string str = "NEON_EDEN";

            Strings.Add("STRINGS.WORLDS." + str + ".NAME", "Neon Eden");
            Strings.Add("STRINGS.WORLDS." + str + ".DESCRIPTION", "A huge target location with an abundance of resources.\n\n<smallcaps>Neon Eden will pose almost no challenges and the abundance of resources and space will enable you to support a large colony. </smallcaps>\n\n");
            Strings.Add("STRINGS.CLUSTER_NAMES." + str + ".NAME", "Neon Eden");
            Strings.Add("STRINGS.CLUSTER_NAMES." + str + ".DESCRIPTION", "A huge target location with an abundance of resources.\n\n<smallcaps>Neon Eden will pose almost no challenges and the abundance of resources and space will enable you to support a large colony. </smallcaps>\n\n");
            Strings.Add("STRINGS.SUBWORLDS.NEONEDEN.NAME", "Neon Eden");
            Strings.Add("STRINGS.SUBWORLDS.NEONEDEN.DESC", "A huge target location with an abundance of resources.\n\n<smallcaps>Neon Eden will pose almost no challenges and the abundance of resources and space will enable you to support a large colony. </smallcaps>\n\n");
            Strings.Add("STRINGS.SUBWORLDS.NEONEDEN.UTILITY", "Neon Eden UTILITY");
            string text = "Asteroid_NeonEden";

            ModUtil.RegisterForTranslation(typeof(NeonEdenPatch));

            var sprite = Assembly.GetExecutingAssembly().GetManifestResourceStream("NeonEden." + text + ".dds");

            Debug.Log(sprite == null ? "sprite is null" : "sprite is not null");
            Sprite value = Sprites.CreateSpriteDXT5(sprite, 512, 512);

            Assets.Sprites.Add(text, value);

            var textureBiom = Assembly.GetExecutingAssembly().GetManifestResourceStream("NeonEden.NeonEdenBiom.png");

            Debug.Log(textureBiom == null ? "textureBiom is null" : "textureBiom is not null");
            Sprite spriteBiom = Sprites.CreateSpriteFromPng(textureBiom, 512, 512);

            Assets.Sprites.Add("biomeIconNeoneden", spriteBiom);
        }
예제 #3
0
        /// <summary>
        /// Add strings and icon for a world
        /// </summary>
        /// <param name="NAME"> Name of the world </param>
        /// <param name="DESCRIPTION"> Description of the world </param>
        /// <param name="iconName"> DDS icon name (incorporated ressources only) </param>
        /// <param name="className"> Class containing the locstrings </param>
        public static void addWorldYaml(string NAME, string DESCRIPTION, string iconName, Type className)
        {
            // Add strings used in Fuleria.yaml
            Strings.Add($"STRINGS.WORLDS." + NAME.ToUpper() + ".NAME", NAME);
            Strings.Add($"STRINGS.WORLDS." + NAME.ToUpper() + ".DESCRIPTION", DESCRIPTION);

            Logs.LogIfDebugging("Strings added at: " + "STRINGS.WORLDS." + NAME.ToUpper() + ".NAME");

            // Generate a translation .pot
            ModUtil.RegisterForTranslation(className);

            if (!iconName.IsNullOrWhiteSpace())
            {
                //Load the sprite from Asteroid_Fuleria.dds (converted online from png) and set "generation action" to incorporated ressources
                try
                {
                    Sprite sprite = Sprites.CreateSpriteDXT5(Assembly.GetExecutingAssembly().GetManifestResourceStream(className.AssemblyQualifiedName + "." + iconName + ".dds"), 512, 512);
                    Assets.Sprites.Add(iconName, sprite);
                }
                catch (Exception e)
                {
                    Logs.Log(e.ToString());
                    throw new ArgumentException();
                }
            }
        }
예제 #4
0
        /// <summary>
        /// Add strings and icon for a world
        /// Don't call this method OnLoad !
        /// To call at Db.Initialize
        /// </summary>
        /// <param name="NAME"> Name of the world </param>
        /// <param name="DESCRIPTION"> Description of the world </param>
        /// <param name="iconName"> DDS icon name (incorporated ressources only) </param>
        /// <param name="className"> Class containing the locstrings </param>
        public static void AddWorldYaml(string NAME, string DESCRIPTION, string iconName, Type className)
        {
            // Add strings used in ****.yaml
            Strings.Add($"STRINGS.WORLDS." + NAME.ToUpper() + ".NAME", NAME);
            Strings.Add($"STRINGS.WORLDS." + NAME.ToUpper() + ".DESCRIPTION", DESCRIPTION);

            // Generate a translation .pot
            if (!alreadyLoaded.Contains(className))
            {
                ModUtil.RegisterForTranslation(className);
                alreadyLoaded.Add(className);
            }

            if (!iconName.IsNullOrWhiteSpace())
            {
                //Load the sprite from Asteroid_****.dds (converted online from png) and add it to the project and set build action to embedded resource
                string resourceName = Assembly.GetExecutingAssembly().GetManifestResourceNames().Single(str => str.EndsWith(iconName + ".dds"));
                Stream stream       = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName);
                if (stream == null)
                {
                    throw new ArgumentException($"Could not load the sprite at {resourceName}.");
                }
                Sprite sprite = CreateSpriteDXT5(stream, 512, 512);
                Assets.Sprites.Add(iconName, sprite);
            }
        }
예제 #5
0
            /// <summary>
            /// Applied before Initialize runs.
            /// </summary>
            internal static void Prefix()
            {
#if DEBUG
                ModUtil.RegisterForTranslation(typeof(ClaustrophobiaStrings));
#else
                Localization.RegisterForTranslation(typeof(ClaustrophobiaStrings));
#endif
            }
예제 #6
0
        public static void OnLoad()
        {
#if DEBUG
            ModUtil.RegisterForTranslation(typeof(Languages));
#else
            Localization.RegisterForTranslation(typeof(Languages));
#endif
        }
예제 #7
0
        public static void Prefix()
        {
            // Add strings used in Fuleria.yaml
            Strings.Add($"STRINGS.WORLDS.VOID.NAME", NAME);
            Strings.Add($"STRINGS.WORLDS.VOID.DESCRIPTION", DESCRIPTION);

            // Generate a translation .pot
            ModUtil.RegisterForTranslation(typeof(VoidPatch));
        }
예제 #8
0
        public static void OnLoad()
        {
            Debug.Log("OnLoad !!");
#if DEBUG
            ModUtil.RegisterForTranslation(typeof(Class1));
#else
            Localization.RegisterForTranslation(typeof(Class1));
#endif
        }
예제 #9
0
 /// <summary>
 /// Add strings and icon for a world
 /// Don't call this method OnLoad !
 /// Should be called at Db.Initialize
 /// </summary>
 /// <param name="className"> Class containing the locstrings </param>
 public static void AddWorldYaml(Type className)
 {
     // Generate a translation .pot and prepare translation strings for loading
     if (!alreadyLoaded.Contains(className))
     {
         ModUtil.RegisterForTranslation(className);
         alreadyLoaded.Add(className);
     }
 }
예제 #10
0
        public static void Prefix()
        {
            // Add strings used in Fuleria.yaml
            Strings.Add($"STRINGS.WORLDS.FULERIA.NAME", NAME);
            Strings.Add($"STRINGS.WORLDS.FULERIA.DESCRIPTION", DESCRIPTION);

            // Generate a translation .pot
            ModUtil.RegisterForTranslation(typeof(AllBiomesWorldPatch));

            // Load the sprite from Asteroid_Fuleria.dds (converted online from png) and set "generation action" to incorporated ressources
            Sprite fuleriaSprite = Utilities.Sprites.CreateSpriteDXT5(Assembly.GetExecutingAssembly().GetManifestResourceStream("AllBiomesWorld.Asteroid_Fuleria.dds"), 512, 512);

            Assets.Sprites.Add("Asteroid_Fuleria", fuleriaSprite);
        }
예제 #11
0
 /// <summary>
 /// Debug dumps the translation templates for ALL registered PLib localized mods.
 /// </summary>
 internal static void DumpAll()
 {
     lock (PSharedData.GetLock(PRegistry.KEY_LOCALE_LOCK)) {
         // Get list holding locale information
         var list = PSharedData.GetData <IList <Assembly> >(PRegistry.KEY_LOCALE_TABLE);
         if (list != null)
         {
             foreach (var mod in list)
             {
                 if (mod != null)
                 {
                     ModUtil.RegisterForTranslation(mod.GetTypes()[0]);
                 }
             }
         }
     }
 }
예제 #12
0
        /// <summary>
        /// Debug dumps the translation templates for ALL registered PLib localized mods.
        /// </summary>
        internal void DumpAll()
        {
            var allMods = PRegistry.Instance.GetAllComponents(ID);

            if (allMods != null)
            {
                foreach (var toDump in allMods)
                {
                    // Reach for those assemblies
                    var assemblies = toDump.GetInstanceData <ICollection <Assembly> >();
                    if (assemblies != null)
                    {
                        foreach (var modAssembly in assemblies)
                        {
                            ModUtil.RegisterForTranslation(modAssembly.GetTypes()[0]);
                        }
                    }
                }
            }
        }
예제 #13
0
        /// <summary>
        /// Add strings and icon for a world
        /// Don't call this method OnLoad !
        /// Should be called at Db.Initialize
        /// </summary>
        /// <param name="iconName"> DDS icon name (incorporated ressources only) </param>
        /// <param name="className"> Class containing the locstrings </param>
        public static void AddWorldYaml(string iconName, Type className)
        {
            // Generate a translation .pot and prepare translation strings for loading
            if (!alreadyLoaded.Contains(className))
            {
                ModUtil.RegisterForTranslation(className);
                alreadyLoaded.Add(className);
            }


            if (!iconName.IsNullOrWhiteSpace())
            {
                //Load the sprite from Asteroid_****.dds (converted online from png) and set "generation action" to incorporated ressources
                Logs.LogIfDebugging("Loading Sprite: " + className.Assembly.GetName().Name + "." + iconName + ".dds");
                Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(className.Assembly.GetName().Name + "." + iconName + ".dds");
                if (stream == null)
                {
                    throw new ArgumentException("Sprite name is not valid.");
                }
                Sprite sprite = CreateSpriteDXT5(stream, 512, 512);
                Assets.Sprites.Add(iconName, sprite);
            }
        }
예제 #14
0
            /// <summary>
            /// Applied before Initialize runs.
            /// </summary>
            internal static void Prefix()
            {
#if DEBUG
                ModUtil.RegisterForTranslation(typeof(BulkChangeStrings));
#endif
            }
예제 #15
0
 private static void Prefix(Db __instance)
 {
     ModUtil.RegisterForTranslation(typeof(Strings));
 }
예제 #16
0
 public static void OnLoad(string modPath)
 {
     OnLoadPatch.modPath = modPath;
     ModUtil.RegisterForTranslation(typeof(PHO_STRINGS));
 }
예제 #17
0
 /// <summary>
 /// Applied before Initialize runs.
 /// </summary>
 internal static void Prefix()
 {
     ModUtil.RegisterForTranslation(typeof(BulkChangeStrings));
 }