Example #1
0
        public MacroControl(string name)
        {
            CanMove = true;

            _hotkeyBox = new HotkeyBox();
            _hotkeyBox.HotkeyChanged   += BoxOnHotkeyChanged;
            _hotkeyBox.HotkeyCancelled += BoxOnHotkeyCancelled;


            Add(_hotkeyBox);

            Add
            (
                new NiceButton
                (
                    0,
                    _hotkeyBox.Height + 3,
                    170,
                    25,
                    ButtonAction.Activate,
                    ResGumps.CreateMacroButton,
                    0,
                    TEXT_ALIGN_TYPE.TS_LEFT
                )
            {
                ButtonParameter = 2, IsSelectable = false
            }
            );

            Add
            (
                new NiceButton
                (
                    0,
                    _hotkeyBox.Height + 30,
                    50,
                    25,
                    ButtonAction.Activate,
                    ResGumps.Add
                )
            {
                IsSelectable = false
            }
            );

            Add
            (
                new NiceButton
                (
                    52,
                    _hotkeyBox.Height + 30,
                    50,
                    25,
                    ButtonAction.Activate,
                    ResGumps.Remove
                )
            {
                ButtonParameter = 1, IsSelectable = false
            }
            );


            ScrollArea area = new ScrollArea
                              (
                10,
                _hotkeyBox.Bounds.Bottom + 80,
                280,
                280,
                true
                              );

            Add(area);

            _databox = new DataBox(0, 0, 280, 280);
            _databox.WantUpdateSize = true;
            area.Add(_databox);


            Macro = Client.Game.GetScene <GameScene>().Macros.FindMacro(name) ?? Macro.CreateEmptyMacro(name);

            SetupKeyByDefault();
            SetupMacroUI();
        }
Example #2
0
        public MacroControl(string name, bool isFastAssign = false)
        {
            CanMove = true;

            _hotkeyBox = new HotkeyBox();
            _hotkeyBox.HotkeyChanged   += BoxOnHotkeyChanged;
            _hotkeyBox.HotkeyCancelled += BoxOnHotkeyCancelled;


            Add(_hotkeyBox);

            Add
            (
                new NiceButton
                (
                    0,
                    _hotkeyBox.Height + 3,
                    170,
                    25,
                    ButtonAction.Activate,
                    ResGumps.CreateMacroButton,
                    0,
                    TEXT_ALIGN_TYPE.TS_LEFT
                )
            {
                ButtonParameter = (int)buttonsOption.CreateNewMacro, IsSelectable = false
            }
            );

            if (!isFastAssign)
            {
                Add
                (
                    new NiceButton
                    (
                        0,
                        _hotkeyBox.Height + 30,
                        50,
                        25,
                        ButtonAction.Activate,
                        ResGumps.Add
                    )
                {
                    ButtonParameter = (int)buttonsOption.AddBtn, IsSelectable = false
                }
                );

                Add
                (
                    new NiceButton
                    (
                        52,
                        _hotkeyBox.Height + 30,
                        50,
                        25,
                        ButtonAction.Activate,
                        ResGumps.Remove,
                        0,
                        TEXT_ALIGN_TYPE.TS_LEFT
                    )
                {
                    ButtonParameter = (int)buttonsOption.RemoveBtn, IsSelectable = false
                }
                );
            }
            else
            {
                Add
                (
                    new NiceButton
                    (
                        0,
                        _hotkeyBox.Height + 30,
                        170,
                        25,
                        ButtonAction.Activate,
                        ResGumps.OpenMacroSettings
                    )
                {
                    ButtonParameter = (int)buttonsOption.OpenMacroOptions, IsSelectable = false
                }
                );
            }

            var scrollAreaH = isFastAssign ? 80 : 280;
            var scrollAreaW = isFastAssign ? 230 : 280;

            ScrollArea area = new ScrollArea
                              (
                10,
                _hotkeyBox.Bounds.Bottom + 80,
                scrollAreaW,
                scrollAreaH,
                true
                              );

            Add(area);

            _databox = new DataBox(0, 0, 280, 280)
            {
                WantUpdateSize = true
            };
            area.Add(_databox);


            Macro = Client.Game.GetScene <GameScene>().Macros.FindMacro(name) ?? Macro.CreateEmptyMacro(name);

            SetupKeyByDefault();
            SetupMacroUI();
        }