コード例 #1
0
        public override void Draw(SpriteBatch sprite_batch, Vector2 draw_offset = default(Vector2))
        {
            Vector2 loc = (draw_offset + this.offset) -
                          (this.loc + this.draw_offset + stereo_offset());

            Window.draw(sprite_batch, loc);
            if (Active)
            {
                Chapter.draw(sprite_batch, loc);
            }
            else
            {
                Short_Chapter.draw(sprite_batch, loc);
            }
            if (Save_Id != -1)
            {
                Save_Label.draw(sprite_batch, loc);
                Save.draw(sprite_batch, loc);
            }
            if (!New_Game)
            {
                if (!Active)
                {
                    Style.draw(sprite_batch, loc - new Vector2(72, -16));
                }
                else
                {
                    Mode.draw(sprite_batch, loc);
                    Style.draw(sprite_batch, loc);
                    Map_Save.draw(sprite_batch, loc);
                    Suspend.draw(sprite_batch, loc);
                }
            }
        }
コード例 #2
0
        public void set_data(int save_id)
        {
            Save_Id = save_id;
            // If no save exists
            if (Save_Id == -1 || Global.save_files_info == null || !Global.save_files_info.ContainsKey(Save_Id))
            {
                if (Window is System_Color_Window)
                {
                    var window = Window as System_Color_Window;
                    if (Global.save_files_info == null || !Global.save_files_info.ContainsKey(Save_Id))
                    {
                        window.color_override = Constants.Difficulty.DIFFICULTY_COLOR_REDIRECT[Difficulty_Modes.Normal];
                    }
                    else
                    {
                        window.color_override = Constants.Difficulty.DIFFICULTY_COLOR_REDIRECT[Global.save_files_info[Save_Id].difficulty];
                    }
                }
                New_Game           = true;
                Chapter.text       = Short_Chapter.text = "-----";
                Short_Chapter.text = "-----";
            }
            else
            {
                New_Game = false;

                Tactile.IO.Save_Info info = Global.save_files_info[Save_Id];
                if (Window is System_Color_Window)
                {
                    (Window as System_Color_Window).color_override =
                        Constants.Difficulty.DIFFICULTY_COLOR_REDIRECT[info.difficulty];
                }
                if (string.IsNullOrEmpty(info.chapter_id))
                {
                    Chapter.text = Short_Chapter.text = "New Game";
                }
                else
                {
                    string actual_chapter_id = !Global.data_chapters.ContainsKey(info.chapter_id) ?
                                               info.chapter_id.Substring(0, info.chapter_id.Length - 1) : info.chapter_id;

                    if (Global.data_chapters.ContainsKey(info.chapter_id))
                    {
                        Chapter.text       = Global.data_chapters[info.chapter_id].FileSelectName;
                        Short_Chapter.text = Global.data_chapters[info.chapter_id].ShortName;
                    }
                    else
                    {
                        Chapter.text       = info.chapter_id;
                        Short_Chapter.text = info.chapter_id;
                    }
                }
                Mode.text  = info.difficulty.ToString();
                Style.text = info.style.ToString();
                Map_Save.SetColor(Global.Content, info.map_save_exists ? "White" : "Grey");
                Suspend.SetColor(Global.Content, info.suspend_exists ? "White" : "Grey");
            }
            if (Save_Id != -1)
            {
                Save.text = Save_Id.ToString();
            }
        }