示例#1
0
        /// <summary>
        /// Load game from "save/game" directory
        /// GuiManager must started first
        /// </summary>
        public static void LoadGame(bool isInitlizeGame)
        {
            if (isInitlizeGame)
            {
                //Clear
                ScriptManager.Clear();
                ScriptExecuter.Init();
                Utils.ClearScriptParserCache();
                MagicManager.Clear();
                NpcManager.ClearAllNpc();
                ObjManager.ClearAllObjAndFileName();
                MapBase.Free();
                GuiManager.CloseTimeLimit();
                GuiManager.EndDialog();
                BackgroundMusic.Stop();
                Globals.IsInputDisabled = false;
                Globals.IsSaveDisabled  = false;
                Npc.EnableAI();
            }

            LoadGameFile();
            LoadMagicGoodMemoList();
            LoadPlayer();
            //Apply xiulian magic to player
            Globals.ThePlayer.XiuLianMagic = MagicListManager.GetItemInfo(
                MagicListManager.XiuLianIndex);

            LoadPartner();
            LoadTraps();
            LoadTrapIgnoreList();

            Globals.TheCarmera.CenterPlayerInCamera();

            GameState.State = GameState.StateType.Playing;
            Globals.TheGame.IsGamePlayPaused = false;
            GuiManager.ShowAllPanels(false);
        }