internal GumpBackGround(GumpPicTiled bg) { Location = new Point2D(bg.X, bg.Y); Size = new Size(bg.Height, bg.Width); GumpID = bg.GumpId; Page = bg.Page; ElementID = bg.ElemNum; }
public CharacterListGump(Action onBack, Action <int> onLogin, Action <int> onDelete, Action onNew) : base(0, 0) { _onBackToSelectServer = onBack; _onLoginWithCharacter = onLogin; _onDeleteCharacter = onDelete; _onNewCharacter = onNew; // get the resource provider var provider = Service.Get <IResourceProvider>(); // backdrop AddControl(_background = new GumpPicTiled(this, 0, 0, 800, 600, 9274)); AddControl(new GumpPic(this, 0, 0, 5500, 0)); // quit button AddControl(new Button(this, 554, 2, 5513, 5515, ButtonTypes.Activate, 0, (int)Buttons.QuitButton)); ((Button)LastControl).GumpOverID = 5514; // Page 1 - select a character // back button AddControl(new Button(this, 586, 435, 5537, 5539, ButtonTypes.Activate, 0, (int)Buttons.BackButton), 1); ((Button)LastControl).GumpOverID = 5538; // forward button AddControl(new Button(this, 610, 435, 5540, 5542, ButtonTypes.Activate, 0, (int)Buttons.ForwardButton), 1); ((Button)LastControl).GumpOverID = 5541; // center message window backdrop AddControl(new ResizePic(this, 160, 70, 2600, 408, 390), 1); AddControl(new TextLabelAscii(this, 266, 112, 2, 2016, provider.GetString(3000050)), 1); // delete button AddControl(new Button(this, 224, 398, 5530, 5532, ButtonTypes.Activate, 0, (int)Buttons.DeleteCharacterButton), 1); ((Button)LastControl).GumpOverID = 5531; // new button AddControl(new Button(this, 442, 398, 5533, 5535, ButtonTypes.Activate, 0, (int)Buttons.NewCharacterButton), 1); ((Button)LastControl).GumpOverID = 5534; // Page 2 - logging in to server // center message window backdrop AddControl(new ResizePic(this, 116, 95, 2600, 408, 288), 2); AddControl(new TextLabelAscii(this, 166, 143, 2, 2016, provider.GetString(3000001)), 2); IsUncloseableWithRMB = true; }
public PartyGumpAdvanced() : base(0, 0) { _partyListEntries = new List <PartyListEntry>(); _line = new Texture2D(Engine.Batcher.GraphicsDevice, 1, 1); _line.SetData(new[] { Color.White }); X = 100; Y = 100; CanMove = true; AcceptMouseInput = false; Add(_gameBorder = new GameBorder(0, 0, 320, 400, 4)); Add(_gumpPicTiled = new GumpPicTiled(4, 4, 320 - 8, 400 - 8, 0x0A40) { IsTransparent = true }); Add(_gumpPicTiled); _scrollArea = new ScrollArea(20, 60, 295, 190, true) { AcceptMouseInput = true }; Add(_scrollArea); Add(new Label("Bar", true, 1153) { X = 30, Y = 25 }); Add(new Label("Kick", true, 1153) { X = 60, Y = 25 }); Add(new Label("Player", true, 1153) { X = 100, Y = 25 }); Add(new Label("Status", true, 1153) { X = 250, Y = 25 }); //====================================================== Add(_messagePartyButton = new Button((int)Buttons.Message, 0xFAB, 0xFAC, 0xFAD) { X = 30, Y = 275, ButtonAction = ButtonAction.Activate, IsVisible = false }); Add(_messagePartyLabel = new Label("Message party", true, 1153) { X = 70, Y = 275, IsVisible = false }); //====================================================== Add(_lootMeButton = new Button((int)Buttons.Loot, 0xFA2, 0xFA3, 0xFA4) { X = 30, Y = 300, ButtonAction = ButtonAction.Activate, IsVisible = false }); Add(_lootMeLabel = new Label("Party CANNOT loot me", true, 1153) { X = 70, Y = 300, IsVisible = false }); //====================================================== Add(_leaveButton = new Button((int)Buttons.Leave, 0xFAE, 0xFAF, 0xFB0) { X = 30, Y = 325, ButtonAction = ButtonAction.Activate, IsVisible = false }); Add(_leaveLabel = new Label("Leave party", true, 1153) { X = 70, Y = 325, IsVisible = false }); //====================================================== Add(_createAddButton = new Button((int)Buttons.Add, 0xFA8, 0xFA9, 0xFAA) { X = 30, Y = 350, ButtonAction = ButtonAction.Activate }); Add(_createAddLabel = new Label("Add party member", true, 1153) { X = 70, Y = 350 }); //====================================================== World.Party.PartyMemberChanged += OnPartyMemberChanged; }
public ShopGump(uint serial, bool isBuyGump, int x, int y) : base(serial, 0) //60 is the base height, original size { int height = ProfileManager.Current.VendorGumpHeight; if (_shopGumpParts == null) { GenerateVirtualTextures(); } 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; int add = isBuyGump ? 0 : 6; GumpPic pic = new GumpPic(0, 0, _shopGumpParts[0 + add], 0); Add(pic); pic = new GumpPic(250, 144, _shopGumpParts[3 + add], 0); Add(pic); Add(_middleGumpLeft = new GumpPicTiled(0, 64, pic.Width, height, _shopGumpParts[1 + add])); Add(new GumpPic(0, _middleGumpLeft.Height + _middleGumpLeft.Y, _shopGumpParts[2 + add], 0)); _shopScrollArea = new ScrollArea(30, 60, 225, _middleGumpLeft.Height + _middleGumpLeft.Y + 50, false, _middleGumpLeft.Height + _middleGumpLeft.Y); Add(_shopScrollArea); Add(_middleGumpRight = new GumpPicTiled(250, 144 + 64, pic.Width, _middleGumpLeft.Height >> 1, _shopGumpParts[4 + add])); Add(new GumpPic(250, _middleGumpRight.Height + _middleGumpRight.Y, _shopGumpParts[5 + add], 0)); HitBox boxAccept = new HitBox(280, 306 + _middleGumpRight.Height, 34, 30) { Alpha = 1 }; HitBox boxClear = new HitBox(452, 310 + _middleGumpRight.Height, 24, 24) { Alpha = 1 }; boxAccept.MouseUp += (sender, e) => { OnButtonClick((int)Buttons.Accept); }; boxClear.MouseUp += (sender, e) => { OnButtonClick((int)Buttons.Clear); }; Add(boxAccept); Add(boxClear); if (isBuyGump) { Add(_totalLabel = new Label("0", true, 0x0386, 0, 1) { X = 318, Y = 281 + _middleGumpRight.Height }); Add(_playerGoldLabel = new Label(World.Player.Gold.ToString(), true, 0x0386, 0, 1) { X = 436, Y = 281 + _middleGumpRight.Height }); } else { Add(_totalLabel = new Label("0", true, 0x0386, 0, 1) { X = 436, Y = 281 + _middleGumpRight.Height }); } Add(new Label(World.Player.Name, false, 0x0386, font: 5) { X = 322, Y = 308 + _middleGumpRight.Height }); Add(_transactionScrollArea = new ScrollArea(260, 215, 245, 53 + _middleGumpRight.Height, false)); HitBox upButton = new HitBox(233, 50, 18, 16) { Alpha = 1 }; upButton.MouseDown += (sender, e) => { _isUpDOWN = true; }; upButton.MouseUp += (sender, e) => { _isUpDOWN = false; }; Add(upButton); HitBox downButton = new HitBox(233, 130 + _middleGumpLeft.Height, 18, 16) { Alpha = 1 }; downButton.MouseDown += (sender, e) => { _isDownDOWN = true; }; downButton.MouseUp += (sender, e) => { _isDownDOWN = false; }; Add(downButton); HitBox upButtonT = new HitBox(483, 195, 18, 16) { Alpha = 1 }; upButtonT.MouseDown += (sender, e) => { _isUpDOWN_T = true; }; upButtonT.MouseUp += (sender, e) => { _isUpDOWN_T = false; }; Add(upButtonT); HitBox downButtonT = new HitBox(483, 270 + _middleGumpRight.Height, 18, 16) { Alpha = 1 }; downButtonT.MouseDown += (sender, e) => { _isDownDOWN_T = true; }; downButtonT.MouseUp += (sender, e) => { _isDownDOWN_T = false; }; Add(downButtonT); }