Example #1
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();
            }
        }
Example #2
0
        protected override void UpdateMenu(bool active)
        {
            update_map_sprite();
            Cursor.update();
            Counter.update();
            Left_Page_Arrow.update();
            Right_Page_Arrow.update();

            base.UpdateMenu(active);

            if (ChangingPage)
            {
                (PageLoc.X < target_page_loc.X ? Right_Page_Arrow : Left_Page_Arrow).twirling_update();
                float distance = Math.Abs(PageLoc.X - target_page_loc.X) / 2;
                distance  = MathHelper.Clamp(MathHelper.Lerp(0, distance, ChangingPageTime / 12f), 0, distance);
                distance  = Math.Min(distance, 32);
                distance  = Math.Max(distance, 1);
                distance  = (float)Math.Pow(2, Math.Round(Math.Log(distance, 2)));
                PageLoc.X = (float)Additional_Math.double_closer(PageLoc.X, target_page_loc.X, (int)distance);

                ChangingPageTime++;
                if (PageLoc.X == target_page_loc.X)
                {
                    ChangingPage = false;
                }
            }
        }
Example #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();
        }