protected virtual void RefreshData(bool resetData = true)
        {
            if (resetData)
            {
                MenuData.RefreshPreviousChapters(MenuData.ChapterId);
            }

            Difficulty_Modes difficulty = Global.game_system != null ?
                                          Global.game_system.Difficulty_Mode : Difficulty_Modes.Normal;

            TactileLibrary.Preset_Chapter_Data chapterData;

            if (Global.chapter_by_index(this.Redirect).Standalone ||
                MenuData.ValidPreviousChapters.Count == 0)
            {
                Global.game_system     = new Game_System();
                Global.game_battalions = new Game_Battalions();
                Global.game_actors     = new Game_Actors();

                chapterData = Global.chapter_by_index(this.Redirect).Preset_Data;
            }
            else
            {
                LoadData();
                Global.game_battalions.current_battalion =
                    Global.chapter_by_index(this.Redirect).Battalion;
                Global.game_actors.heal_battalion();
                // Not sure why this happens //Yeti
                // what conflicts are caused by using the loaded system //Yeti
                var system = Global.game_system;
                Global.game_system = system.copy();
                // For now, setting the event data so it shows up in the monitor //Yeti
                Global.game_system.set_event_data(system.SWITCHES, system.VARIABLES);

                chapterData = new TactileLibrary.Preset_Chapter_Data
                {
                    Lord_Lvl = Global.game_actors[Global.chapter_by_index(this.Redirect).World_Map_Lord_Id].level,
                    Units    = Global.chapter_by_index(this.Redirect).Preset_Data.Units + Global.battalion.actors.Count,
                    Gold     = Global.chapter_by_index(this.Redirect).Preset_Data.Gold + Global.battalion.gold,
                    Playtime = system.total_play_time
                };
            }

            DataWindow.set(
                Global.chapter_by_index(this.Redirect).ShortName,
                Global.chapter_by_index(this.Redirect).World_Map_Lord_Id,
                chapterData);

            Global.game_system.Difficulty_Mode = difficulty;

            UnitWindowAvailable = Global.game_system.Style != Mode_Styles.Classic &&
                                  Global.battalion != null && Global.battalion.actors.Any();
            // Block ranking window if this chapter is unranked
            RankingWindowAvailable =
                !Global.data_chapters[MenuData.ChapterId].Unranked &&
                Global.save_file.ContainsKey(MenuData.ChapterId);

            RefreshInputHelp();
            RefreshPreviousChapterSelected();
        }
 internal Preset_Chapter_Data(Preset_Chapter_Data data)
 {
     Lord_Lvl = data.Lord_Lvl;
     Units    = data.Units;
     Gold     = data.Gold;
     Playtime = data.Playtime;
 }
        internal static Preset_Chapter_Data Read(BinaryReader input)
        {
            Preset_Chapter_Data result = new Preset_Chapter_Data();

            result.Lord_Lvl = input.ReadInt32();
            result.Units    = input.ReadInt32();
            result.Gold     = input.ReadInt32();
            result.Playtime = input.ReadInt32();
            return(result);
        }
        public override void CopyFrom(TactileDataContent other)
        {
            CheckSameClass(other);

            var chapter = (Data_Chapter)other;

            Id = chapter.Id;
            Progression_Ids        = new List <string>(chapter.Progression_Ids);
            Prior_Chapters         = new List <string>(chapter.Prior_Chapters);
            Prior_Ranking_Chapters = new List <string>(chapter.Prior_Ranking_Chapters);
            Completed_Chapters     = new List <string>(chapter.Completed_Chapters);
            Standalone             = chapter.Standalone;

            Label        = chapter.Label;
            LabelString  = chapter.LabelString;
            Chapter_Name = chapter.Chapter_Name;

            WorldMapNameFormatString   = chapter.WorldMapNameFormatString;
            DisplayNameFormatString    = chapter.DisplayNameFormatString;
            FileSelectNameFormatString = chapter.FileSelectNameFormatString;
            ShortNameFormatString      = chapter.ShortNameFormatString;
            ListNameFormatString       = chapter.ListNameFormatString;
            AlternateTitle             = chapter.AlternateTitle;

            Arc               = chapter.Arc;
            World_Map_Loc     = chapter.World_Map_Loc;
            World_Map_Lord_Id = chapter.World_Map_Lord_Id;

            Turn_Themes   = new List <string>(chapter.Turn_Themes);
            Battle_Themes = new List <string>(chapter.Battle_Themes);

            Battalion     = chapter.Battalion;
            Text_Key      = chapter.Text_Key;
            Event_Data_Id = chapter.Event_Data_Id;

            Unranked           = chapter.Unranked;
            Ranking_Turns      = chapter.Ranking_Turns;
            Ranking_Combat     = chapter.Ranking_Combat;
            Ranking_Exp        = chapter.Ranking_Exp;
            Ranking_Completion = chapter.Ranking_Completion;

            Preset_Data = new Preset_Chapter_Data(chapter.Preset_Data);
        }
        public override void Read(BinaryReader input)
        {
            Id = input.ReadString();
            Prior_Chapters.read(input);
            Prior_Ranking_Chapters.read(input);
            Completed_Chapters.read(input);
            Standalone = input.ReadBoolean();

            Label        = (ChapterLabels)input.ReadInt32();
            LabelString  = input.ReadString();
            Chapter_Name = input.ReadString();

            WorldMapNameFormatString   = input.ReadString();
            DisplayNameFormatString    = input.ReadString();
            FileSelectNameFormatString = input.ReadString();
            ShortNameFormatString      = input.ReadString();
            ListNameFormatString       = input.ReadString();
            AlternateTitle             = input.ReadString();

            Arc               = input.ReadString();
            World_Map_Loc     = World_Map_Loc.read(input);
            World_Map_Lord_Id = input.ReadInt32();

            Turn_Themes.read(input);
            Battle_Themes.read(input);

            Battalion     = input.ReadInt32();
            Text_Key      = input.ReadString();
            Event_Data_Id = input.ReadString();

            Unranked           = input.ReadBoolean();
            Ranking_Turns      = input.ReadInt32();
            Ranking_Combat     = input.ReadInt32();
            Ranking_Exp        = input.ReadInt32();
            Ranking_Completion = input.ReadInt32();

            Preset_Data = Preset_Chapter_Data.Read(input);

            Progression_Ids.read(input);
        }