Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        private void BuildTooltip()
        {
            const int      PAGE      = 5;
            ScrollArea     rightArea = new ScrollArea(190, 60, 390, 380, true);
            ScrollAreaItem item      = new ScrollAreaItem();

            Add(rightArea, PAGE);
        }
Ejemplo n.º 3
0
        private void BuildTooltip()
        {
            const int      PAGE      = 5;
            ScrollArea     rightArea = new ScrollArea(190, 20, WIDTH - 210, 420, true);
            ScrollAreaItem item      = new ScrollAreaItem();

            Add(rightArea, PAGE);
        }
Ejemplo n.º 4
0
        private void BuildCommands()
        {
            const int      PAGE      = 4;
            ScrollArea     rightArea = new ScrollArea(190, 60, 390, 380, true);
            ScrollAreaItem item      = new ScrollAreaItem();

            Add(rightArea, PAGE);
        }
Ejemplo n.º 5
0
        private void BuildFonts()
        {
            const int      PAGE      = 6;
            ScrollArea     rightArea = new ScrollArea(190, 60, 390, 380, true);
            ScrollAreaItem item      = new ScrollAreaItem();

            AddChildren(rightArea, PAGE);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        private ClickableColorBox CreateClickableColorBox(ScrollArea area, int x, int y, ushort hue, string text, int labelX, int labelY)
        {
            ScrollAreaItem item = new ScrollAreaItem();

            uint color = 0xFF7F7F7F;

            if (hue != 0xFFFF)
            {
                color = FileManager.Hues.GetPolygoneColor(12, hue);
            }

            ClickableColorBox box = new ClickableColorBox(x, y, 13, 14, hue, color);

            item.Add(box);

            item.Add(new Label(text, true, HUE_FONT, font: FONT)
            {
                X = labelX, Y = labelY
            });
            area.Add(item);
            return(box);
        }
Ejemplo n.º 8
0
        private TextBox CreateInputField(ScrollAreaItem area, TextBox elem, string label = null)
        {
            area.Add(new ResizePic(0x0BB8)
            {
                X      = elem.X - 10,
                Y      = elem.Y - 5,
                Width  = elem.Width + 10,
                Height = elem.Height - 7
            });

            area.Add(elem);

            if (label != null)
            {
                Label text = new Label(label, true, HUE_FONT, 0, FONT)
                {
                    Y = elem.Y - 30
                };
                area.Add(text);
            }

            return(elem);
        }
Ejemplo n.º 9
0
        private Checkbox CreateCheckBox(ScrollArea area, string text, bool ischecked, int x, int y)
        {
            Checkbox box = new Checkbox(0x00D2, 0x00D3, text, FONT, HUE_FONT, true)
            {
                IsChecked = ischecked
            };

            if (x != 0)
            {
                ScrollAreaItem item = new ScrollAreaItem();
                box.X = x;
                box.Y = y;

                item.Add(box);
                area.Add(item);
            }
            else
            {
                box.Y = y;

                area.Add(box);
            }
            return(box);
        }
Ejemplo n.º 10
0
        public OptionsGump1() : base(0, 0)
        {
            _settings = Service.Get <Settings>();

            AddChildren(new ResizePic(/*0x2436*/ /*0x2422*/ /*0x9C40*/ 9200 /*0x53*/ /*0xE10*/)
            {
                Width = 600, Height = 500
            });

            //AddChildren(new GameBorder(0, 0, 600, 400, 4));

            //AddChildren(new GumpPicTiled(4, 4, 600 - 8, 400 - 8, 0x0A40) { IsTransparent = false});

            //AddChildren(new ResizePic(0x2436) { X = 20, Y = 20, Width = 150, Height = 460 });

            //AddChildren(new LeftButton() { X = 40, Y = 40 });
            ScrollArea     leftArea = new ScrollArea(10, 10, 160, 480, true);
            ScrollAreaItem item     = new ScrollAreaItem();

            item.AddChildren(new Button(0, 0x9C5, 0x9C5, 0x9C5, "General", 1, true, 14, 24)
            {
                Y = 30, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 1
            });

            item.AddChildren(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Sounds", 1, true, 14, 24)
            {
                Y = 30 * 2, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 2
            });

            item.AddChildren(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Video", 1, true, 14, 24)
            {
                Y = 30 * 3, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 3
            });

            item.AddChildren(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Commands", 1, true, 14, 24)
            {
                Y = 30 * 4, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 4
            });

            item.AddChildren(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Tooltip", 1, true, 14, 24)
            {
                Y = 30 * 5, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 5
            });

            item.AddChildren(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Fonts", 1, true, 14, 24)
            {
                Y = 30 * 6, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 6
            });

            item.AddChildren(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Speech", 1, true, 14, 24)
            {
                Y = 30 * 7, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 7
            });

            item.AddChildren(new Button(0, 0x9C5, 0x9C5, 0x9C5, "Combat", 1, true, 14, 24)
            {
                Y = 30 * 8, FontCenter = true, ButtonAction = ButtonAction.SwitchPage, ToPage = 8
            });
            leftArea.AddChildren(item);
            AddChildren(leftArea);
            int offsetX = 60;
            int offsetY = 60;

            AddChildren(new Button((int)Buttons.Cancel, 0x00F3, 0x00F1, 0x00F2)
            {
                X = 154 + offsetX, Y = 405 + offsetY, ButtonAction = ButtonAction.Activate
            });

            AddChildren(new Button((int)Buttons.Apply, 0x00EF, 0x00F0, 0x00EE)
            {
                X = 248 + offsetX, Y = 405 + offsetY, ButtonAction = ButtonAction.Activate
            });

            AddChildren(new Button((int)Buttons.Default, 0x00F6, 0x00F4, 0x00F5)
            {
                X = 346 + offsetX, Y = 405 + offsetY, ButtonAction = ButtonAction.Activate
            });

            AddChildren(new Button((int)Buttons.Ok, 0x00F9, 0x00F8, 0x00F7)
            {
                X = 443 + offsetX, Y = 405 + offsetY, ButtonAction = ButtonAction.Activate
            });
            AcceptMouseInput = false;
            CanMove          = true;
            BuildGeneral();
            BuildSounds();
            BuildVideo();
            BuildCommands();
            BuildFonts();
            BuildSpeech();
            BuildCombat();
            BuildTooltip();
            ChangePage(1);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
        public InspectorGump(GameObject obj) : base(0, 0)
        {
            X                      = 200;
            Y                      = 100;
            _obj                   = obj;
            CanMove                = true;
            AcceptMouseInput       = false;
            CanCloseWithRightClick = true;
            Add(new BorderControl(0, 0, WIDTH, HEIGHT, 4));

            Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                Alpha = 0.5f
            });

            Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                Alpha = 0.5f
            });
            Add(new Label("Object Information", true, 1153, font: 3)
            {
                X = 20, Y = 10
            });
            Add(new Line(20, 30, WIDTH - 50, 1, 0xFFFFFFFF));
            Add(new NiceButton(WIDTH - 115, 5, 100, 25, ButtonAction.Activate, "Dump")
            {
                ButtonParameter = 0
            });

            _scrollArea = new ScrollArea(20, 35, WIDTH - 40, HEIGHT - 45, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Dictionary <string, string> dict = ReflectionHolder.GetGameObjectProperties(obj);

            if (dict != null)
            {
                foreach (KeyValuePair <string, string> item in dict.OrderBy(s => s.Key))
                {
                    ScrollAreaItem areaItem = new ScrollAreaItem();

                    Label label = new Label(item.Key + ":", true, 33, font: 1, style: FontStyle.BlackBorder)
                    {
                        X = 2
                    };
                    areaItem.Add(label);

                    int height = label.Height;

                    label = new Label(item.Value, true, 1153, font: 1, style: FontStyle.BlackBorder, maxwidth: WIDTH - 65 - 200)
                    {
                        X = 200,
                        AcceptMouseInput = true
                    };
                    label.MouseUp += OnLabelClick;

                    if (label.Height > 0)
                    {
                        height = label.Height;
                    }

                    areaItem.Add(label);
                    areaItem.Add(new Line(0, height + 2, WIDTH - 65, 1, Color.Gray.PackedValue));

                    _scrollArea.Add(areaItem);
                }
            }
        }
Ejemplo n.º 14
0
        private void BuildCombat()
        {
            const int      PAGE      = 8;
            ScrollArea     rightArea = new ScrollArea(190, 60, 390, 380, true);
            ScrollAreaItem item      = new ScrollAreaItem();

            Button buttonInnocentColor = new Button((int)Buttons.InnocentColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate
            };

            item.AddChildren(buttonInnocentColor);
            uint color = 0xFF7F7F7F;

            if (Engine.Profile.Current.InnocentHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.InnocentHue) << 8) | 0xFF);
            }
            ColorPickerBox innocentColor = new ColorPickerBox(3, 3, 1, 1, 13, 14);

            innocentColor.MouseClick += (sender, e) => buttonInnocentColor.InvokeMouseClick(e.Location, e.Button);
            innocentColor.SetHue(color);

            buttonInnocentColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => innocentColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(innocentColor);

            Label text = new Label("Innocent color", true, 1)
            {
                X = 20
            };

            item.AddChildren(text);

            Button buttonFriendColor = new Button((int)Buttons.FriendColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate, Y = buttonInnocentColor.Height
            };

            item.AddChildren(buttonFriendColor);
            color = 0xFF7F7F7F;

            if (Engine.Profile.Current.FriendHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.FriendHue) << 8) | 0xFF);
            }

            ColorPickerBox friendColor = new ColorPickerBox(3, 3, 1, 1, 13, 14)
            {
                Y = buttonInnocentColor.Height + 3
            };

            friendColor.MouseClick += (sender, e) => buttonFriendColor.InvokeMouseClick(e.Location, e.Button);
            friendColor.SetHue(color);

            buttonFriendColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => friendColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(friendColor);

            text = new Label("Friend color", true, 1)
            {
                X = 20, Y = buttonInnocentColor.Height
            };
            item.AddChildren(text);

            Button buttonCriminalColor = new Button((int)Buttons.CriminalColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate, Y = buttonFriendColor.Bounds.Bottom
            };

            item.AddChildren(buttonCriminalColor);
            color = 0xFF7F7F7F;

            if (Engine.Profile.Current.CriminalHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.CriminalHue) << 8) | 0xFF);
            }

            ColorPickerBox criminalColor = new ColorPickerBox(3, 3, 1, 1, 13, 14)
            {
                Y = buttonFriendColor.Bounds.Bottom + 3
            };

            criminalColor.MouseClick += (sender, e) => buttonCriminalColor.InvokeMouseClick(e.Location, e.Button);
            criminalColor.SetHue(color);

            buttonCriminalColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => criminalColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(criminalColor);

            text = new Label("Criminal color", true, 1)
            {
                X = 20, Y = buttonFriendColor.Bounds.Bottom
            };
            item.AddChildren(text);

            Button buttonEnemyColor = new Button((int)Buttons.EnemyColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate, X = 150
            };

            item.AddChildren(buttonEnemyColor);
            color = 0xFF7F7F7F;

            if (Engine.Profile.Current.EnemyHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.EnemyHue) << 8) | 0xFF);
            }

            ColorPickerBox enemyColor = new ColorPickerBox(3, 3, 1, 1, 13, 14)
            {
                X = 150 + 3
            };

            enemyColor.MouseClick += (sender, e) => buttonEnemyColor.InvokeMouseClick(e.Location, e.Button);
            enemyColor.SetHue(color);

            buttonEnemyColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => enemyColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(enemyColor);

            text = new Label("Enemy color", true, 1)
            {
                X = 150 + 20
            };
            item.AddChildren(text);

            Button buttonMurdererColor = new Button((int)Buttons.MurdererColor, 0x00D4, 0x00D4)
            {
                ButtonAction = ButtonAction.Activate, X = 150, Y = buttonEnemyColor.Bounds.Bottom
            };

            item.AddChildren(buttonMurdererColor);
            color = 0xFF7F7F7F;

            if (Engine.Profile.Current.MurdererHue != 0xFFFF)
            {
                color = Hues.RgbaToArgb((Hues.GetPolygoneColor(12, Engine.Profile.Current.MurdererHue) << 8) | 0xFF);
            }

            ColorPickerBox murdererColor = new ColorPickerBox(3, 3, 1, 1, 13, 14)
            {
                X = 150 + 3, Y = buttonEnemyColor.Bounds.Bottom + 3
            };

            murdererColor.MouseClick += (sender, e) => buttonMurdererColor.InvokeMouseClick(e.Location, e.Button);
            murdererColor.SetHue(color);

            buttonMurdererColor.MouseClick += (sender, e) =>
            {
                // TODO: fix multi opening
                ColorPickerGump pickerGump = new ColorPickerGump(100, 100, s => murdererColor.SetHue(s));
                Engine.UI.Add(pickerGump);
            };
            item.AddChildren(murdererColor);

            text = new Label("Murderer color", true, 1)
            {
                X = 150 + 20, Y = buttonEnemyColor.Bounds.Bottom
            };
            item.AddChildren(text);
            rightArea.AddChildren(item);
            item = new ScrollAreaItem();

            Checkbox queryBeforeAttact = new Checkbox(0x00D2, 0x00D3, "Query before attack", 1)
            {
                Y = 30, IsChecked = Engine.Profile.Current.EnabledCriminalActionQuery
            };

            item.AddChildren(queryBeforeAttact);
            rightArea.AddChildren(item);
            AddChildren(rightArea, PAGE);
        }
Ejemplo n.º 15
0
        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);
        }
Ejemplo n.º 16
0
        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);
        }
Ejemplo n.º 17
0
        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           = 105,
                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           = 105,
                Width       = 50,
                Height      = 30,
                NumericOnly = true
            });

            _gameWindowLock = new Checkbox(0x00D2, 0x00D3, "Lock game window moving/resizing", FONT, HUE_FONT, true)
            {
                X         = 140,
                Y         = 100,
                IsChecked = Engine.Profile.Current.GameWindowLock
            };

            item.Add(_gameWindowLock);

            _gameWindowPositionX = CreateInputField(item, new TextBox(1, 5, 80, 80, false)
            {
                Text        = Engine.Profile.Current.GameWindowPosition.X.ToString(),
                X           = 10,
                Y           = 160,
                Width       = 50,
                Height      = 30,
                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           = 160,
                Width       = 50,
                Height      = 30,
                NumericOnly = true
            });

            rightArea.Add(item);

            Add(rightArea, PAGE);
        }
Ejemplo n.º 18
0
        public InfoGump(GameObject obj) : base(0, 0)
        {
            X                = 200;
            Y                = 200;
            CanMove          = true;
            AcceptMouseInput = false;
            Add(new GameBorder(0, 0, WIDTH, HEIGHT, 4));

            Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true,
                Alpha         = 0.5f,
            });

            Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true,
                Alpha         = 0.5f,
            });
            Add(new Label("Object Information", true, 1153, font: 3)
            {
                X = 20, Y = 20
            });
            Add(new Line(20, 50, WIDTH - 50, 1, 0xFFFFFFFF));
            _scrollArea = new ScrollArea(20, 60, WIDTH - 40, 510, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Dictionary <string, string> dict = ReflectionHolder.GetGameObjectProperties(obj);

            if (dict != null)
            {
                foreach (KeyValuePair <string, string> item in dict.OrderBy(s => s.Key))
                {
                    ScrollAreaItem areaItem = new ScrollAreaItem();

                    Label label = new Label(item.Key + ":", true, 33, font: 1, style: FontStyle.BlackBorder)
                    {
                        X = 2
                    };
                    areaItem.Add(label);

                    int height = label.Height;

                    label = new Label(item.Value, true, 1153, font: 1, style: FontStyle.BlackBorder, maxwidth: WIDTH - 65 - 200)
                    {
                        X = 200
                    };

                    if (label.Height > 0)
                    {
                        height = label.Height;
                    }

                    areaItem.Add(label);
                    areaItem.Add(new Line(0, height + 2, WIDTH - 65, 1, Color.Gray.PackedValue));

                    _scrollArea.Add(areaItem);
                }
            }
        }
Ejemplo n.º 19
0
        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);

            // HtmlGump scrollArea = new HtmlGump(64, 90, 500, 300, false, true);
            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;
            ScrollAreaItem areaItem = new ScrollAreaItem();

            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);
                areaItem.AddChildren(ck);
                y += 22;
            }

            scrollArea.AddChildren(areaItem);
            y += 20;

            for (int i = 0; i < 40; i++)
            {
                Button ck = new Button((int)Buttons.Ok + i + 1, 0x00F9, 0x00F8, 0x00F7)
                {
                    X = 34, Y = 0, ButtonAction = ButtonAction.Activate
                };
                ck.MouseClick += (sender, e) => Console.WriteLine("PRESSED: " + ck.ButtonID);
                scrollArea.AddChildren(ck);
            }
        }