public static MenuInputWidget Create( Game game, int x, int y, int width, int height, string text, Anchor horizontal,
            Anchor vertical, Font font, Font tildeFont, MenuInputValidator validator)
        {
            MenuInputWidget widget = new MenuInputWidget( game, font, tildeFont );

            widget.HorizontalAnchor = horizontal;
            widget.VerticalAnchor = vertical;
            widget.XOffset = x;
            widget.YOffset = y;
            widget.DesiredMaxWidth = width;
            widget.DesiredMaxHeight = height;
            widget.chatInputText.Append( 0, text );
            widget.Validator = validator;
            widget.Init();
            return widget;
        }
        public override void Init()
        {
            base.Init();

            widgets = new Widget[] {
                // Column 1
                MakeBool( -1, -100, "Simple arms anim", OptionsKey.SimpleArmsAnim,
                         OnWidgetClick, g => g.SimpleArmsAnim, (g, v) => g.SimpleArmsAnim = v ),

                MakeBool( -1, -50, "Classic gui textures", OptionsKey.UseClassicGui,
                         OnWidgetClick, g => g.UseClassicGui, (g, v) => g.UseClassicGui = v ),

                MakeBool( -1, 0, "Classic player list", OptionsKey.UseClassicTabList,
                         OnWidgetClick, g => g.UseClassicTabList, (g, v) => g.UseClassicTabList = v ),

                MakeBool( -1, 50, "Classic options", OptionsKey.UseClassicOptions,
                         OnWidgetClick, g => g.UseClassicOptions, (g, v) => g.UseClassicOptions = v ),

                // Column 2
                MakeBool( 1, -100, "Allow custom blocks", OptionsKey.AllowCustomBlocks,
                         OnWidgetClick, g => g.AllowCustomBlocks, (g, v) => g.AllowCustomBlocks = v ),

                MakeBool( 1, -50, "Use CPE", OptionsKey.UseCPE,
                         OnWidgetClick, g => g.UseCPE, (g, v) => g.UseCPE = v ),

                MakeBool( 1, 0, "Use server textures", OptionsKey.AllowServerTextures,
                         OnWidgetClick, g => g.AllowServerTextures, (g, v) => g.AllowServerTextures = v ),

                MakeBack( false, titleFont,
                     (g, w) => g.SetNewScreen( new PauseScreen( g ) ) ),
                null, null,
            };

            validators = new MenuInputValidator[] {
                new BooleanValidator(),
                new BooleanValidator(),
                new BooleanValidator(),
                new BooleanValidator(),

                new BooleanValidator(),
                new BooleanValidator(),
                new BooleanValidator(),
            };
            infoWidget = ChatTextWidget.Create( game, 0, 100, "&eButtons on the right require a client restart",
                                           Anchor.Centre, Anchor.Centre, regularFont );
        }
        void MakeValidators()
        {
            INetworkProcessor network = game.Network;
            validators = new MenuInputValidator[] {
                new BooleanValidator(),
                new BooleanValidator(),
                new IntegerValidator( 16, 4096 ),
                network.IsSinglePlayer ? new BooleanValidator() : null,

                new BooleanValidator(),
                new BooleanValidator(),
                new BooleanValidator(),
                new EnumValidator( typeof(FpsLimitMethod) ),
                game.ClassicHacks ? new BooleanValidator() : null,
            };
        }
 void MakeValidators()
 {
     INetworkProcessor network = game.Network;
     validators = new MenuInputValidator[] {
         new EnumValidator( typeof(FpsLimitMethod) ),
         new IntegerValidator( 16, 4096 ),
         new EnumValidator( typeof(NameMode) ),
         new EnumValidator( typeof(EntityShadow) ),
     };
 }
 void MakeValidators()
 {
     validators = new MenuInputValidator[] {
         new EnumValidator( typeof(FpsLimitMethod) ),
         new IntegerValidator( 16, 4096 ),
         new EnumValidator( typeof(NameMode) ),
         new EnumValidator( typeof(EntityShadow) ),
     };
 }
Example #6
0
        public static MenuInputWidget Create(Game game, int x, int y, int width, int height, string text, Anchor horizontal,
                                             Anchor vertical, Font font, Font tildeFont, MenuInputValidator validator)
        {
            MenuInputWidget widget = new MenuInputWidget(game, font, tildeFont);

            widget.HorizontalAnchor = horizontal;
            widget.VerticalAnchor   = vertical;
            widget.XOffset          = x;
            widget.YOffset          = y;
            widget.DesiredMaxWidth  = width;
            widget.DesiredMaxHeight = height;
            widget.chatInputText.Append(0, text);
            widget.Validator = validator;
            widget.Init();
            return(widget);
        }
        void MakeValidators()
        {
            INetworkProcessor network = game.Network;
            validators = new MenuInputValidator[] {
                network.IsSinglePlayer ? new RealValidator( 1, 1024 ) : null,
                new BooleanValidator(),
                new BooleanValidator(),
                new BooleanValidator(),

                network.IsSinglePlayer ? new BooleanValidator() : null,
                new BooleanValidator(),
                new BooleanValidator(),
                new IntegerValidator( 1, 200 ),
            };
        }
        void MakeValidators()
        {
            validators = new MenuInputValidator[] {
                new BooleanValidator(),
                new BooleanValidator(),
                new RealValidator( 0.25f, 4f ),
                new RealValidator( 0.25f, 4f ),
                new BooleanValidator(),

                new BooleanValidator(),
                new RealValidator( 0.25f, 4f ),
                new IntegerValidator( 0, 30 ),
                new BooleanValidator(),
                new StringValidator( 32 ),
            };
        }
        void MakeValidators()
        {
            validators = new MenuInputValidator[] {
                new HexColourValidator(),
                new HexColourValidator(),
                new HexColourValidator(),
                new RealValidator( 0, 1000 ),
                new IntegerValidator( -10000, 10000 ),

                new HexColourValidator(),
                new HexColourValidator(),
                new EnumValidator( typeof(Weather) ),
                new IntegerValidator( -2048, 2048 ),
            };
        }
        void MakeValidators()
        {
            validators = new MenuInputValidator[] {
                new BooleanValidator(),
                new RealValidator( 0.1f, 50 ),
                new BooleanValidator(),
                new RealValidator( 0.1f, 1024f ),
                new BooleanValidator(),

                new BooleanValidator(),
                new BooleanValidator(),
                new BooleanValidator(),
                new IntegerValidator( 1, 150 ),
            };
        }