示例#1
0
        public OptionsMenu()
        {
            SetSize = MinSize = (800, 450);
            IoCManager.InjectDependencies(this);

            Title = Loc.GetString("ui-options-title");

            GraphicsControl  graphicsControl;
            KeyRebindControl rebindControl;
            AudioControl     audioControl;

            var tabs = new TabContainer
            {
                Children =
                {
                    (graphicsControl = new GraphicsControl(_configManager)),
                    (rebindControl   = new KeyRebindControl()),
                    (audioControl    = new AudioControl(_configManager,     _clydeAudio)),
                }
            };

            TabContainer.SetTabTitle(graphicsControl, Loc.GetString("ui-options-tab-graphics"));
            TabContainer.SetTabTitle(rebindControl, Loc.GetString("ui-options-tab-controls"));
            TabContainer.SetTabTitle(audioControl, Loc.GetString("ui-options-tab-audio"));

            Contents.AddChild(tabs);
        }
示例#2
0
        public OptionsMenu()
        {
            IoCManager.InjectDependencies(this);

            Title = Loc.GetString("Game Options");

            GraphicsControl  graphicsControl;
            KeyRebindControl rebindControl;
            AudioControl     audioControl;

            var tabs = new TabContainer
            {
                Children =
                {
                    (graphicsControl = new GraphicsControl(_configManager)),
                    (rebindControl   = new KeyRebindControl()),
                    (audioControl    = new AudioControl(_configManager)),
                }
            };

            TabContainer.SetTabTitle(graphicsControl, Loc.GetString("Graphics"));
            TabContainer.SetTabTitle(rebindControl, Loc.GetString("Controls"));
            TabContainer.SetTabTitle(audioControl, Loc.GetString("Audio"));

            Contents.AddChild(tabs);
        }
示例#3
0
                public KeyControl(KeyRebindControl parent, BoundKeyFunction function)
                {
                    Function = function;
                    var name = new Label
                    {
                        Text = Loc.GetString(
                            $"ui-options-function-{CaseConversion.PascalToKebab(function.FunctionName)}"),
                        HorizontalExpand    = true,
                        HorizontalAlignment = HAlignment.Left
                    };

                    BindButton1 = new BindButton(parent, this, StyleBase.ButtonOpenRight);
                    BindButton2 = new BindButton(parent, this, StyleBase.ButtonOpenLeft);
                    ResetButton = new Button {
                        Text = Loc.GetString("ui-options-bind-reset"), StyleClasses = { StyleBase.ButtonCaution }
                    };

                    var hBox = new BoxContainer
                    {
                        Orientation = LayoutOrientation.Horizontal,
                        Children    =
                        {
                            new Control {
                                MinSize = (5, 0)
                            },
示例#4
0
                public BindButton(KeyRebindControl control, KeyControl keyControl, string styleClass)
                {
                    _control   = control;
                    KeyControl = keyControl;
                    Button     = new Button {
                        StyleClasses = { styleClass }
                    };
                    UpdateText();
                    AddChild(Button);

                    Button.OnPressed += args =>
                    {
                        control.RebindButtonPressed(this);
                    };

                    Button.OnKeyBindDown += ButtonOnOnKeyBindDown;

                    CustomMinimumSize = (200, 0);
                }
示例#5
0
                public KeyControl(KeyRebindControl parent, string niceName, BoundKeyFunction function)
                {
                    Function = function;
                    var name = new Label
                    {
                        Text = Loc.GetString(niceName),
                        SizeFlagsHorizontal = SizeFlags.Expand
                    };

                    BindButton1 = new BindButton(parent, this, StyleBase.ButtonOpenRight);
                    BindButton2 = new BindButton(parent, this, StyleBase.ButtonOpenLeft);
                    ResetButton = new Button {
                        Text = "Reset", StyleClasses = { StyleBase.ButtonCaution }
                    };

                    var hBox = new HBoxContainer
                    {
                        Children =
                        {
                            new Control {
                                CustomMinimumSize = (5, 0)
                            },
示例#6
0
                public KeyControl(KeyRebindControl parent, string niceName, BoundKeyFunction function)
                {
                    Function = function;
                    var name = new Label
                    {
                        Text                = Loc.GetString(niceName),
                        HorizontalExpand    = true,
                        HorizontalAlignment = HAlignment.Left
                    };

                    BindButton1 = new BindButton(parent, this, StyleBase.ButtonOpenRight);
                    BindButton2 = new BindButton(parent, this, StyleBase.ButtonOpenLeft);
                    ResetButton = new Button {
                        Text = Loc.GetString("Reset"), StyleClasses = { StyleBase.ButtonCaution }
                    };

                    var hBox = new HBoxContainer
                    {
                        Children =
                        {
                            new Control {
                                MinSize = (5, 0)
                            },