Ejemplo n.º 1
0
        private void Clicked(Gump g)
        {
            GMacroEditorForm gmacroEditorForm = this.m_Parent.Parent as GMacroEditorForm;

            if (gmacroEditorForm == null)
            {
                return;
            }
            if (this.m_Macro == null)
            {
                Keys           keys           = Keys.None;
                MacroModifiers macroModifiers = MacroModifiers.All;
                if (gmacroEditorForm.Keyboard != null)
                {
                    macroModifiers = gmacroEditorForm.Keyboard.Mods;
                }
                if (macroModifiers == MacroModifiers.All)
                {
                    keys = Control.ModifierKeys;
                }
                else
                {
                    if ((macroModifiers & MacroModifiers.Alt) != MacroModifiers.None)
                    {
                        keys |= Keys.Alt;
                    }
                    if ((macroModifiers & MacroModifiers.Shift) != MacroModifiers.None)
                    {
                        keys |= Keys.Shift;
                    }
                    if ((macroModifiers & MacroModifiers.Ctrl) != MacroModifiers.None)
                    {
                        keys |= Keys.Control;
                    }
                }
                MacroSet     current = Macros.Current;
                PlayUO.Macro macro   = new PlayUO.Macro(new MacroData()
                {
                    Key = this.m_Key, Mods = keys
                });
                current.Macros.Add(macro);
                gmacroEditorForm.Current = macro;
                gmacroEditorForm.UpdateKeyboard();
            }
            else if (this.m_Macro is PlayUO.Macro)
            {
                gmacroEditorForm.Current = (PlayUO.Macro) this.m_Macro;
            }
            else
            {
                if (!(this.m_Macro is PlayUO.Macro[]))
                {
                    return;
                }
                PlayUO.Macro[] array = (PlayUO.Macro[]) this.m_Macro;
                int            num   = Array.IndexOf <PlayUO.Macro>(array, gmacroEditorForm.Current);
                gmacroEditorForm.Current = array[(num + 1) % array.Length];
            }
        }
Ejemplo n.º 2
0
 public static void Open()
 {
     if (GMacroEditorForm.m_Instance != null)
     {
         return;
     }
     GMacroEditorForm.m_Instance = new GMacroEditorForm();
     Gumps.Desktop.Children.Add((Gump)GMacroEditorForm.m_Instance);
     Gumps.Focus = (Gump)GMacroEditorForm.m_Instance;
 }
Ejemplo n.º 3
0
        public void NotifyParent()
        {
            GMacroEditorForm gmacroEditorForm = this.m_Parent.Parent as GMacroEditorForm;

            if (gmacroEditorForm == null)
            {
                return;
            }
            gmacroEditorForm.UpdateKeyboard();
        }
Ejemplo n.º 4
0
        private void Delete_OnClick(Gump g)
        {
            this.m_Macro.Actions.Remove(this.m_Action);
            GMacroEditorForm gmacroEditorForm = this.m_Panel.Parent.Parent as GMacroEditorForm;

            if (gmacroEditorForm != null)
            {
                gmacroEditorForm.Current = gmacroEditorForm.Current;
            }
            Gumps.Destroy((Gump)this);
            Gumps.Focus = (Gump)gmacroEditorForm;
        }
Ejemplo n.º 5
0
        private void Delete_OnClick(Gump g)
        {
            if (Macros.List.Contains(this.m_Macro))
            {
                Macros.List.Remove(this.m_Macro);
            }
            GMacroEditorForm gmacroEditorForm = this.m_Parent.Parent as GMacroEditorForm;

            if (gmacroEditorForm == null)
            {
                return;
            }
            gmacroEditorForm.Current = (Macro)null;
            gmacroEditorForm.UpdateKeyboard();
        }
Ejemplo n.º 6
0
        private void Down_OnClick(Gump g)
        {
            int index = this.m_Macro.Actions.IndexOf(this.m_Action);

            if (index > this.m_Macro.Actions.Count - 1)
            {
                this.m_Macro.Actions.RemoveAt(index);
                this.m_Macro.Actions.Insert(index + 1, this.m_Action);
            }
            GMacroEditorForm gmacroEditorForm = this.m_Panel.Parent.Parent as GMacroEditorForm;

            if (gmacroEditorForm == null)
            {
                return;
            }
            gmacroEditorForm.Current = gmacroEditorForm.Current;
        }
Ejemplo n.º 7
0
        private static bool Open_OnAction(string args)
        {
            if (args != null && args.Length > 0)
            {
                switch (args.ToLower())
                {
                case "help":
                    Engine.OpenHelp();
                    break;

                case "options":
                    Engine.OpenOptions();
                    break;

                case "journal":
                    Engine.OpenJournal();
                    break;

                case "skills":
                    Engine.OpenSkills();
                    break;

                case "status":
                    Engine.OpenStatus();
                    break;

                case "spellbook":
                    Engine.OpenSpellbook(1);
                    break;

                case "necrospellbook":
                    Engine.OpenSpellbook(2);
                    break;

                case "paladinspellbook":
                    Engine.OpenSpellbook(3);
                    break;

                case "paperdoll":
                    Engine.OpenPaperdoll();
                    break;

                case "backpack":
                    Engine.OpenBackpack();
                    break;

                case "radar":
                    GRadar.Open();
                    break;

                case "abilities":
                    GCombatGump.Open();
                    break;

                case "macros":
                    GMacroEditorForm.Open();
                    break;
                }
            }
            return(true);
        }
Ejemplo n.º 8
0
 protected internal override void OnDispose()
 {
     GMacroEditorForm.m_Instance = (GMacroEditorForm)null;
     Macros.Save();
     base.OnDispose();
 }
Ejemplo n.º 9
0
        protected internal override void OnMouseUp(int X, int Y, MouseButtons mb)
        {
            if (mb != MouseButtons.Left)
            {
                return;
            }
            if (this.Parent.Parent is GEditorPanel)
            {
                ((GEditorPanel)this.Parent.Parent).Reset();
            }
            if (this.m_Entry.Property.PropertyType == typeof(Volume))
            {
                return;
            }
            object obj = this.m_Entry.Property.GetValue(this.m_Object, (object[])null);

            if (obj is bool)
            {
                this.SetValue((object)!(bool)obj);
            }
            else if (obj is Item || this.m_Entry.Property.PropertyType == typeof(Item))
            {
                TargetManager.Client = (ClientTargetHandler) new SetItemPropertyTarget(this);
            }
            else if (obj is Enum)
            {
                Array values = Enum.GetValues(obj.GetType());
                for (int index = 0; index < values.Length; ++index)
                {
                    if (values.GetValue(index).Equals(obj))
                    {
                        this.SetValue(values.GetValue((index + 1) % values.Length));
                        break;
                    }
                }
            }
            else if (this.m_Entry.Hue != null)
            {
                if (this.m_Picker != null)
                {
                    return;
                }
                GPropertyHuePicker gpropertyHuePicker = this.m_Picker = new GPropertyHuePicker(this);
                gpropertyHuePicker.X = this.Width - 1;
                gpropertyHuePicker.Y = 0;
                this.m_Children.Add((Gump)gpropertyHuePicker);
            }
            else if (this.m_Entry.Property.IsDefined(typeof(MacroEditorAttribute), true))
            {
                Gumps.Destroy(this.Parent.Parent.Parent.Parent);
                GMacroEditorForm.Open();
            }
            else
            {
                if (!this.m_Entry.Property.IsDefined(typeof(RenderSettingEditor), true))
                {
                    return;
                }
                Gumps.Destroy(this.Parent.Parent.Parent.Parent);
                GRenderSettingEditorForm.Open();
            }
        }