Пример #1
0
        /*
         * public override void Close()
         * {
         *      if (Main.music[MusicID.Title] == GetMusic("Sounds/Music/Title"))
         *      {
         *              stop = true;
         *              swap = true;
         *              swapComplete.WaitOne();
         *      }
         *      base.Close();
         * }
         *
         * public static void Swap<T>(ref T a, ref T b)
         * {
         *      var tmp = a;
         *      a = b;
         *      b = tmp;
         * }
         *
         * public override void UpdateMusic(ref int music, ref MusicPriority priority)
         * {
         *      if (swap)
         *      {
         *              int slot = GetSoundSlot(SoundType.Music, "Sounds/Music/Title");
         *              Swap(ref Main.music[MusicID.Title], ref Main.music[slot]);
         *              Swap(ref Main.musicFade[MusicID.Title], ref Main.musicFade[slot]);
         *              swap = false;
         *
         *              if (stop)
         *                      ((MusicStreaming)Main.music[slot]).Dispose();
         *
         *              swapComplete.Set();
         *      }
         * }*/

        #endregion tModLoader Hooks

        #region Events

        private void OnUpdate()
        {
            if (Main.gameMenu)
            {
                fadePercent += MathHelper.ToRadians(1.7f * 360f / 60f);

                if (Mods.Overhaul == null)
                {
                    if (ModContent.GetInstance <DesiccationClientsideConfig>().MainMenuDesert)
                    {
                        Main.dayTime = true;
                        Main.time    = 40000;
                        Main.sunModY = 5;

                        if (!Main.dedServ)
                        {
                            BGData.LoadBackgrounds(new List <int>()
                            {
                                173, 171, 172, 20, 21, 22
                            });
                            BGData.MainMenuBackgroundSwap(20, 21, 22);
                            for (int vanillaCloudTextureID = 0; vanillaCloudTextureID < vanillaCloud.Length; vanillaCloudTextureID++)
                            {
                                Main.cloudTexture[vanillaCloudTextureID] = DrawData.BlankTexture;
                            }
                            Main.backgroundTexture[0] = GetTexture("UI/Textures/Sky");
                            Main.logoTexture          = Main.logo2Texture = GetTexture("UI/Textures/DesertLogo");
                        }
                    }
                    else
                    {
                        if (!Main.dedServ)
                        {
                            Main.logoTexture          = vanillaLogoDay;
                            Main.logo2Texture         = vanillaLogoNight;
                            Main.backgroundTexture[0] = vanillaSkyBackground;
                            for (int i = 0; i < vanillaCloud.Length; i++)
                            {
                                Main.cloudTexture[i] = vanillaCloud[i];
                            }
                            Main.backgroundTexture[173] = vanillaFrontMainMenuBackground;
                            Main.backgroundTexture[172] = vanillaMiddleMainMenuBackground;
                            Main.backgroundTexture[171] = vanillaBackMainMenuBackground;
                        }
                    }
                    if (Main.menuMode == 10006 && !unloadCalled)
                    {
                        Unload();
                        return;
                    }
                }
            }
        }
Пример #2
0
 public override void OnEnterWorld(Player player)
 {
     BGData.BackgroundReReplacing(173, 172, 171);
     GetTeamValues();
     if (MyPlayer.team != 0 && !teamChanged)
     {
         MyPlayer.team = teamInt;
         DUtils.Chat("Team auto changed to " + teamString + " from config.", false, 172, 191, 184);
         teamChanged = true;
     }
     if (ModContent.GetInstance <DesiccationClientsideConfig>().WelcomeMessage)
     {
         CombatText.NewText(player.Hitbox, Color.CornflowerBlue, "Thanks for playing with Desiccation, " + MyName + ". Remeber to check out the config menu!", true);
     }
 }