private void BuildVideo() { const int PAGE = 3; ScrollArea rightArea = new ScrollArea(190, 60, 390, 380, true); _debugControls = CreateCheckBox(rightArea, "Debugging mode", Engine.GlobalSettings.Debug, 0, 0); _zoom = CreateCheckBox(rightArea, "Enable in game zoom scaling", Engine.Profile.Current.EnableScaleZoom, 0, 0); _savezoom = CreateCheckBox(rightArea, "Save scale after close game", Engine.Profile.Current.SaveScaleAfterClose, 0, 0); _gameWindowFullsize = CreateCheckBox(rightArea, "Always use fullsize game window", Engine.Profile.Current.GameWindowFullSize, 0, 0); ScrollAreaItem item = new ScrollAreaItem(); Label text = new Label("- Status gump type:", true, 0, 0, 1) { Y = 30 }; item.Add(text); _shardType = new Combobox(text.Width + 20, text.Y, 100, new[] { "Modern", "Old", "Outlands" }) { SelectedIndex = Engine.GlobalSettings.ShardType }; item.Add(_shardType); rightArea.Add(item); item = new ScrollAreaItem(); _gameWindowWidth = CreateInputField(item, new TextBox(1, 5, 80, 80, false) { Text = Engine.Profile.Current.GameWindowSize.X.ToString(), X = 10, Y = 105, Width = 50, Height = 30 }, "Game Play Window Size: "); _gameWindowHeight = CreateInputField(item, new TextBox(1, 5, 80, 80, false) { Text = Engine.Profile.Current.GameWindowSize.Y.ToString(), X = 80, Y = 105, Width = 50, Height = 30 }); _gameWindowLock = new Checkbox(0x00D2, 0x00D3, "Lock game window moving/resizing", 1) { X = 140, Y = 100, IsChecked = Engine.Profile.Current.GameWindowLock }; item.Add(_gameWindowLock); _gameWindowPositionX = CreateInputField(item, new TextBox(1, 5, 80, 80, false) { Text = Engine.Profile.Current.GameWindowPosition.X.ToString(), X = 10, Y = 160, Width = 50, Height = 30 }, "Game Play Window Position: "); _gameWindowPositionY = CreateInputField(item, new TextBox(1, 5, 80, 80, false) { Text = Engine.Profile.Current.GameWindowPosition.Y.ToString(), X = 80, Y = 160, Width = 50, Height = 30 }); rightArea.Add(item); Add(rightArea, PAGE); }
public OptionsGump1() : base(0, 0) { Add(new ResizePic(/*0x2436*/ /*0x2422*/ /*0x9C40*/ 9200 /*0x53*/ /*0xE10*/) { Width = 600, Height = 500 }); //AddChildren(new GameBorder(0, 0, 600, 400, 4)); //AddChildren(new GumpPicTiled(4, 4, 600 - 8, 400 - 8, 0x0A40) { IsTransparent = false}); //AddChildren(new ResizePic(0x2436) { X = 20, Y = 20, Width = 150, Height = 460 }); //AddChildren(new LeftButton() { X = 40, Y = 40 }); ScrollArea leftArea = new ScrollArea(10, 10, 160, 480, true); ScrollAreaItem item = new ScrollAreaItem(); item.Add(new Button(0, 0x9C5, 0x9C5, 0x9C5, "General", 1, true, 14, 24) { Y = 30, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 1 }); item.Add(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Sounds", 1, true, 14, 24) { Y = 30 * 2, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 2 }); item.Add(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Video", 1, true, 14, 24) { Y = 30 * 3, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 3 }); item.Add(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Commands", 1, true, 14, 24) { Y = 30 * 4, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 4 }); item.Add(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Tooltip", 1, true, 14, 24) { Y = 30 * 5, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 5 }); item.Add(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Fonts", 1, true, 14, 24) { Y = 30 * 6, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 6 }); item.Add(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Speech", 1, true, 14, 24) { Y = 30 * 7, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 7 }); item.Add(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Combat", 1, true, 14, 24) { Y = 30 * 8, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 8 }); leftArea.Add(item); Add(leftArea); int offsetX = 60; int offsetY = 60; Add(new Button((int)Buttons.Cancel, 0x00F3, 0x00F1, 0x00F2) { X = 154 + offsetX, Y = 405 + offsetY, ButtonAction = ButtonAction.Activate }); Add(new Button((int)Buttons.Apply, 0x00EF, 0x00F0, 0x00EE) { X = 248 + offsetX, Y = 405 + offsetY, ButtonAction = ButtonAction.Activate }); Add(new Button((int)Buttons.Default, 0x00F6, 0x00F4, 0x00F5) { X = 346 + offsetX, Y = 405 + offsetY, ButtonAction = ButtonAction.Activate }); Add(new Button((int)Buttons.Ok, 0x00F9, 0x00F8, 0x00F7) { X = 443 + offsetX, Y = 405 + offsetY, ButtonAction = ButtonAction.Activate }); AcceptMouseInput = true; CanMove = true; BuildGeneral(); BuildSounds(); BuildVideo(); BuildCommands(); BuildFonts(); BuildSpeech(); BuildCombat(); BuildTooltip(); ChangePage(1); }
public UOChatGump() : base(0, 0) { CanMove = true; AcceptMouseInput = true; CanCloseWithRightClick = true; WantUpdateSize = false; Width = 345; Height = 390; Add(new ResizePic(0x0A28) { Width = Width, Height = Height }); int startY = 25; Label text = new Label("Channels", false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER) { Y = startY }; Add(text); startY += 40; Add(new BorderControl(61, startY - 3, 220 + 8, 200 + 6, 3)); Add(new AlphaBlendControl(0) { X = 64, Y = startY, Width = 220, Height = 200 }); _area = new ScrollArea(64, startY, 220, 200, true) { ScrollbarBehaviour = ScrollbarBehaviour.ShowAlways }; foreach (var k in UOChatManager.Channels) { var chan = new ChannelListItemControl(k.Key, 195); _area.Add(chan); _channelList.Add(chan); } Add(_area); startY = 275; text = new Label("Your current channel:", false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER) { Y = startY }; Add(text); startY += 25; _currentChannelLabel = new Label(UOChatManager.CurrentChannelName, false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER) { Y = startY }; Add(_currentChannelLabel); startY = 337; Button button = new Button(0, 0x0845, 0x0846, 0x0845) { X = 48, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); button = new Button(1, 0x0845, 0x0846, 0x0845) { X = 123, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); button = new Button(2, 0x0845, 0x0846, 0x0845) { X = 216, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); text = new Label("Join", false, 0x0386, 0, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_LEFT) { X = 65, Y = startY }; Add(text); text = new Label("Leave", false, 0x0386, 0, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_LEFT) { X = 140, Y = startY }; Add(text); text = new Label("Create", false, 0x0386, 0, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_LEFT) { X = 233, Y = startY }; Add(text); }
public InspectorGump(GameObject obj) : base(0, 0) { X = 200; Y = 100; _obj = obj; CanMove = true; AcceptMouseInput = false; CanCloseWithRightClick = true; Add(new BorderControl(0, 0, WIDTH, HEIGHT, 4)); Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40) { Alpha = 0.5f }); Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40) { Alpha = 0.5f }); Add(new Label("Object Information", true, 1153, font: 3) { X = 20, Y = 10 }); Add(new Line(20, 30, WIDTH - 50, 1, 0xFFFFFFFF)); Add(new NiceButton(WIDTH - 115, 5, 100, 25, ButtonAction.Activate, "Dump") { ButtonParameter = 0 }); _scrollArea = new ScrollArea(20, 35, WIDTH - 40, HEIGHT - 45, true) { AcceptMouseInput = true }; Add(_scrollArea); Dictionary <string, string> dict = ReflectionHolder.GetGameObjectProperties(obj); if (dict != null) { foreach (KeyValuePair <string, string> item in dict.OrderBy(s => s.Key)) { ScrollAreaItem areaItem = new ScrollAreaItem(); Label label = new Label(item.Key + ":", true, 33, font: 1, style: FontStyle.BlackBorder) { X = 2 }; areaItem.Add(label); int height = label.Height; label = new Label(item.Value, true, 1153, font: 1, style: FontStyle.BlackBorder, maxwidth: WIDTH - 65 - 200) { X = 200, AcceptMouseInput = true }; label.MouseUp += OnLabelClick; if (label.Height > 0) { height = label.Height; } areaItem.Add(label); areaItem.Add(new Line(0, height + 2, WIDTH - 65, 1, Color.Gray.PackedValue)); _scrollArea.Add(areaItem); } } }
public InfoGump(GameObject obj) : base(0, 0) { X = 200; Y = 100; CanMove = true; AcceptMouseInput = false; Add(new GameBorder(0, 0, WIDTH, HEIGHT, 4)); Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40) { IsTransparent = true, Alpha = 0.5f }); Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40) { IsTransparent = true, Alpha = 0.5f }); Add(new Label("Object Information", true, 1153, font: 3) { X = 20, Y = 10 }); Add(new Line(20, 30, WIDTH - 50, 1, 0xFFFFFFFF)); _scrollArea = new ScrollArea(20, 35, WIDTH - 40, HEIGHT - 45, true) { AcceptMouseInput = true }; Add(_scrollArea); Dictionary <string, string> dict = ReflectionHolder.GetGameObjectProperties(obj); if (dict != null) { foreach (KeyValuePair <string, string> item in dict.OrderBy(s => s.Key)) { ScrollAreaItem areaItem = new ScrollAreaItem(); Label label = new Label(item.Key + ":", true, 33, font: 1, style: FontStyle.BlackBorder) { X = 2 }; areaItem.Add(label); int height = label.Height; label = new Label(item.Value, true, 1153, font: 1, style: FontStyle.BlackBorder, maxwidth: WIDTH - 65 - 200) { X = 200 }; if (label.Height > 0) { height = label.Height; } areaItem.Add(label); areaItem.Add(new Line(0, height + 2, WIDTH - 65, 1, Color.Gray.PackedValue)); _scrollArea.Add(areaItem); } } }
public BulletinBoardItem(uint serial, uint msgSerial, string poster, string subject, string datatime, string data, byte variant) : base(serial, 0) { _msgSerial = msgSerial; AcceptKeyboardInput = true; CanMove = true; CanCloseWithRightClick = true; _datatime = datatime; _articleContainer = new ExpandableScroll(0, 0, 408, 0x0820) { TitleGumpID = 0x0820, AcceptMouseInput = true }; Add(_articleContainer); _scrollArea = new ScrollArea(0, 120, 272, 224, false); AddHorizontalBar(_scrollArea, 92, 35, 220); bool useUnicode = Client.Version >= ClientVersion.CV_305D; byte unicodeFontIndex = 1; int unicodeFontHeightOffset = 0; ushort textColor = 0x0386; if (useUnicode) { unicodeFontHeightOffset = -6; textColor = 0; } Label text = new Label("Author:", useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6) { X = 30, Y = 40 }; Add(text); text = new Label(poster, useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)9) { X = 30 + text.Width, Y = 46 + unicodeFontHeightOffset }; Add(text); text = new Label("Date:", useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6) { X = 30, Y = 58 }; Add(text); text = new Label(datatime, useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)9) { X = 32 + text.Width, Y = 64 + unicodeFontHeightOffset }; Add(text); text = new Label("Title:", useUnicode, textColor, font: useUnicode ? unicodeFontIndex : (byte)6) { X = 30, Y = 77 }; Add(text); ushort subjectColor = textColor; if (variant == 0) { subjectColor = 0x0008; } Add(_subjectTextbox = new TextBox(useUnicode ? unicodeFontIndex : (byte)9, maxWidth: 150, width: 150, isunicode: useUnicode, hue: subjectColor) { X = 30 + text.Width, Y = 83 + unicodeFontHeightOffset, Width = 150, IsEditable = variant == 0 }); _subjectTextbox.SetText(subject); Add(new GumpPicTiled(30, 106, 235, 4, 0x0835)); _scrollArea.Add(_textBox = new MultiLineBox( new MultiLineEntry(useUnicode ? unicodeFontIndex : (byte)9, -1, 0, 220, hue: textColor, unicode: useUnicode), true) { X = 40, Y = 0, Width = 220, ScissorsEnabled = true, Text = data, IsEditable = variant == 0 }); Add(_scrollArea); switch (variant) { case 0: Add(new GumpPic(97, 12, 0x0883, 0)); Add(_buttonPost = new Button((int)ButtonType.Post, 0x0886, 0x0886) { X = 37, Y = Height - 50, ButtonAction = ButtonAction.Activate, ContainsByBounds = true }); break; case 1: Add(_buttonReply = new Button((int)ButtonType.Reply, 0x0884, 0x0884) { X = 37, Y = Height - 50, ButtonAction = ButtonAction.Activate, ContainsByBounds = true }); break; case 2: Add(_buttonRemove = new Button((int)ButtonType.Remove, 0x0885, 0x0885) //DISABLED { X = 235, Y = Height - 50, ButtonAction = ButtonAction.Activate, ContainsByBounds = true }); break; } }
public void Add(BulletinBoardObject obj) { _area.Add(obj); }
public StandardSkillsGump() : base(Constants.SKILLSTD_LOCALSERIAL, 0) { AcceptMouseInput = false; CanMove = true; CanCloseWithRightClick = true; Height = 200 + _diffY; Add(_gumpPic = new GumpPic(160, 0, 0x82D, 0)); _gumpPic.MouseDoubleClick += _picBase_MouseDoubleClick; _scrollArea = new ExpandableScroll(0, _diffY, Height, 0x1F40) { TitleGumpID = 0x0834, AcceptMouseInput = true }; Add(_scrollArea); Add(new GumpPic(50, 35 + _diffY, 0x082B, 0)); Add(_bottomLine = new GumpPic(50, Height - 98, 0x082B, 0)); Add(_bottomComment = new GumpPic(25, Height - 85, 0x0836, 0)); _container = new ScrollArea(22, 45 + _diffY + _bottomLine.Height - 10, _scrollArea.Width - 14, _scrollArea.Height - (83 + _diffY), false) { AcceptMouseInput = true, CanMove = true }; Add(_container); Add(_skillsLabelSum = new Label(World.Player.Skills.Sum(s => s.Value).ToString("F1"), false, 600, 0, 3) { X = _bottomComment.X + _bottomComment.Width + 5, Y = _bottomComment.Y - 5 }); //new group Add(_newGroupButton = new Button(0, 0x083A, 0x083A, 0x083A) { X = 60, Y = Height, ContainsByBounds = true, ButtonAction = ButtonAction.Activate }); Add(_checkReal = new Checkbox(0x938, 0x939, " - Show Real", 1, 0x0386, false) { X = _newGroupButton.X + _newGroupButton.Width + 30, Y = _newGroupButton.Y - 6 }); Add(_checkCaps = new Checkbox(0x938, 0x939, " - Show Caps", 1, 0x0386, false) { X = _newGroupButton.X + _newGroupButton.Width + 30, Y = _newGroupButton.Y + 7 }); _checkReal.ValueChanged += UpdateSkillsValues; _checkCaps.ValueChanged += UpdateSkillsValues; if (World.Player != null) { foreach (var g in SkillsGroupManager.Groups) { SkillsGroupControl control = new SkillsGroupControl(g, 3, 3) { IsMinimized = true, }; _skillsControl.Add(control); _container.Add(control); int count = g.Count; for (int i = 0; i < count; i++) { byte index = g.GetSkill(i); if (index < SkillsLoader.Instance.SkillsCount) { control.AddSkill(index, 0, 17 + i * 17); } } } } _hitBox = new HitBox(160, 0, 23, 24); Add(_hitBox); _hitBox.MouseUp += _hitBox_MouseUp; }
private void BuildCommands() { const int PAGE = 4; ScrollArea rightArea = new ScrollArea(190, 52 + 25 + 4, 150, 360, true); NiceButton addButton = new NiceButton(190, 20, 130, 20, ButtonAction.Activate, "New macro") { IsSelectable = false, ButtonParameter = (int)Buttons.NewMacro }; addButton.MouseClick += (sender, e) => { EntryDialog dialog = new EntryDialog(250, 150, "Macro name:", name => { if (string.IsNullOrWhiteSpace(name)) { return; } MacroManager manager = Engine.SceneManager.GetScene <GameScene>().Macros; List <Macro> macros = manager.GetAllMacros(); if (macros.Any(s => s.Name == name)) { return; } NiceButton nb; rightArea.Add(nb = new NiceButton(0, 0, 130, 25, ButtonAction.Activate, name) { ButtonParameter = (int)Buttons.Last + 1 + rightArea.Children.Count, }); nb.IsSelected = true; _macroControl?.Dispose(); _macroControl = new MacroControl(name) { X = 400, Y = 20, }; Add(_macroControl, PAGE); nb.MouseClick += (sss, eee) => { _macroControl?.Dispose(); _macroControl = new MacroControl(name) { X = 400, Y = 20, }; Add(_macroControl, PAGE); }; }); Engine.UI.Add(dialog); }; Add(addButton, PAGE); NiceButton delButton = new NiceButton(190, 52, 130, 20, ButtonAction.Activate, "Delete macro") { IsSelectable = false, ButtonParameter = (int)Buttons.DeleteMacro }; delButton.MouseClick += (ss, ee) => { NiceButton nb = rightArea.FindControls <ScrollAreaItem>() .SelectMany(s => s.Children.OfType <NiceButton>()) .SingleOrDefault(a => a.IsSelected); if (nb != null) { QuestionGump dialog = new QuestionGump("Do you want\ndelete it?", b => { if (!b) { return; } nb.Parent.Dispose(); if (_macroControl != null) { MacroCollectionControl control = _macroControl.FindControls <MacroCollectionControl>().SingleOrDefault(); if (control == null) { return; } Engine.SceneManager.GetScene <GameScene>().Macros.RemoveMacro(control.Macro); } if (rightArea.Children.OfType <ScrollAreaItem>().All(s => s.IsDisposed)) { _macroControl?.Dispose(); } }); Engine.UI.Add(dialog); } }; Add(delButton, PAGE); Add(new Line(190, 52 + 25 + 2, 150, 1, Color.Gray.PackedValue), PAGE); Add(rightArea, PAGE); Add(new Line(191 + 150, 21, 1, 418, Color.Gray.PackedValue), PAGE); foreach (Macro macro in Engine.SceneManager.GetScene <GameScene>().Macros.GetAllMacros()) { NiceButton nb; rightArea.Add(nb = new NiceButton(0, 0, 130, 25, ButtonAction.Activate, macro.Name) { ButtonParameter = (int)Buttons.Last + 1 + rightArea.Children.Count, }); nb.IsSelected = true; nb.MouseClick += (sss, eee) => { _macroControl?.Dispose(); _macroControl = new MacroControl(macro.Name) { X = 400, Y = 20, }; Add(_macroControl, PAGE); }; } }
public ShopGump(uint serial, bool isBuyGump, int x, int y) : base(serial, 0) //60 is the base height, original size { int height = ProfileManager.CurrentProfile.VendorGumpHeight; X = x; Y = y; AcceptMouseInput = false; AcceptKeyboardInput = true; CanMove = true; CanCloseWithRightClick = true; IsBuyGump = isBuyGump; _transactionItems = new Dictionary <uint, TransactionItem>(); _shopItems = new Dictionary <uint, ShopItem>(); _updateTotal = false; WantUpdateSize = true; const ushort BUY_GRAPHIC_LEFT = 0x0870; const ushort BUY_GRAPHIC_RIGHT = 0x0871; const ushort SELL_GRAPHIC_LEFT = 0x0872; const ushort SELL_GRAPHIC_RIGHT = 0x0873; ushort graphicLeft = isBuyGump ? BUY_GRAPHIC_LEFT : SELL_GRAPHIC_LEFT; ushort graphicRight = isBuyGump ? BUY_GRAPHIC_RIGHT : SELL_GRAPHIC_RIGHT; _ = GumpsLoader.Instance.GetGumpTexture(graphicLeft, out var boundsLeft); _ = GumpsLoader.Instance.GetGumpTexture(graphicRight, out var boundsRight); const int LEFT_TOP_HEIGHT = 64; const int LEFT_BOTTOM_HEIGHT = 116; Rectangle offset = new Rectangle(0, 0, boundsLeft.Width, LEFT_TOP_HEIGHT); GumpPicTexture leftTop = new GumpPicTexture(graphicLeft, 0, 0, offset, false); Add(leftTop); offset.Y += LEFT_TOP_HEIGHT; offset.Height = boundsLeft.Height - (LEFT_BOTTOM_HEIGHT + LEFT_TOP_HEIGHT); GumpPicTexture leftmiddle = new GumpPicTexture(graphicLeft, 0, LEFT_TOP_HEIGHT, offset, true); int diff = height - leftmiddle.Height; leftmiddle.Height = height; Add(leftmiddle); offset.Y += offset.Height; offset.Height = LEFT_BOTTOM_HEIGHT; GumpPicTexture leftBottom = new GumpPicTexture(graphicLeft, 0, leftmiddle.Y + leftmiddle.Height, offset, false); Add(leftBottom); const int RIGHT_OFFSET = 32; const int RIGHT_BOTTOM_HEIGHT = 93; int rightX = boundsLeft.Width - RIGHT_OFFSET; int rightY = boundsLeft.Height / 2 - RIGHT_OFFSET; offset = new Rectangle(0, 0, boundsRight.Width, LEFT_TOP_HEIGHT); GumpPicTexture rightTop = new GumpPicTexture(graphicRight, rightX, rightY, offset, false); Add(rightTop); offset.Y += LEFT_TOP_HEIGHT; offset.Height = boundsRight.Height - (RIGHT_BOTTOM_HEIGHT + LEFT_TOP_HEIGHT); GumpPicTexture rightMiddle = new GumpPicTexture(graphicRight, rightX, rightY + LEFT_TOP_HEIGHT, offset, true); rightMiddle.Height += diff; Add(rightMiddle); offset.Y += offset.Height; offset.Height = RIGHT_BOTTOM_HEIGHT; GumpPicTexture rightBottom = new GumpPicTexture(graphicRight, rightX, rightMiddle.Y + rightMiddle.Height, offset, false); Add(rightBottom); _shopScrollArea = new ScrollArea ( RIGHT_OFFSET, leftmiddle.Y, boundsLeft.Width - RIGHT_OFFSET * 2 + 5, leftmiddle.Height + 50, false, leftmiddle.Height ); Add(_shopScrollArea); _transactionScrollArea = new ScrollArea ( RIGHT_OFFSET / 2 + rightTop.X, LEFT_TOP_HEIGHT + rightTop.Y, boundsRight.Width - RIGHT_OFFSET * 2 + RIGHT_OFFSET / 2 + 5, rightMiddle.Height, false ); Add(_transactionScrollArea); _transactionDataBox = new DataBox(0, 0, 1, 1); _transactionDataBox.WantUpdateSize = true; _transactionScrollArea.Add(_transactionDataBox); _totalLabel = new Label("0", true, 0x0386, 0, 1) { X = RIGHT_OFFSET + rightTop.X + 32 + 4, Y = rightBottom.Y + rightBottom.Height - 32 * 3 + 15, }; Add(_totalLabel); if (isBuyGump) { _playerGoldLabel = new Label ( World.Player.Gold.ToString(), true, 0x0386, 0, 1 ) { X = _totalLabel.X + 120, Y = _totalLabel.Y }; Add(_playerGoldLabel); } else { _totalLabel.X = (rightTop.X + rightTop.Width) - RIGHT_OFFSET * 3; } Button expander = new Button(2, 0x082E, 0x82F) { ButtonAction = ButtonAction.Activate, X = boundsLeft.Width / 2 - 10, Y = leftBottom.Y + leftBottom.Height - 5 }; Add(expander); const float ALPHA_HIT_BUTTON = 0f; HitBox accept = new HitBox(RIGHT_OFFSET + rightTop.X, (rightBottom.Y + rightBottom.Height) - 50, 34, 30, "Accept", ALPHA_HIT_BUTTON); HitBox clear = new HitBox(accept.X + 175, accept.Y, 20, 20, "Clear", ALPHA_HIT_BUTTON); accept.MouseUp += (sender, e) => { OnButtonClick((int)Buttons.Accept); }; clear.MouseUp += (sender, e) => { OnButtonClick((int)Buttons.Clear); }; Add(accept); Add(clear); HitBox leftUp = new HitBox((leftTop.X + leftTop.Width) - 50, (leftTop.Y + leftTop.Height) - 18, 18, 16, "Scroll Up", ALPHA_HIT_BUTTON); HitBox leftDown = new HitBox(leftUp.X, leftBottom.Y, 18, 16, "Scroll Down", ALPHA_HIT_BUTTON); HitBox rightUp = new HitBox((rightTop.X + rightTop.Width - 50), (rightTop.Y + rightTop.Height) - 18, 18, 16, "Scroll Up", ALPHA_HIT_BUTTON); HitBox rightDown = new HitBox(rightUp.X, rightBottom.Y, 18, 16, "Scroll Down", ALPHA_HIT_BUTTON); leftUp.MouseUp += ButtonMouseUp; leftDown.MouseUp += ButtonMouseUp; rightUp.MouseUp += ButtonMouseUp; rightDown.MouseUp += ButtonMouseUp; leftUp.MouseDown += (sender, e) => { _buttonScroll = ButtonScroll.LeftScrollUp; }; leftDown.MouseDown += (sender, e) => { _buttonScroll = ButtonScroll.LeftScrollDown; }; rightUp.MouseDown += (sender, e) => { _buttonScroll = ButtonScroll.RightScrollUp; }; rightDown.MouseDown += (sender, e) => { _buttonScroll = ButtonScroll.RightScrollDown; }; Add(leftUp); Add(leftDown); Add(rightUp); Add(rightDown); bool is_pressing = false; int initial_height = 0, initialHeightRight = 0; int minHeight = boundsLeft.Height - (LEFT_BOTTOM_HEIGHT + LEFT_TOP_HEIGHT); int minHeightRight = boundsRight.Height - (RIGHT_BOTTOM_HEIGHT + LEFT_TOP_HEIGHT); expander.MouseDown += (sender, args) => { is_pressing = true; initial_height = leftmiddle.Height; initialHeightRight = rightMiddle.Height; }; expander.MouseUp += (sender, args) => { is_pressing = false; }; expander.MouseOver += (sender, args) => { int steps = Mouse.LDragOffset.Y; if (is_pressing && steps != 0) { leftmiddle.Height = initial_height + steps; if (leftmiddle.Height < minHeight) { leftmiddle.Height = minHeight; } else if (leftmiddle.Height > 640) { leftmiddle.Height = 640; } rightMiddle.Height = initialHeightRight + steps; if (rightMiddle.Height < minHeightRight) { rightMiddle.Height = minHeightRight; } else if (rightMiddle.Height > 640 - LEFT_TOP_HEIGHT) { rightMiddle.Height = 640 - LEFT_TOP_HEIGHT; } ProfileManager.CurrentProfile.VendorGumpHeight = leftmiddle.Height; leftBottom.Y = leftmiddle.Y + leftmiddle.Height; expander.Y = leftBottom.Y + leftBottom.Height - 5; rightBottom.Y = rightMiddle.Y + rightMiddle.Height; _shopScrollArea.Height = leftmiddle.Height + 50; _shopScrollArea.ScrollMaxHeight = leftmiddle.Height; _transactionDataBox.Height = _transactionScrollArea.Height = rightMiddle.Height; _totalLabel.Y = rightBottom.Y + rightBottom.Height - RIGHT_OFFSET * 3 + 15; accept.Y = clear.Y = (rightBottom.Y + rightBottom.Height) - 50; leftDown.Y = leftBottom.Y; rightDown.Y = rightBottom.Y; if (_playerGoldLabel != null) { _playerGoldLabel.Y = _totalLabel.Y; } _transactionDataBox.ReArrangeChildren(); WantUpdateSize = true; } }; //Label name = new Label(World.Player.Name, false, 0x0386, font: 5) //{ // X = 322, // Y = 308 + _middleGumpRight.Height //}; //Add(name); }
private void BuildVideo() { const int PAGE = 3; ScrollArea rightArea = new ScrollArea(190, 20, WIDTH - 210, 420, true); _debugControls = CreateCheckBox(rightArea, "Debugging mode", Engine.GlobalSettings.Debug, 0, 0); _zoom = CreateCheckBox(rightArea, "Enable in game zoom scaling", Engine.Profile.Current.EnableScaleZoom, 0, 0); _savezoom = CreateCheckBox(rightArea, "Save scale after close game", Engine.Profile.Current.SaveScaleAfterClose, 0, 0); _gameWindowFullsize = CreateCheckBox(rightArea, "Always use fullsize game window", Engine.Profile.Current.GameWindowFullSize, 0, 0); _enableDeathScreen = CreateCheckBox(rightArea, "Enable Death Screen", Engine.Profile.Current.EnableDeathScreen, 0, 0); _enableBlackWhiteEffect = CreateCheckBox(rightArea, "Black&White mode for dead player", Engine.Profile.Current.EnableBlackWhiteEffect, 0, 0); ScrollAreaItem item = new ScrollAreaItem(); Label text = new Label("- Status gump type:", true, HUE_FONT, 0, FONT) { Y = 30 }; item.Add(text); _shardType = new Combobox(text.Width + 20, text.Y, 100, new[] { "Modern", "Old", "Outlands" }) { SelectedIndex = Engine.GlobalSettings.ShardType }; item.Add(_shardType); rightArea.Add(item); item = new ScrollAreaItem(); _gameWindowWidth = CreateInputField(item, new TextBox(1, 5, 80, 80, false) { Text = Engine.Profile.Current.GameWindowSize.X.ToString(), X = 10, Y = 60, Width = 50, Height = 30, NumericOnly = true }, "Game Play Window Size: "); _gameWindowHeight = CreateInputField(item, new TextBox(1, 5, 80, 80, false) { Text = Engine.Profile.Current.GameWindowSize.Y.ToString(), X = 80, Y = 60, Width = 50, Height = 30, NumericOnly = true }); _gameWindowLock = new Checkbox(0x00D2, 0x00D3, "Lock game window moving/resizing", FONT, HUE_FONT, true) { X = 140, Y = 57, IsChecked = Engine.Profile.Current.GameWindowLock }; item.Add(_gameWindowLock); rightArea.Add(item); item = new ScrollAreaItem(); _gameWindowPositionX = CreateInputField(item, new TextBox(1, 5, 80, 80, false) { Text = Engine.Profile.Current.GameWindowPosition.X.ToString(), X = 10, Y = 35, Width = 50, Height = 30, NumericOnly = true }, "Game Play Window Position: "); _gameWindowPositionY = CreateInputField(item, new TextBox(1, 5, 80, 80, false) { Text = Engine.Profile.Current.GameWindowPosition.Y.ToString(), X = 80, Y = 35, Width = 50, Height = 30, NumericOnly = true }); rightArea.Add(item); item = new ScrollAreaItem(); _enableLight = new Checkbox(0x00D2, 0x00D3, "Light level", FONT, HUE_FONT, true) { Y = 20, IsChecked = Engine.Profile.Current.UseCustomLightLevel }; _lightBar = new HSliderBar(_enableLight.Width + 10, 20, 250, 0, 0x1E, 0x1E - Engine.Profile.Current.LightLevel, HSliderBarStyle.MetalWidgetRecessedBar, true, FONT, HUE_FONT, true); item.Add(_enableLight); item.Add(_lightBar); rightArea.Add(item); Add(rightArea, PAGE); }
public ServerSelectionGump() : base(0, 0) { //AddChildren(new LoginBackground(true)); Add ( new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2) { X = 586, Y = 445, ButtonAction = ButtonAction.Activate } ); Add ( new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5) { X = 610, Y = 445, ButtonAction = ButtonAction.Activate } ); if (Client.Version >= ClientVersion.CV_500A) { ushort textColor = 0xFFFF; Add ( new Label(ClilocLoader.Instance.GetString(1044579), true, textColor, font: 1) { X = 155, Y = 70 } ); // "Select which shard to play on:" Add ( new Label(ClilocLoader.Instance.GetString(1044577), true, textColor, font: 1) { X = 400, Y = 70 } ); // "Latency:" Add ( new Label(ClilocLoader.Instance.GetString(1044578), true, textColor, font: 1) { X = 470, Y = 70 } ); // "Packet Loss:" Add ( new Label(ClilocLoader.Instance.GetString(1044580), true, textColor, font: 1) { X = 153, Y = 368 } ); // "Sort by:" } else { ushort textColor = 0x0481; Add ( new Label(ResGumps.SelectWhichShardToPlayOn, false, textColor, font: 9) { X = 155, Y = 70 } ); Add ( new Label(ResGumps.Latency, false, textColor, font: 9) { X = 400, Y = 70 } ); Add ( new Label(ResGumps.PacketLoss, false, textColor, font: 9) { X = 470, Y = 70 } ); Add ( new Label(ResGumps.SortBy, false, textColor, font: 9) { X = 153, Y = 368 } ); } Add ( new Button((int)Buttons.SortTimeZone, 0x093B, 0x093C, 0x093D) { X = 230, Y = 366 } ); Add ( new Button((int)Buttons.SortFull, 0x093E, 0x093F, 0x0940) { X = 338, Y = 366 } ); Add ( new Button((int)Buttons.SortConnection, 0x0941, 0x0942, 0x0943) { X = 446, Y = 366 } ); // World Pic Bg Add(new GumpPic(150, 390, 0x0589, 0)); // Earth Add ( new Button((int)Buttons.Earth, 0x15E8, 0x15EA, 0x15E9) { X = 160, Y = 400, ButtonAction = ButtonAction.Activate } ); // Sever Scroll Area Bg Add ( new ResizePic(0x0DAC) { X = 150, Y = 90, Width = 393 - 14, Height = 271 } ); // Sever Scroll Area ScrollArea scrollArea = new ScrollArea(150, 90, 393, 271, true); LoginScene loginScene = Client.Game.GetScene <LoginScene>(); scrollArea.ScissorRectangle.Y = 16; scrollArea.ScissorRectangle.Height = -(scrollArea.ScissorRectangle.Y + 32); foreach (ServerListEntry server in loginScene.Servers) { scrollArea.Add(new ServerEntryGump(server, 5, NORMAL_COLOR, SELECTED_COLOR)); } Add(scrollArea); if (loginScene.Servers.Length != 0) { int index = Settings.GlobalSettings.LastServerNum - 1; if (index < 0 || index >= loginScene.Servers.Length) { index = 0; } Add ( new Label ( loginScene.Servers[index] .Name, false, 0x0481, font: 9 ) { X = 243, Y = 420 } ); } AcceptKeyboardInput = true; CanCloseWithRightClick = false; }
private void AddHorizontalBar(ScrollArea area, ushort start, int x, int width) { PrivateContainer container = new PrivateContainer(); area.Add(container); }
public ProfileGump(uint serial, string header, string footer, string body, bool canEdit) : base(serial, 0) { Height = 300 + _diffY; CanMove = true; AcceptKeyboardInput = true; CanCloseWithRightClick = true; Add(_gumpPic = new GumpPic(143, 0, 0x82D, 0)); _gumpPic.MouseDoubleClick += _picBase_MouseDoubleClick; Add(new ExpandableScroll(0, _diffY, Height - _diffY, 0x0820)); _scrollArea = new ScrollArea ( 22, 32 + _diffY, 272 - 22, Height - (96 + _diffY), false ); Label topText = new Label ( header, true, 0, font: 1, maxwidth: 140 ) { X = 53, Y = 6 }; _scrollArea.Add(topText); int offsetY = topText.Height - 15; _scrollArea.Add(new GumpPic(4, offsetY, 0x005C, 0)); _scrollArea.Add ( new GumpPicTiled ( 56, offsetY, 138, 0, 0x005D ) ); _scrollArea.Add(new GumpPic(194, offsetY, 0x005E, 0)); offsetY += 44; _textBox = new StbTextBox(1, -1, 220) { Width = 220, X = 4, Y = offsetY, IsEditable = canEdit, Multiline = true }; _originalText = body; _textBox.TextChanged += _textBox_TextChanged; _textBox.SetText(body); _scrollArea.Add(_textBox); _databox = new DataBox(4, _textBox.Height + 3, 1, 1); _databox.WantUpdateSize = true; _databox.Add(new GumpPic(4, 0, 0x005F, 0)); _databox.Add ( new GumpPicTiled ( 13, 0 + 9, 197, 0, 0x0060 ) ); _databox.Add(new GumpPic(210, 0, 0x0061, 0)); _databox.Add ( new Label ( footer, true, 0, font: 1, maxwidth: 220 ) { X = 2, Y = 26 } ); Add(_scrollArea); _scrollArea.Add(_databox); Add(_hitBox = new HitBox(143, 0, 23, 24)); _hitBox.MouseUp += _hitBox_MouseUp; }
public void AddItem(uint serial, ushort graphic, ushort hue, ushort amount, uint price, string name, bool fromcliloc) { ShopItem shopItem; _shopScrollArea.Add(shopItem = new ShopItem(serial, graphic, hue, amount, price, name) { X = 5, Y = 5, NameFromCliloc = fromcliloc }); _shopScrollArea.Add(new ResizePicLine(0x39) { X = 10, Width = 190 }); shopItem.MouseUp += ShopItem_MouseClick; shopItem.MouseDoubleClick += ShopItem_MouseDoubleClick; _shopItems.Add(serial, shopItem); if (ProfileManager.Current.AutoSellItem) { if (ProfileManager.Current.SellList == null) { ProfileManager.Current.SellList = new List <ushort[]>(); } if (ProfileManager.Current.BuyList == null) { ProfileManager.Current.BuyList = new List <ushort[]>(); } List <ushort[]> list; if (IsBuyGump) { list = ProfileManager.Current.BuyList; } else { list = ProfileManager.Current.SellList; } foreach (ushort[] tosell in list) { if (graphic == tosell[0]) { int total = amount; int have = 0; PlayerMobile.GetAmount(World.Player.Equipment[(int)Layer.Backpack], graphic, ref have); int tohave = 0; if (tosell.Length < 3) { tohave = ProfileManager.Current.AutoBuyAmount; } else { tohave = tosell[2]; } if (IsBuyGump) { total = tohave - have; if (total > amount) { total = amount; } } if (total > 0) { if (_transactionItems.TryGetValue(shopItem.LocalSerial, out TransactionItem transactionItem)) { transactionItem.Amount += total; } else { transactionItem = new TransactionItem(shopItem.LocalSerial, shopItem.Graphic, shopItem.Hue, total, shopItem.Price, shopItem.ShopItemName); transactionItem.OnIncreaseButtomClicked += TransactionItem_OnIncreaseButtomClicked; transactionItem.OnDecreaseButtomClicked += TransactionItem_OnDecreaseButtomClicked; _transactionScrollArea.Add(transactionItem); _transactionItems.Add(shopItem.LocalSerial, transactionItem); } shopItem.Amount -= total; _updateTotal = true; } } } } }
public ChatGump() : base(0, 0) { CanMove = true; AcceptMouseInput = true; CanCloseWithRightClick = true; WantUpdateSize = false; Width = 345; Height = 390; Add ( new ResizePic(0x0A28) { Width = Width, Height = Height } ); int startY = 25; Label text = new Label ( ResGumps.Channels, false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER ) { Y = startY }; Add(text); startY += 40; Add ( new BorderControl ( 61, startY - 3, 220 + 8, 200 + 6, 3 ) ); Add(new AlphaBlendControl(0) { X = 64, Y = startY, Width = 220, Height = 200 }); ScrollArea area = new ScrollArea ( 64, startY, 220, 200, true ) { ScrollbarBehaviour = ScrollbarBehaviour.ShowAlways }; Add(area); _databox = new DataBox(0, 0, 1, 1); _databox.WantUpdateSize = true; area.Add(_databox); foreach (KeyValuePair <string, ChatChannel> k in ChatManager.Channels) { ChannelListItemControl chan = new ChannelListItemControl(k.Key, 195); _databox.Add(chan); _channelList.Add(chan); } _databox.ReArrangeChildren(); startY = 275; text = new Label ( ResGumps.YourCurrentChannel, false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER ) { Y = startY }; Add(text); startY += 25; _currentChannelLabel = new Label ( ChatManager.CurrentChannelName, false, 0x0386, 345, 2, FontStyle.None, TEXT_ALIGN_TYPE.TS_CENTER ) { Y = startY }; Add(_currentChannelLabel); startY = 337; Button button = new Button(0, 0x0845, 0x0846, 0x0845) { X = 48, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); button = new Button(1, 0x0845, 0x0846, 0x0845) { X = 123, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); button = new Button(2, 0x0845, 0x0846, 0x0845) { X = 216, Y = startY + 5, ButtonAction = ButtonAction.Activate }; Add(button); text = new Label ( ResGumps.Join, false, 0x0386, 0, 2 ) { X = 65, Y = startY }; Add(text); text = new Label ( ResGumps.Leave, false, 0x0386, 0, 2 ) { X = 140, Y = startY }; Add(text); text = new Label ( ResGumps.Create, false, 0x0386, 0, 2 ) { X = 233, Y = startY }; Add(text); }
public SkillGumpAdvanced() : base(0, 0) { _totalReal = 0; _totalValue = 0; CanMove = true; AcceptMouseInput = true; WantUpdateSize = false; Width = WIDTH; Height = HEIGHT; Add ( new AlphaBlendControl(0.05f) { X = 1, Y = 1, Width = WIDTH - 2, Height = HEIGHT - 2 } ); ScrollArea area = new ScrollArea(20, 60, WIDTH - 40, 250, true) { AcceptMouseInput = true }; Add(area); _databox = new DataBox(0, 0, 1, 1); _databox.WantUpdateSize = true; area.Add(_databox); Add ( new NiceButton(10, 10, 180, 25, ButtonAction.Activate, ResGumps.Name) { ButtonParameter = (int)Buttons.SortName, IsSelected = true, X = 40, Y = 25 } ); Add ( new NiceButton(10, 10, 80, 25, ButtonAction.Activate, ResGumps.Real) { ButtonParameter = (int)Buttons.SortReal, X = 220, Y = 25 } ); Add ( new NiceButton(10, 10, 80, 25, ButtonAction.Activate, ResGumps.Base) { ButtonParameter = (int)Buttons.SortBase, X = 300, Y = 25 } ); Add ( new NiceButton(10, 10, 80, 25, ButtonAction.Activate, ResGumps.Cap) { ButtonParameter = (int)Buttons.SortCap, X = 380, Y = 25 } ); Add(new Line(20, 60, 435, 1, 0xFFFFFFFF)); Add(new Line(20, 310, 435, 1, 0xFFFFFFFF)); Add(_sortOrderIndicator = new GumpPic(0, 0, 0x985, 0)); OnButtonClick((int)Buttons.SortName); }
public ServerSelectionGump() : base(0, 0) { //AddChildren(new LoginBackground(true)); Add(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2) { X = 586, Y = 445, ButtonAction = ButtonAction.Activate }); Add(new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5) { X = 610, Y = 445, ButtonAction = ButtonAction.Activate }); if (FileManager.ClientVersion >= ClientVersions.CV_500A) { ushort textColor = 0xFFFF; Add(new Label(FileManager.Cliloc.GetString(1044579), true, textColor, font: 1) { X = 155, Y = 70 }); // "Select which shard to play on:" Add(new Label(FileManager.Cliloc.GetString(1044577), true, textColor, font: 1) { X = 400, Y = 70 }); // "Latency:" Add(new Label(FileManager.Cliloc.GetString(1044578), true, textColor, font: 1) { X = 470, Y = 70 }); // "Packet Loss:" Add(new Label(FileManager.Cliloc.GetString(1044580), true, textColor, font: 1) { X = 153, Y = 368 }); // "Sort by:" } else { ushort textColor = 0x0481; Add(new Label("Select which shard to play on:", true, textColor, font: 9) { X = 155, Y = 70 }); Add(new Label("Latency:", true, textColor, font: 9) { X = 400, Y = 70 }); Add(new Label("Packet Loss:", true, textColor, font: 9) { X = 470, Y = 70 }); Add(new Label("Sort by:", true, textColor, font: 9) { X = 153, Y = 368 }); } Add(new Button((int)Buttons.SortTimeZone, 0x093B, 0x093C, 0x093D) { X = 230, Y = 366 }); Add(new Button((int)Buttons.SortFull, 0x093E, 0x093F, 0x0940) { X = 338, Y = 366 }); Add(new Button((int)Buttons.SortConnection, 0x0941, 0x0942, 0x0943) { X = 446, Y = 366 }); // World Pic Bg Add(new GumpPic(150, 390, 0x0589, 0)); // Earth Add(new Button((int)Buttons.Earth, 0x15E8, 0x15EA, 0x15E9) { X = 160, Y = 400 }); // Sever Scroll Area Bg Add(new ResizePic(0x0DAC) { X = 150, Y = 90, Width = 393 - 14, Height = 271 }); // Sever Scroll Area ScrollArea scrollArea = new ScrollArea(150, 100, 383, 271, true); LoginScene loginScene = Engine.SceneManager.GetScene <LoginScene>(); foreach (ServerListEntry server in loginScene.Servers) { scrollArea.Add(new ServerEntryGump(server)); } Add(scrollArea); if (loginScene.Servers.Length > 0) { if (loginScene.Servers.Last().Index < loginScene.Servers.Count()) { Add(new Label(loginScene.Servers.Last().Name, false, 0x0481, font: 9) { X = 243, Y = 420 }); } else { Add(new Label(loginScene.Servers.First().Name, false, 0x0481, font: 9) { X = 243, Y = 420 }); } } AcceptKeyboardInput = true; }
public StandardSkillsGump() : base(0, 0) { AcceptMouseInput = false; CanMove = true; CanCloseWithRightClick = true; Height = 200 + _diffY; Add(_gumpPic = new GumpPic(160, 0, 0x82D, 0)); _gumpPic.MouseDoubleClick += _picBase_MouseDoubleClick; _scrollArea = new ExpandableScroll(0, _diffY, Height, 0x1F40) { TitleGumpID = 0x0834, AcceptMouseInput = true }; Add(_scrollArea); Add(new GumpPic(50, 35 + _diffY, 0x082B, 0)); Add(_bottomLine = new GumpPic(50, Height - 98, 0x082B, 0)); Add(_bottomComment = new GumpPic(25, Height - 85, 0x0836, 0)); _area = new ScrollArea ( 22, 45 + _diffY + _bottomLine.Height - 10, _scrollArea.Width - 14, _scrollArea.Height - (83 + _diffY), false ) { AcceptMouseInput = true, CanMove = true }; Add(_area); _container = new DataBox(0, 0, 1, 1); _container.WantUpdateSize = true; _container.AcceptMouseInput = true; _container.CanMove = true; _area.Add(_container); Add ( _skillsLabelSum = new Label ( World.Player.Skills.Sum(s => s.Value).ToString("F1"), false, 600, 0, 3 ) { X = _bottomComment.X + _bottomComment.Width + 5, Y = _bottomComment.Y - 5 } ); //new group int x = 60; Add ( _newGroupButton = new Button(0, 0x083A, 0x083A, 0x083A) { X = x, Y = Height, ContainsByBounds = true, ButtonAction = ButtonAction.Activate } ); Add ( _checkReal = new Checkbox ( 0x938, 0x939, ResGumps.ShowReal, 1, 0x0386, false ) { X = _newGroupButton.X + _newGroupButton.Width + 30, Y = _newGroupButton.Y - 6 } ); Add ( _checkCaps = new Checkbox ( 0x938, 0x939, ResGumps.ShowCaps, 1, 0x0386, false ) { X = _newGroupButton.X + _newGroupButton.Width + 30, Y = _newGroupButton.Y + 7 } ); _checkReal.ValueChanged += UpdateSkillsValues; _checkCaps.ValueChanged += UpdateSkillsValues; LoadSkills(); Add(_resetGroups = new NiceButton(_scrollArea.X + 25, _scrollArea.Y + 7, 100, 18, ButtonAction.Activate, ResGumps.ResetGroups, unicode: false, font: 6) { ButtonParameter = 1, IsSelectable = false, //Alpha = 1f }); _hitBox = new HitBox(160, 0, 23, 24); Add(_hitBox); _hitBox.MouseUp += _hitBox_MouseUp; _container.ReArrangeChildren(); }
private void BuildGeneral() { const int PAGE = 1; ScrollArea rightArea = new ScrollArea(190, 60, 390, 380, true); // FPS ScrollAreaItem fpsItem = new ScrollAreaItem(); Label text = new Label("- FPS:", true, 1); fpsItem.Add(text); _sliderFPS = new HSliderBar(80, 5, 250, 15, 250, Engine.Profile.Current.MaxFPS, HSliderBarStyle.MetalWidgetRecessedBar, true, 1); fpsItem.Add(_sliderFPS); rightArea.Add(fpsItem); fpsItem = new ScrollAreaItem(); text = new Label("- Login FPS:", true, 1); fpsItem.Add(text); _sliderFPSLogin = new HSliderBar(80, 5, 250, 15, 250, Engine.GlobalSettings.MaxLoginFPS, HSliderBarStyle.MetalWidgetRecessedBar, true, 1); fpsItem.Add(_sliderFPSLogin); rightArea.Add(fpsItem); // Highlight _highlightObjects = CreateCheckBox(rightArea, "Highlight game objects", Engine.Profile.Current.HighlightGameObjects, 0, 10); //// smooth movements //_smoothMovements = new Checkbox(0x00D2, 0x00D3, "Smooth movements", 1) //{ // IsChecked = Engine.Profile.Current.SmoothMovements //}; //rightArea.AddChildren(_smoothMovements); _enablePathfind = CreateCheckBox(rightArea, "Enable pathfinding", Engine.Profile.Current.EnablePathfind, 0, 0); _alwaysRun = CreateCheckBox(rightArea, "Always run", Engine.Profile.Current.AlwaysRun, 0, 0); _preloadMaps = CreateCheckBox(rightArea, "Preload maps (it increases the RAM usage)", Engine.GlobalSettings.PreloadMaps, 0, 0); _enableTopbar = CreateCheckBox(rightArea, "Disable the Menu Bar", Engine.Profile.Current.TopbarGumpIsDisabled, 0, 0); // show % hp mobile ScrollAreaItem hpAreaItem = new ScrollAreaItem(); text = new Label("- Mobiles HP", true, 1) { Y = 10 }; hpAreaItem.Add(text); _showHpMobile = new Checkbox(0x00D2, 0x00D3, "Show HP", 1) { X = 25, Y = 30, IsChecked = Engine.Profile.Current.ShowMobilesHP }; hpAreaItem.Add(_showHpMobile); int mode = Engine.Profile.Current.MobileHPType; if (mode < 0 || mode > 2) { mode = 0; } _hpComboBox = new Combobox(200, 30, 150, new[] { "Percentage", "Line", "Both" }, mode); hpAreaItem.Add(_hpComboBox); rightArea.Add(hpAreaItem); // highlight character by flags ScrollAreaItem highlightByFlagsItem = new ScrollAreaItem(); text = new Label("- Mobiles status", true, 1) { Y = 10 }; highlightByFlagsItem.Add(text); _highlightByState = new Checkbox(0x00D2, 0x00D3, "Highlight by state\n(poisoned, yellow hits, paralyzed)", 1) { X = 25, Y = 30, IsChecked = Engine.Profile.Current.HighlightMobilesByFlags }; highlightByFlagsItem.Add(_highlightByState); rightArea.Add(highlightByFlagsItem); _drawRoofs = CreateCheckBox(rightArea, "Draw roofs", Engine.Profile.Current.DrawRoofs, 0, 20); _treeToStumps = CreateCheckBox(rightArea, "Tree to stumps", Engine.Profile.Current.TreeToStumps, 0, 0); _hideVegetation = CreateCheckBox(rightArea, "Hide vegetation", Engine.Profile.Current.HideVegetation, 0, 0); hpAreaItem = new ScrollAreaItem(); text = new Label("- Fields: ", true, 1) { Y = 10, }; hpAreaItem.Add(text); _normalFields = new RadioButton(0, 0x00D0, 0x00D1, "Normal fields", 1) { X = 25, Y = 30, IsChecked = Engine.Profile.Current.FieldsType == 0, }; hpAreaItem.Add(_normalFields); _staticFields = new RadioButton(0, 0x00D0, 0x00D1, "Static fields", 1) { X = 25, Y = 30 + _normalFields.Height, IsChecked = Engine.Profile.Current.FieldsType == 1 }; hpAreaItem.Add(_staticFields); _fieldsToTile = new RadioButton(0, 0x00D0, 0x00D1, "Tile fields", 1) { X = 25, Y = 30 + _normalFields.Height * 2, IsChecked = Engine.Profile.Current.FieldsType == 2 }; hpAreaItem.Add(_fieldsToTile); rightArea.Add(hpAreaItem); _noColorOutOfRangeObjects = CreateCheckBox(rightArea, "No color for object out of range", Engine.Profile.Current.NoColorObjectsOutOfRange, 0, 0); hpAreaItem = new ScrollAreaItem(); text = new Label("- Circle of Transparency:", true, 1) { Y = 10 }; hpAreaItem.Add(text); _circleOfTranspRadius = new HSliderBar(160, 15, 100, Constants.MIN_CIRCLE_OF_TRANSPARENCY_RADIUS, Constants.MAX_CIRCLE_OF_TRANSPARENCY_RADIUS, Engine.Profile.Current.CircleOfTransparencyRadius, HSliderBarStyle.MetalWidgetRecessedBar, true, 1); hpAreaItem.Add(_circleOfTranspRadius); _useCircleOfTransparency = new Checkbox(0x00D2, 0x00D3, "Enable circle of transparency", 1) { X = 25, Y = 30, IsChecked = Engine.Profile.Current.UseCircleOfTransparency }; hpAreaItem.Add(_useCircleOfTransparency); rightArea.Add(hpAreaItem); Add(rightArea, PAGE); }
public StandardSkillsGump() : base(0, 0) { AcceptMouseInput = false; CanMove = true; CanCloseWithRightClick = true; Height = 600; Add(_background = new ExpandableScroll(0, _diffY - 65, Height - _diffY, 0x820)); Add(_gumpPic = new GumpPic(245, 0, 0x2C94, 0)); Add(_bottomComment = new GumpPic(25, Height - 85, 0x0836, 0)); _area = new ScrollArea ( 22, _diffY + 10, _background.Width - 14, _background.Height - (83 + _diffY), false ) { AcceptMouseInput = true, CanMove = true }; Add(_area); _container = new DataBox(0, 0, 1, 1); _container.WantUpdateSize = true; _container.AcceptMouseInput = true; _container.CanMove = true; _area.Add(_container); Add ( _skillsLabelSum = new Label ( World.Player.Skills.Sum(s => s.Value).ToString("F1"), true, 0x04EC, 200, 0 ) { X = _bottomComment.X - 20 + _bottomComment.Width + 5, Y = _bottomComment.Y - 5 } ); _databox = new DataBox(25, _background.Height + 3, 1, 1); _databox.WantUpdateSize = true; _databox.Add(new GumpPic(2, 22, 0x005F, 0)); _databox.Add ( new GumpPicTiled ( 13, 31, 245, 0, 0x0060 ) ); _databox.Add(new GumpPic(250, 22, 0x0061, 0)); _background.Add(_databox); //new group int x = 50; Add ( _newGroupButton = new Button(0, 0x8B, 0x8D, 0x8C) { X = x, Y = Height, ContainsByBounds = true, ButtonAction = ButtonAction.Activate } ); Add ( _checkReal = new Checkbox ( 0x938, 0x939, ResGumps.ShowReal, 1, 0x0386, false ) { X = _newGroupButton.X - 5 + _newGroupButton.Width + 30, Y = _newGroupButton.Y - 4 } ); Add ( _checkCaps = new Checkbox ( 0x938, 0x939, ResGumps.ShowCaps, 1, 0x0386, false ) { X = _newGroupButton.X - 5 + _newGroupButton.Width + 30, Y = _newGroupButton.Y + 9 } ); _checkReal.ValueChanged += UpdateSkillsValues; _checkCaps.ValueChanged += UpdateSkillsValues; LoadSkills(); Add(_resetGroups = new NiceButton(57, _background.Height + 15, 82, 18, ButtonAction.Activate, ResGumps.ResetGroups, hue: 0x26, unicode: true, font: 1) { ButtonParameter = 1, IsSelectable = false, //Alpha = 1f }); Add(_hitBox = new HitBox(245, 0, 15, 20)); _hitBox.MouseUp += _hitBox_MouseUp; _gumpPic.MouseDoubleClick += _gumpPic_MouseDoubleClick; _container.ReArrangeChildren(); }