Example #1
0
        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();
            }
        }
Example #2
0
        public LoginGump() : base(0, 0)
        {
            CanCloseWithRightClick = false;

            AcceptKeyboardInput = false;

            int offsetX, offsetY, offtextY;

            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("Log in to Ultima Online", false, HUE, font: 2)
                {
                    X = 253,
                    Y = 305
                });

                Add(new Label("Account Name", false, HUE, font: 2)
                {
                    X = 183,
                    Y = 345
                });

                Add(new Label("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($"ClassicUO Version {CUOEnviroment.Version}", false, 0x034E, font: 9)
                {
                    X = 286,
                    Y = 465
                });


                Add(_checkboxAutologin = new Checkbox(0x00D2, 0x00D3, "Autologin", 1, 0x0386, false)
                {
                    X = 200,
                    Y = 417
                });

                Add(_checkboxSaveAccount = new Checkbox(0x00D2, 0x00D3, "Save Account", 1, 0x0386, false)
                {
                    X = _checkboxAutologin.X + _checkboxAutologin.Width + 10,
                    Y = 417
                });
            }
            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($"ClassicUO Version {CUOEnviroment.Version}", false, 0x0481, font: 9)
                {
                    X = 286,
                    Y = 465
                });


                Add(_checkboxAutologin = new Checkbox(0x00D2, 0x00D3, "Autologin", 9, 0x0481, false)
                {
                    X = 200,
                    Y = 417
                });

                Add(_checkboxSaveAccount = new Checkbox(0x00D2, 0x00D3, "Save Account", 9, 0x0481, false)
                {
                    X = _checkboxAutologin.X + _checkboxAutologin.Width + 10,
                    Y = 417
                });
            }

            //Upscale arrow button on mobile
            UpscaleNextArrow();

            // 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 HtmlControl(htmlX, htmlY, 150, 15,
                                false, false,
                                false,
                                text: "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://www.paypal.me/muskara\">> Support ClassicUO",
                                0x32, true, isunicode: true, style: FontStyle.BlackBorder));
            Add(new HtmlControl(htmlX, htmlY + 20, 150, 15,
                                false, false,
                                false,
                                text: "<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 + 19, 100, 15,
                                false, false,
                                false,
                                text: "<body link=\"#6a6a62\" vlink=\"#00FF00\" ><a href=\"https://discord.gg/VdyCpjQ\">CUO Discord",
                                0x32, true, isunicode: true, style: FontStyle.Cropped));


            if (!string.IsNullOrEmpty(_textboxAccount.Text))
            {
                _passwordFake.SetKeyboardFocus();
            }
            else
            {
                _textboxAccount.SetKeyboardFocus();
            }
        }
Example #3
0
        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();
            }
        }
Example #4
0
        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 = 0x08FC;

                if (Client.Version >= ClientVersion.CV_500A)
                {
                    Add(new GumpPic(0, 0, 0x2329, 0));
                }

                // 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));
                }

                // Credits
                Add
                (
                    new Button((int)Buttons.Credits, 0x1583, 0x1585, 0x1584)
                {
                    X            = 60,
                    Y            = 385,
                    ButtonAction = ButtonAction.Activate
                }
                );

                Add
                (
                    new Label(ResGumps.LoginToUO, false, HUE, font: 2)
                {
                    X = 253,
                    Y = 305
                }
                );

                Add
                (
                    new Label(ResGumps.Account, false, HUE, font: 1)
                {
                    X = 183,
                    Y = 345
                }
                );

                Add
                (
                    new Label(ResGumps.Password, false, HUE, font: 1)
                {
                    X = 183,
                    Y = 385
                }
                );

                // Login Button
                Add
                (
                    _nextArrow0 = new Button((int)Buttons.NextArrow, 0x121, 0x122, 0x121)
                {
                    X            = 610,
                    Y            = 445,
                    ButtonAction = ButtonAction.Activate
                }
                );


                offsetX  = 328;
                offsetY  = 343;
                offtextY = 40;

                Add
                (
                    new Label($"UO Version {Settings.GlobalSettings.ClientVersion}.", false, 0x04EC, font: 9)
                {
                    X = 286,
                    Y = 453
                }
                );

                Add
                (
                    new Label(string.Format(ResGumps.CUOVersion0, CUOEnviroment.Version), false, 0x04EC, 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 = 0x121;
                _buttonOver   = 0x122;
                offsetX       = 755;
                offsetY       = 759;
                offtextY      = 50;

                // Background
                Add(new GumpPic(0, 0, 0x157C, 0)
                {
                    AcceptKeyboardInput = false
                });

                // Quit Button
                Add
                (
                    new Button((int)Buttons.Quit, 0x1589, 0x158A, 0x158B)
                {
                    X            = 1550,
                    Y            = 80,
                    ButtonAction = ButtonAction.Activate
                }
                );

                // Login Button
                Add
                (
                    _nextArrow0 = new Button((int)Buttons.NextArrow, 0x121, 0x122, 0x121)
                {
                    X            = 775,
                    Y            = 840,
                    ButtonAction = ButtonAction.Activate
                }
                );

                Add
                (
                    new Label($"UO Version {Settings.GlobalSettings.ClientVersion}.", false, 0x0481, font: 9)
                {
                    X = 110,
                    Y = 25
                }
                );

                Add
                (
                    new Label(string.Format(ResGumps.CUOVersion0, CUOEnviroment.Version), false, 0x0481, font: 9)
                {
                    X = 110,
                    Y = 37
                }
                );
            }

            // Text Inputs
            Add
            (
                _textboxAccount = new StbTextBox
                                  (
                    0,
                    16,
                    190,
                    false,
                    hue: 0x0481
                                  )
            {
                X      = offsetX,
                Y      = offsetY,
                Width  = 190,
                Height = 25
            }
            );

            _textboxAccount.SetText(Settings.GlobalSettings.Username);

            Add
            (
                _passwordFake = new PasswordStbTextBox
                                (
                    0,
                    16,
                    190,
                    false,
                    hue: 0x0481
                                )
            {
                X      = offsetX,
                Y      = offsetY + offtextY,
                Width  = 190,
                Height = 25
            }
            );

            _passwordFake.RealText = Crypter.Decrypt(Settings.GlobalSettings.Password);

            /* _checkboxSaveAccount.IsChecked = Settings.GlobalSettings.SaveAccount;
             * _checkboxAutologin.IsChecked = Settings.GlobalSettings.AutoLogin; */


            int htmlX = 1090;
            int htmlY = 15;

            //Add(new NiceButton(){ });

            Add
            (
                new HtmlControl
                (
                    htmlX,
                    htmlY,
                    150,
                    15,
                    false,
                    false,
                    false,
                    "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://paypal.me/ZuluhotelOmega\">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://discord.gg/TqjZVwGx\">Join Discord",
                    0x32,
                    true,
                    isunicode: true,
                    style: FontStyle.BlackBorder
                )
            );

            Add
            (
                new HtmlControl
                (
                    480,
                    htmlY,
                    100,
                    15,
                    false,
                    false,
                    false,
                    "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://zuluhotelomega.com\">ZHO Website",
                    0x32,
                    true,
                    isunicode: true,
                    style: FontStyle.BlackBorder
                )
            );

            Add
            (
                new HtmlControl
                (
                    480,
                    htmlY + 19,
                    100,
                    15,
                    false,
                    false,
                    false,
                    "<body link=\"#ad9413\" vlink=\"#00FF00\" ><a href=\"https://zuluhotelomega.com/info-vault\">ZHO Wiki",
                    0x32,
                    true,
                    isunicode: true,
                    style: FontStyle.BlackBorder
                )
            );

            if (!string.IsNullOrEmpty(_textboxAccount.Text))
            {
                _passwordFake.SetKeyboardFocus();
            }
            else
            {
                _textboxAccount.SetKeyboardFocus();
            }
        }