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]; } }
public void NotifyParent() { GMacroEditorForm gmacroEditorForm = this.m_Parent.Parent as GMacroEditorForm; if (gmacroEditorForm == null) { return; } gmacroEditorForm.UpdateKeyboard(); }
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(); }