Ejemplo n.º 1
0
        protected override void update_movement(bool input)
        {
            Up_Page_Arrow.update();
            Down_Page_Arrow.update();

            if (Global.Input.mouse_triggered(MouseButtons.Left, false))
            {
            }

            //Down_Page_Arrow.angle += MathHelper.Pi / 360f;
            //Down_Page_Arrow.mirrored = !Down_Page_Arrow.mirrored;

            if (Global.Input.mouseScroll > 0)
            {
                Up_Page_Arrow_ArrowClicked(this, null);
            }
            else if (Global.Input.mouseScroll < 0)
            {
                Down_Page_Arrow_ArrowClicked(this, null);
            }
            else
            {
                Up_Page_Arrow.UpdateInput(-(loc + draw_offset));
                Down_Page_Arrow.UpdateInput(-(loc + draw_offset));
            }

            base.update_movement(input);
        }
Ejemplo n.º 2
0
        protected override void update_input(bool active)
        {
            bool input = active && this.ready_for_inputs;

            update_node_location(input);
            if (CancelButton != null)
            {
                CancelButton.Update(input);
            }

            if (input)
            {
                if (Global.Input.mouseScroll > 0)
                {
                    Up_Page_Arrow_ArrowClicked(this, null);
                }
                else if (Global.Input.mouseScroll < 0)
                {
                    Down_Page_Arrow_ArrowClicked(this, null);
                }
                else
                {
                    Up_Page_Arrow.UpdateInput();
                    Down_Page_Arrow.UpdateInput();
                }

                var settings_index = SettingsNodes.consume_triggered(
                    MouseButtons.Left, TouchGestures.Tap);
                bool soloanim_node_clicked = false;
                if (settings_index.IsSomething)
                {
                    var node = SettingsNodes[settings_index];
                    jump_to_option(SettingsNodes.ActiveNode);

                    byte setting = setting_from_node(node);
                    if (!this.active_option_data.Gauge && setting != this.current_setting)
                    {
                        Global.game_system.play_se(System_Sounds.Menu_Move2);
                        change_setting(OptionsNodes.ActiveNode.Option, setting);
                        return;
                    }

                    soloanim_node_clicked = this.active_option == (int)Constants.Options.Animation_Mode &&
                                            SettingsGroups[OptionsNodes.ActiveNodeIndex].IndexOf(node) ==
                                            (int)Constants.Animation_Modes.Solo;
                }
                var slider_index = SettingsNodes.consume_triggered(TouchGestures.Scrubbing);
                if (slider_index.IsSomething)
                {
                    var node = SettingsNodes[slider_index];
                    jump_to_option(SettingsNodes.ActiveNode);

                    byte setting = setting_from_node(node);
                    if (setting != this.current_setting)
                    {
                        Global.game_system.play_se(System_Sounds.Menu_Move2);
                        ManualScroll = false;
                    }
                    change_setting(OptionsNodes.ActiveNode.Option, setting);
                    return;
                }

                if (Global.Input.repeated(Inputs.Left))
                {
                    if (can_move_left)
                    {
                        Global.game_system.play_se(System_Sounds.Menu_Move2);
                        move_left();
                    }
                }
                else if (Global.Input.repeated(Inputs.Right))
                {
                    if (can_move_right)
                    {
                        Global.game_system.play_se(System_Sounds.Menu_Move2);
                        move_right();
                    }
                }
                else if (Global.Input.triggered(Inputs.B) ||
                         CancelButton.consume_trigger(MouseButtons.Left) ||
                         CancelButton.consume_trigger(TouchGestures.Tap))
                {
                    Global.game_system.play_se(System_Sounds.Cancel);
                    if (Map_Info_Changed && Global.scene.is_map_scene)
                    {
                        ((Scene_Map)Global.scene).create_info_windows();
                    }
                    close();
                }
                else if (this.on_soloanim && SoloAnim_Allowed &&
                         (Global.Input.triggered(Inputs.A) || soloanim_node_clicked))
                {
                    if (SoloAnim != null)
                    {
                        Global.game_system.play_se(System_Sounds.Confirm);
                        SoloAnim(this, new EventArgs());
                    }
                }
            }
        }