public ColorPickerGump(Serial serial, ushort graphic, int x, int y, Action <ushort> okClicked) : base(serial, 0) { _graphic = graphic; CanMove = true; AcceptMouseInput = false; X = x; Y = y; Add(new GumpPic(0, 0, 0x0906, 0)); Add(new Button(0, 0x0907, 0x0908, 0x909) { X = 208, Y = 138, ButtonAction = ButtonAction.Activate }); HSliderBar slider; Add(slider = new HSliderBar(39, 142, 145, SLIDER_MIN, SLIDER_MAX, 1, HSliderBarStyle.BlueWidgetNoBar)); slider.ValueChanged += (sender, e) => { _box.Graduation = slider.Value; }; Add(_box = new ColorPickerBox(34, 34)); _box.ColorSelectedIndex += (sender, e) => { _dyeTybeImage.Hue = (ushort)(_box.SelectedHue + 1); }; Add(_dyeTybeImage = new StaticPic(0x0FAB, 0) { X = 200, Y = 58 }); _okClicked = okClicked; }
private void BuildSpeech() { const int PAGE = 7; ScrollArea rightArea = new ScrollArea(190, 20, WIDTH - 210, 420, true); ScrollAreaItem item = new ScrollAreaItem(); _scaleSpeechDelay = new Checkbox(0x00D2, 0x00D3, "Scale speech delay by length", FONT, HUE_FONT, true) { IsChecked = Engine.Profile.Current.ScaleSpeechDelay }; item.Add(_scaleSpeechDelay); rightArea.Add(item); item = new ScrollAreaItem(); Label text = new Label("- Speech delay:", true, HUE_FONT, font: FONT); item.Add(text); _sliderSpeechDelay = new HSliderBar(100, 5, 150, 1, 1000, Engine.Profile.Current.SpeechDelay, HSliderBarStyle.MetalWidgetRecessedBar, true, FONT, HUE_FONT, true); item.Add(_sliderSpeechDelay); rightArea.Add(item); _speechColorPickerBox = CreateClickableColorBox(rightArea, 0, 30, Engine.Profile.Current.SpeechHue, "Speech color", 20, 30); _emoteColorPickerBox = CreateClickableColorBox(rightArea, 0, 0, Engine.Profile.Current.EmoteHue, "Emote color", 20, 0); _partyMessageColorPickerBox = CreateClickableColorBox(rightArea, 0, 0, Engine.Profile.Current.PartyMessageHue, "Party message color", 20, 0); _guildMessageColorPickerBox = CreateClickableColorBox(rightArea, 0, 0, Engine.Profile.Current.GuildMessageHue, "Guild message color", 20, 0); _allyMessageColorPickerBox = CreateClickableColorBox(rightArea, 0, 0, Engine.Profile.Current.AllyMessageHue, "Alliance message color", 20, 0); Add(rightArea, PAGE); }
public SplitMenuGump(Item item, Point offset) : base(item, 0) { Item = item; _offsert = offset; CanMove = true; AcceptMouseInput = false; GumpPic background = new GumpPic(0, 0, 0x085C, 0); Add(background); Add(_slider = new HSliderBar(29, 16, 105, 1, item.Amount, item.Amount, HSliderBarStyle.BlueWidgetNoBar)); _lastValue = _slider.Value; Add(_okButton = new Button(0, 0x085d, 0x085e, 0x085f) { ButtonAction = ButtonAction.Default, X = 102, Y = 37 }); _okButton.MouseClick += OkButtonOnMouseClick; Add(_textBox = new TextBox(1, isunicode: false, hue: 0x0386, width: 60, maxWidth: 1000) { X = 29, Y = 42, Width = 60, NumericOnly = true, }); _textBox.SetText(item.Amount.ToString()); }
public SplitItemStackGump(Item item, Point pickupOffset) : base(0, 0) { Item = item; m_PickupOffset = pickupOffset; IsMoveable = true; // Background AddControl(new GumpPic(this, 0, 0, 0x085c, 0)); // Slider m_Slider = (HSliderBar)AddControl(new HSliderBar(this, 30, 16, 104, 0, item.Amount, item.Amount, HSliderBarStyle.BlueWidgetNoBar)); m_LastValue = m_Slider.Value; // Ok button AddControl(m_OKButton = new Button(this, 102, 38, 0x085d, 0x085e, ButtonTypes.Default, 0, 0)); m_OKButton.GumpOverID = 0x085f; m_OKButton.MouseClickEvent += ClickOkayButton; // Text entry field m_AmountEntry = (TextEntry)AddControl(new TextEntry(this, 30, 39, 60, 16, 0, 0, 5, item.Amount.ToString())); m_AmountEntry.LeadingHtmlTag = "<big>"; m_AmountEntry.LegacyCarat = true; m_AmountEntry.Hue = 1001; m_AmountEntry.ReplaceDefaultTextOnFirstKeypress = true; m_AmountEntry.NumericOnly = true; }
public SplitMenuGump(uint serial, Point offset) : base(serial, 0) { Item item = World.Items.Get(serial); if (item == null || item.IsDestroyed) { Dispose(); return; } _offset = offset; CanMove = true; AcceptMouseInput = false; CanCloseWithRightClick = true; GumpPic background = new GumpPic(0, 0, 0x085C, 0) { ContainsByBounds = true }; Add(background); Add(_slider = new HSliderBar(29, 16, 105, 1, item.Amount, item.Amount, HSliderBarStyle.BlueWidgetNoBar)); _lastValue = _slider.Value; Add ( _okButton = new Button(0, 0x085d, 0x085e, 0x085f) { ButtonAction = ButtonAction.Default, X = 102, Y = 37 } ); _okButton.MouseUp += OkButtonOnMouseClick; Add ( _textBox = new StbTextBox(1, isunicode: false, hue: 0x0386, maxWidth: 60) { X = 29, Y = 42, Width = 60, Height = 20, NumbersOnly = true } ); _textBox.SetText(item.Amount.ToString()); _textBox.TextChanged += (sender, args) => { UpdateText(); }; _textBox.SetKeyboardFocus(); _slider.ValueChanged += (sender, args) => { UpdateText(); }; }
private void BuildSounds() { const int PAGE = 2; ScrollArea rightArea = new ScrollArea(190, 60, 390, 380, true); _enableSounds = CreateCheckBox(rightArea, "Sounds", Engine.Profile.Current.EnableSound, 0, 0); ScrollAreaItem item = new ScrollAreaItem(); Label text = new Label("- Sounds volume:", true, 0, 0, 1); _soundsVolume = new HSliderBar(150, 5, 180, 0, 100, Engine.Profile.Current.SoundVolume, HSliderBarStyle.MetalWidgetRecessedBar, true, 1); item.Add(text); item.Add(_soundsVolume); rightArea.Add(item); _enableMusic = CreateCheckBox(rightArea, "Music", Engine.Profile.Current.EnableMusic, 0, 0); item = new ScrollAreaItem(); text = new Label("- Music volume:", true, 0, 0, 1); _musicVolume = new HSliderBar(150, 5, 180, 0, 100, Engine.Profile.Current.MusicVolume, HSliderBarStyle.MetalWidgetRecessedBar, true, 1); item.Add(text); item.Add(_musicVolume); rightArea.Add(item); _footStepsSound = CreateCheckBox(rightArea, "Footsteps sound", Engine.Profile.Current.EnableFootstepsSound, 0, 30); _combatMusic = CreateCheckBox(rightArea, "Combat music", Engine.Profile.Current.EnableCombatMusic, 0, 0); _musicInBackground = CreateCheckBox(rightArea, "Reproduce music when ClassicUO is not focused", Engine.Profile.Current.ReproduceSoundsInBackground, 0, 0); _loginMusic = CreateCheckBox(rightArea, "Login music", Engine.GlobalSettings.LoginMusic, 0, 40); item = new ScrollAreaItem(); text = new Label("- Login music volume:", true, 0, 0, 1); _loginMusicVolume = new HSliderBar(150, 5, 180, 0, 100, Engine.GlobalSettings.LoginMusicVolume, HSliderBarStyle.MetalWidgetRecessedBar, true, 1); item.Add(text); item.Add(_loginMusicVolume); rightArea.Add(item); Add(rightArea, PAGE); }
public SplitMenuGump(Item item, Point offset) : base(item, 0) { Item = item; ItemGump itemGump = Engine.UI.GetChildByLocalSerial <ContainerGump, ItemGump>(item.Container, item.Serial); if (itemGump != null) { _itemGump = new WeakReference(itemGump); itemGump.Disposed += ItemGumpOnDisposed; } _offsert = offset; CanMove = true; AcceptMouseInput = false; GumpPic background = new GumpPic(0, 0, 0x085C, 0); Add(background); Add(_slider = new HSliderBar(29, 16, 105, 1, item.Amount, item.Amount, HSliderBarStyle.BlueWidgetNoBar)); _lastValue = _slider.Value; Add(_okButton = new Button(0, 0x085d, 0x085e, 0x085f) { ButtonAction = ButtonAction.Default, X = 102, Y = 37 }); _okButton.MouseClick += OkButtonOnMouseClick; Add(_textBox = new TextBox(1, isunicode: false, hue: 0x0386, width: 60, maxWidth: 1000) { X = 29, Y = 42, Width = 60, NumericOnly = true }); _textBox.SetText(item.Amount.ToString()); }
public GridLootItem(Serial serial) { _serial = serial; Item item = World.Items.Get(serial); if (item == null) { Dispose(); return; } const int SIZE = 70; CanMove = false; HSliderBar amount = new HSliderBar(0, 0, SIZE, 1, item.Amount, item.Amount, HSliderBarStyle.MetalWidgetRecessedBar, true, color: 0xFFFF, drawUp: true); Add(amount); amount.IsVisible = amount.IsEnabled = amount.MaxValue > 1; AlphaBlendControl background = new AlphaBlendControl(); background.Y = 15; background.Width = SIZE; background.Height = SIZE; Add(background); _texture = new TextureControl(); _texture.IsPartial = item.ItemData.IsPartialHue; _texture.ScaleTexture = true; _texture.Hue = item.Hue; _texture.Texture = FileManager.Art.GetTexture(item.DisplayedGraphic); _texture.Y = 15; _texture.Width = SIZE; _texture.Height = SIZE; _texture.CanMove = false; if (World.ClientFlags.TooltipsEnabled) { _texture.SetTooltip(item); } Add(_texture); _texture.MouseUp += (sender, e) => { if (e.Button == MouseButton.Left) { NetClient.Socket.Send(new PPickUpRequest(item, (ushort)amount.Value)); GameActions.DropItem(_serial, Position.INVALID, World.Player.Equipment[(int)Layer.Backpack]); } }; Width = background.Width; Height = background.Height + 15; WantUpdateSize = false; }
public MenuGump(uint serial, uint serv, string name) : base(serial, serv) { CanMove = true; AcceptMouseInput = true; CanCloseWithRightClick = true; IsFromServer = true; Add(new GumpPic(0, 0, 0x0910, 0)); Add ( new ColorBox(217, 49, 0, 0xFF000001) { X = 40, Y = 42 } ); Label label = new Label(name, false, 0x0386, 200, 1, FontStyle.Fixed) { X = 39, Y = 18 }; Add(label); _container = new ContainerHorizontal { X = 40, Y = 42, Width = 217, Height = 49, WantUpdateSize = false }; Add(_container); Add(_slider = new HSliderBar(40, _container.Y + _container.Height + 12, 217, 0, 1, 0, HSliderBarStyle.MetalWidgetRecessedBar)); _slider.ValueChanged += (sender, e) => { _container.Value = _slider.Value; }; HitBox left = new HitBox(25, 60, 10, 15) { Alpha = 1 }; left.MouseDown += (sender, e) => { _isDown = true; _isLeft = true; }; left.MouseUp += (sender, e) => { _isDown = false; }; Add(left); HitBox right = new HitBox(260, 60, 10, 15) { Alpha = 1 }; right.MouseDown += (sender, e) => { _isDown = true; _isLeft = false; }; right.MouseUp += (sender, e) => { _isDown = false; }; Add(right); }
public OptionsGump() : base(0, 0) { BuildResolutionsLists(); IsMoveable = true; AddControl(new ResizePic(this, 40, 0, 2600, 550, 450)); //left column AddControl(new Button(this, 0, 40, 218, 217, ButtonTypes.SwitchPage, 1, (int)Buttons.Sound)); AddControl(new Button(this, 0, 110, 220, 219, ButtonTypes.SwitchPage, 2, (int)Buttons.Help)); AddControl(new Button(this, 0, 250, 224, 223, ButtonTypes.SwitchPage, 3, (int)Buttons.Chat)); AddControl(new Button(this, 0, 320, 237, 236, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros)); //right column AddControl(new Button(this, 576, 40, 226, 225, ButtonTypes.SwitchPage, 5, (int)Buttons.Interface)); AddControl(new Button(this, 576, 110, 228, 227, ButtonTypes.SwitchPage, 6, (int)Buttons.Display)); AddControl(new Button(this, 576, 180, 230, 229, ButtonTypes.SwitchPage, 7, (int)Buttons.Reputation)); AddControl(new Button(this, 576, 250, 232, 231, ButtonTypes.SwitchPage, 8, (int)Buttons.Miscellaneous)); AddControl(new Button(this, 576, 320, 235, 234, ButtonTypes.SwitchPage, 9, (int)Buttons.Filters)); //bottom buttons AddControl(new Button(this, 140, 410, 243, 241, ButtonTypes.Activate, 0, (int)Buttons.Cancel)); AddControl(new Button(this, 240, 410, 239, 240, ButtonTypes.Activate, 0, (int)Buttons.Apply)); AddControl(new Button(this, 340, 410, 246, 244, ButtonTypes.Activate, 0, (int)Buttons.Default)); AddControl(new Button(this, 440, 410, 249, 248, ButtonTypes.Activate, 0, (int)Buttons.Okay)); m_UserInterface = ServiceRegistry.GetService <UserInterfaceService>(); m_World = ServiceRegistry.GetService <WorldModel>(); // page 1 Sound and Music AddControl(new Button(this, 0, 40, 217, 217, ButtonTypes.SwitchPage, 1, (int)Buttons.Sound), 1); AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Sound and Music"), 1); AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect the sound and music you will hear while playing Ultima Online."), 1); AddControl(new TextLabelAscii(this, 85, 85, 1, 9, @"Sound on/off"), 1); m_SoundOn = (CheckBox)AddControl(new CheckBox(this, 60, 80, 210, 211, Settings.Audio.SoundOn, 61), 1); AddControl(new TextLabelAscii(this, 60, 110, 1, 9, @"Sound volume"), 1); m_SoundVolume = (HSliderBar)AddControl(new HSliderBar(this, 60, 130, 150, 0, 100, Settings.Audio.SoundVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1); m_Labels[(int)Labels.SoundVolume] = (TextLabelAscii)AddControl(new TextLabelAscii(this, 220, 130, 1, 9, Settings.Audio.SoundVolume.ToString()), 1); AddControl(new TextLabelAscii(this, 85, 155, 1, 9, @"Music on/off"), 1); m_MusicOn = (CheckBox)AddControl(new CheckBox(this, 60, 150, 210, 211, Settings.Audio.MusicOn, 62), 1); AddControl(new TextLabelAscii(this, 60, 180, 1, 9, @"Music volume"), 1); m_MusicVolume = (HSliderBar)AddControl(new HSliderBar(this, 60, 200, 150, 0, 100, Settings.Audio.MusicVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1); m_Labels[(int)Labels.MusicVolume] = (TextLabelAscii)AddControl(new TextLabelAscii(this, 220, 200, 1, 9, m_MusicVolume.Value.ToString()), 1); AddControl(new TextLabelAscii(this, 85, 225, 1, 9, @"Play footstep sound"), 1); m_FootStepSoundOn = (CheckBox)AddControl(new CheckBox(this, 60, 220, 210, 211, Settings.Audio.FootStepSoundOn, 62), 1); // page 2 Pop-up Help AddControl(new Button(this, 0, 110, 219, 219, ButtonTypes.SwitchPage, 2, (int)Buttons.Help), 2); AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Pop-up Help"), 2); AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting configure the behavior of the pop-up help."), 2); // page 3 Chat AddControl(new Button(this, 0, 250, 223, 223, ButtonTypes.SwitchPage, 3, (int)Buttons.Chat), 3); AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Chat"), 3); AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect the interface display for chat system."), 3); // page 4 Macro Options AddControl(new Button(this, 0, 320, 236, 236, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros), 4); AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Macro Options"), 4); AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @""), 4); // page 5 Interface AddControl(new Button(this, 576, 40, 225, 225, ButtonTypes.SwitchPage, 5, (int)Buttons.Interface), 5); AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Interface"), 5); AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect your interface."), 5); AddControl(new TextLabelAscii(this, 85, 85, 1, 9, @"Your character will always run if this is checked"), 5); m_AlwaysRun = (CheckBox)AddControl(new CheckBox(this, 60, 80, 210, 211, Settings.World.AlwaysRun, 61), 5); AddControl(new TextLabelAscii(this, 85, 115, 1, 9, @"Disable the Menu Bar"), 5); m_MenuBarDisabled = (CheckBox)AddControl(new CheckBox(this, 60, 110, 210, 211, Settings.World.MenuBarDisabled, 61), 5); // page 6 Display AddControl(new Button(this, 576, 110, 227, 227, ButtonTypes.SwitchPage, 6, (int)Buttons.Display), 6); AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Display"), 6); AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect your display, and adjusting some of them may improve your graphics performance.", 430), 6); AddControl(new TextLabelAscii(this, 85, 80, 1, 9, @"Enable vertical synchronization"), 6); m_IsVSyncEnabled = (CheckBox)AddControl(new CheckBox(this, 60, 80, 210, 211, Settings.Game.IsVSyncEnabled, 61), 6); AddControl(new TextLabelAscii(this, 85, 100, 1, 9, @"Some unused option"), 6); AddControl(new CheckBox(this, 60, 100, 210, 211, false, 62), 6); AddControl(new TextLabelAscii(this, 85, 120, 1, 9, @"Use full screen display"), 6); AddControl(new CheckBox(this, 60, 120, 210, 211, Settings.World.IsMaximized, 61), 6); AddControl(new TextLabelAscii(this, 60, 150, 1, 9, @"Client Window Resolution:"), 6); m_DropDownFullScreenResolutions = (DropDownList)AddControl(new DropDownList(this, 60, 165, 122, CreateResolutionsStringArrayFromList(m_FullScreenResolutionsList), 10, GetCurrentFullScreenIndex(), false), 6); AddControl(new TextLabelAscii(this, 60, 190, 1, 9, @"Play Window Resolution:"), 6); m_DropDownPlayWindowResolutions = (DropDownList)AddControl(new DropDownList(this, 60, 205, 122, CreateResolutionsStringArrayFromList(m_PlayWindowResolutionsList), 10, GetCurrentPlayWindowIndex(), false), 6); AddControl(new TextLabelAscii(this, 85, 235, 1, 9, @"Speech color"), 6); m_SpeechColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 235, 15, 15), new Rectangle(60, 235, 450, 150), 30, 10, Hues.TextTones, Settings.Game.SpeechColor), 6); AddControl(new TextLabelAscii(this, 85, 255, 1, 9, @"Emote color"), 6); m_EmoteColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 255, 15, 15), new Rectangle(60, 255, 450, 150), 30, 10, Hues.TextTones, Settings.Game.EmoteColor), 6); AddControl(new TextLabelAscii(this, 85, 275, 1, 9, @"Party message color"), 6); m_PartyMsgColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 275, 15, 15), new Rectangle(60, 275, 450, 150), 30, 10, Hues.TextTones, Settings.Game.PartyMsgColor), 6); AddControl(new TextLabelAscii(this, 85, 295, 1, 9, @"Guild message color"), 6); m_GuildMsgColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 295, 15, 15), new Rectangle(60, 295, 450, 150), 30, 10, Hues.TextTones, Settings.Game.GuildMsgColor), 6); AddControl(new TextLabelAscii(this, 85, 315, 1, 9, @"Ignore guild messages"), 6); m_IgnoreGuildMsg = (CheckBox)AddControl(new CheckBox(this, 60, 315, 210, 211, Settings.Game.IgnoreGuildMsg, 62), 6); AddControl(new TextLabelAscii(this, 85, 335, 1, 9, @"Alliance message color"), 6); m_AllianceMsgColor = (ColorPickerBox)AddControl(new ColorPickerBox(this, new Rectangle(60, 335, 15, 15), new Rectangle(60, 335, 450, 150), 30, 10, Hues.TextTones, Settings.Game.AllianceMsgColor), 6); AddControl(new TextLabelAscii(this, 85, 355, 1, 9, @"Ignore alliance messages"), 6); m_IgnoreAllianceMsg = (CheckBox)AddControl(new CheckBox(this, 60, 355, 210, 211, Settings.Game.IgnoreAllianceMsg, 62), 6); // page 7 Reputation system AddControl(new Button(this, 576, 180, 229, 229, ButtonTypes.SwitchPage, 7, (int)Buttons.Reputation), 7); AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Reputation system"), 7); AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"These settting affect the reputation system, which is Ultima Online's system for controlling antisocial behavior."), 7); // page 8 Miscellaneous AddControl(new Button(this, 576, 250, 231, 231, ButtonTypes.SwitchPage, 8, (int)Buttons.Miscellaneous), 8); AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Miscellaneous"), 8); AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @"Miscellaneous options."), 8); AddControl(new TextLabelAscii(this, 85, 80, 1, 9, @"Enable debug console"), 8); m_IsConsoleEnabled = (CheckBox)AddControl(new CheckBox(this, 60, 80, 210, 211, Settings.Debug.IsConsoleEnabled, 61), 8); AddControl(new TextLabelAscii(this, 85, 100, 1, 9, @"Show FPS"), 8); m_ShowFps = (CheckBox)AddControl(new CheckBox(this, 60, 100, 210, 211, Settings.Debug.ShowFps, 61), 8); // page 9 Filter Options AddControl(new Button(this, 576, 320, 234, 234, ButtonTypes.SwitchPage, 9, (int)Buttons.Filters), 9); AddControl(new TextLabelAscii(this, 250, 20, 1, 2, @"Filter Options"), 9); AddControl(new TextLabelAscii(this, 60, 45, 1, 9, @""), 9); }
private void BuildGeneral() { const int PAGE = 1; ScrollArea rightArea = new ScrollArea(190, 20, WIDTH - 210, 420, true); // FPS ScrollAreaItem fpsItem = new ScrollAreaItem(); Label text = new Label("- FPS:", true, HUE_FONT, font: FONT); fpsItem.Add(text); _sliderFPS = new HSliderBar(80, 5, 250, 15, 250, Engine.Profile.Current.MaxFPS, HSliderBarStyle.MetalWidgetRecessedBar, true, FONT, HUE_FONT, true); fpsItem.Add(_sliderFPS); rightArea.Add(fpsItem); fpsItem = new ScrollAreaItem(); text = new Label("- Login FPS:", true, HUE_FONT, font: FONT); fpsItem.Add(text); _sliderFPSLogin = new HSliderBar(80, 5, 250, 15, 250, Engine.GlobalSettings.MaxLoginFPS, HSliderBarStyle.MetalWidgetRecessedBar, true, FONT, HUE_FONT, true); 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); _holdDownKeyTab = CreateCheckBox(rightArea, "Hold down TAB key for combat", Engine.Profile.Current.HoldDownKeyTab, 0, 0); // show % hp mobile ScrollAreaItem hpAreaItem = new ScrollAreaItem(); text = new Label("- Mobiles HP", true, HUE_FONT, font: FONT) { Y = 10 }; hpAreaItem.Add(text); _showHpMobile = new Checkbox(0x00D2, 0x00D3, "Show HP", FONT, HUE_FONT, true) { 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, HUE_FONT, font: FONT) { Y = 10 }; highlightByFlagsItem.Add(text); _highlightByState = new Checkbox(0x00D2, 0x00D3, "Highlight by state\n(poisoned, yellow hits, paralyzed)", FONT, HUE_FONT, true) { X = 25, Y = 30, IsChecked = Engine.Profile.Current.HighlightMobilesByFlags }; highlightByFlagsItem.Add(_highlightByState); rightArea.Add(highlightByFlagsItem); _drawRoofs = CreateCheckBox(rightArea, "Hide 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); _enableCaveBorder = CreateCheckBox(rightArea, "Marking cave tiles", Engine.Profile.Current.EnableCaveBorder, 0, 0); hpAreaItem = new ScrollAreaItem(); text = new Label("- Fields: ", true, HUE_FONT, font: FONT) { Y = 10, }; hpAreaItem.Add(text); _normalFields = new RadioButton(0, 0x00D0, 0x00D1, "Normal fields", FONT, HUE_FONT, true) { X = 25, Y = 30, IsChecked = Engine.Profile.Current.FieldsType == 0, }; hpAreaItem.Add(_normalFields); _staticFields = new RadioButton(0, 0x00D0, 0x00D1, "Static fields", FONT, HUE_FONT, true) { X = 25, Y = 30 + _normalFields.Height, IsChecked = Engine.Profile.Current.FieldsType == 1 }; hpAreaItem.Add(_staticFields); _fieldsToTile = new RadioButton(0, 0x00D0, 0x00D1, "Tile fields", FONT, HUE_FONT, true) { 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, HUE_FONT, font: FONT) { 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, FONT, HUE_FONT, true); hpAreaItem.Add(_circleOfTranspRadius); _useCircleOfTransparency = new Checkbox(0x00D2, 0x00D3, "Enable circle of transparency", FONT, HUE_FONT, true) { X = 25, Y = 30, IsChecked = Engine.Profile.Current.UseCircleOfTransparency }; hpAreaItem.Add(_useCircleOfTransparency); rightArea.Add(hpAreaItem); Add(rightArea, PAGE); }
public CreateCharSkillsGump() : base(0, 0) { // get the resource provider IResourceProvider provider = ServiceRegistry.GetService <IResourceProvider>(); // backdrop AddControl(new GumpPicTiled(this, 0, 0, 800, 600, 9274)); AddControl(new GumpPic(this, 0, 0, 5500, 0)); // center menu with fancy top AddControl(new ResizePic(this, 100, 80, 2600, 470, 372), 1); AddControl(new GumpPic(this, 291, 42, 1417, 0), 1); AddControl(new GumpPic(this, 214, 58, 1419, 0), 1); AddControl(new GumpPic(this, 300, 51, 5545, 0), 1); // title text AddControl(new TextLabelAscii(this, 148, 132, 2, 841, provider.GetString(3000326)), 1); // strength, dexterity, intelligence AddControl(new TextLabelAscii(this, 158, 170, 1, 2430, provider.GetString(3000111)), 1); AddControl(new TextLabelAscii(this, 158, 250, 1, 2430, provider.GetString(3000112)), 1); AddControl(new TextLabelAscii(this, 158, 330, 1, 2430, provider.GetString(3000113)), 1); // sliders for attributes sliderAttributes = new HSliderBar[3]; sliderAttributes[0] = new HSliderBar(this, 164, 196, 93, 10, 60, 60, HSliderBarStyle.MetalWidgetRecessedBar); sliderAttributes[1] = new HSliderBar(this, 164, 276, 93, 10, 60, 10, HSliderBarStyle.MetalWidgetRecessedBar); sliderAttributes[2] = new HSliderBar(this, 164, 356, 93, 10, 60, 10, HSliderBarStyle.MetalWidgetRecessedBar); // labels for attributes lblAttributes = new TextLabelAscii[3]; lblAttributes[0] = new TextLabelAscii(this, 284, 170, 1, 2430, string.Empty); lblAttributes[1] = new TextLabelAscii(this, 284, 250, 1, 2430, string.Empty); lblAttributes[2] = new TextLabelAscii(this, 284, 330, 1, 2430, string.Empty); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (i != j) { sliderAttributes[i].PairSlider(sliderAttributes[j]); } } AddControl(sliderAttributes[i], 1); AddControl(lblAttributes[i], 1); } // sliders for skills sliderSkills = new HSliderBar[3]; sliderSkills[0] = new HSliderBar(this, 344, 204, 93, 0, 50, 50, HSliderBarStyle.MetalWidgetRecessedBar); sliderSkills[1] = new HSliderBar(this, 344, 284, 93, 0, 50, 50, HSliderBarStyle.MetalWidgetRecessedBar); sliderSkills[2] = new HSliderBar(this, 344, 364, 93, 0, 50, 0, HSliderBarStyle.MetalWidgetRecessedBar); // labels for skills lblSkills = new TextLabelAscii[3]; lblSkills[0] = new TextLabelAscii(this, 494, 200, 1, 2430, string.Empty); lblSkills[1] = new TextLabelAscii(this, 494, 280, 1, 2430, string.Empty); lblSkills[2] = new TextLabelAscii(this, 494, 360, 1, 2430, string.Empty); // drop downs for skills listSkills = new DropDownList[3]; string[] skillList = SkillsData.ListNames; listSkills[0] = new DropDownList(this, 344, 172, 182, skillList, 8, -1, true); listSkills[1] = new DropDownList(this, 344, 252, 182, skillList, 8, -1, true); listSkills[2] = new DropDownList(this, 344, 332, 182, skillList, 8, -1, true); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (i != j) { sliderSkills[i].PairSlider(sliderSkills[j]); } } AddControl(sliderSkills[i], 1); AddControl(lblSkills[i], 1); AddControl(listSkills[i], 1); } AddControl(new TextLabelAscii(this, 158, 170, 1, 2430, provider.GetString(3000111)), 1); AddControl(new TextLabelAscii(this, 158, 250, 1, 2430, provider.GetString(3000112)), 1); AddControl(new TextLabelAscii(this, 158, 330, 1, 2430, provider.GetString(3000113)), 1); // 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; // quit button AddControl(new Button(this, 554, 2, 5513, 5515, ButtonTypes.Activate, 0, (int)Buttons.QuitButton)); ((Button)LastControl).GumpOverID = 5514; IsUncloseableWithRMB = true; }
public CreateCharTradeGump(PlayerMobile character, ProfessionInfo profession) : base(0, 0) { _character = character; foreach (Skill skill in _character.Skills) { skill.ValueFixed = 0; skill.BaseFixed = 0; skill.CapFixed = 0; skill.Lock = Lock.Locked; } Add ( new ResizePic(2600) { X = 100, Y = 80, Width = 470, Height = 372 } ); // center menu with fancy top // public GumpPic(AControl parent, int x, int y, int gumpID, int hue) Add(new GumpPic(291, 42, 0x0589, 0)); Add(new GumpPic(214, 58, 0x058B, 0)); Add(new GumpPic(300, 51, 0x15A9, 0)); bool isAsianLang = string.Compare(Settings.GlobalSettings.Language, "CHT", StringComparison.InvariantCultureIgnoreCase) == 0 || string.Compare(Settings.GlobalSettings.Language, "KOR", StringComparison.InvariantCultureIgnoreCase) == 0 || string.Compare(Settings.GlobalSettings.Language, "JPN", StringComparison.InvariantCultureIgnoreCase) == 0; bool unicode = isAsianLang; byte font = (byte)(isAsianLang ? 1 : 2); ushort hue = (ushort)(isAsianLang ? 0xFFFF : 0x0386); // title text //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400) Add ( new Label(ClilocLoader.Instance.GetString(3000326), unicode, hue, font: font) { X = 148, Y = 132 } ); // strength, dexterity, intelligence Add ( new Label(ClilocLoader.Instance.GetString(3000111), unicode, 1, font: 1) { X = 158, Y = 170 } ); Add ( new Label(ClilocLoader.Instance.GetString(3000112), unicode, 1, font: 1) { X = 158, Y = 250 } ); Add ( new Label(ClilocLoader.Instance.GetString(3000113), unicode, 1, font: 1) { X = 158, Y = 330 } ); // sliders for attributes _attributeSliders = new HSliderBar[3]; Add ( _attributeSliders[0] = new HSliderBar ( 164, 196, 93, 10, 60, ProfessionInfo._VoidStats[0], HSliderBarStyle.MetalWidgetRecessedBar, true ) ); Add ( _attributeSliders[1] = new HSliderBar ( 164, 276, 93, 10, 60, ProfessionInfo._VoidStats[1], HSliderBarStyle.MetalWidgetRecessedBar, true ) ); Add ( _attributeSliders[2] = new HSliderBar ( 164, 356, 93, 10, 60, ProfessionInfo._VoidStats[2], HSliderBarStyle.MetalWidgetRecessedBar, true ) ); string[] skillList = new string[SkillsLoader.Instance.SortedSkills.Count]; for (int i = 0; i < skillList.Length; ++i) { SkillEntry entry = SkillsLoader.Instance.SortedSkills[i]; if ((World.ClientFeatures.Flags & CharacterListFlags.CLF_SAMURAI_NINJA) == 0 && (entry.Index == 52 || entry.Index == 47 || entry.Index == 53) || entry.Index == 54) { skillList[i] = string.Empty; } else { skillList[i] = entry.Name; } } int y = 172; _skillSliders = new HSliderBar[CharCreationGump._skillsCount]; _skills = new Combobox[CharCreationGump._skillsCount]; for (int i = 0; i < CharCreationGump._skillsCount; i++) { Add ( _skills[i] = new Combobox ( 344, y, 182, skillList, -1, 200, false, "Click here" ) ); Add ( _skillSliders[i] = new HSliderBar ( 344, y + 32, 93, 0, 50, ProfessionInfo._VoidSkills[i, 1], HSliderBarStyle.MetalWidgetRecessedBar, true ) ); y += 70; } 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 } ); for (int i = 0; i < _attributeSliders.Length; i++) { for (int j = 0; j < _attributeSliders.Length; j++) { if (i != j) { _attributeSliders[i].AddParisSlider(_attributeSliders[j]); } } } for (int i = 0; i < _skillSliders.Length; i++) { for (int j = 0; j < _skillSliders.Length; j++) { if (i != j) { _skillSliders[i].AddParisSlider(_skillSliders[j]); } } } }
public LoginGump(LoginScene scene) : base(0, 0) { CanCloseWithRightClick = false; AcceptKeyboardInput = false; int offsetX, offsetY, offtextY; byte font; ushort hue; if (Client.Version < ClientVersion.CV_706400) { _buttonNormal = 0x15A4; _buttonOver = 0x15A5; const ushort HUE = 0x0A7C; /* ALTER UO-OSI RAHMEN * if (Client.Version >= ClientVersion.CV_500A) * { * Add(new GumpPic(0, 0, 0x2329, 0)); * } */ //UO Flag //Add(new GumpPic(0, 4, 0x15A0, 0) { AcceptKeyboardInput = false }); // Quit Button /* * Add * ( * new Button((int) Buttons.Quit, 0x1589, 0x158B, 0x158A) * { * X = 555, * Y = 4, * ButtonAction = ButtonAction.Activate * } * ); */ //Login Panel /* * Add * ( * new ResizePic(0x13BE) * { * X = 475, * Y = 600, * Width = 451, * Height = 157 * } * ); * * if (Client.Version < ClientVersion.CV_500A) * { * Add(new GumpPic(286, 45, 0x058A, 0)); * } */ /* Log in to Ultima Online * Add * ( * new Label(ResGumps.LoginToUO, false, HUE, font: 2) * //new Label("Gebe deine Benutzerdaten ein", false, 0x034F, font: 5) * { * X = 570, * Y = 605 * } * ); */ Add ( new Label("Name", false, HUE, font: 3) { X = 555, Y = 615 } ); Add ( new Label("Passwort", false, HUE, font: 3) { X = 555, Y = 685 } ); // Arrow Button ALT /* * Add * ( * _nextArrow0 = new Button((int) Buttons.NextArrow, 0x15A4, 0x15A6, 0x15A5) * { * X = 610, * Y = 445, * ButtonAction = ButtonAction.Activate * } * ); */ // Arrow Button LOGIN Neu Add ( _nextArrow0 = new Button((int)Buttons.NextArrow, 0x09AB, 0x09AD, 0x09AC) { X = 610, Y = 750, ButtonAction = ButtonAction.Activate } ); offsetX = 550; offsetY = 637; offtextY = 70; /* UO UND CUO VERSION NUMMERIERUNG DEAKTIVIERT! * Add * ( * new Label($"UO Version {Settings.GlobalSettings.ClientVersion}.", false, 0x034E, font: 9) * { * X = 286, * Y = 453 * } * ); * * Add * ( * new Label(string.Format(ResGumps.CUOVersion0, CUOEnviroment.Version), false, 0x034E, font: 9) * { * X = 286, * Y = 465 * } * ); */ Add ( _checkboxAutologin = new Checkbox(0x00D2, 0x00D3, "Autologin", 3, HUE, false) { X = 1050, Y = 760 } ); Add ( _checkboxSaveAccount = new Checkbox(0x00D2, 0x00D3, "Account speichern", 3, HUE, false) { X = _checkboxAutologin.X + _checkboxAutologin.Width + 10, Y = 760 } ); font = 3; hue = HUE; } else { _buttonNormal = 0x5CD; _buttonOver = 0x5CB; Add(new GumpPic(0, 0, 0x014E, 0)); //// Quit Button Add ( new Button((int)Buttons.Quit, 0x05CA, 0x05C9, 0x05C8) { X = 25, Y = 240, ButtonAction = ButtonAction.Activate } ); // Arrow Button Add ( _nextArrow0 = new Button((int)Buttons.NextArrow, 0x5CD, 0x5CC, 0x5CB) { X = 280, Y = 365, ButtonAction = ButtonAction.Activate } ); offsetX = 218; offsetY = 283; offtextY = 40; /* VERSION NUMMERIERUNG DEAKTIVIERT! * Add * ( * new Label($"UO Version {Settings.GlobalSettings.ClientVersion}.", false, 0x0481, font: 9) * { * X = 286, * Y = 453 * } * ); * * Add * ( * new Label(string.Format(ResGumps.CUOVersion0, CUOEnviroment.Version), false, 0x0481, font: 9) * { * X = 286, * Y = 465 * } * ); */ Add ( _checkboxAutologin = new Checkbox(0x00D2, 0x00D3, ResGumps.Autologin, 9, 0x0481, false) { X = 150, Y = 417 } ); Add ( _checkboxSaveAccount = new Checkbox(0x00D2, 0x00D3, ResGumps.SaveAccount, 9, 0x0481, false) { X = _checkboxAutologin.X + _checkboxAutologin.Width + 5, Y = 417 } ); font = 9; hue = 0x0481; } // Account Text Input Background Add ( new ResizePic(0x0BB8) { X = offsetX, Y = offsetY, Width = 210, Height = 30 } ); // Password Text Input Background Add ( new ResizePic(0x0BB8) { X = offsetX, Y = offsetY + offtextY, Width = 210, Height = 30 } ); offsetX += 7; // Text Inputs Add ( _textboxAccount = new StbTextBox(5, 16, 190, false, hue: 0x034F) { X = offsetX, Y = offsetY, Width = 190, Height = 25 } ); _textboxAccount.SetText(Settings.GlobalSettings.Username); Add ( _passwordFake = new PasswordStbTextBox(5, 16, 190, false, hue: 0x034F) { X = offsetX, Y = offsetY + offtextY + 2, Width = 190, Height = 25 } ); _passwordFake.RealText = Crypter.Decrypt(Settings.GlobalSettings.Password); _checkboxSaveAccount.IsChecked = Settings.GlobalSettings.SaveAccount; _checkboxAutologin.IsChecked = Settings.GlobalSettings.AutoLogin; int htmlX = 130; int htmlY = 442; //Add(new NiceButton(){ }); /* PAYPAL DONATION BUTTON FÜR CLASSICUO - DEAKTIVIERT! * Add * ( * new HtmlControl * ( * htmlX, htmlY, 150, 15, false, false, false, * "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://www.paypal.me/muskara\">Click to donate PayPal", * 0x32, true, isunicode: true, style: FontStyle.BlackBorder * ) * ); */ /* PATREON BUTTON FÜR CLASSICUO - DEAKTIVIERT! * Add * ( * new HtmlControl * ( * htmlX, htmlY + 20, 150, 15, false, false, false, * "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://www.patreon.com/classicuo\">Become a Patreon!", * 0x32, true, isunicode: true, style: FontStyle.BlackBorder * ) * ); */ /* WEBSITE BUTTON FÜR CLASSICUO - DEAKTIVIERT! * Add * ( * new HtmlControl * ( * 505, htmlY, 100, 15, false, false, false, * "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://www.classicuo.eu\">Website", 0x32, * true, isunicode: true, style: FontStyle.BlackBorder * ) * ); */ /* TODO - DISCORD LOGO EINFÜGEN? * Add * ( * new HtmlControl * ( * 505, htmlY + 19, 100, 15, false, false, false, * "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://discord.gg/dXE7kF4ZSr\">Discord", * 0x32, true, isunicode: true, style: FontStyle.BlackBorder * ) * ); */ Checkbox loginmusic_checkbox = new Checkbox(0x00D2, 0x00D3, "Musik", font, hue, false) { X = _checkboxSaveAccount.X + _checkboxSaveAccount.Width + 5, Y = 760, IsChecked = Settings.GlobalSettings.LoginMusic }; Add(loginmusic_checkbox); HSliderBar login_music = new HSliderBar ( loginmusic_checkbox.X + loginmusic_checkbox.Width + 10, loginmusic_checkbox.Y + 4, 80, 0, 100, Settings.GlobalSettings.LoginMusicVolume, HSliderBarStyle.MetalWidgetRecessedBar, true, font, hue, false ); Add(login_music); login_music.IsVisible = Settings.GlobalSettings.LoginMusic; loginmusic_checkbox.ValueChanged += (sender, e) => { Settings.GlobalSettings.LoginMusic = loginmusic_checkbox.IsChecked; scene.Audio.UpdateCurrentMusicVolume(true); login_music.IsVisible = Settings.GlobalSettings.LoginMusic; }; login_music.ValueChanged += (sender, e) => { Settings.GlobalSettings.LoginMusicVolume = login_music.Value; scene.Audio.UpdateCurrentMusicVolume(true); }; if (!string.IsNullOrEmpty(_textboxAccount.Text)) { _passwordFake.SetKeyboardFocus(); } else { _textboxAccount.SetKeyboardFocus(); } }
private void BuildPage2() { AddChildren(new GumpPic(0, 111, 0x00DB, 0) { CanMove = false }, 2); Label label = new Label("ClassicUO configuration", true, 0, 460, align: TEXT_ALIGN_TYPE.TS_CENTER) { X = 84, Y = 22 }; AddChildren(label, 2); ScrollArea scrollArea = new ScrollArea(64, 90, 500, 300, true); AddChildren(scrollArea, 2); label = new Label("FPS:", true, 0) { X = 0, Y = 0 }; scrollArea.AddChildren(label); _sliderFPS = new HSliderBar(0, 21, 90, 15, 250, _settings.MaxFPS, HSliderBarStyle.MetalWidgetRecessedBar, true); scrollArea.AddChildren(_sliderFPS); _checkboxHighlightGameObjects = new Checkbox(0x00D2, 0x00D3, "Highlight game objects") { X = 0, Y = 41, IsChecked = _settings.HighlightGameObjects }; scrollArea.AddChildren(_checkboxHighlightGameObjects); _checkboxSmoothMovement = new Checkbox(0x00D2, 0x00D3, "Smooth movement") { X = 0, Y = 61, IsChecked = _settings.SmoothMovement }; scrollArea.AddChildren(_checkboxSmoothMovement); int y = 81; for (int i = 0; i < 400; i++) { Checkbox ck = new Checkbox(0x00D2, 0x00D3, "TRY " + i) { Y = y }; ck.ValueChanged += (sender, e) => Console.WriteLine("PRESSED: " + ck.Text); scrollArea.AddChildren(ck); y += 20; } y += 20; for (int i = 0; i < 40; i++) { Button ck = new Button((int)Buttons.Ok + i + 1, 0x00F9, 0x00F8, 0x00F7) { X = 34, Y = y, ButtonAction = ButtonAction.Activate }; ck.MouseClick += (sender, e) => Console.WriteLine("PRESSED: " + ck.ButtonID); scrollArea.AddChildren(ck); y += ck.Height; } }
private void BuildPage3() { AddChildren(new GumpPic(0, 177, 0x00DD, 0) { CanMove = false }, 3); Label label = new Label("Language", true, 0, 460, align: TEXT_ALIGN_TYPE.TS_CENTER) { X = 84, Y = 22 }; AddChildren(label, 3); label = new Label("The language you use when playing UO is obtained from your OS.", true, 0, 480) { X = 64, Y = 44 }; AddChildren(label, 3); _checkboxUseTooltips = new Checkbox(0x00D2, 0x00D3, "Use tooltips") { X = 64, Y = 90, IsChecked = _settings.UseTooltips }; AddChildren(_checkboxUseTooltips, 3); label = new Label("Delay before tooltip appears", true, 0) { X = 64, Y = 112 }; AddChildren(label, 3); _sliderDelayAppearTooltips = new HSliderBar(64, 133, 90, 0, 5000, _settings.DelayAppearTooltips, HSliderBarStyle.MetalWidgetRecessedBar, true); AddChildren(_sliderDelayAppearTooltips, 3); Button button = new Button((int)Buttons.TextColor, 0x00D4, 0x00D4) { X = 64, Y = 151, ButtonAction = ButtonAction.Activate, ToPage = 3 }; button.MouseClick += (sender, e) => { ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => _colorPickerTooltipText.SetHue(s)); UIManager.Add(pickerGump); }; AddChildren(button, 3); uint color = 0xFF7F7F7F; if (_settings.TooltipsTextColor != 0xFFFF) { color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, _settings.TooltipsTextColor) << 8) | 0xFF); } _colorPickerTooltipText = new ColorPickerBox(67, 154, 1, 1, 13, 14); _colorPickerTooltipText.SetHue(color); AddChildren(_colorPickerTooltipText, 3); label = new Label("Color of tooltips text", true, 0) { X = 88, Y = 151 }; AddChildren(label, 3); AddChildren(new Button((int)Buttons.TextFont, 0x00D0, 0x00D0) { X = 64, Y = 173, ButtonAction = ButtonAction.Activate, ToPage = 3 }, 3); label = new Label("Font for tooltips", true, 0) { X = 88, Y = 173 }; AddChildren(label, 3); }
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.AddChildren(text); HSliderBar sliderFPS = new HSliderBar(40, 5, 250, 15, 250, _settings.MaxFPS, HSliderBarStyle.MetalWidgetRecessedBar, true, 1); fpsItem.AddChildren(sliderFPS); rightArea.AddChildren(fpsItem); // Highlight Checkbox highlightObjects = new Checkbox(0x00D2, 0x00D3, "Highlight game objects", 1) { Y = 10, IsChecked = Engine.Profile.Current.HighlightGameObjects }; rightArea.AddChildren(highlightObjects); // smooth movements Checkbox smoothMovement = new Checkbox(0x00D2, 0x00D3, "Smooth movements", 1) { IsChecked = Engine.Profile.Current.SmoothMovements }; rightArea.AddChildren(smoothMovement); Checkbox enablePathfind = new Checkbox(0x00D2, 0x00D3, "Enable pathfinding", 1) { IsChecked = Engine.Profile.Current.EnablePathfind }; rightArea.AddChildren(enablePathfind); Checkbox alwaysRun = new Checkbox(0x00D2, 0x00D3, "Always run", 1) { IsChecked = Engine.Profile.Current.AlwaysRun }; rightArea.AddChildren(alwaysRun); // preload maps Checkbox preloadMaps = new Checkbox(0x00D2, 0x00D3, "Preload maps (it increases the RAM usage)", 1) { IsChecked = _settings.PreloadMaps }; rightArea.AddChildren(preloadMaps); // show % hp mobile ScrollAreaItem hpAreaItem = new ScrollAreaItem(); text = new Label("- Mobiles HP", true, 1) { Y = 10 }; hpAreaItem.AddChildren(text); Checkbox showHPMobile = new Checkbox(0x00D2, 0x00D3, "Show HP", 1) { X = 25, Y = 30, IsChecked = Engine.Profile.Current.ShowMobilesHP }; hpAreaItem.AddChildren(showHPMobile); int mode = Engine.Profile.Current.MobileHPType; if (mode < 0 || mode > 2) { mode = 0; } Combobox hpComboBox = new Combobox(200, 30, 150, new[] { "Percentage", "Line", "Both" }, mode); hpAreaItem.AddChildren(hpComboBox); rightArea.AddChildren(hpAreaItem); // highlight character by flags ScrollAreaItem highlightByFlagsItem = new ScrollAreaItem(); text = new Label("- Mobiles status", true, 1) { Y = 10 }; highlightByFlagsItem.AddChildren(text); Checkbox highlightEnabled = new Checkbox(0x00D2, 0x00D3, "Highlight by state\n(poisoned, yellow hits, paralyzed)", 1) { X = 25, Y = 30, IsChecked = Engine.Profile.Current.HighlightMobilesByFlags }; highlightByFlagsItem.AddChildren(highlightEnabled); rightArea.AddChildren(highlightByFlagsItem); AddChildren(rightArea, PAGE); }
public LoginGump(LoginScene scene) : base(0, 0) { CanCloseWithRightClick = false; AcceptKeyboardInput = false; int offsetX, offsetY, offtextY; byte font; ushort hue; if (Client.Version < ClientVersion.CV_706400) { _buttonNormal = 0x15A4; _buttonOver = 0x15A5; const ushort HUE = 0x0386; if (Client.Version >= ClientVersion.CV_500A) { Add(new GumpPic(0, 0, 0x2329, 0)); } //UO Flag Add(new GumpPic(0, 4, 0x15A0, 0) { AcceptKeyboardInput = false }); // Quit Button Add ( new Button((int)Buttons.Quit, 0x1589, 0x158B, 0x158A) { X = 555, Y = 4, ButtonAction = ButtonAction.Activate } ); //Login Panel Add ( new ResizePic(0x13BE) { X = 128, Y = 288, Width = 451, Height = 157 } ); if (Client.Version < ClientVersion.CV_500A) { Add(new GumpPic(286, 45, 0x058A, 0)); } Add ( new Label(ResGumps.LoginToUO, false, HUE, font: 2) { X = 253, Y = 305 } ); Add ( new Label(ResGumps.Account, false, HUE, font: 2) { X = 183, Y = 345 } ); Add ( new Label(ResGumps.Password, false, HUE, font: 2) { X = 183, Y = 385 } ); // Arrow Button Add ( _nextArrow0 = new Button((int)Buttons.NextArrow, 0x15A4, 0x15A6, 0x15A5) { X = 610, Y = 445, ButtonAction = ButtonAction.Activate } ); offsetX = 328; offsetY = 343; offtextY = 40; Add ( new Label($"UO Version {Settings.GlobalSettings.ClientVersion}.", false, 0x034E, font: 9) { X = 286, Y = 453 } ); Add ( new Label(string.Format(ResGumps.CUOVersion0, CUOEnviroment.Version), false, 0x034E, font: 9) { X = 286, Y = 465 } ); Add ( _checkboxAutologin = new Checkbox ( 0x00D2, 0x00D3, ResGumps.Autologin, 1, 0x0386, false ) { X = 150, Y = 417 } ); Add ( _checkboxSaveAccount = new Checkbox ( 0x00D2, 0x00D3, ResGumps.SaveAccount, 1, 0x0386, false ) { X = _checkboxAutologin.X + _checkboxAutologin.Width + 10, Y = 417 } ); font = 1; hue = 0x0386; } else { _buttonNormal = 0x5CD; _buttonOver = 0x5CB; Add(new GumpPic(0, 0, 0x014E, 0)); //// Quit Button Add ( new Button((int)Buttons.Quit, 0x05CA, 0x05C9, 0x05C8) { X = 25, Y = 240, ButtonAction = ButtonAction.Activate } ); // Arrow Button Add ( _nextArrow0 = new Button((int)Buttons.NextArrow, 0x5CD, 0x5CC, 0x5CB) { X = 280, Y = 365, ButtonAction = ButtonAction.Activate } ); offsetX = 218; offsetY = 283; offtextY = 50; Add ( new Label($"UO Version {Settings.GlobalSettings.ClientVersion}.", false, 0x0481, font: 9) { X = 286, Y = 453 } ); Add ( new Label(string.Format(ResGumps.CUOVersion0, CUOEnviroment.Version), false, 0x0481, font: 9) { X = 286, Y = 465 } ); Add ( _checkboxAutologin = new Checkbox ( 0x00D2, 0x00D3, ResGumps.Autologin, 9, 0x0481, false ) { X = 150, Y = 417 } ); Add ( _checkboxSaveAccount = new Checkbox ( 0x00D2, 0x00D3, ResGumps.SaveAccount, 9, 0x0481, false ) { X = _checkboxAutologin.X + _checkboxAutologin.Width + 10, Y = 417 } ); font = 9; hue = 0x0481; } // Account Text Input Background Add ( new ResizePic(0x0BB8) { X = offsetX, Y = offsetY, Width = 210, Height = 30 } ); // Password Text Input Background Add ( new ResizePic(0x0BB8) { X = offsetX, Y = offsetY + offtextY, Width = 210, Height = 30 } ); offsetX += 7; // Text Inputs Add ( _textboxAccount = new StbTextBox ( 5, 16, 190, false, hue: 0x034F ) { X = offsetX, Y = offsetY, Width = 190, Height = 25 } ); _textboxAccount.SetText(Settings.GlobalSettings.Username); Add ( _passwordFake = new PasswordStbTextBox ( 5, 16, 190, false, hue: 0x034F ) { X = offsetX, Y = offsetY + offtextY + 2, Width = 190, Height = 25 } ); _passwordFake.RealText = Crypter.Decrypt(Settings.GlobalSettings.Password); _checkboxSaveAccount.IsChecked = Settings.GlobalSettings.SaveAccount; _checkboxAutologin.IsChecked = Settings.GlobalSettings.AutoLogin; int htmlX = 130; int htmlY = 442; //Add(new NiceButton(){ }); Add ( new HtmlControl ( htmlX, htmlY, 150, 15, false, false, false, "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://www.paypal.me/muskara\">Click to donate PayPal", 0x32, true, isunicode: true, style: FontStyle.BlackBorder ) ); Add ( new HtmlControl ( htmlX, htmlY + 20, 150, 15, false, false, false, "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://www.patreon.com/classicuo\">Become a Patreon!", 0x32, true, isunicode: true, style: FontStyle.BlackBorder ) ); Add ( new HtmlControl ( 505, htmlY, 100, 15, false, false, false, "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://www.classicuo.eu\">Website", 0x32, true, isunicode: true, style: FontStyle.BlackBorder ) ); Add ( new HtmlControl ( 505, htmlY + 19, 100, 15, false, false, false, "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://discord.gg/VdyCpjQ\">Join Discord", 0x32, true, isunicode: true, style: FontStyle.BlackBorder ) ); Checkbox loginmusic_checkbox = new Checkbox ( 0x00D2, 0x00D3, "Music", font, hue, false ) { X = _checkboxSaveAccount.X + _checkboxSaveAccount.Width + 10, Y = 417, IsChecked = Settings.GlobalSettings.LoginMusic }; Add(loginmusic_checkbox); HSliderBar login_music = new HSliderBar ( loginmusic_checkbox.X + loginmusic_checkbox.Width + 10, loginmusic_checkbox.Y + 4, 80, 0, 100, Settings.GlobalSettings.LoginMusicVolume, HSliderBarStyle.MetalWidgetRecessedBar, true, font, hue, false ); Add(login_music); login_music.IsVisible = Settings.GlobalSettings.LoginMusic; loginmusic_checkbox.ValueChanged += (sender, e) => { Settings.GlobalSettings.LoginMusic = loginmusic_checkbox.IsChecked; scene.Audio.UpdateCurrentMusicVolume(true); login_music.IsVisible = Settings.GlobalSettings.LoginMusic; }; login_music.ValueChanged += (sender, e) => { Settings.GlobalSettings.LoginMusicVolume = login_music.Value; scene.Audio.UpdateCurrentMusicVolume(true); }; if (!string.IsNullOrEmpty(_textboxAccount.Text)) { _passwordFake.SetKeyboardFocus(); } else { _textboxAccount.SetKeyboardFocus(); } }
private void BuildSounds() { const int PAGE = 2; ScrollArea rightArea = new ScrollArea(190, 60, 390, 380, true); Checkbox soundCheckbox = new Checkbox(0x00D2, 0x00D3, "Sounds", 1) { IsChecked = Engine.Profile.Current.EnableSound }; rightArea.AddChildren(soundCheckbox); ScrollAreaItem item = new ScrollAreaItem(); Label text = new Label("- Sounds volume:", true, 0, 0, 1); HSliderBar sliderVolume = new HSliderBar(40, 5, 180, 0, 255, Engine.Profile.Current.SoundVolume, HSliderBarStyle.MetalWidgetRecessedBar, true, 1) { X = 120 }; item.AddChildren(text); item.AddChildren(sliderVolume); rightArea.AddChildren(item); Checkbox musicCheckbox = new Checkbox(0x00D2, 0x00D3, "Music", 1) { IsChecked = Engine.Profile.Current.EnableMusic }; rightArea.AddChildren(musicCheckbox); item = new ScrollAreaItem(); text = new Label("- Music volume:", true, 0, 0, 1); HSliderBar sliderMusicVolume = new HSliderBar(40, 5, 180, 0, 255, Engine.Profile.Current.MusicVolume, HSliderBarStyle.MetalWidgetRecessedBar, true, 1) { X = 120 }; item.AddChildren(text); item.AddChildren(sliderMusicVolume); rightArea.AddChildren(item); item = new ScrollAreaItem(); Checkbox footstepsCheckbox = new Checkbox(0x00D2, 0x00D3, "Footsteps sound", 1) { Y = 30, IsChecked = Engine.Profile.Current.EnableFootstepsSound }; item.AddChildren(footstepsCheckbox); rightArea.AddChildren(item); Checkbox combatMusicCheckbox = new Checkbox(0x00D2, 0x00D3, "Combat music", 1) { IsChecked = Engine.Profile.Current.EnableCombatMusic }; rightArea.AddChildren(combatMusicCheckbox); Checkbox backgroundMusicCheckbox = new Checkbox(0x00D2, 0x00D3, "Reproduce music when ClassicUO is not focussed", 1) { IsChecked = Engine.Profile.Current.ReproduceSoundsInBackground }; rightArea.AddChildren(backgroundMusicCheckbox); AddChildren(rightArea, PAGE); }
public CreateCharTradeGump(PlayerMobile character, ProfessionInfo profession) : base(0, 0) { var skillCount = 3; if (FileManager.ClientVersion >= ClientVersions.CV_70160) { skillCount = 4; } _character = character; if (profession.TrueName != "advanced") { for (int i = 0; i < skillCount; i++) { _character.UpdateSkill(profession.SkillDefVal[i, 0], (ushort)profession.SkillDefVal[i, 1], 0, Lock.Locked, 0); } _character.Strength = (ushort)profession.StatsVal[0]; _character.Intelligence = (ushort)profession.StatsVal[1]; _character.Dexterity = (ushort)profession.StatsVal[2]; OnButtonClick((int)Buttons.Skip); return; } foreach (var skill in _character.Skills) { _character.UpdateSkill(skill.Index, 0, 0, Lock.Locked, 0); } Add(new ResizePic(2600) { X = 100, Y = 80, Width = 470, Height = 372 }); // center menu with fancy top // public GumpPic(AControl parent, int x, int y, int gumpID, int hue) Add(new GumpPic(291, 42, 0x0589, 0)); Add(new GumpPic(214, 58, 0x058B, 0)); Add(new GumpPic(300, 51, 0x15A9, 0)); // title text //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400) Add(new Label(FileManager.Cliloc.GetString(3000326), false, 0x0386, font: 2) { X = 148, Y = 132 }); // strength, dexterity, intelligence Add(new Label(FileManager.Cliloc.GetString(3000111), false, 1, font: 1) { X = 158, Y = 170 }); Add(new Label(FileManager.Cliloc.GetString(3000112), false, 1, font: 1) { X = 158, Y = 250 }); Add(new Label(FileManager.Cliloc.GetString(3000113), false, 1, font: 1) { X = 158, Y = 330 }); // sliders for attributes _attributeSliders = new HSliderBar[3]; Add(_attributeSliders[0] = new HSliderBar(164, 196, 93, 10, 60, ProfessionInfo._VoidStats[0], HSliderBarStyle.MetalWidgetRecessedBar, true)); Add(_attributeSliders[1] = new HSliderBar(164, 276, 93, 10, 60, ProfessionInfo._VoidStats[1], HSliderBarStyle.MetalWidgetRecessedBar, true)); Add(_attributeSliders[2] = new HSliderBar(164, 356, 93, 10, 60, ProfessionInfo._VoidStats[2], HSliderBarStyle.MetalWidgetRecessedBar, true)); string[] skillList = FileManager.Skills.SkillNames; int y = 172; _skillSliders = new HSliderBar[skillCount]; _skills = new Combobox[skillCount]; for (var i = 0; i < skillCount; i++) { Add(_skills[i] = new Combobox(344, y, 182, skillList, -1, 200, false, "Click here")); Add(_skillSliders[i] = new HSliderBar(344, y + 32, 93, 0, 50, ProfessionInfo._VoidSkills[i, 1], HSliderBarStyle.MetalWidgetRecessedBar, true)); y += 70; } if (profession.SkillDefVal.Length >= skillCount) { for (int i = 0; i < skillCount; i++) { _skillSliders[i].Value = ProfessionInfo._VoidSkills[i, 1]; } int GetSkillIndex(string name) { /* Not sure if other cases exist. * 7.0.20.0 has a specific function to convert string -> index for each skill in prof.txt. */ if (String.Equals(name, "Blacksmith", StringComparison.CurrentCulture)) { name = "Blacksmithy"; } else if (String.Equals(name, "AnimalLore", StringComparison.CurrentCulture)) { name = "Animal Lore"; } else if (String.Equals(name, "ItemID", StringComparison.CurrentCulture)) { name = "Item Identification"; } else if (String.Equals(name, "ArmsLore", StringComparison.CurrentCulture)) { name = "Arms Lore"; } else if (String.Equals(name, "Bowcraft", StringComparison.CurrentCulture)) { name = "Bowcraft/Fletching"; } else if (String.Equals(name, "DetectHidden", StringComparison.CurrentCulture)) { name = "Detecting Hidden"; } else if (String.Equals(name, "Enticement", StringComparison.CurrentCulture)) { name = "Discordance"; } else if (String.Equals(name, "EvaluateIntelligence", StringComparison.CurrentCulture)) { name = "Evaluating Intelligence"; } else if (String.Equals(name, "ForensicEvaluation", StringComparison.CurrentCulture)) { name = "Forensic Evaluation"; } else if (String.Equals(name, "ResistingSpells", StringComparison.CurrentCulture)) { name = "Resisting Spells"; } else if (String.Equals(name, "SpiritSpeak", StringComparison.CurrentCulture)) { name = "Spirit Speak"; } else if (String.Equals(name, "AnimalTaming", StringComparison.CurrentCulture)) { name = "Animal Taming"; } else if (String.Equals(name, "TasteIdentification", StringComparison.CurrentCulture)) { name = "Taste Identification"; } else if (String.Equals(name, "MaceFighting", StringComparison.CurrentCulture)) { name = "Mace Fighting"; } else if (String.Equals(name, "Disarm", StringComparison.CurrentCulture)) { name = "Remove Trap"; } return(Array.IndexOf(skillList, name)); } var skillIndex = 0; for (int i = 0; i < skillCount; i++) { var index = GetSkillIndex(FileManager.Skills.SkillNames[profession.SkillDefVal[i, 0]]); var skillCombo = _skills[skillIndex]; var skillSlider = _skillSliders[skillIndex]; if (index > 0) { skillCombo.SelectedIndex = index; skillSlider.Value = profession.SkillDefVal[i, 1]; } } } if (profession.StatsVal.Length == 3) { _attributeSliders[0].Value = profession.StatsVal[0]; //STR _attributeSliders[1].Value = profession.StatsVal[2]; //DEX _attributeSliders[2].Value = profession.StatsVal[1]; //INT } 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 }); for (int i = 0; i < _attributeSliders.Length; i++) { for (int j = 0; j < _attributeSliders.Length; j++) { if (i != j) { _attributeSliders[i].AddParisSlider(_attributeSliders[j]); } } } for (int i = 0; i < _skillSliders.Length; i++) { for (int j = 0; j < _skillSliders.Length; j++) { if (i != j) { _skillSliders[i].AddParisSlider(_skillSliders[j]); } } } }
private void BuildSpeech() { const int PAGE = 7; ScrollArea rightArea = new ScrollArea(190, 60, 390, 380, true); ScrollAreaItem item = new ScrollAreaItem(); Checkbox scaleSpeechDelay = new Checkbox(0x00D2, 0x00D3, "Scale speech delay by length", 1) { IsChecked = Engine.Profile.Current.ScaleSpeechDelay }; item.AddChildren(scaleSpeechDelay); rightArea.AddChildren(item); item = new ScrollAreaItem(); Label text = new Label("- Speech delay:", true, 1); item.AddChildren(text); HSliderBar sliderSpeechDelay = new HSliderBar(100, 5, 150, 1, 1000, Engine.Profile.Current.SpeechDelay, HSliderBarStyle.MetalWidgetRecessedBar, true, 1); item.AddChildren(sliderSpeechDelay); rightArea.AddChildren(item); item = new ScrollAreaItem(); Button buttonSpeechColor = new Button((int)Buttons.SpeechColor, 0x00D4, 0x00D4) { ButtonAction = ButtonAction.Activate, Y = 30 }; item.AddChildren(buttonSpeechColor); uint color = 0xFF7F7F7F; if (Engine.Profile.Current.SpeechHue != 0xFFFF) { color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.SpeechHue) << 8) | 0xFF); } ColorPickerBox speechColorPickerBox = new ColorPickerBox(3, 3, 1, 1, 13, 14) { Y = 33 }; speechColorPickerBox.MouseClick += (sender, e) => buttonSpeechColor.InvokeMouseClick(e.Location, e.Button); speechColorPickerBox.SetHue(color); buttonSpeechColor.MouseClick += (sender, e) => { // TODO: fix multi opening ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => speechColorPickerBox.SetHue(s)); Engine.UI.Add(pickerGump); }; item.AddChildren(speechColorPickerBox); text = new Label("Speech color", true, 1) { X = 20, Y = 30 }; item.AddChildren(text); rightArea.AddChildren(item); item = new ScrollAreaItem(); Button buttonEmoteColor = new Button((int)Buttons.EmoteColor, 0x00D4, 0x00D4) { ButtonAction = ButtonAction.Activate }; item.AddChildren(buttonEmoteColor); color = 0xFF7F7F7F; if (Engine.Profile.Current.EmoteHue != 0xFFFF) { color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.EmoteHue) << 8) | 0xFF); } ColorPickerBox emoteColorPickerBox = new ColorPickerBox(3, 3, 1, 1, 13, 14); emoteColorPickerBox.MouseClick += (sender, e) => buttonEmoteColor.InvokeMouseClick(e.Location, e.Button); emoteColorPickerBox.SetHue(color); buttonEmoteColor.MouseClick += (sender, e) => { // TODO: fix multi opening ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => emoteColorPickerBox.SetHue(s)); Engine.UI.Add(pickerGump); }; item.AddChildren(emoteColorPickerBox); text = new Label("Emote color", true, 1) { X = 20 }; item.AddChildren(text); rightArea.AddChildren(item); item = new ScrollAreaItem(); Button butttonPartyMessageColor = new Button((int)Buttons.PartyMessageColor, 0x00D4, 0x00D4) { ButtonAction = ButtonAction.Activate }; item.AddChildren(butttonPartyMessageColor); color = 0xFF7F7F7F; if (Engine.Profile.Current.PartyMessageHue != 0xFFFF) { color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.PartyMessageHue) << 8) | 0xFF); } ColorPickerBox partyMessageColor = new ColorPickerBox(3, 3, 1, 1, 13, 14); partyMessageColor.MouseClick += (sender, e) => butttonPartyMessageColor.InvokeMouseClick(e.Location, e.Button); partyMessageColor.SetHue(color); butttonPartyMessageColor.MouseClick += (sender, e) => { // TODO: fix multi opening ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => partyMessageColor.SetHue(s)); Engine.UI.Add(pickerGump); }; item.AddChildren(partyMessageColor); text = new Label("Party message color", true, 1) { X = 20 }; item.AddChildren(text); rightArea.AddChildren(item); item = new ScrollAreaItem(); Button buttonGuildMessageColor = new Button((int)Buttons.GuildMessageColor, 0x00D4, 0x00D4) { ButtonAction = ButtonAction.Activate }; item.AddChildren(buttonGuildMessageColor); color = 0xFF7F7F7F; if (Engine.Profile.Current.GuildMessageHue != 0xFFFF) { color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.GuildMessageHue) << 8) | 0xFF); } ColorPickerBox guildMessageColor = new ColorPickerBox(3, 3, 1, 1, 13, 14); guildMessageColor.MouseClick += (sender, e) => buttonGuildMessageColor.InvokeMouseClick(e.Location, e.Button); guildMessageColor.SetHue(color); buttonGuildMessageColor.MouseClick += (sender, e) => { // TODO: fix multi opening ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => guildMessageColor.SetHue(s)); Engine.UI.Add(pickerGump); }; item.AddChildren(guildMessageColor); text = new Label("Guild message color", true, 1) { X = 20 }; item.AddChildren(text); rightArea.AddChildren(item); item = new ScrollAreaItem(); Button buttonAllyMessageColor = new Button((int)Buttons.AllyMessageColor, 0x00D4, 0x00D4) { ButtonAction = ButtonAction.Activate }; item.AddChildren(buttonAllyMessageColor); color = 0xFF7F7F7F; if (Engine.Profile.Current.AllyMessageHue != 0xFFFF) { color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.AllyMessageHue) << 8) | 0xFF); } ColorPickerBox allyMessageColor = new ColorPickerBox(3, 3, 1, 1, 13, 14); allyMessageColor.MouseClick += (sender, e) => buttonAllyMessageColor.InvokeMouseClick(e.Location, e.Button); allyMessageColor.SetHue(color); buttonAllyMessageColor.MouseClick += (sender, e) => { // TODO: fix multi opening ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => allyMessageColor.SetHue(s)); Engine.UI.Add(pickerGump); }; item.AddChildren(allyMessageColor); text = new Label("Ally message color", true, 1) { X = 20 }; item.AddChildren(text); rightArea.AddChildren(item); AddChildren(rightArea, PAGE); }
public CreateCharTradeGump(PlayerMobile character, ProfessionInfo profession) : base(0, 0) { _character = character; foreach (var skill in _character.Skills) { skill.ValueFixed = 0; skill.BaseFixed = 0; skill.CapFixed = 0; skill.Lock = Lock.Locked; } Add(new ResizePic(2600) { X = 100, Y = 80, Width = 470, Height = 372 }); // center menu with fancy top // public GumpPic(AControl parent, int x, int y, int gumpID, int hue) Add(new GumpPic(291, 42, 0x0589, 0)); Add(new GumpPic(214, 58, 0x058B, 0)); Add(new GumpPic(300, 51, 0x15A9, 0)); // title text //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400) Add(new Label(ClilocLoader.Instance.GetString(3000326), false, 0x0386, font: 2) { X = 148, Y = 132 }); // strength, dexterity, intelligence Add(new Label(ClilocLoader.Instance.GetString(3000111), false, 1, font: 1) { X = 158, Y = 170 }); Add(new Label(ClilocLoader.Instance.GetString(3000112), false, 1, font: 1) { X = 158, Y = 250 }); Add(new Label(ClilocLoader.Instance.GetString(3000113), false, 1, font: 1) { X = 158, Y = 330 }); // sliders for attributes _attributeSliders = new HSliderBar[3]; Add(_attributeSliders[0] = new HSliderBar(164, 196, 93, 10, 60, ProfessionInfo._VoidStats[0], HSliderBarStyle.MetalWidgetRecessedBar, true)); Add(_attributeSliders[1] = new HSliderBar(164, 276, 93, 10, 60, ProfessionInfo._VoidStats[1], HSliderBarStyle.MetalWidgetRecessedBar, true)); Add(_attributeSliders[2] = new HSliderBar(164, 356, 93, 10, 60, ProfessionInfo._VoidStats[2], HSliderBarStyle.MetalWidgetRecessedBar, true)); string[] skillList = SkillsLoader.Instance.SortedSkills.Select(s => ( (s.Index == 52 || s.Index == 53 && (World.ClientFeatures.Flags & CharacterListFlags.CLF_SAMURAI_NINJA) == 0)) || s.Index == 54 ? "" : s.Name).ToArray(); int y = 172; _skillSliders = new HSliderBar[CharCreationGump._skillsCount]; _skills = new Combobox[CharCreationGump._skillsCount]; for (var i = 0; i < CharCreationGump._skillsCount; i++) { Add(_skills[i] = new Combobox(344, y, 182, skillList, -1, 200, false, "Click here")); Add(_skillSliders[i] = new HSliderBar(344, y + 32, 93, 0, 50, ProfessionInfo._VoidSkills[i, 1], HSliderBarStyle.MetalWidgetRecessedBar, true)); y += 70; } 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 }); for (int i = 0; i < _attributeSliders.Length; i++) { for (int j = 0; j < _attributeSliders.Length; j++) { if (i != j) { _attributeSliders[i].AddParisSlider(_attributeSliders[j]); } } } for (int i = 0; i < _skillSliders.Length; i++) { for (int j = 0; j < _skillSliders.Length; j++) { if (i != j) { _skillSliders[i].AddParisSlider(_skillSliders[j]); } } } }
public GridLootItem(uint serial, int size) { LocalSerial = serial; Item item = World.Items.Get(serial); if (item == null) { Dispose(); return; } CanMove = false; HSliderBar amount = new HSliderBar ( 0, 0, size, 1, // OSI has an odd behaviour. It uses the Amount field to store unknown data for non stackable items. item.ItemData.IsStackable ? item.Amount : 1, item.ItemData.IsStackable ? item.Amount : 1, HSliderBarStyle.MetalWidgetRecessedBar, true, color: 0xFFFF, drawUp: true ); Add(amount); amount.IsVisible = amount.IsEnabled = amount.MaxValue > 1; AlphaBlendControl background = new AlphaBlendControl(); background.Y = 15; background.Width = size; background.Height = size; Add(background); _hit = new HitBox(0, 15, size, size, null, 0f); Add(_hit); if (World.ClientFeatures.TooltipsEnabled) { _hit.SetTooltip(item); } _hit.MouseUp += (sender, e) => { if (e.Button == MouseButtonType.Left) { GameActions.GrabItem(item, (ushort)amount.Value); } }; Width = background.Width; Height = background.Height + 15; WantUpdateSize = false; }
public CreateCharTradeGump(PlayerMobile character) : base(0, 0) { _character = character; AddChildren(new ResizePic(2600) { X = 100, Y = 80, Width = 470, Height = 372 }); // center menu with fancy top // public GumpPic(AControl parent, int x, int y, int gumpID, int hue) AddChildren(new GumpPic(291, 42, 0x0589, 0)); AddChildren(new GumpPic(214, 58, 0x058B, 0)); AddChildren(new GumpPic(300, 51, 0x15A9, 0)); // title text //TextLabelAscii(AControl parent, int x, int y, int font, int hue, string text, int width = 400) AddChildren(new Label(IO.Resources.Cliloc.GetString(3000326), false, 0x0386, font: 2) { X = 148, Y = 132 }); // strength, dexterity, intelligence AddChildren(new Label(IO.Resources.Cliloc.GetString(3000111), false, 1, font: 1) { X = 158, Y = 170 }); AddChildren(new Label(IO.Resources.Cliloc.GetString(3000112), false, 1, font: 1) { X = 158, Y = 250 }); AddChildren(new Label(IO.Resources.Cliloc.GetString(3000113), false, 1, font: 1) { X = 158, Y = 330 }); // sliders for attributes _attributeSliders = new HSliderBar[3]; var values = FileManager.ClientVersion >= ClientVersions.CV_70160 ? 15 : 10; AddChildren(_attributeSliders[0] = new HSliderBar(164, 196, 93, 10, 60, 60, HSliderBarStyle.MetalWidgetRecessedBar, true)); AddChildren(_attributeSliders[1] = new HSliderBar(164, 276, 93, 10, 60, values, HSliderBarStyle.MetalWidgetRecessedBar, true)); AddChildren(_attributeSliders[2] = new HSliderBar(164, 356, 93, 10, 60, values, HSliderBarStyle.MetalWidgetRecessedBar, true)); var skillCount = 3; var initialValue = 50; if (FileManager.ClientVersion >= ClientVersions.CV_70160) { skillCount = 4; initialValue = 30; } string[] skillList = IO.Resources.Skills.SkillNames; int y = 172; _skillSliders = new HSliderBar[skillCount]; _skills = new Combobox[skillCount]; for (var i = 0; i < skillCount; i++) { if (FileManager.ClientVersion < ClientVersions.CV_70160 && i == 2) { initialValue = 0; } AddChildren(_skills[i] = new Combobox(344, y, 182, skillList, -1, 200, false, "Click here")); AddChildren(_skillSliders[i] = new HSliderBar(344, y + 32, 93, 0, 50, initialValue, HSliderBarStyle.MetalWidgetRecessedBar, true)); y += 70; } //// sliders for skills //_skillSliders = new HSliderBar[4]; //AddChildren(_skillSliders[0] = new HSliderBar(344, 204, 93, 0, 50, 50, HSliderBarStyle.MetalWidgetRecessedBar, true)); //AddChildren(_skillSliders[1] = new HSliderBar(344, 284, 93, 0, 50, 50, HSliderBarStyle.MetalWidgetRecessedBar, true)); //AddChildren(_skillSliders[2] = new HSliderBar(344, 364, 93, 0, 50, 0, HSliderBarStyle.MetalWidgetRecessedBar, true)); //// drop downs for skills //_skills = new Combobox[3]; //AddChildren(_skills[0] = new Combobox(344, 172, 182, skillList, -1, 200, false, "Click here")); //AddChildren(_skills[1] = new Combobox(344, 252, 182, skillList, -1, 200, false, "Click here")); //AddChildren(_skills[2] = new Combobox(344, 332, 182, skillList, -1, 200, false, "Click here")); AddChildren(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, over: 0x15A2) { X = 586, Y = 445, ButtonAction = ButtonAction.Activate }); AddChildren(new Button((int)Buttons.Next, 0x15A4, 0x15A6, over: 0x15A5) { X = 610, Y = 445, ButtonAction = ButtonAction.Activate }); for (int i = 0; i < _attributeSliders.Length; i++) { for (int j = 0; j < _attributeSliders.Length; j++) { if (i != j) { _attributeSliders[i].AddParisSlider(_attributeSliders[j]); } } } for (int i = 0; i < _skillSliders.Length; i++) { for (int j = 0; j < _skillSliders.Length; j++) { if (i != j) { _skillSliders[i].AddParisSlider(_skillSliders[j]); } } } }
public SellListItem(ushort[] item, int size, SellListGump list) { if (item == null) { Dispose(); return; } int SIZE = size; CanMove = false; int total; if (item.Length < 3) { total = (ProfileManager.Current.AutoBuyAmount * 2); } else { total = item[2] * 2; } HSliderBar amount = new HSliderBar(0, 0, SIZE, 0, total, total / 2, HSliderBarStyle.MetalWidgetRecessedBar, true, color: 0xFFFF, drawUp: true); Add(amount); amount.IsVisible = list.IsBuyGump; AlphaBlendControl background = new AlphaBlendControl(); background.Y = 15; background.Width = SIZE; background.Height = SIZE; Add(background); _texture = new TextureControl { IsPartial = false, ScaleTexture = true, Hue = item[1], Texture = ArtLoader.Instance.GetTexture(item[0]), Y = 15, Width = SIZE, Height = SIZE, CanMove = false }; Add(_texture); _texture.MouseUp += (sender, e) => { if (e.Button == MouseButtonType.Left) { if (list.IsBuyGump) { if (amount.Value == 0) { ProfileManager.Current.BuyList.Remove(item); } else { ProfileManager.Current.BuyList.Add(new ushort[3] { item[0], item[1], (ushort)amount.Value }); ProfileManager.Current.BuyList.Remove(item); } } else { ProfileManager.Current.SellList.Remove(item); } UIManager.GetGump <SellListGump>()?.Dispose(); UIManager.Add(new SellListGump(list.IsBuyGump)); } }; Width = background.Width; Height = background.Height + 15; WantUpdateSize = false; }
public OptionsGump() : base(0, 0) { IsMoveable = true; AddControl(new ResizePic(this, 40, 0, 2600, 550, 450)); //left column AddControl(new Button(this, 0, 40, 218, 217, ButtonTypes.SwitchPage, 1, (int)Buttons.Sound)); AddControl(new Button(this, 0, 110, 220, 219, ButtonTypes.SwitchPage, 2, (int)Buttons.Help)); AddControl(new Button(this, 0, 250, 224, 223, ButtonTypes.SwitchPage, 3, (int)Buttons.Chat)); AddControl(new Button(this, 0, 320, 237, 236, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros)); //right column AddControl(new Button(this, 576, 40, 226, 225, ButtonTypes.SwitchPage, 5, (int)Buttons.Interface)); AddControl(new Button(this, 576, 110, 228, 227, ButtonTypes.SwitchPage, 6, (int)Buttons.Display)); AddControl(new Button(this, 576, 180, 230, 229, ButtonTypes.SwitchPage, 7, (int)Buttons.Reputation)); AddControl(new Button(this, 576, 250, 232, 231, ButtonTypes.SwitchPage, 8, (int)Buttons.Miscellaneous)); AddControl(new Button(this, 576, 320, 235, 234, ButtonTypes.SwitchPage, 9, (int)Buttons.Filters)); //bottom buttons AddControl(new Button(this, 140, 410, 243, 241, ButtonTypes.Activate, 0, (int)Buttons.Cancel)); AddControl(new Button(this, 240, 410, 239, 240, ButtonTypes.Activate, 0, (int)Buttons.Apply)); AddControl(new Button(this, 340, 410, 246, 244, ButtonTypes.Activate, 0, (int)Buttons.Default)); AddControl(new Button(this, 440, 410, 249, 248, ButtonTypes.Activate, 0, (int)Buttons.Okay)); m_UserInterface = Service.Get <UserInterfaceService>(); m_World = Service.Get <WorldModel>(); // page 1 Sound and Music AddControl(new Button(this, 0, 40, 217, 217, ButtonTypes.SwitchPage, 1, (int)Buttons.Sound), 1); AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Sound and Music"), 1); AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settings affect the sound and music you will hear while playing Ultima Online."), 1); AddControl(new TextLabelAscii(this, 85, 85, 9, 1, @"Sound on/off"), 1); m_SoundOn = AddControl <CheckBox>(new CheckBox(this, 60, 80, 210, 211, Settings.Audio.SoundOn, 61), 1); AddControl(new TextLabelAscii(this, 60, 110, 9, 1, @"Sound volume"), 1); m_SoundVolume = AddControl <HSliderBar>(new HSliderBar(this, 60, 130, 150, 0, 100, Settings.Audio.SoundVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1); m_Labels[(int)Labels.SoundVolume] = AddControl <TextLabelAscii>(new TextLabelAscii(this, 220, 130, 9, 1, Settings.Audio.SoundVolume.ToString()), 1); AddControl(new TextLabelAscii(this, 85, 155, 9, 1, @"Music on/off"), 1); m_MusicOn = AddControl <CheckBox>(new CheckBox(this, 60, 150, 210, 211, Settings.Audio.MusicOn, 62), 1); AddControl(new TextLabelAscii(this, 60, 180, 9, 1, @"Music volume"), 1); m_MusicVolume = AddControl <HSliderBar>(new HSliderBar(this, 60, 200, 150, 0, 100, Settings.Audio.MusicVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1); m_Labels[(int)Labels.MusicVolume] = AddControl <TextLabelAscii>(new TextLabelAscii(this, 220, 200, 9, 1, m_MusicVolume.Value.ToString()), 1); AddControl(new TextLabelAscii(this, 85, 225, 9, 1, @"Play footstep sound"), 1); m_FootStepSoundOn = AddControl <CheckBox>(new CheckBox(this, 60, 220, 210, 211, Settings.Audio.FootStepSoundOn, 62), 1); // page 2 Pop-up Help AddControl(new Button(this, 0, 110, 219, 219, ButtonTypes.SwitchPage, 2, (int)Buttons.Help), 2); AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Pop-up Help"), 2); AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settings configure the behavior of the pop-up help."), 2); // page 3 Chat AddControl(new Button(this, 0, 250, 223, 223, ButtonTypes.SwitchPage, 3, (int)Buttons.Chat), 3); AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Chat"), 3); AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settings affect the interface display for chat system."), 3); // page 4 Macro Options AddControl(new Button(this, 0, 320, 236, 236, ButtonTypes.SwitchPage, 4, (int)Buttons.Macros), 4); AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Macro Options"), 4); AddControl(new TextLabelAscii(this, 60, 40, 9, 1, @""), 4); AddControl(new Button(this, 180, 60, 2460, 2461, ButtonTypes.Activate, 4, (int)Buttons.MAdd), 4); // add AddControl(new Button(this, 234, 60, 2463, 2464, ButtonTypes.Activate, 4, (int)Buttons.MDelete), 4); // delete AddControl(new Button(this, 302, 60, 2466, 2467, ButtonTypes.Activate, 4, (int)Buttons.MPrevious), 4); // previous AddControl(new Button(this, 386, 60, 2469, 2470, ButtonTypes.Activate, 4, (int)Buttons.MNext), 4); // next AddControl(new TextLabelAscii(this, 125, 85, 9, 1, @"Keystroke"), 4); // key press event KeyPressControl myKeyPress = new KeyPressControl(this, 130, 100, 57, 14, 4000, WinKeys.None); AddControl(new ResizePic(this, myKeyPress), 4); m_MacroKeyPress = AddControl <KeyPressControl>(myKeyPress, 4); /// AddControl(new TextLabelAscii(this, 195, 100, 9, 1, @"Key"), 4); m_chkShift = AddControl <CheckBox>(new CheckBox(this, 260, 90, 2151, 2153, Settings.Audio.FootStepSoundOn, 62), 4); //shift m_chkAlt = AddControl <CheckBox>(new CheckBox(this, 330, 90, 2151, 2153, Settings.Audio.FootStepSoundOn, 62), 4); //alt m_chkCtrl = AddControl <CheckBox>(new CheckBox(this, 400, 90, 2151, 2153, Settings.Audio.FootStepSoundOn, 62), 4); //ctrl AddControl(new TextLabelAscii(this, 285, 90, 9, 1, @"Shift"), 4); AddControl(new TextLabelAscii(this, 355, 90, 9, 1, @"Alt"), 4); AddControl(new TextLabelAscii(this, 425, 90, 9, 1, @"Ctrl"), 4); AddControl(new TextLabelAscii(this, 180, 135, 9, 1, @"ACTION"), 4); AddControl(new TextLabelAscii(this, 420, 135, 9, 1, @"VALUE"), 4); // macro's action type and controlling another dropdown list for visual int y = 0; for (int i = 0; i < MACRO_CAPACITY; i++) { //number of action AddControl(new TextLabelAscii(this, 84, 155 + y, 9, 1, (i + 1).ToString()), 4); // action dropdown list (i need ID variable for find in controls) m_ActionTypeList[i] = AddControl <MacroDropDownList>(new MacroDropDownList( this, 100, 150 + y, 215, Utility.CreateStringLinesFromList(Macros.Types), 10, 0, false, (i + 1000), true), 4); // value dropdown list (i need ID variable for find in controls) m_ActionDropDown[i] = AddControl <MacroDropDownList>(new MacroDropDownList( this, 330, 150 + y, 190, new string[] { }, 10, 0, false, (i + 2000), false), 4); //visual control about resizable picture m_ActionDropDown[i].IsVisible = false; //here is textentry for example: Say,Emote,Yell (i need ID variable for find in controls) m_ActionText[i] = AddControl <TextEntry>(new TextEntry(this, 340, 150 + y, 160, 20, 1, (3000 + i), 80, string.Empty), 4); m_ActionText[i].IsEditable = false; m_ActionText[i].IsVisible = false; y += 25; } // page 5 Interface AddControl(new Button(this, 576, 40, 225, 225, ButtonTypes.SwitchPage, 5, (int)Buttons.Interface), 5); AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Interface"), 5); AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These options affect your interface."), 5); AddControl(new TextLabelAscii(this, 85, 85, 9, 1, @"Your character will always run if this is checked"), 5); m_AlwaysRun = AddControl <CheckBox>(new CheckBox(this, 60, 80, 210, 211, Settings.UserInterface.AlwaysRun, 61), 5); AddControl(new TextLabelAscii(this, 85, 115, 9, 1, @"Disable the Menu Bar"), 5); m_MenuBarDisabled = AddControl <CheckBox>(new CheckBox(this, 60, 110, 210, 211, Settings.UserInterface.MenuBarDisabled, 61), 5); // page 6 Display AddControl(new Button(this, 576, 110, 227, 227, ButtonTypes.SwitchPage, 6, (int)Buttons.Display), 6); AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Display"), 6); AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These options affect your display, and adjusting some of them may improve your graphics performance.", 430), 6); AddControl(new TextLabelAscii(this, 85, 80, 9, 1, @"Enable vertical synchronization"), 6); m_IsVSyncEnabled = AddControl <CheckBox>(new CheckBox(this, 60, 80, 210, 211, Settings.Engine.IsVSyncEnabled, 61), 6); AddControl(new TextLabelAscii(this, 85, 100, 9, 1, @"Some unused option"), 6); AddControl(new CheckBox(this, 60, 100, 210, 211, false, 62), 6); AddControl(new TextLabelAscii(this, 85, 120, 9, 1, @"Use full screen display"), 6); AddControl(new CheckBox(this, 60, 120, 210, 211, Settings.UserInterface.IsMaximized, 61), 6); AddControl(new TextLabelAscii(this, 60, 150, 9, 1, @"Full Screen Resolution:"), 6); m_DropDownFullScreenResolutions = AddControl <DropDownList>(new DropDownList(this, 60, 165, 122, Utility.CreateStringLinesFromList(Resolutions.FullScreenResolutionsList), 10, GetCurrentFullScreenIndex(), false), 6); AddControl(new TextLabelAscii(this, 60, 190, 9, 1, @"Play Window Resolution:"), 6); m_DropDownPlayWindowResolutions = AddControl <DropDownList>(new DropDownList(this, 60, 205, 122, Utility.CreateStringLinesFromList(Resolutions.FullScreenResolutionsList), 10, GetCurrentPlayWindowIndex(), false), 6); AddControl(new TextLabelAscii(this, 85, 235, 9, 1, @"Speech color"), 6); m_SpeechColor = AddControl <ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 235, 15, 15), new Rectangle(60, 235, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.SpeechColor), 6); AddControl(new TextLabelAscii(this, 85, 255, 9, 1, @"Emote color"), 6); m_EmoteColor = AddControl <ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 255, 15, 15), new Rectangle(60, 255, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.EmoteColor), 6); AddControl(new TextLabelAscii(this, 85, 275, 9, 1, @"Party message color"), 6); m_PartyMsgColor = AddControl <ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 275, 15, 15), new Rectangle(60, 275, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.PartyMsgColor), 6); AddControl(new TextLabelAscii(this, 85, 295, 9, 1, @"Guild message color"), 6); m_GuildMsgColor = AddControl <ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 295, 15, 15), new Rectangle(60, 295, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.GuildMsgColor), 6); AddControl(new TextLabelAscii(this, 85, 315, 9, 1, @"Ignore guild messages"), 6); m_IgnoreGuildMsg = AddControl <CheckBox>(new CheckBox(this, 60, 315, 210, 211, Settings.UserInterface.IgnoreGuildMsg, 62), 6); AddControl(new TextLabelAscii(this, 85, 335, 9, 1, @"Alliance message color"), 6); m_AllianceMsgColor = AddControl <ColorPickerBox>(new ColorPickerBox(this, new Rectangle(60, 335, 15, 15), new Rectangle(60, 335, 450, 150), 30, 10, Hues.TextTones, Settings.UserInterface.AllianceMsgColor), 6); AddControl(new TextLabelAscii(this, 85, 355, 9, 1, @"Ignore alliance messages"), 6); m_IgnoreAllianceMsg = AddControl <CheckBox>(new CheckBox(this, 60, 355, 210, 211, Settings.UserInterface.IgnoreAllianceMsg, 62), 6); // page 7 Reputation system AddControl(new Button(this, 576, 180, 229, 229, ButtonTypes.SwitchPage, 7, (int)Buttons.Reputation), 7); AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Reputation system"), 7); AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"These settings affect the reputation system, which is Ultima Online's system for controlling antisocial behavior."), 7); AddControl(new TextLabelAscii(this, 85, 100, 9, 1, @"Query before performing criminal actions"), 7); m_CrimeQuery = AddControl <CheckBox>(new CheckBox(this, 60, 100, 210, 211, Settings.UserInterface.CrimeQuery, 61), 7); // page 8 Miscellaneous AddControl(new Button(this, 576, 250, 231, 231, ButtonTypes.SwitchPage, 8, (int)Buttons.Miscellaneous), 8); AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Miscellaneous"), 8); AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @"Miscellaneous options."), 8); AddControl(new TextLabelAscii(this, 85, 80, 9, 1, @"Enable debug console"), 8); m_IsConsoleEnabled = AddControl <CheckBox>(new CheckBox(this, 60, 80, 210, 211, Settings.Debug.IsConsoleEnabled, 61), 8); AddControl(new TextLabelAscii(this, 85, 100, 9, 1, @"Show FPS"), 8); m_ShowFps = AddControl <CheckBox>(new CheckBox(this, 60, 100, 210, 211, Settings.Debug.ShowFps, 61), 8); // page 9 Filter Options AddControl(new Button(this, 576, 320, 234, 234, ButtonTypes.SwitchPage, 9, (int)Buttons.Filters), 9); AddControl(new TextLabelAscii(this, 250, 20, 2, 1, @"Filter Options"), 9); AddControl(new TextLabelAscii(this, 60, 45, 9, 1, @""), 9); ChangeCurrentMacro(Macros.Player.Count - 1); }
private void BuildPage1() { AddChildren(new GumpPic(0, 45, 0x00D9, 0) { CanMove = false }, 1); Label label = new Label("Sound and Music", true, 0, 460, align: TEXT_ALIGN_TYPE.TS_CENTER) { X = 84, Y = 22 }; AddChildren(label, 1); label = new Label("These settings affect the sound and music you will hear while playing Ultima Online.", true, 0, 500) { X = 64, Y = 44 }; AddChildren(label, 1); _checkboxSound = new Checkbox(0x00D2, 0x00D3, "Sound On/Off") { X = 64, Y = 90, IsChecked = _settings.Sound }; AddChildren(_checkboxSound, 1); label = new Label("Sound Volume", true, 0) { X = 64, Y = 112 }; AddChildren(label, 1); _sliderSound = new HSliderBar(64, 133, 90, 0, 255, _settings.SoundVolume, HSliderBarStyle.MetalWidgetRecessedBar, true); AddChildren(_sliderSound, 1); _checkboxMusic = new Checkbox(0x00D2, 0x00D3, "Music On/Off") { X = 64, Y = 151, IsChecked = _settings.Music }; AddChildren(_checkboxMusic, 1); label = new Label("Music volume", true, 0) { X = 64, Y = 173 }; AddChildren(label, 1); _sliderMusic = new HSliderBar(64, 194, 90, 0, 255, _settings.MusicVolume, HSliderBarStyle.MetalWidgetRecessedBar, true); AddChildren(_sliderMusic, 1); _checboxFootstepsSound = new Checkbox(0x00D2, 0x00D3, "Play footsteps sound") { X = 64, Y = 212 }; AddChildren(_checboxFootstepsSound, 1); _checkboxPlayCombatMusic = new Checkbox(0x00D2, 0x00D3, "Play combat music") { X = 64, Y = 232 }; AddChildren(_checkboxPlayCombatMusic, 1); _checkboxPlaySoundsInBackground = new Checkbox(0x00D2, 0x00D3, "Play sounds in background") { X = 64, Y = 252 }; AddChildren(_checkboxPlaySoundsInBackground, 1); }
public GridLootItem(uint serial) { LocalSerial = serial; Item item = World.Items.Get(serial); if (item == null) { Dispose(); return; } const int SIZE = 50; CanMove = false; HSliderBar amount = new HSliderBar(0, 0, SIZE, 1, item.Amount, item.Amount, HSliderBarStyle.MetalWidgetRecessedBar, true, color: 0xFFFF, drawUp: true); Add(amount); amount.IsVisible = amount.IsEnabled = amount.MaxValue > 1; AlphaBlendControl background = new AlphaBlendControl(); background.Y = 15; background.Width = SIZE; background.Height = SIZE; Add(background); _texture = new TextureControl(); _texture.IsPartial = item.ItemData.IsPartialHue; _texture.ScaleTexture = true; _texture.Hue = item.Hue; _texture.Texture = ArtLoader.Instance.GetTexture(item.DisplayedGraphic); _texture.Y = 15; _texture.Width = SIZE; _texture.Height = SIZE; _texture.CanMove = false; if (World.ClientFeatures.TooltipsEnabled) { _texture.SetTooltip(item); } Add(_texture); _texture.MouseUp += (sender, e) => { if (e.Button == MouseButtonType.Left) { GameActions.GrabItem(item, (ushort)amount.Value); } }; Width = background.Width; Height = background.Height + 15; WantUpdateSize = false; }
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); }