public GPropertyEntry(object obj, ObjectEditorEntry entry) : base(0, 0, 279, 22) { this.m_Object = obj; this.m_Entry = entry; this.m_NonRestrictivePicking = true; bool flag = entry.Property.PropertyType == typeof(Volume); this.m_NameBack = new GAlphaBackground(0, 0, 140, 22); this.m_NameBack.FillColor = GumpColors.Window; this.m_NameBack.FillAlpha = 1f; this.m_NameBack.DrawBorder = false; this.m_NameBack.ShouldHitTest = false; this.m_Children.Add((Gump)this.m_NameBack); this.m_ValueBack = new GAlphaBackground(139, 0, 140, 22); this.m_ValueBack.FillColor = GumpColors.Window; this.m_ValueBack.FillAlpha = 1f; this.m_ValueBack.BorderColor = GumpColors.Control; this.m_ValueBack.ShouldHitTest = false; this.m_ValueBack.DrawBorder = false; this.m_Children.Add((Gump)this.m_ValueBack); this.m_Name = new GLabel(entry.Optionable.Name, (IFont)Engine.GetUniFont(2), GumpHues.WindowText, 0, 0); this.m_Name.X = 5 - this.m_Name.Image.xMin; this.m_Name.Y = (22 - (this.m_Name.Image.yMax - this.m_Name.Image.yMin + 1)) / 2 - this.m_Name.Image.yMin; this.m_NameBack.Children.Add((Gump)this.m_Name); object obj1 = entry.Property.GetValue(obj, (object[])null); string valString = this.GetValString(obj1); if (flag) { return; } IFont Font = (obj1 is ValueType ? (obj1.Equals(entry.Optionable.Default) ? 1 : 0) : (object.ReferenceEquals(obj1, entry.Optionable.Default) ? 1 : 0)) == 0 ? (IFont)Engine.GetUniFont(1) : (IFont)Engine.GetUniFont(2); this.m_Value = new GLabel(valString, Font, GumpHues.WindowText, 0, 0); if (entry.Hue != null) { GAlphaBackground galphaBackground = new GAlphaBackground(4, 4, 22, 14); galphaBackground.FillColor = Engine.C16232((int)Hues.Load((int)obj1).Pixel(ushort.MaxValue)); galphaBackground.FillAlpha = 1f; galphaBackground.ShouldHitTest = false; this.m_ValueBack.Children.Add((Gump)galphaBackground); this.m_Value.Text = "Hue"; this.m_Value.X = 30 - this.m_Value.Image.xMin; this.m_Value.Y = (22 - (this.m_Value.Image.yMax - this.m_Value.Image.yMin + 1)) / 2 - this.m_Value.Image.yMin; this.m_Hue = galphaBackground; } else { this.m_Value.X = 5 - this.m_Value.Image.xMin; this.m_Value.Y = (22 - (this.m_Value.Image.yMax - this.m_Value.Image.yMin + 1)) / 2 - this.m_Value.Image.yMin; } this.m_ValueBack.Children.Add((Gump)this.m_Value); }
public GVirtueItem(GServerGump owner, int x, int y, int gumpID, IHue hue) : base(owner, x, y, gumpID, hue) { this.m_QuickDrag = false; int num1 = hue.HueID() - 1; int num2 = -1; int num3 = 0; int index1 = 0; while (index1 < GVirtueItem.m_Table.Length) { if (GVirtueItem.m_Table[index1] == gumpID) { num2 = index1 / 4; for (int index2 = 1; index2 < 4; ++index2) { if (GVirtueItem.m_Table[index1 + index2] == num1) { num3 = index2; goto label_9; } } } index1 += 4; } label_9: if (num2 < 0) { return; } this.m_Title = new GAlphaBackground(30 - x, 40 - y, 0, 0); GLabel glabel = new GLabel(Localization.GetString(1051000 + num3 * 8 + num2), (IFont)Engine.GetUniFont(0), hue, 3, 3); this.m_Title.Children.Add((Gump)glabel); glabel.X -= glabel.Image.xMin; glabel.Y -= glabel.Image.yMin; this.m_Title.Width = glabel.Image.xMax - glabel.Image.xMin + 7; this.m_Title.Height = glabel.Image.yMax - glabel.Image.yMin + 7; Size size = Engine.m_Gumps.Measure(104); this.m_Title.X += (size.Width - this.m_Title.Width) / 2; this.m_Title.Y += (size.Height - this.m_Title.Height) / 2; this.m_Title.Visible = false; this.m_Children.Add((Gump)this.m_Title); }
public GMacroEditorForm() : base(0, 0, 269, 283) { Gumps.Focus = (Gump)this; this.m_NonRestrictivePicking = true; this.Client.m_NonRestrictivePicking = true; this.Text = "Macro Editor"; GAlphaBackground galphaBackground = this.m_Sunken = new GAlphaBackground(1, 2, 259, 230); galphaBackground.ShouldHitTest = false; galphaBackground.FillAlpha = 1f; galphaBackground.FillColor = GumpColors.AppWorkspace; galphaBackground.DrawBorder = false; this.Client.Children.Add((Gump)galphaBackground); this.m_KeyboardFlipper = new GSystemButton(71, 236, 120, 20, SystemColors.Control, SystemColors.ControlText, "Show Keyboard", (IFont)Engine.GetUniFont(2)); this.m_KeyboardFlipper.OnClick = new OnClick(this.KeyboardFlipper_OnClick); this.Client.Children.Add((Gump)this.m_KeyboardFlipper); GSystemButton gsystemButton1 = new GSystemButton(240, 236, 20, 20, SystemColors.Control, SystemColors.ControlText, "→", (IFont)Engine.GetUniFont(2)); gsystemButton1.Tooltip = (ITooltip) new Tooltip("Advance to the next macro", true); gsystemButton1.OnClick = new OnClick(this.Next_OnClick); this.Client.Children.Add((Gump)gsystemButton1); GSystemButton gsystemButton2 = new GSystemButton(1, 236, 20, 20, SystemColors.Control, SystemColors.ControlText, "←", (IFont)Engine.GetUniFont(2)); gsystemButton2.Tooltip = (ITooltip) new Tooltip("Go back to the previous macro", true); gsystemButton2.OnClick = new OnClick(this.Prev_OnClick); this.Client.Children.Add((Gump)gsystemButton2); this.Center(); this.Y -= 92; if (Macros.List.Count > 0) { this.Current = Macros.List[0]; } else { this.m_NoSel = new GLabel("No macro is currently selected", (IFont)Engine.GetUniFont(1), Hues.Load(1153), 16, 18); this.Client.Children.Add((Gump)this.m_NoSel); } }
public GMacroEditorPanel(Macro m) : base(0, 0, 259, 230) { this.m_Macro = m; this.m_CanDrag = false; this.m_NonRestrictivePicking = true; this.ShouldHitTest = false; this.m_Ctrl = new GSystemButton(10, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f), SystemColors.ControlText, "Ctrl", (IFont)Engine.GetUniFont(2)); this.m_Alt = new GSystemButton(49, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f), SystemColors.ControlText, "Alt", (IFont)Engine.GetUniFont(2)); this.m_Shift = new GSystemButton(88, 10, 42, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f), SystemColors.ControlText, "Shift", (IFont)Engine.GetUniFont(2)); this.m_Ctrl.OnClick = new OnClick(this.Ctrl_OnClick); this.m_Alt.OnClick = new OnClick(this.Alt_OnClick); this.m_Shift.OnClick = new OnClick(this.Shift_OnClick); this.m_Ctrl.Tooltip = (ITooltip) new Tooltip("Toggles the control key modifier", true); this.m_Alt.Tooltip = (ITooltip) new Tooltip("Toggles the alt key modifier", true); this.m_Shift.Tooltip = (ITooltip) new Tooltip("Toggles the shift key modifier", true); this.m_Children.Add((Gump)this.m_Ctrl); this.m_Children.Add((Gump)this.m_Alt); this.m_Children.Add((Gump)this.m_Shift); this.UpdateModifiers(); this.m_Children.Add((Gump) new GAlphaBackground(129, 10, 74, 20) { FillAlpha = 1f, FillColor = GumpColors.Window }); GMacroKeyEntry gmacroKeyEntry = new GMacroKeyEntry(GMacroEditorPanel.GetKeyName(m.Key), 129, 10, 74, 20); gmacroKeyEntry.Tooltip = (ITooltip) new Tooltip("Press any key here to change the macro", true); this.m_Children.Add((Gump)gmacroKeyEntry); GSystemButton gsystemButton = new GSystemButton(10, 10, 40, 20, GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f), SystemColors.ControlText, "Delete", (IFont)Engine.GetUniFont(2)); gsystemButton.SetBackColor(GumpPaint.Blend(Color.SteelBlue, SystemColors.Control, 0.25f)); gsystemButton.InactiveColor = GumpPaint.Blend(Color.WhiteSmoke, SystemColors.Control, 0.5f); gsystemButton.Tooltip = (ITooltip) new Tooltip("Deletes the entire macro", true); gsystemButton.OnClick = new OnClick(this.Delete_OnClick); gsystemButton.X = this.Width - 10 - gsystemButton.Width; this.m_Children.Add((Gump)gsystemButton); this.FillAlpha = 0.15f; for (int index = 0; index < m.Actions.Count; ++index) { try { Action action = m.Actions[index]; if (action.Handler != null) { ActionHandler handler = action.Handler; GMainMenu gmainMenu = new GMainMenu(10, 35 + index * 23); GMenuItem mi = (GMenuItem) new GActionMenu(this, m, action); gmainMenu.Add(this.FormatMenu(mi)); if (handler.Params == null) { GAlphaBackground galphaBackground = new GAlphaBackground(129, 35 + index * 23, 120, 24); galphaBackground.FillAlpha = 1f; galphaBackground.FillColor = GumpColors.Window; this.m_Children.Add((Gump)galphaBackground); IHue windowText = GumpHues.WindowText; GTextBox gtextBox = (GTextBox) new GMacroParamEntry(action, action.Param, galphaBackground.X + 4, galphaBackground.Y, galphaBackground.Width - 4, galphaBackground.Height); gtextBox.MaxChars = 239; this.m_Children.Add((Gump)gtextBox); } else if (handler.Params.Length != 0) { GMenuItem menuFrom = this.GetMenuFrom(new ParamNode(GMacroEditorPanel.Find(action.Param, handler.Params) ?? action.Param, handler.Params), action, handler); menuFrom.DropDown = index == m.Actions.Count - 1; gmainMenu.Add(menuFrom); } gmainMenu.LeftToRight = true; this.m_Children.Add((Gump)gmainMenu); } } catch { } } GMainMenu gmainMenu1 = new GMainMenu(10, 35 + m.Actions.Count * 23); GMenuItem menuFrom1 = this.GetMenuFrom(ActionHandler.Root); menuFrom1.Tooltip = (ITooltip) new Tooltip("To create a new instruction pick one from the menu below", false, 200); menuFrom1.Text = "New..."; menuFrom1.DropDown = true; gmainMenu1.Add(this.FormatMenu(menuFrom1)); gmainMenu1.LeftToRight = true; this.m_Children.Add((Gump)gmainMenu1); }