public override void OnButtonClick(int buttonID) { if (_buttonsToSkillsValues.TryGetValue((Buttons)buttonID, out string fieldValue)) { if (_sortField == fieldValue) { _sortAsc = !_sortAsc; } _sortField = fieldValue; } if (FindControls <NiceButton>().Any(s => s.ToPage == buttonID)) { NiceButton btn = FindControls <NiceButton>().First(s => s.ToPage == buttonID); Graphic g = (Graphic)(_sortAsc ? 0x985 : 0x983); _sortOrderIndicator.Graphic = g; _sortOrderIndicator.Texture = FileManager.Gumps.GetTexture(g); _sortOrderIndicator.X = btn.X + btn.Width - 15; _sortOrderIndicator.Y = btn.Y + 5; } _updateSkillsNeeded = true; }
public override void OnButtonClick(int buttonID) { if (_buttonsToSkillsValues.TryGetValue((Buttons)buttonID, out string fieldValue)) { if (_sortField == fieldValue) { _sortAsc = !_sortAsc; } _sortField = fieldValue; } if (FindControls <NiceButton>().Any(s => s.ButtonParameter == buttonID)) { NiceButton btn = FindControls <NiceButton>().First(s => s.ButtonParameter == buttonID); ushort g = (ushort)(_sortAsc ? 0x985 : 0x983); _sortOrderIndicator.Graphic = g; _sortOrderIndicator.X = btn.X + btn.Width - 15; _sortOrderIndicator.Y = btn.Y + 5; } _updateSkillsNeeded = true; }
public LootListGump() : base(0, 0) { if (ProfileManager.Current.LootList == null) { ProfileManager.Current.LootList = new List <ushort[]>(); } _items = ProfileManager.Current.LootList; //if (_items == null) //{ // Dispose(); // return; //} X = _lastX; Y = _lastY; CanMove = true; AcceptMouseInput = true; _background = new AlphaBlendControl(); _background.Width = 120 * ProfileManager.Current.CorpseScale; _background.Height = 160 * ProfileManager.Current.CorpseScale; Add(_background); Width = _background.Width; Height = _background.Height; NiceButton setLootBag = new NiceButton(3, Height - 23, 50 * ProfileManager.Current.CorpseScale, 10 * ProfileManager.Current.CorpseScale, ButtonAction.Activate, LanguageManager.Current.UI_Add) { ButtonParameter = 2, IsSelectable = false }; Add(setLootBag); _buttonPrev = new NiceButton(Width - 50, Height - 20, 20, 20, ButtonAction.Activate, "<<") { ButtonParameter = 0, IsSelectable = false }; _buttonNext = new NiceButton(Width - 20, Height - 20, 20, 20, ButtonAction.Activate, ">>") { ButtonParameter = 1, IsSelectable = false }; _buttonNext.IsEnabled = _buttonPrev.IsEnabled = false; _buttonNext.IsVisible = _buttonPrev.IsVisible = false; Add(_buttonPrev); Add(_buttonNext); if (_items != null) { RedrawItems(); } }
public PartyInviteGump(uint inviter) : base(0, 0) { CanCloseWithRightClick = true; AlphaBlendControl partyGumpBackground = new AlphaBlendControl { Width = 250, Height = 80, X = ProfileManager.Current.GameWindowSize.X / 2 - 125, Y = 150, Alpha = 0.2f }; Mobile mobile = World.Mobiles.Get(inviter); Label text = new Label(string.Format(ResGumps.P0HasInvitedYouToParty, mobile == null || string.IsNullOrEmpty(mobile.Name) ? ResGumps.NoName : mobile.Name), true, 15) { X = ProfileManager.Current.GameWindowSize.X / 2 - 115, Y = 165 }; NiceButton acceptButton = new NiceButton(ProfileManager.Current.GameWindowSize.X / 2 + 70, 205, 45, 25, ButtonAction.Activate, ResGumps.Accept); NiceButton declineButton = new NiceButton(ProfileManager.Current.GameWindowSize.X / 2 + 10, 205, 45, 25, ButtonAction.Activate, ResGumps.Decline); Add(partyGumpBackground); Add(text); Add(acceptButton); Add(declineButton); acceptButton.MouseUp += (sender, e) => { if (World.Party.Inviter != 0 && World.Party.Leader == 0) { GameActions.RequestPartyAccept(World.Party.Inviter); World.Party.Leader = World.Party.Inviter; World.Party.Inviter = 0; } base.Dispose(); }; declineButton.MouseUp += (sender, e) => { if (World.Party.Inviter != 0 && World.Party.Leader == 0) { NetClient.Socket.Send(new PPartyDecline(World.Party.Inviter)); World.Party.Inviter = 0; } base.Dispose(); }; }
public GridLootGump(Serial local) : base(local, 0) { _corpse = World.Items.Get(local); if (_corpse == null) { Dispose(); return; } X = _lastX; Y = _lastY; CanMove = true; AcceptMouseInput = true; _background = new AlphaBlendControl(); _background.Width = 300 - 10; _background.Height = 400; Add(_background); Width = _background.Width; Height = _background.Height; NiceButton setLootBag = new NiceButton(3, Height - 23, 100, 20, ButtonAction.Activate, "Set loot bag") { ButtonParameter = 2, IsSelectable = false }; Add(setLootBag); _buttonPrev = new NiceButton(Width - 50, Height - 20, 20, 20, ButtonAction.Activate, "<<") { ButtonParameter = 0, IsSelectable = false }; _buttonNext = new NiceButton(Width - 20, Height - 20, 20, 20, ButtonAction.Activate, ">>") { ButtonParameter = 1, IsSelectable = false }; _buttonNext.IsEnabled = _buttonPrev.IsEnabled = false; _buttonNext.IsVisible = _buttonPrev.IsVisible = false; Add(_buttonPrev); Add(_buttonNext); RedrawItems(); }
public PartyInviteGump(uint inviter) : base(0, 0) { CanCloseWithRightClick = true; var partyGumpBackground = new AlphaBlendControl() { Width = 250, Height = 80, X = (ProfileManager.Current.GameWindowSize.X / 2) - 125, Y = 150, Alpha = 0.2f }; Mobile mobile = World.Mobiles.Get(inviter); var text = new Label($"{ (mobile == null || string.IsNullOrEmpty(mobile.Name) ? "[no-name]" : mobile.Name) }\n has invited you to join a party.", true, 15) { X = (ProfileManager.Current.GameWindowSize.X / 2) - 115, Y = 165, }; var acceptButton = new NiceButton(((ProfileManager.Current.GameWindowSize.X / 2) + 70), 205, 45, 25, ButtonAction.Activate, "Accept"); var declineButton = new NiceButton(((ProfileManager.Current.GameWindowSize.X / 2) + 10), 205, 45, 25, ButtonAction.Activate, "Decline"); Add(partyGumpBackground); Add(text); Add(acceptButton); Add(declineButton); acceptButton.MouseUp += (sender, e) => { if (World.Party.Inviter != 0 && World.Party.Leader == 0) { GameActions.RequestPartyAccept(World.Party.Inviter); World.Party.Leader = World.Party.Inviter; World.Party.Inviter = 0; } base.Dispose(); }; declineButton.MouseUp += (sender, e) => { if (World.Party.Inviter != 0 && World.Party.Leader == 0) { NetClient.Socket.Send(new PPartyDecline(World.Party.Inviter)); World.Party.Inviter = 0; } base.Dispose(); }; }
public GridLootGump(Serial local) : base(local, 0) { _corpse = World.Items.Get(local); if (_corpse == null) { Dispose(); return; } X = Engine.Profile.Current.GridLootType == 2 ? 200 : 100; Y = 100; CanMove = true; AcceptMouseInput = true; _background = new AlphaBlendControl(); _background.Width = 300 - 10; _background.Height = 400; Add(_background); Width = _background.Width; Height = _background.Height; _buttonPrev = new NiceButton(Width - 50, Height - 20, 20, 20, ButtonAction.Activate, "<<") { ButtonParameter = 0, IsSelectable = false }; _buttonNext = new NiceButton(Width - 20, Height - 20, 20, 20, ButtonAction.Activate, ">>") { ButtonParameter = 1, IsSelectable = false }; _buttonNext.IsEnabled = _buttonPrev.IsEnabled = false; _buttonNext.IsVisible = _buttonPrev.IsVisible = false; Add(_buttonPrev); Add(_buttonNext); RedrawItems(); }
public GridLootGump(uint local) : base(local, 0) { _corpse = World.Items.Get(local); if (_corpse == null) { Dispose(); return; } if (World.Player.ManualOpenedCorpses.Contains(LocalSerial)) { World.Player.ManualOpenedCorpses.Remove(LocalSerial); } else if (World.Player.AutoOpenedCorpses.Contains(LocalSerial) && ProfileManager.Current != null && ProfileManager.Current.SkipEmptyCorpse) { IsVisible = false; _hideIfEmpty = true; } X = _lastX; Y = _lastY; CanMove = true; AcceptMouseInput = true; WantUpdateSize = false; CanCloseWithRightClick = true; _background = new AlphaBlendControl(); _background.Width = 300; _background.Height = 400; Add(_background); Width = _background.Width; Height = _background.Height; NiceButton setLootBag = new NiceButton(3, Height - 23, 100, 20, ButtonAction.Activate, "Set loot bag") { ButtonParameter = 2, IsSelectable = false }; Add(setLootBag); _buttonPrev = new NiceButton(Width - 80, Height - 20, 40, 20, ButtonAction.Activate, "<<") { ButtonParameter = 0, IsSelectable = false }; _buttonNext = new NiceButton(Width - 40, Height - 20, 40, 20, ButtonAction.Activate, ">>") { ButtonParameter = 1, IsSelectable = false }; _buttonNext.IsVisible = _buttonPrev.IsVisible = false; Add(_buttonPrev); Add(_buttonNext); Add(_currentPageLabel = new Label("1", true, 999, align: IO.Resources.TEXT_ALIGN_TYPE.TS_CENTER) { X = Width / 2 - 5, Y = Height - 20, }); _corpse.Items.Added += Items_Added; _corpse.Items.Removed += Items_Removed; }
public GridLootGump(uint local) : base(local, 0) { _corpse = World.Items.Get(local); if (_corpse == null) { Dispose(); return; } if (World.Player.ManualOpenedCorpses.Contains(LocalSerial)) { World.Player.ManualOpenedCorpses.Remove(LocalSerial); } else if (World.Player.AutoOpenedCorpses.Contains(LocalSerial) && ProfileManager.CurrentProfile != null && ProfileManager.CurrentProfile.SkipEmptyCorpse) { IsVisible = false; _hideIfEmpty = true; } X = _lastX; Y = _lastY; CanMove = true; AcceptMouseInput = true; WantUpdateSize = true; CanCloseWithRightClick = true; _background = new AlphaBlendControl(); //_background.Width = MAX_WIDTH; //_background.Height = MAX_HEIGHT; Add(_background); Width = _background.Width; Height = _background.Height; _setlootbag = new NiceButton ( 3, Height - 23, 100, 20, ButtonAction.Activate, ResGumps.SetLootBag ) { ButtonParameter = 2, IsSelectable = false }; Add(_setlootbag); _buttonPrev = new NiceButton ( Width - 80, Height - 20, 40, 20, ButtonAction.Activate, ResGumps.Prev ) { ButtonParameter = 0, IsSelectable = false }; _buttonNext = new NiceButton ( Width - 40, Height - 20, 40, 20, ButtonAction.Activate, ResGumps.Next ) { ButtonParameter = 1, IsSelectable = false }; _buttonNext.IsVisible = _buttonPrev.IsVisible = false; Add(_buttonPrev); Add(_buttonNext); Add ( _currentPageLabel = new Label("1", true, 999, align: TEXT_ALIGN_TYPE.TS_CENTER) { X = Width / 2 - 5, Y = Height - 20 } ); Add ( _corpseNameLabel = new Label(GetCorpseName(), true, 0x0481, align: TEXT_ALIGN_TYPE.TS_CENTER, maxwidth: 300) { Width = 300, X = 0, Y = 0 } ); }
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 GridLootGump(uint local) : base(local, 0) { _corpse = World.Items.Get(local); if (_corpse == null) { Dispose(); return; } if (World.Player.ManualOpenedCorpses.Contains(LocalSerial)) { World.Player.ManualOpenedCorpses.Remove(LocalSerial); } else if (World.Player.AutoOpenedCorpses.Contains (LocalSerial) && ProfileManager.CurrentProfile != null && ProfileManager.CurrentProfile.SkipEmptyCorpse) { IsVisible = false; _hideIfEmpty = true; } X = _lastX; Y = _lastY; CanMove = true; AcceptMouseInput = true; WantUpdateSize = true; CanCloseWithRightClick = true; _background = new AlphaBlendControl(); //_background.Width = MAX_WIDTH; //_background.Height = MAX_HEIGHT; // ## BEGIN - END ## // if (ProfileManager.CurrentProfile.UOClassicCombatAL_EnableGridLootColoring) { if (_corpse.LootFlag != 0xFF && _corpse.LootFlag == ProfileManager.CurrentProfile.UOClassicCombatAL_SL_Gray) //grey { _background.Hue = 0x0040; //green } if (_corpse.LootFlag != 0xFF && _corpse.LootFlag == ProfileManager.CurrentProfile.UOClassicCombatAL_SL_Red) //red { _background.Hue = 0x0040; //green } if (_corpse.LootFlag != 0xFF && _corpse.LootFlag == ProfileManager.CurrentProfile.UOClassicCombatAL_SL_Green) //green { _background.Hue = 0x0040; //green } if (_corpse.LootFlag != 0xFF && _corpse.LootFlag == ProfileManager.CurrentProfile.UOClassicCombatAL_SL_Blue) //blue { _background.Hue = 0x0021; //red } } //TRIGGER AL IF ENABLED if (ProfileManager.CurrentProfile.UOClassicCombatAL) { UOClassicCombatAL UOClassicCombatAL = UIManager.GetGump <UOClassicCombatAL>(); UOClassicCombatAL?.OpenCorpseTrigger(_corpse.Serial); } // ## BEGIN - END ## // Add(_background); Width = _background.Width; Height = _background.Height; _setlootbag = new NiceButton(3, Height - 23, 100, 20, ButtonAction.Activate, ResGumps.SetLootBag) { ButtonParameter = 2, IsSelectable = false }; Add(_setlootbag); _buttonPrev = new NiceButton(Width - 80, Height - 20, 40, 20, ButtonAction.Activate, ResGumps.Prev) { ButtonParameter = 0, IsSelectable = false }; _buttonNext = new NiceButton(Width - 40, Height - 20, 40, 20, ButtonAction.Activate, ResGumps.Next) { ButtonParameter = 1, IsSelectable = false }; _buttonNext.IsVisible = _buttonPrev.IsVisible = false; Add(_buttonPrev); Add(_buttonNext); Add ( _currentPageLabel = new Label("1", true, 999, align: TEXT_ALIGN_TYPE.TS_CENTER) { X = Width / 2 - 5, Y = Height - 20 } ); }
public GridLootGump(uint local) : base(local, 0) { _corpse = World.Items.Get(local); c = local; //if (c == null) //{ c = local; } //else //{ // if(c != local) // { // X = _lastX += 10; // Y = _lastY += 10; // c = local; // } //} if (_corpse == null) { Dispose(); return; } GridLootGump gg = UIManager.Gumps.OfType <GridLootGump>().FirstOrDefault(s => s.LocalSerial == LocalSerial); if (gg == null) { X = _lastX += 10 * ProfileManager.Current.CorpseScale; Y = _lastY += 10 * ProfileManager.Current.CorpseScale; } else { X = gg.X; Y = gg.Y; } int gx = ProfileManager.Current.GameWindowPosition.X + ProfileManager.Current.GameWindowSize.X; int gy = ProfileManager.Current.GameWindowPosition.Y + ProfileManager.Current.GameWindowSize.Y; if (X > (gx - 50)) { X = 0; } if (Y > (gy - 50)) { Y = 0; } CanMove = true; AcceptMouseInput = true; _background = new AlphaBlendControl(); _background.Width = 120 * ProfileManager.Current.CorpseScale; _background.Height = 160 * ProfileManager.Current.CorpseScale; Add(_background); Width = _background.Width; Height = _background.Height; NiceButton setLootBag = new NiceButton(3, Height - 23, 50 * ProfileManager.Current.CorpseScale, 10 * ProfileManager.Current.CorpseScale, ButtonAction.Activate, LanguageManager.Current.UI_GridLoot_SetBag) { ButtonParameter = 2, IsSelectable = false }; Add(setLootBag); _buttonPrev = new NiceButton(Width - 50, Height - 20, 20, 20, ButtonAction.Activate, "<<") { ButtonParameter = 0, IsSelectable = false }; _buttonNext = new NiceButton(Width - 20, Height - 20, 20, 20, ButtonAction.Activate, ">>") { ButtonParameter = 1, IsSelectable = false }; _buttonNext.IsEnabled = _buttonPrev.IsEnabled = false; _buttonNext.IsVisible = _buttonPrev.IsVisible = false; if (_corpse.Items.Count == 0 && ProfileManager.Current.SkipEmptyCorpse) { IsVisible = false; } else { IsVisible = true; } Add(_buttonPrev); Add(_buttonNext); Add(_currentPageLabel = new Label("1", true, 999, align: IO.Resources.TEXT_ALIGN_TYPE.TS_CENTER) { X = Width / 2 - 5, Y = Height - 20, }); _corpse.Items.Added += Items_Added; _corpse.Items.Removed += Items_Removed; }
internal MarkersManagerGump() : base(0, 0) { X = 50; Y = 50; CanMove = true; AcceptMouseInput = true; var button_width = 50; if (_markerFiles.Count > 0) { _markers = _markerFiles[0].Markers; button_width = WIDTH / _markerFiles.Count; } Add ( new AlphaBlendControl(0.05f) { X = 1, Y = 1, Width = WIDTH, Height = HEIGHT, Hue = 999, AcceptMouseInput = true, CanCloseWithRightClick = true, CanMove = true, } ); #region Boarder Add ( new Line ( 0, 0, WIDTH, 1, Color.Gray.PackedValue ) ); Add ( new Line ( 0, 0, 1, HEIGHT, Color.Gray.PackedValue ) ); Add ( new Line ( 0, HEIGHT, WIDTH, 1, Color.Gray.PackedValue ) ); Add ( new Line ( WIDTH, 0, 1, HEIGHT, Color.Gray.PackedValue ) ); #endregion var initY = 10; #region Legend Add(new Label(ResGumps.MarkerIcon, true, HUE_FONT, 185, 255, FontStyle.BlackBorder) { X = 5, Y = initY }); Add(new Label(ResGumps.MarkerName, true, HUE_FONT, 185, 255, FontStyle.BlackBorder) { X = 50, Y = initY }); Add(new Label(ResGumps.MarkerX, true, HUE_FONT, 35, 255, FontStyle.BlackBorder) { X = 315, Y = initY }); Add(new Label(ResGumps.MarkerY, true, HUE_FONT, 35, 255, FontStyle.BlackBorder) { X = 380, Y = initY }); Add(new Label(ResGumps.MarkerColor, true, HUE_FONT, 35, 255, FontStyle.BlackBorder) { X = 420, Y = initY }); Add(new Label(ResGumps.Edit, true, HUE_FONT, 35, 255, FontStyle.BlackBorder) { X = 475, Y = initY }); Add(new Label(ResGumps.Remove, true, HUE_FONT, 40, 255, FontStyle.BlackBorder) { X = 505, Y = initY }); Add(new Label(ResGumps.MarkerGoTo, true, HUE_FONT, 40, 255, FontStyle.BlackBorder) { X = 550, Y = initY }); #endregion Add ( new Line ( 0, initY + 20, WIDTH, 1, Color.Gray.PackedValue ) ); // Search Field Add(_searchTextBox = new SearchTextBoxControl(WIDTH / 2 - 150, 40)); DrawArea(_markerFiles[_categoryId].IsEditable); var initX = 0; foreach (var file in _markerFiles) { var b = new NiceButton( button_width * initX, HEIGHT - 40, button_width, 40, ButtonAction.Activate, file.Name, MARKERS_CATEGORY_GROUP_INDEX ) { ButtonParameter = initX, IsSelectable = true, }; b.SetTooltip(file.Name); if (initX == 0) { b.IsSelected = true; } Add(b); Add ( new Line ( b.X, b.Y, 1, b.Height, Color.Gray.PackedValue ) ); initX++; } Add ( new Line ( 0, HEIGHT - 40, WIDTH, 1, Color.Gray.PackedValue ) ); SetInScreen(); }
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(); }
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(); }