示例#1
0
        internal static void InitMenu()
        {
            ModMenu = new UIMenu("Map Editor", "~b~" + Translation.Translate("EXTERNAL MODS"));

            ModMenu.DisableInstructionalButtons(true);
            ModMenu.OnItemSelect += (menu, item, index) =>
            {
                var tmpMod = Mods[index];
                if (CurrentMod == tmpMod)
                {
                    UI.Notify("~b~~h~Map Editor~h~~n~~w~Mod ~h~" + tmpMod.Name + "~h~ " + Translation.Translate("has been disconnected."));
                    CurrentMod.ModDisconnectInvoker();
                    CurrentMod = null;
                }
                else
                {
                    UI.Notify("~b~~h~Map Editor~h~~n~~w~Mod ~h~" + tmpMod.Name + "~h~ " + Translation.Translate("has been connected."));
                    tmpMod.ModSelectInvoker();
                    CurrentMod = tmpMod;
                }
            };
        }
示例#2
0
        internal static void InitMenu()
        {
            ModMenu = new UIMenu("Map Editor", "~b~" + Translation.Translate("EXTERNAL MODS"));

            ModMenu.DisableInstructionalButtons(true);
            ModMenu.OnItemSelect += (menu, item, index) =>
            {
                var tmpMod = Mods[index];
                if (CurrentMod == tmpMod)
                {
                    UI.Notify("~b~~h~Map Editor~h~~n~~w~Mod ~h~" + tmpMod.Name + "~h~ " + Translation.Translate("has been disconnected."));
                    CurrentMod.ModDisconnectInvoker();
                    CurrentMod = null;
                }
                else
                {
                    UI.Notify("~b~~h~Map Editor~h~~n~~w~Mod ~h~" + tmpMod.Name + "~h~ " + Translation.Translate("has been connected."));
                    tmpMod.ModSelectInvoker();
                    CurrentMod = tmpMod;
                }
            };
        }
示例#3
0
 public static void SuscribeMod(ModListener mod)
 {
     Mods.Add(mod);
     ModMenu.AddItem(new UIMenuItem(mod.ButtonString, mod.Description));
 }
示例#4
0
 public static void SuscribeMod(ModListener mod)
 {
     Mods.Add(mod);
     ModMenu.AddItem(new UIMenuItem(mod.ButtonString, mod.Description));
 }
示例#5
0
		/// <summary>
		/// This method is encapsulated, so if MapEditor.dll is missing, the script won't crash!
		/// </summary>
	    private void AttachMapEditor()
	    {
			var thisMod = new ModListener()
			{
				ButtonString = "Create a Community Race",
				Description = "Create a race for the Community Races mod.",
				Name = "Community Races",
			};
			ModManager.SuscribeMod(thisMod);
			thisMod.OnMapSaved += SaveMap;
		}