コード例 #1
0
        private void ShopItem_MouseDoubleClick(object sender, MouseDoubleClickEventArgs e)
        {
            var             shopItem = (ShopItem)sender;
            TransactionItem transactionItem;

            if (shopItem.Amount <= 0)
            {
                return;
            }

            if (_transactionItems.TryGetValue(shopItem.Item, out transactionItem))
            {
                transactionItem.Amount++;
            }
            else
            {
                transactionItem = new TransactionItem(shopItem.Item);
                transactionItem.OnIncreaseButtomClicked += TransactionItem_OnIncreaseButtomClicked;
                transactionItem.OnDecreaseButtomClicked += TransactionItem_OnDecreaseButtomClicked;
                _transactionScrollArea.AddChildren(transactionItem);
                _transactionItems.Add(shopItem.Item, transactionItem);
            }

            shopItem.Amount--;
            updateTotal = true;
        }
コード例 #2
0
        protected override void OnInitialize()
        {
            _totalReal  = 0;
            _totalValue = 0;
            _scrollArea.Clear();

            foreach (SkillListEntry entry in _skillListEntries)
            {
                entry.Clear();
                entry.Dispose();
            }

            _skillListEntries.Clear();

            foreach (Skill skill in World.Player.Skills)
            {
                _totalReal  += skill.Base;
                _totalValue += skill.Value;
                Label skillName      = new Label(skill.Name, true, 1153, font: 3); //3
                Label skillValueBase = new Label(skill.Base.ToString(), true, 1153, font: 3);
                Label skillValue     = new Label(skill.Value.ToString(), true, 1153, font: 3);
                Label skillCap       = new Label(skill.Cap.ToString(), true, 1153, font: 3);
                _skillListEntries.Add(new SkillListEntry(skillName, skillValueBase, skillValue, skillCap, skill));
            }

            for (int i = 0; i < _skillListEntries.Count; i++)
            {
                _scrollArea.AddChildren(_skillListEntries[i]);
            }

            AddChildren(new Label($"{_totalReal} | {_totalValue}", true, 1153)
            {
                X = 170, Y = 315
            });
        }
コード例 #3
0
        protected override void OnInitialize()
        {
            _scrollArea.Clear();

            foreach (PartyListEntry entry in _partyListEntries)
            {
                entry.Clear();
                entry.Dispose();
            }

            _partyListEntries.Clear();
            foreach (PartyMember member in PartySystem.Members)
            {
                _partyListEntries.Add(new PartyListEntry(member));
            }
            for (int i = 0; i < _partyListEntries.Count; i++)
            {
                _scrollArea.AddChildren(_partyListEntries[i]);
            }
        }
コード例 #4
0
        public InfoGump(object obj) : base(0, 0)
        {
            X                = 200;
            Y                = 200;
            CanMove          = true;
            AcceptMouseInput = false;
            AddChildren(new GameBorder(0, 0, WIDTH, HEIGHT, 4));

            AddChildren(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true
            });

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

            foreach (var item in ReflectionHolder.GameObjectDictionary(obj))
            {
                if (item.Value.ToString() != "")
                {
                    _scrollArea.AddChildren(new Label(item.Key + " : " + item.Value, true, 1153, font: 3, maxwidth: WIDTH - 65));
                }
            }
        }
コード例 #5
0
        public ServerSelectionGump() : base(0, 0)
        {
            AddChildren(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2)
            {
                X = 586, Y = 445, ButtonAction = ButtonAction.Activate
            });
            AddChildren(new Button((int)Buttons.Next, 0x15A4, 0x15A6, 0x15A5)
            {
                X = 610, Y = 445, ButtonAction = ButtonAction.Activate
            });

            if (FileManager.ClientVersion >= ClientVersions.CV_500A)
            {
                ushort textColor = 0xFFFF;
                AddChildren(new Label(Cliloc.GetString(1044579), true, textColor, font: 1)
                {
                    X = 155, Y = 70
                });                                                                                            // "Select which shard to play on:"
                AddChildren(new Label(Cliloc.GetString(1044577), true, textColor, font: 1)
                {
                    X = 400, Y = 70
                });                                                                                            // "Latency:"
                AddChildren(new Label(Cliloc.GetString(1044578), true, textColor, font: 1)
                {
                    X = 470, Y = 70
                });                                                                                            // "Packet Loss:"
                AddChildren(new Label(Cliloc.GetString(1044580), true, textColor, font: 1)
                {
                    X = 153, Y = 368
                });                                                                                             // "Sort by:"
            }
            else
            {
                ushort textColor = 0x0481;
                AddChildren(new Label("Select which shard to play on:", true, textColor, font: 9)
                {
                    X = 155, Y = 70
                });
                AddChildren(new Label("Latency:", true, textColor, font: 9)
                {
                    X = 400, Y = 70
                });
                AddChildren(new Label("Packet Loss:", true, textColor, font: 9)
                {
                    X = 470, Y = 70
                });
                AddChildren(new Label("Sort by:", true, textColor, font: 9)
                {
                    X = 153, Y = 368
                });
            }

            AddChildren(new Button((int)Buttons.SortTimeZone, 0x093B, 0x093C, 0x093D)
            {
                X = 230, Y = 366
            });
            AddChildren(new Button((int)Buttons.SortFull, 0x093E, 0x093F, 0x0940)
            {
                X = 338, Y = 366
            });
            AddChildren(new Button((int)Buttons.SortConnection, 0x0941, 0x0942, 0x0943)
            {
                X = 446, Y = 366
            });

            // World Pic Bg
            AddChildren(new GumpPic(150, 390, 0x0589, 0));
            // Earth
            AddChildren(new Button((int)Buttons.Earth, 0x15E8, 0x15EA, 0x15E9)
            {
                X = 160, Y = 400
            });

            // Sever Scroll Area Bg
            AddChildren(new ResizePic(0x0DAC)
            {
                X = 150, Y = 90, Width = 393 - 14, Height = 271
            });
            // Sever Scroll Area
            ScrollArea scrollArea = new ScrollArea(150, 90, 393, 271, true);
            LoginScene loginScene = Service.Get <LoginScene>();

            foreach (ServerListEntry server in loginScene.Servers)
            {
                scrollArea.AddChildren(new ServerEntryGump(server));
            }
            AddChildren(scrollArea);

            if (loginScene.Servers.Count() > 0)
            {
                if (loginScene.Servers.Last().Index < loginScene.Servers.Count())
                {
                    AddChildren(new Label(loginScene.Servers.Last().Name, false, 0x0481, font: 9)
                    {
                        X = 243, Y = 420
                    });
                }
                else
                {
                    AddChildren(new Label(loginScene.Servers.First().Name, false, 0x0481, font: 9)
                    {
                        X = 243, Y = 420
                    });
                }
            }
        }
コード例 #6
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);
            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;
            }
        }
コード例 #7
0
ファイル: OptionsGump1.cs プロジェクト: msx752/ClassicUO
        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);
        }
コード例 #8
0
ファイル: OptionsGump1.cs プロジェクト: msx752/ClassicUO
        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);
        }
コード例 #9
0
ファイル: OptionsGump1.cs プロジェクト: msx752/ClassicUO
        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);
        }
コード例 #10
0
ファイル: OptionsGump1.cs プロジェクト: msx752/ClassicUO
        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);
        }
コード例 #11
0
ファイル: OptionsGump1.cs プロジェクト: msx752/ClassicUO
        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);
        }
コード例 #12
0
        public ShopGump(Serial serial, Item[] itemList, bool isBuyGump, int x, int y) : base(serial, 0)
        {
            _transactionItems = new Dictionary <Item, TransactionItem>();
            _shopItems        = new Dictionary <Item, ShopItem>();
            _isBuyGump        = isBuyGump;
            updateTotal       = false;
            X = x;
            Y = y;

            if (isBuyGump)
            {
                AddChildren(new GumpPic(0, 0, 0x0870, 0));
            }
            else
            {
                AddChildren(new GumpPic(0, 0, 0x0872, 0));
            }

            if (isBuyGump)
            {
                AddChildren(new GumpPic(170, 214, 0x0871, 0));
            }
            else
            {
                AddChildren(new GumpPic(170, 214, 0x0873, 0));
            }

            HitBox boxAccept = new HitBox(200, 406, 34, 30)
            {
                Alpha = 1
            };

            HitBox boxClear = new HitBox(372, 410, 24, 24)
            {
                Alpha = 1
            };

            boxAccept.MouseClick += (sender, e) => { OnButtonClick((int)Buttons.Accept); };
            boxClear.MouseClick  += (sender, e) => { OnButtonClick((int)Buttons.Clear); };
            AddChildren(boxAccept);
            AddChildren(boxClear);

            if (isBuyGump)
            {
                AddChildren(_totalLabel = new Label("0", false, 0x0386, font: 9)
                {
                    X = 240, Y = 385
                });

                AddChildren(_playerGoldLabel = new Label(World.Player.Gold.ToString(), false, 0x0386, font: 9)
                {
                    X = 358, Y = 385
                });
            }
            else
            {
                AddChildren(_totalLabel = new Label("0", false, 0x0386, font: 9)
                {
                    X = 358, Y = 386
                });
            }

            AddChildren(new Label(World.Player.Name, false, 0x0386, font: 5)
            {
                X = 242, Y = 408
            });

            _shopScrollArea = new ScrollArea(20, 60, 235, 150, false);

            foreach (var item in itemList)
            {
                ShopItem shopItem;

                _shopScrollArea.AddChildren(shopItem = new ShopItem(item)
                {
                    X = 5, Y = 5
                });

                _shopScrollArea.AddChildren(new ResizePicLine(0x39)
                {
                    X = 10, Width = 210
                });
                shopItem.MouseClick       += ShopItem_MouseClick;
                shopItem.MouseDoubleClick += ShopItem_MouseDoubleClick;
                _shopItems.Add(item, shopItem);
            }

            AddChildren(_shopScrollArea);
            AddChildren(_transactionScrollArea = new ScrollArea(200, 280, 225, 80, false));

            AcceptMouseInput = true;
            CanMove          = true;
        }
コード例 #13
0
        public InfoGump(GameObject obj) : base(0, 0)
        {
            X                = 200;
            Y                = 200;
            CanMove          = true;
            AcceptMouseInput = false;
            AddChildren(new GameBorder(0, 0, WIDTH, HEIGHT, 4));

            AddChildren(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true
            });

            AddChildren(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                IsTransparent = true
            });
            AddChildren(new Label("Object Information", true, 1153, font: 3)
            {
                X = 20, Y = 20
            });
            AddChildren(new Line(20, 50, WIDTH - 50, 1, 0xFFFFFFFF));
            _scrollArea = new ScrollArea(20, 60, WIDTH - 40, 510, true)
            {
                AcceptMouseInput = true
            };
            AddChildren(_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.AddChildren(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.AddChildren(label);
                    areaItem.AddChildren(new Line(0, height + 2, WIDTH - 65, 1, Color.Gray.PackedValue));

                    _scrollArea.AddChildren(areaItem);
                }
            }
        }