Ejemplo n.º 1
0
        public virtual void update(bool active)
        {
            CommandWindow.update(active && Active && ready);
            bool moved = this.index != CommandWindow.index;

            this.index  = CommandWindow.index;
            this.scroll = CommandWindow.scroll;

            if (moved)
            {
                refresh_loc();
            }

            if (active && Active && ready)
            {
                update_input();
            }
            if (!ready)
            {
                update_page_change();
            }
            if (is_help_active)
            {
                Help_Window.update();
            }
            Left_Arrow.update();
            Right_Arrow.update();
        }
Ejemplo n.º 2
0
        protected override void UpdateMenu(bool active)
        {
            // Block inputs while waiting for IO
            if (WaitingForIO)
            {
                if (!Global.copying && !Global.move_file && !Global.delete_file)
                {
                    this.waiting_for_io = false;
                    refresh_page();
                }
                else
                {
                    active = false;
                }
            }

            Cursor.update();
            Left_Page_Arrow.update();
            Right_Page_Arrow.update();

            if (active)
            {
                update_input();
            }
            update_ui(active);

            if (Moving)
            {
                update_move_darken();
            }
        }
Ejemplo n.º 3
0
        protected override void UpdateMenu(bool active)
        {
            update_map_sprite();
            update_direction();
            // Black Screen
            update_black_screen();
            // Inputs
            bool input = active && Delay == 0 && !Closing && Black_Screen_Timer <= 0;

#if DEBUG
            if (Help_Window != null && input && Global.Input.pressed(Inputs.X))
            {
                DirectionFlags dir = Global.Input.dir_triggered();
                if (dir != DirectionFlags.None)
                {
                    StatusNodes[page].ActiveNode.cheat(this.unit, dir);
                    move_to(Help_Index);
                    Help_Window.add_remaining_text();

                    foreach (var status_page in Pages)
                    {
                        status_page.refresh(this.unit);
                    }
                    foreach (StatusUINode node in TopPanelNodes)
                    {
                        node.refresh(unit);
                    }
                }
                input = false;
            }
#endif

            // Cancel button
            CancelButton.Update(input);

            StatusNodes[page].Update(!input ? ControlSet.None :
                                     (Help_Window != null ?
                                      ControlSet.Movement : (ControlSet.Mouse | ControlSet.Touch)));

            if (input)
            {
                if (Help_Window == null)
                {
                    update_input();

                    var help_index = StatusNodes[page].consume_triggered(
                        MouseButtons.Left, TouchGestures.Tap);
                    if (help_index.IsNothing)
                    {
                        help_index = StatusNodes[page].consume_triggered(
                            TouchGestures.LongPress);
                    }

                    if (help_index.IsSomething)
                    {
                        Help_Index = StatusNodes[page][help_index].HelpLabel;
                        open_help();
                    }
                }
                else
                {
                    if (StatusNodes[page].ActiveNode.HelpLabel != Help_Index)
                    {
                        move_to(StatusNodes[page].ActiveNode.HelpLabel);
                    }

                    var help_index = StatusNodes[page].consume_triggered(
                        MouseButtons.Left, TouchGestures.Tap);
                    var help_cancel_index = StatusNodes[page].consume_triggered(
                        TouchGestures.LongPress);

                    if (Global.Input.triggered(Inputs.B) ||
                        Global.Input.triggered(Inputs.R) ||
                        Global.Input.mouse_click(MouseButtons.Right) ||
                        help_cancel_index.IsSomething ||
                        CancelButton.consume_trigger(MouseButtons.Left) ||
                        CancelButton.consume_trigger(TouchGestures.Tap))
                    {
                        close_help();
                    }

                    /* //Debug
                     * if (Global.Input.repeated(Inputs.Down))
                     * {
                     *  if (move(2))
                     *  {
                     *
                     *  }
                     * }
                     * if (Global.Input.repeated(Inputs.Up))
                     * {
                     *  if (move(8))
                     *  {
                     *
                     *  }
                     * }
                     * if (Global.Input.repeated(Inputs.Right))
                     * {
                     *  if (move(6))
                     *  {
                     *
                     *  }
                     * }
                     * if (Global.Input.repeated(Inputs.Left))
                     * {
                     *  if (move(4))
                     *  {
                     *
                     *  }
                     * }
                     * else if (Global.Input.triggered(Inputs.R) || Global.Input.triggered(Inputs.B))
                     * {
                     *  close_help();
                     * }*/
                }
                StatusCursors[page].update();
            }

            if (Help_Window != null)
            {
                Help_Window.update();
            }
            Background.update();
            // Top Panel
            Top_Panel.update();
            foreach (TextSprite label in Battle_Stat_Labels)
            {
                label.update();
            }
            // Pages
            foreach (Status_Page status_page in Pages)
            {
                status_page.update();
            }
            Left_Page_Arrow.update();
            Right_Page_Arrow.update();
        }
Ejemplo n.º 4
0
 public void update()
 {
     Counter.update();
     Left_Arrow.update();
     Right_Arrow.update();
 }
Ejemplo n.º 5
0
        public void update()
        {
            UpArrow.update();
            DownArrow.update();

            float max_speed;

            if (Input.ControlScheme == ControlSchemes.Buttons)
            {
                max_speed = (Global.Input.speed_up_input() ? 2 : 1) *
                            Config.CONVO_BACKLOG_MAX_SCROLL_SPEED;
            }
            else if (Input.ControlScheme == ControlSchemes.Mouse)
            {
                max_speed = 5f * Config.CONVO_BACKLOG_MAX_SCROLL_SPEED;
            }
            else
            {
                max_speed = Config.WINDOW_HEIGHT;
            }

            // Pan out
            if (PanTimer > 0 && !Fading_In)
            {
                PanTimer--;
                int pan = Config.CONVO_BACKLOG_PAN_OUT_TIME - PanTimer;
                // Set full alpha if the pan is over
                int alpha = 255;
                if (PanTimer > 0)
                {
                    alpha = Math.Min(255, PanTimer * 256 / Config.CONVO_BACKLOG_PAN_OUT_TIME);
                }
                Color tint = new Color(alpha, alpha, alpha, alpha);
                foreach (var text in Text)
                {
                    text.draw_offset = new Vector2(
                        -(int)Math.Pow(pan, 1.8f), 0);
                    text.tint = tint;
                }
            }
            else if (FadeTimer > 0)
            {
                FadeTimer--;
                Black_Fill.tint = new Color(0, 0, 0,
                                            ((Fading_In ? (Config.CONVO_BACKLOG_FADE_TIME - FadeTimer) : FadeTimer) *
                                             Config.CONVO_BACKLOG_BG_OPACITY) /
                                            Config.CONVO_BACKLOG_FADE_TIME);
            }
            // Pan in
            else if (PanTimer > 0)
            {
                PanTimer--;
                int   pan   = Config.CONVO_BACKLOG_PAN_IN_TIME - PanTimer;
                int   alpha = Math.Min(255, pan * 256 / Config.CONVO_BACKLOG_PAN_IN_TIME);
                Color tint  = new Color(alpha, alpha, alpha, alpha);
                foreach (var text in Text)
                {
                    text.draw_offset = new Vector2(
                        -(int)Math.Pow(PanTimer, 1.8f), 0);
                    text.tint = tint;
                }
            }
            if (FadeTimer == 0 && PanTimer == 0)
            {
                Fading_In = false;
            }

            if (ready)
            {
                update_input(max_speed);
            }
            Scroll_Speed = MathHelper.Clamp(Scroll_Speed, -max_speed, max_speed);
            Offset.Y     = MathHelper.Clamp(Offset.Y + Scroll_Speed, this.min_offset, this.max_offset);

            UpArrow.visible   = Offset.Y > this.min_offset;
            DownArrow.visible = Offset.Y < this.max_offset;
        }