Inheritance: UpperRightAction
Exemple #1
0
 public void CreateToolBar(Gtk.Toolbar toolbar)
 {
     toolbar.AppendItem(new Gtk.SeparatorToolItem());
     toolbar.AppendItem(ZoomOut.CreateToolBarItem());
     toolbar.AppendItem(ZoomComboBox);
     toolbar.AppendItem(ZoomIn.CreateToolBarItem());
 }
 void Start()
 {
     followPlayer = camera.GetComponent <FollowPlayer>();
     zoomOut      = GetComponent <ZoomOut>();
     shake        = GetComponent <Shake>();
     zoomIn       = camera.GetComponent <ZoomIn>();
 }
        //private readonly int MAX_CHANNEL = 4;


        public MainWindow()
        {
            InitializeComponent();

            ZoomOut.AddHandler(UIElement.MouseLeftButtonDownEvent, new RoutedEventHandler(ZoomOut_Click), true);
            ZoomOut.AddHandler(UIElement.MouseLeftButtonUpEvent, new RoutedEventHandler(ZoomStop_Click), true);

            ZoomIn.AddHandler(UIElement.MouseLeftButtonDownEvent, new RoutedEventHandler(ZoomIn_Click), true);
            ZoomIn.AddHandler(UIElement.MouseLeftButtonUpEvent, new RoutedEventHandler(ZoomStop_Click), true);

            ShowInTaskbar = false;

            string name = this.GetType().Name;

            this.StateChanged += new EventHandler(MainWindow_StateChanged);
            //this.StateChanged += MainWindow_StateChanged;

            winInfoIni.ReadIni();
            systemIpAddrInfo.ReadIni(1);
            //ReadIni();

            ch1Btn.IsChecked = true;//라디오 버튼이 선택된거와같이 이벤트가 발생함 ch1Btn_Checked
            //ReadIniChannelInfo(1);

            Minimize();
        }
Exemple #4
0
        public void RegisterActions(Gtk.Application app, GLib.Menu menu)
        {
            var zoom_section = new GLib.Menu();

            menu.AppendSection(null, zoom_section);

            app.AddAccelAction(ZoomIn, new[] { "<Primary>plus", "<Primary>equal", "equal", "<Primary>KP_Add", "KP_Add" });
            zoom_section.AppendItem(ZoomIn.CreateMenuItem());

            app.AddAccelAction(ZoomOut, new[] { "<Primary>minus", "<Primary>underscore", "minus", "<Primary>KP_Subtract", "KP_Subtract" });
            zoom_section.AppendItem(ZoomOut.CreateMenuItem());

            app.AddAccelAction(ActualSize, new[] { "<Primary>0", "<Primary><Shift>A" });
            zoom_section.AppendItem(ActualSize.CreateMenuItem());

            app.AddAccelAction(ZoomToWindow, "<Primary>B");
            zoom_section.AppendItem(ZoomToWindow.CreateMenuItem());

            app.AddAccelAction(Fullscreen, "F11");
            zoom_section.AppendItem(Fullscreen.CreateMenuItem());

            var metric_section = new GLib.Menu();

            menu.AppendSection(null, metric_section);

            var metric_menu = new GLib.Menu();

            metric_section.AppendSubmenu(Translations.GetString("Ruler Units"), metric_menu);

            app.AddAction(RulerMetric);
            metric_menu.Append(Translations.GetString("Pixels"), $"app.{RulerMetric.Name}(0)");
            metric_menu.Append(Translations.GetString("Inches"), $"app.{RulerMetric.Name}(1)");
            metric_menu.Append(Translations.GetString("Centimeters"), $"app.{RulerMetric.Name}(2)");

            var show_hide_section = new GLib.Menu();

            menu.AppendSection(null, show_hide_section);

            var show_hide_menu = new GLib.Menu();

            show_hide_section.AppendSubmenu(Translations.GetString("Show/Hide"), show_hide_menu);

            app.AddAction(PixelGrid);
            show_hide_menu.AppendItem(PixelGrid.CreateMenuItem());

            app.AddAction(Rulers);
            show_hide_menu.AppendItem(Rulers.CreateMenuItem());

            app.AddAction(ToolBar);
            show_hide_menu.AppendItem(ToolBar.CreateMenuItem());

            app.AddAction(StatusBar);
            show_hide_menu.AppendItem(StatusBar.CreateMenuItem());

            app.AddAction(ToolBox);
            show_hide_menu.AppendItem(ToolBox.CreateMenuItem());

            app.AddAction(ImageTabs);
            show_hide_menu.AppendItem(ImageTabs.CreateMenuItem());
        }
Exemple #5
0
 public void CreateStatusBar(Statusbar statusbar)
 {
     statusbar.AppendItem(ZoomIn.CreateToolBarItem());
     statusbar.AppendItem(ZoomComboBox);
     statusbar.AppendItem(ZoomOut.CreateToolBarItem());
     statusbar.AppendItem(new SeparatorToolItem {
         Margin = 6
     }, 6);
 }
Exemple #6
0
 private void Awake()
 {
     canvas        = GetComponentInParent <Canvas>();
     rectTransform = GetComponent <RectTransform>();
     canvasGroup   = GetComponent <CanvasGroup>();
     po            = GetComponent <PanelOpener>(); // asignare
     my_long_click = GetComponent <LongClick>();
     zoom_plus     = GetComponent <ZoomIn>();
     zoom_minus    = GetComponent <ZoomOut>();
     SubMenu       = transform.parent.transform.Find("Sub menu").gameObject;
 }
Exemple #7
0
        public void CreateMainMenu(Gtk.Menu menu)
        {
            MenuItem show_pad = (MenuItem)menu.Children[0];

            menu.Remove(show_pad);

            menu.Append(ToolBar.CreateMenuItem());
            menu.Append(PixelGrid.CreateMenuItem());
            menu.Append(Rulers.CreateMenuItem());
            menu.Append(ImageTabs.CreateMenuItem());
            menu.AppendSeparator();

            ImageMenuItem zoomin = ZoomIn.CreateAcceleratedMenuItem(Gdk.Key.plus, Gdk.ModifierType.ControlMask);

            zoomin.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.equal, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            zoomin.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.equal, 0, AccelFlags.Visible));
            zoomin.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.KP_Add, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            zoomin.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.KP_Add, 0, AccelFlags.Visible));
            menu.Append(zoomin);

            ImageMenuItem zoomout = ZoomOut.CreateAcceleratedMenuItem(Gdk.Key.minus, Gdk.ModifierType.ControlMask);

            zoomout.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.minus, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            zoomout.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.minus, 0, AccelFlags.Visible));
            zoomout.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.KP_Subtract, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
            zoomout.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.KP_Subtract, 0, AccelFlags.Visible));
            menu.Append(zoomout);

            ImageMenuItem actualsize = ActualSize.CreateAcceleratedMenuItem(Gdk.Key.Key_0, Gdk.ModifierType.ControlMask);

            actualsize.AddAccelerator("activate", PintaCore.Actions.AccelGroup, new AccelKey(Gdk.Key.A, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask, AccelFlags.Visible));
            menu.Append(actualsize);
            menu.Append(ZoomToWindow.CreateAcceleratedMenuItem(Gdk.Key.B, Gdk.ModifierType.ControlMask));
            //menu.Append (ZoomToSelection.CreateAcceleratedMenuItem (Gdk.Key.B, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask));
            menu.Append(Fullscreen.CreateAcceleratedMenuItem(Gdk.Key.F11, Gdk.ModifierType.None));

            menu.AppendSeparator();

            Gtk.Action unit_action = new Gtk.Action("RulerUnits", Mono.Unix.Catalog.GetString("Ruler Units"), null, null);
            Menu       unit_menu   = (Menu)menu.AppendItem(unit_action.CreateSubMenuItem()).Submenu;

            unit_menu.Append(Pixels.CreateMenuItem());
            unit_menu.Append(Inches.CreateMenuItem());
            unit_menu.Append(Centimeters.CreateMenuItem());

            menu.AppendSeparator();
            menu.Append(show_pad);
        }
 void AssociatedObject_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
 {
     if ((Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) && Form != null)
     {
         if (e.Delta > 0 && ZoomIn != null)
         {
             ZoomIn.Execute(Form);
             e.Handled = true;
         }
         else if (e.Delta < 0 && ZoomOut != null)
         {
             ZoomOut.Execute(Form);
             e.Handled = true;
         }
     }
 }
Exemple #9
0
        private void synBox1_DoubleClick(object sender, EventArgs e)
        {
            if (_isFullScreen)
            {
                var height = this.Size.Height - (6 + 17);
                var widht  = this.Size.Width - (6 + 17);

                synBox1.Size     = new Size(widht, height);
                synBox1.Location = new Point(3, 3);
                synBox1.BringToFront();

                pictureBox1.BringToFront();
                pictureBox1.Location = new Point(3, Size.Height - 20);

                pictureBox2.BringToFront();
                pictureBox2.Height   = Size.Height - (6 + 17);
                pictureBox2.Location = new Point(Size.Width - 20, 3);

                pictureBox3.BringToFront();
                pictureBox3.Location = new Point(Size.Width - 18, 3);

                pictureBox4.BringToFront();
                pictureBox4.Location = new Point(Size.Width - 18, Size.Height - (16 + 17));

                pictureBox5.BringToFront();
                pictureBox5.Location = new Point(pictureBox5.Location.X, Size.Height - 18);

                pictureBox6.BringToFront();
                pictureBox6.Location = new Point(pictureBox6.Location.X, Size.Height - 18);

                vMyScrollBar.BringToFront();
                vMyScrollBar.Height   = Size.Height - (6 + 17 + 13 * 2);
                vMyScrollBar.Location = new Point(Size.Width - 18, 16);

                hMyScrollBar.BringToFront();
                hMyScrollBar.Location = new Point(hMyScrollBar.Location.X, Size.Height - 17);

                currentCol.BringToFront();
                currentCol.Location = new Point(currentCol.Location.X, Size.Height - 18);

                CurrentLine.BringToFront();
                CurrentLine.Location = new Point(CurrentLine.Location.X, Size.Height - 18);

                ZoomIn.BringToFront();
                ZoomIn.Location = new Point(ZoomIn.Location.X, Size.Height - 18);

                ZoomOut.BringToFront();
                ZoomOut.Location = new Point(ZoomOut.Location.X, Size.Height - 18);

                _isFullScreen = false;
            }
            else
            {
                synBox1.Location = new Point(4, 89);
                synBox1.Size     = new Size(Size.Width - 27, Size.Height - 153);
                synBox1.SendToBack();

                pictureBox1.Location = new Point(3, Size.Height - 63);

                pictureBox2.Height   = Size.Height - (63 + 89);
                pictureBox2.Location = new Point(Size.Width - 20, 89);

                pictureBox3.Location = new Point(Size.Width - 18, 89);
                pictureBox4.Location = new Point(Size.Width - 18, Size.Height - (17 + 63));

                pictureBox5.Location = new Point(pictureBox5.Location.X, Size.Height - 61);
                pictureBox6.Location = new Point(pictureBox6.Location.X, Size.Height - 61);

                vMyScrollBar.Height   = Size.Height - (6 + 17 + 13 * 2);
                vMyScrollBar.Location = new Point(Size.Width - 18, 16);
                hMyScrollBar.Location = new Point(hMyScrollBar.Location.X, Size.Height - 60);

                currentCol.Location  = new Point(currentCol.Location.X, Size.Height - 61);
                CurrentLine.Location = new Point(CurrentLine.Location.X, Size.Height - 61);

                ZoomIn.Location  = new Point(ZoomIn.Location.X, Size.Height - 61);
                ZoomOut.Location = new Point(ZoomOut.Location.X, Size.Height - 61);

                vScrollBar.SendToBack();
                hScrollBar.SendToBack();
                _isFullScreen = true;
            }
        }
 public void Handle(ZoomOut message)
 {
     _camera.ZoomLevel /= 1.5f;
 }
Exemple #11
0
 private void OnZoomOut()
 {
     ZoomOut?.Invoke(this, EventArgs.Empty);
 }
Exemple #12
0
 private void zoomMinusButton_Click(object sender, EventArgs e)
 {
     ZoomOut?.Invoke(0.1f);
 }
Exemple #13
0
    void Update()
    {
        controllerInputY = Input.GetAxis("Vertical");
        controllerInputX = Input.GetAxis("Horizontal");
        DPadX            = Input.GetAxis("DPadX");

        //This is a band-aid. When I rework glide movement I will remove the X and Y animation parameters and replace it with a single "forward" parameter.
        playerAnim.SetFloat(HashTable.controllerXParam, controllerInputX);
        playerAnim.SetFloat(HashTable.controllerYParam, controllerInputY);


        //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

        //LEFT STICK MOVEMENT
        if ((controllerInputX > .1f || controllerInputX < -.1f) || (controllerInputY > .1f || controllerInputY < -.1f))
        {
            Movement?.Invoke(controllerInputX, controllerInputY);
        }
        else
        {
            MoveCancel?.Invoke();
        }

        //JUMP/GLIDE INITIATION
        //User presses the jump input, they can be on the ground, in the air, or in the gliding state.
        if (Input.GetKeyDown("joystick button 0"))
        {//The 'A' Button
            if (playerAnim.GetCurrentAnimatorStateInfo(0).fullPathHash == HashTable.jumpState)
            {
                Glide?.Invoke();
            }
            else
            {//Cant use switch statement because animation hashes aren't constant.
                if (playerAnim.GetCurrentAnimatorStateInfo(0).fullPathHash == HashTable.glideState)
                {
                    GlideCancel?.Invoke();
                }
                else
                {
                    Jump?.Invoke();
                }
            }
        }

        //INTERACT
        if (Input.GetKeyDown("joystick button 3"))
        {
            Interact?.Invoke();
        }

        //DODGE ROLL
        if (Input.GetKeyDown("joystick button 1") && (playerAnim.GetAnimatorTransitionInfo(0).fullPathHash != HashTable.motionToDodge))
        {//The B Button
            DodgeRoll?.Invoke();
        }

        //GROUND ATTACKS
        if (Input.GetKeyDown("joystick button 2") && playerAnim.GetBool(HashTable.onGroundParam)) //This is for initiating a ground combo
        {                                                                                         //The 'X' Button
            GroundAttacks?.Invoke();
        }

        //AIR ATTACKS
        if (!playerAnim.GetBool(HashTable.onGroundParam) && Input.GetKeyDown("joystick button 2")) //This is for initiating an air combo
        {                                                                                          //The 'X' Button
            AirAttacks?.Invoke();
        }

        //CYCLE ITEMS FORWARD
        if (Mathf.Approximately(DPadX, 1f) && !alreadyDone)
        {
            alreadyDone = true;
            CycleItemsForward?.Invoke();
        }
        if (Mathf.Approximately(DPadX, 0f) && alreadyDone)
        {
            alreadyDone = false;
        }

        //CYCLE ITEMS BACKWARD
        if (Mathf.Approximately(DPadX, -1f) && !alreadyDone)
        {
            alreadyDone = true;
            CycleItemsBackward?.Invoke();
        }
        if (Mathf.Approximately(DPadX, 0f) && alreadyDone)
        {
            alreadyDone = false;
        }

        //ZOOM IN CAMERA
        if (Mathf.Approximately(Input.GetAxis("DPadY"), 1f))
        {//DPad Y "Down"
            ZoomIn?.Invoke();
        }

        //ZOOM OUT CAMERA
        if (Mathf.Approximately(Input.GetAxis("DPadY"), -1f))
        {//DPad Y "Up"
            ZoomOut?.Invoke();
        }

        //CHOOSE ITEM
        if (Input.GetKeyDown("joystick button 4"))
        {//Right Bumper
            if (playerAnim.GetCurrentAnimatorStateInfo(0).fullPathHash == HashTable.glideState)
            {
                GameManagerScript.instance.inputManager.GlideCancel();
            }
            ChooseItem?.Invoke();
        }

        //CAMERA TARGET MODE
        if (Input.GetKeyDown("joystick button 5"))
        {//Left Bumper
            CameraTargetMode?.Invoke();
        }

        //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    }
Exemple #14
0
        private void patchBtn_Click(object sender, EventArgs e)
        {
            try
            {
                if (!File.Exists(this.exePath + ".bak"))
                {
                    File.Copy(this.exePath, this.exePath + ".bak");
                    this.backupBtn.Visible = true;
                }

                var resultSb = new StringBuilder("Patcher v2 :: Created by Zaczero\r\n\r\nPatch results:\r\n");
                var buffer   = File.ReadAllBytes(this.exePath);

                if (this.zoomOutCbox.Checked)
                {
                    if (ZoomOut.Process(ref buffer))
                    {
                        resultSb.AppendLine("ZoomHack (max) --> Success");
                    }
                    else
                    {
                        resultSb.AppendLine("ZoomHack (max) --> Fail");
                    }
                }

                if (this.zoomInCbox.Checked)
                {
                    if (ZoomIn.Process(ref buffer))
                    {
                        resultSb.AppendLine("ZoomHack (min) --> Success");
                    }
                    else
                    {
                        resultSb.AppendLine("ZoomHack (min) --> Fail");
                    }
                }

                if (this.oomCbox.Checked)
                {
                    if (OOM.Process(ref buffer))
                    {
                        resultSb.AppendLine("OOM --> Success");
                    }
                    else
                    {
                        resultSb.AppendLine("OOM --> Fail");
                    }
                }

                if (this.fovCbox.Checked)
                {
                    if (FOV.Process(ref buffer))
                    {
                        resultSb.AppendLine("FOV Changer --> Success");
                    }
                    else
                    {
                        resultSb.AppendLine("FOV Changer --> Fail");
                    }
                }

                if (this.topViewCbox.Checked)
                {
                    if (TopView.Process(ref buffer))
                    {
                        resultSb.AppendLine("TOP View --> Success");
                    }
                    else
                    {
                        resultSb.AppendLine("TOP View --> Fail");
                    }
                }

                resultSb.Append("\r\nIf any of these failed, here are the possible reasons:\r\n* Already patched\r\n* Patcher is outdated");

                File.WriteAllBytes(this.exePath, buffer);
                MessageBox.Show(resultSb.ToString(), "Patcher", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                // MsgBox
                MessageBox.Show("Patch failed!\r\n" + ex.Message + "\r\n\r\nPossible solutions:\r\n* Run as administrator\r\n* Pause anti-virus\r\n* Exit all LoL processes", "Patcher", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #15
0
        /// <param name="win">Окно управления</param>
        public Controller(Control win)
        {
            Form main = win.FindForm();

            win.MouseDown += (s, e) =>
            {
                switch (e.Button)
                {
                case MouseButtons.Left:
                    _isLeftMouseDown     = true;
                    CurrentMousePosition = new Point(e.X, e.Y);
                    break;

                case MouseButtons.Right:
                    _isRightMouseDown    = true;
                    CurrentMousePosition = new Point(e.X, e.Y);
                    break;

                case MouseButtons.Middle:
                    _isMiddleMouseDown   = true;
                    CurrentMousePosition = new Point(e.X, e.Y);
                    break;
                }
            };
            win.MouseUp += (s, e) =>
            {
                switch (e.Button)
                {
                case MouseButtons.Left:
                    _isLeftMouseDown = false;
                    break;

                case MouseButtons.Right:
                    _isRightMouseDown = false;
                    break;

                case MouseButtons.Middle:
                    _isMiddleMouseDown = false;
                    break;
                }
            };
            win.MouseMove += (s, e) =>
            {
                CursorPositionChanged?.Invoke(e.X, e.Y);
                // определить обработку только одной кнопки мыши
                if (_isLeftMouseDown)
                {
                    ShiftByPixel?.Invoke(e.X - CurrentMousePosition.X, e.Y - CurrentMousePosition.Y);
                    CurrentMousePosition = new Point(e.X, e.Y);
                }
                else if (_isMiddleMouseDown)
                {
                    main.Location = new Point(main.Location.X + e.X - CurrentMousePosition.X, main.Location.Y + e.Y - CurrentMousePosition.Y);
                }
            };
            win.MouseWheel += (s, e) =>
            {
                if (e.Delta > 0)
                {
                    ZoomIn?.Invoke(e.X, e.Y);
                }
                else
                {
                    ZoomOut?.Invoke(e.X, e.Y);
                }
            };
            win.KeyUp += (s, e) =>
            {
                Console.WriteLine(e.KeyValue);
                // нажатия на цифру и
                // ЛКМ - уменьшение параметра
                // ПКМ - увеличение параметра
                if (e.KeyValue > 48 && e.KeyValue < 58)
                {
                    if (_isLeftMouseDown)
                    {
                        ParameterReduced?.Invoke(e.KeyValue - 48);
                    }
                    if (_isRightMouseDown)
                    {
                        ParameterIncreased?.Invoke(e.KeyValue - 48);
                    }
                }
                switch ((HotKeys)e.KeyCode)
                {
                case HotKeys.SpeedDown:
                    SpeedDown?.Invoke();
                    break;

                case HotKeys.SpeedUp:
                    SpeedUp?.Invoke();
                    break;

                case HotKeys.StopPlay:
                    StopPlay?.Invoke();
                    break;

                case HotKeys.Statistic:
                    StatisticModeChange?.Invoke();
                    break;

                case HotKeys.ChangeWindowMode:
                    WindowModeChanged?.Invoke();
                    break;

                case HotKeys.FpsUp:
                case HotKeys.FpsUp2:
                    FpsUp?.Invoke();
                    break;

                case HotKeys.FpsDown:
                case HotKeys.FpsDown2:
                    FpsDown?.Invoke();
                    break;

                case HotKeys.SpfUp:
                    StagesByFrameUp?.Invoke();
                    break;

                case HotKeys.SpfDown:
                    StagesByFrameDown?.Invoke();
                    break;

                case HotKeys.Exit:
                    Exit?.Invoke();
                    break;
                }
            };
        }