Ejemplo n.º 1
0
        protected void initialize_images()
        {
            // Lord
            Lord_Sprite              = new Character_Sprite();
            Lord_Sprite.draw_offset  = new Vector2(0, 4); // (0, 8); //Debug
            Lord_Sprite.facing_count = 3;
            Lord_Sprite.frame_count  = 3;
            Lord_Sprite.stereoscopic = Config.MAP_UNITS_DEPTH;
            Lord_Sprite.mirrored     = Constants.Team.flipped_map_sprite(
                Constants.Team.PLAYER_TEAM);
            // Map
            Map = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/Panoramas/Worldmap"));
            Map.stereoscopic      = Config.MAP_MAP_DEPTH;
            Zoomed_Out_Map        = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/Panoramas/Worldmap"));
            Zoomed_Out_Map.loc    = new Vector2(Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT) / 2;
            Zoomed_Out_Map.offset = new Vector2(Zoomed_Out_Map.texture.Width, Zoomed_Out_Map.texture.Height) / 2;
            Zoomed_Out_Map.scale  = new Vector2(
                Math.Max((float)(Config.WINDOW_WIDTH + Config.WMAP_ZOOMED_DEPTH * 4) / Zoomed_Out_Map.texture.Width,
                         (float)(Config.WINDOW_HEIGHT) / Zoomed_Out_Map.texture.Height));//Debug
            Zoomed_Out_Map.opacity      = 0;
            Zoomed_Out_Map.stereoscopic = Config.WMAP_ZOOMED_DEPTH;

            Minimap       = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/Panoramas/Worldmap"));
            Minimap.scale = Constants.WorldMap.WORLDMAP_MINIMAP_SCALE;
            Minimap.loc   = new Vector2(Config.WINDOW_WIDTH - 1, Config.WINDOW_HEIGHT - 1) +
                            Constants.WorldMap.WORLDMAP_MINIMAP_OFFSET;
            Minimap.offset       = new Vector2(Minimap.texture.Width, Minimap.texture.Height);
            Minimap.stereoscopic = Config.WMAP_MINIMAP_DEPTH;

            Minimap_Backing       = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/White_Square"));
            Minimap_Backing.scale = new Vector2((((int)Math.Round(Minimap.scale.X * Minimap.texture.Width) + 2) / (float)Minimap_Backing.texture.Width),
                                                (((int)Math.Round(Minimap.scale.Y * Minimap.texture.Height) + 2) / (float)Minimap_Backing.texture.Height));
            Minimap_Backing.loc = new Vector2(Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT) +
                                  Constants.WorldMap.WORLDMAP_MINIMAP_OFFSET;
            Minimap_Backing.offset       = new Vector2(Minimap_Backing.texture.Width, Minimap_Backing.texture.Height);
            Minimap_Backing.tint         = new Color(0, 0, 0, 255);
            Minimap_Backing.stereoscopic = Config.WMAP_MINIMAP_DEPTH;

            ViewArea = new World_Minimap_ViewArea(new Vector2((int)Math.Round(Config.WINDOW_WIDTH * Minimap.scale.X) + 2,
                                                              (int)Math.Round(Config.WINDOW_HEIGHT * Minimap.scale.Y) + 2));
            ViewArea.loc = Minimap.loc - new Vector2((int)Math.Round(Minimap.scale.X * Minimap.texture.Width),
                                                     (int)Math.Round(Minimap.scale.Y * Minimap.texture.Height)) - new Vector2(1, 1) -
                           new Vector2((int)Math.Round(Config.WINDOW_WIDTH * Minimap.scale.X) + 2,
                                       (int)Math.Round(Config.WINDOW_HEIGHT * Minimap.scale.Y) + 2) / 2;
            ViewArea.stereoscopic = Config.WMAP_MINIMAP_DEPTH;

            MenuManager = new WorldmapMenuManager(this, MenuData);
        }
Ejemplo n.º 2
0
        private void update_worldmap_command()
        {
            switch (Phase)
            {
            case Worldmap_Phases.Fade_In:
                switch (Timer)
                {
                default:
                    // If autoselecting a chapter with no world map event
                    if (MenuData.AutoSelectChapter && GetWorldmapEvent() == null)
                    {
                        // If hard mode is blocked, nevermind
                        if (!IsBlockedHardMode(MenuData.ChapterId))
                        {
                            MenuManager = null;
                            start_chapter();
                            break;
                        }
                    }

                    if (Fade_Timer > 0)
                    {
                        Fade_Timer--;
                    }
                    if (Fade_Timer == Constants.WorldMap.WORLDMAP_FADE_TIME / 4)
                    {
                        if (!MenuData.AutoSelectChapter)
                        {
                            Global.Audio.PlayBgm(Constants.WorldMap.WORLDMAP_THEME);
                        }
                    }
                    if (Fade_Timer == 0)
                    {
                        Phase = Worldmap_Phases.Command_Process;
                    }
                    break;
                }
                break;

            case Worldmap_Phases.Command_Process:
                if (MenuData.AutoSelectChapter)
                {
                    select_chapter_fade();
                }
                break;

            case Worldmap_Phases.Controls_Fade:
                if (Hard_Mode_Blocked_Window != null)
                {
                    Hard_Mode_Blocked_Window.update();
                    if (Hard_Mode_Blocked_Window.is_ready)
                    {
                        if (Hard_Mode_Blocked_Window.selected_index().IsSomething)
                        {
                            Global.game_system.play_se(System_Sounds.Confirm);
                            Hard_Mode_Blocked_Window = null;
                        }
                    }
                }
                else
                {
                    if (Fade_Timer > 0)
                    {
                        Fade_Timer--;
                        MenuOffset += new Vector2(-1, 0);
                    }
                    if (Fade_Timer == 0 && !scrolling)
                    {
                        MenuManager = null;
                        start_chapter_worldmap_event();
                    }
                }
                break;

            case Worldmap_Phases.Worldmap_Event:
                if (!Global.game_system.is_interpreter_running)
                {
                    Phase      = Worldmap_Phases.Fade_Out;
                    Fade_Timer = Constants.WorldMap.WORLDMAP_FADE_TIME;
                    Global.Audio.BgmFadeOut(Constants.WorldMap.WORLDMAP_FADE_TIME);
                }
                break;

            case Worldmap_Phases.Fade_Out:
                if (Fade_Timer > 0)
                {
                    Fade_Timer--;
                }
                if (Fade_Timer == 0)
                {
                    start_chapter();
                }
                break;

            case Worldmap_Phases.Return_To_Title:
                if (Fade_Timer > 0)
                {
                    Fade_Timer--;
                }
                if (Fade_Timer == 0)
                {
                    Global.scene_change("Scene_Title_Load");
                    MenuManager = null;
                }
                break;
            }
        }