Rework Display settings tab.

This commit is contained in:
Paul Chote
2020-01-19 12:15:29 +00:00
committed by Matthias Mailänder
parent 83732f299b
commit 57a8cf7a59
3 changed files with 262 additions and 215 deletions

View File

@@ -226,6 +226,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
windowModeDropdown.GetText = () => ds.Mode == WindowMode.Windowed ? windowModeDropdown.GetText = () => ds.Mode == WindowMode.Windowed ?
"Windowed" : ds.Mode == WindowMode.Fullscreen ? "Fullscreen (Legacy)" : "Fullscreen"; "Windowed" : ds.Mode == WindowMode.Fullscreen ? "Fullscreen (Legacy)" : "Fullscreen";
var modeChangesDesc = panel.Get("MODE_CHANGES_DESC");
modeChangesDesc.IsVisible = () => ds.Mode != WindowMode.Windowed && ds.Mode != OriginalGraphicsMode;
var statusBarsDropDown = panel.Get<DropDownButtonWidget>("STATUS_BAR_DROPDOWN"); var statusBarsDropDown = panel.Get<DropDownButtonWidget>("STATUS_BAR_DROPDOWN");
statusBarsDropDown.OnMouseDown = _ => ShowStatusBarsDropdown(statusBarsDropDown, gs); statusBarsDropDown.OnMouseDown = _ => ShowStatusBarsDropdown(statusBarsDropDown, gs);
statusBarsDropDown.GetText = () => gs.StatusBars == StatusBarsType.Standard ? statusBarsDropDown.GetText = () => gs.StatusBars == StatusBarsType.Standard ?
@@ -252,10 +255,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
panel.Get("WINDOW_RESOLUTION").IsVisible = () => ds.Mode == WindowMode.Windowed; panel.Get("WINDOW_RESOLUTION").IsVisible = () => ds.Mode == WindowMode.Windowed;
var windowWidth = panel.Get<TextFieldWidget>("WINDOW_WIDTH"); var windowWidth = panel.Get<TextFieldWidget>("WINDOW_WIDTH");
windowWidth.Text = ds.WindowedSize.X.ToString(); var origWidthText = windowWidth.Text = ds.WindowedSize.X.ToString();
var windowHeight = panel.Get<TextFieldWidget>("WINDOW_HEIGHT"); var windowHeight = panel.Get<TextFieldWidget>("WINDOW_HEIGHT");
windowHeight.Text = ds.WindowedSize.Y.ToString(); var origHeightText = windowHeight.Text = ds.WindowedSize.Y.ToString();
var windowChangesDesc = panel.Get("WINDOW_CHANGES_DESC");
windowChangesDesc.IsVisible = () => ds.Mode == WindowMode.Windowed &&
(ds.Mode != OriginalGraphicsMode || origWidthText != windowWidth.Text || origHeightText != windowHeight.Text);
var frameLimitCheckbox = panel.Get<CheckboxWidget>("FRAME_LIMIT_CHECKBOX"); var frameLimitCheckbox = panel.Get<CheckboxWidget>("FRAME_LIMIT_CHECKBOX");
var frameLimitOrigLabel = frameLimitCheckbox.Text; var frameLimitOrigLabel = frameLimitCheckbox.Text;

View File

@@ -79,106 +79,35 @@ Container@SETTINGS_PANEL:
Font: Bold Font: Bold
Text: Display Text: Display
Align: Center Align: Center
Label@MODE_LABEL: Label@PLAYER:
X: 110 Text: Player Name:
X: 15
Y: 40 Y: 40
Width: 45 Width: 120
Height: 25 Height: 25
Align: Right Align: Right
Text: Mode:
DropDownButton@MODE_DROPDOWN:
X: 160
Y: 40
Width: 170
Height: 25
Font: Regular
Text: Windowed
Container@WINDOW_RESOLUTION:
X: 330
Y: 40
Children:
Label@At:
Text: @
Font: Bold
Y: 0
Height: 25
Width: 25
Align: Center
TextField@WINDOW_WIDTH:
X: 25
Width: 45
Height: 25
MaxLength: 5
Type: Integer
Label@X:
Text: x
Font: Bold
X: 70
Y: 0
Height: 25
Width: 15
Align: Center
TextField@WINDOW_HEIGHT:
X: 85
Width: 45
Height: 25
MaxLength: 5
Type: Integer
Label@VIDEO_DESC:
Y: 67
Width: PARENT_RIGHT
Height: 25
Font: Tiny
Align: Center
Text: Mode and resolution changes will be applied after the game is restarted
Checkbox@VSYNC_CHECKBOX:
X: 80
Y: 125
Width: 200
Height: 20
Font: Regular
Text: Enable VSync
Checkbox@FRAME_LIMIT_CHECKBOX:
X: 310
Y: 125
Width: 200
Height: 20
Font: Regular
Text: Enable Frame Limiter
Slider@FRAME_LIMIT_SLIDER:
X: 340
Y: 150
Width: 200
Height: 20
Ticks: 20
MinimumValue: 50
MaximumValue: 240
Checkbox@PLAYER_STANCE_COLORS_CHECKBOX:
X: 310
Y: 183
Width: 200
Height: 20
Font: Regular
Text: Player Stance Colors
Label@PLAYER:
Text: Player:
X: 15
Y: 180
Height: 25
TextField@PLAYERNAME: TextField@PLAYERNAME:
Text: Name Text: Name
X: 65 X: 140
Y: 180 Y: 40
Width: 145 Width: 160
Height: 25 Height: 25
MaxLength: 16 MaxLength: 16
Label@COLOR:
X: 265
Y: 40
Width: 145
Height: 25
Text: Preferred Color:
Align: Right
ColorPreviewManager@COLOR_MANAGER: ColorPreviewManager@COLOR_MANAGER:
DropDownButton@PLAYERCOLOR: DropDownButton@PLAYERCOLOR:
X: 215 X: 415
Y: 180 Y: 40
Width: 70 Width: 75
Height: 25 Height: 25
IgnoreChildMouseOver: true IgnoreChildMouseOver: true
PanelAlign: Right
Children: Children:
ColorBlock@COLORBLOCK: ColorBlock@COLORBLOCK:
X: 5 X: 5
@@ -187,50 +116,141 @@ Container@SETTINGS_PANEL:
Height: PARENT_BOTTOM - 12 Height: PARENT_BOTTOM - 12
Label@BATTLEFIELD_CAMERA: Label@BATTLEFIELD_CAMERA:
X: 15 X: 15
Y: 210 Y: 70
Width: 120 Width: 120
Height: 25 Height: 25
Text: Battlefield Camera: Text: Battlefield Camera:
Align: Right Align: Right
DropDownButton@BATTLEFIELD_CAMERA_DROPDOWN: DropDownButton@BATTLEFIELD_CAMERA_DROPDOWN:
X: 140 X: 140
Y: 210 Y: 70
Width: 145 Width: 160
Height: 25 Height: 25
Font: Regular Font: Regular
Label@TARGET_LINES: Label@TARGET_LINES:
X: 250 X: 265
Y: 210 Y: 70
Width: 145 Width: 145
Height: 25 Height: 25
Text: Target Lines: Text: Target Lines:
Align: Right Align: Right
DropDownButton@TARGET_LINES_DROPDOWN: DropDownButton@TARGET_LINES_DROPDOWN:
X: 400 X: 415
Y: 210 Y: 70
Width: 175 Width: 160
Height: 25 Height: 25
Font: Regular Font: Regular
Checkbox@CURSORDOUBLE_CHECKBOX:
X: 15
Y: 243
Width: 200
Height: 20
Font: Regular
Text: Increase Cursor Size
Label@STATUS_BARS: Label@STATUS_BARS:
X: 250 X: 265
Y: 240 Y: 100
Width: 145 Width: 145
Height: 25 Height: 25
Text: Status Bars: Text: Status Bars:
Align: Right Align: Right
DropDownButton@STATUS_BAR_DROPDOWN: DropDownButton@STATUS_BAR_DROPDOWN:
X: 400 X: 415
Y: 240 Y: 100
Width: 175 Width: 160
Height: 25 Height: 25
Font: Regular Font: Regular
Checkbox@CURSORDOUBLE_CHECKBOX:
X: 15
Y: 133
Width: 200
Height: 20
Font: Regular
Text: Increase Cursor Size
Checkbox@PLAYER_STANCE_COLORS_CHECKBOX:
X: 310
Y: 133
Width: 200
Height: 20
Font: Regular
Text: Player Stance Colors
Label@VIDEO_TITLE:
Y: 190
Width: PARENT_RIGHT
Font: Bold
Text: Video
Align: Center
Label@VIDEO_MODE:
X: 15
Y: 210
Width: 120
Height: 25
Align: Right
Text: Video Mode:
DropDownButton@MODE_DROPDOWN:
X: 140
Y: 210
Width: 160
Height: 25
Font: Regular
Text: Windowed
Label@MODE_CHANGES_DESC:
X: 100
Y: 237
Width: 200
Height: 15
Font: Tiny
Text: Video mode changes require restart
Container@WINDOW_RESOLUTION:
Y: 240
Children:
Label@WINDOW_SIZE:
X: 15
Height: 25
Width: 120
Align: Right
Text: Window Size:
TextField@WINDOW_WIDTH:
X: 140
Width: 55
Height: 25
MaxLength: 5
Type: Integer
Label@X:
Text: x
Font: Bold
X: 195
Height: 25
Width: 15
Align: Center
TextField@WINDOW_HEIGHT:
X: 210
Width: 55
Height: 25
MaxLength: 5
Type: Integer
Label@WINDOW_CHANGES_DESC:
X: 60
Y: 27
Width: 200
Height: 15
Font: Tiny
Text: Video mode and window size changes require restart
Checkbox@VSYNC_CHECKBOX:
X: 310
Y: 210
Width: 200
Height: 20
Font: Regular
Text: Enable VSync
Checkbox@FRAME_LIMIT_CHECKBOX:
X: 310
Y: 243
Width: 200
Height: 20
Font: Regular
Text: Enable Frame Limiter
Slider@FRAME_LIMIT_SLIDER:
X: 340
Y: 265
Width: 200
Height: 20
Ticks: 20
MinimumValue: 50
MaximumValue: 240
Container@AUDIO_PANEL: Container@AUDIO_PANEL:
Width: PARENT_RIGHT Width: PARENT_RIGHT
Height: PARENT_BOTTOM Height: PARENT_BOTTOM

View File

@@ -93,106 +93,35 @@ Background@SETTINGS_PANEL:
Width: PARENT_RIGHT - 10 Width: PARENT_RIGHT - 10
Height: PARENT_BOTTOM Height: PARENT_BOTTOM
Children: Children:
Label@MODE_LABEL: Label@PLAYER:
X: 110 Text: Player Name:
X: 15
Y: 40 Y: 40
Width: 45 Width: 120
Height: 25 Height: 25
Align: Right Align: Right
Text: Mode:
DropDownButton@MODE_DROPDOWN:
X: 160
Y: 40
Width: 170
Height: 25
Font: Regular
Text: Windowed
Container@WINDOW_RESOLUTION:
X: 330
Y: 40
Children:
Label@At:
Text: @
Font: Bold
Y: 1
Height: 25
Width: 25
Align: Center
TextField@WINDOW_WIDTH:
X: 25
Width: 45
Height: 25
MaxLength: 5
Type: Integer
Label@X:
Text: x
Font: Bold
X: 70
Y: 0
Height: 25
Width: 15
Align: Center
TextField@WINDOW_HEIGHT:
X: 85
Width: 45
Height: 25
MaxLength: 5
Type: Integer
Label@VIDEO_DESC:
Y: 67
Width: PARENT_RIGHT
Height: 25
Font: Tiny
Align: Center
Text: Mode and resolutiom changes will be applied after the game is restarted
Checkbox@VSYNC_CHECKBOX:
X: 80
Y: 125
Width: 200
Height: 20
Font: Regular
Text: Enable VSync
Checkbox@FRAME_LIMIT_CHECKBOX:
X: 310
Y: 125
Width: 200
Height: 20
Font: Regular
Text: Enable Frame Limiter
Slider@FRAME_LIMIT_SLIDER:
X: 330
Y: 150
Width: 200
Height: 20
Ticks: 20
MinimumValue: 50
MaximumValue: 240
Checkbox@PLAYER_STANCE_COLORS_CHECKBOX:
X: 310
Y: 183
Width: 200
Height: 20
Font: Regular
Text: Player Stance Colors
Label@PLAYER:
Text: Player:
X: 15
Y: 180
Height: 25
TextField@PLAYERNAME: TextField@PLAYERNAME:
Text: Name Text: Name
X: 65 X: 140
Y: 180 Y: 40
Width: 145 Width: 160
Height: 25 Height: 25
MaxLength: 16 MaxLength: 16
Label@COLOR:
X: 265
Y: 40
Width: 145
Height: 25
Text: Preferred Color:
Align: Right
ColorPreviewManager@COLOR_MANAGER: ColorPreviewManager@COLOR_MANAGER:
DropDownButton@PLAYERCOLOR: DropDownButton@PLAYERCOLOR:
X: 215 X: 415
Y: 180 Y: 40
Width: 70 Width: 75
Height: 25 Height: 25
IgnoreChildMouseOver: true IgnoreChildMouseOver: true
PanelAlign: Right
Children: Children:
ColorBlock@COLORBLOCK: ColorBlock@COLORBLOCK:
X: 5 X: 5
@@ -201,50 +130,141 @@ Background@SETTINGS_PANEL:
Height: PARENT_BOTTOM - 12 Height: PARENT_BOTTOM - 12
Label@BATTLEFIELD_CAMERA: Label@BATTLEFIELD_CAMERA:
X: 15 X: 15
Y: 210 Y: 70
Width: 120 Width: 120
Height: 25 Height: 25
Text: Battlefield Camera: Text: Battlefield Camera:
Align: Right Align: Right
DropDownButton@BATTLEFIELD_CAMERA_DROPDOWN: DropDownButton@BATTLEFIELD_CAMERA_DROPDOWN:
X: 140 X: 140
Y: 210 Y: 70
Width: 145 Width: 160
Height: 25 Height: 25
Font: Regular Font: Regular
Label@TARGET_LINES: Label@TARGET_LINES:
X: 250 X: 265
Y: 210 Y: 70
Width: 145 Width: 145
Height: 25 Height: 25
Text: Target Lines: Text: Target Lines:
Align: Right Align: Right
DropDownButton@TARGET_LINES_DROPDOWN: DropDownButton@TARGET_LINES_DROPDOWN:
X: 400 X: 415
Y: 210 Y: 70
Width: 175 Width: 160
Height: 25 Height: 25
Font: Regular Font: Regular
Label@STATUS_BARS: Label@STATUS_BARS:
X: 250 X: 265
Y: 240 Y: 100
Width: 145 Width: 145
Height: 25 Height: 25
Text: Status Bars: Text: Status Bars:
Align: Right Align: Right
DropDownButton@STATUS_BAR_DROPDOWN:
X: 415
Y: 100
Width: 160
Height: 25
Font: Regular
Checkbox@CURSORDOUBLE_CHECKBOX: Checkbox@CURSORDOUBLE_CHECKBOX:
X: 15 X: 15
Y: 243 Y: 133
Width: 200 Width: 200
Height: 20 Height: 20
Font: Regular Font: Regular
Text: Increase Cursor Size Text: Increase Cursor Size
DropDownButton@STATUS_BAR_DROPDOWN: Checkbox@PLAYER_STANCE_COLORS_CHECKBOX:
X: 400 X: 310
Y: 240 Y: 133
Width: 175 Width: 200
Height: 20
Font: Regular
Text: Player Stance Colors
Label@VIDEO_TITLE:
Y: 190
Width: PARENT_RIGHT
Font: Bold
Text: Video
Align: Center
Label@VIDEO_MODE:
X: 15
Y: 210
Width: 120
Height: 25
Align: Right
Text: Video Mode:
DropDownButton@MODE_DROPDOWN:
X: 140
Y: 210
Width: 160
Height: 25 Height: 25
Font: Regular Font: Regular
Text: Windowed
Label@MODE_CHANGES_DESC:
X: 100
Y: 237
Width: 200
Height: 15
Font: Tiny
Text: Video mode changes require restart
Checkbox@VSYNC_CHECKBOX:
X: 310
Y: 213
Width: 200
Height: 20
Font: Regular
Text: Enable VSync
Container@WINDOW_RESOLUTION:
Y: 240
Children:
Label@WINDOW_SIZE:
X: 15
Height: 25
Width: 120
Align: Right
Text: Window Size:
TextField@WINDOW_WIDTH:
X: 140
Width: 55
Height: 25
MaxLength: 5
Type: Integer
Label@X:
Text: x
Font: Bold
X: 195
Height: 25
Width: 15
Align: Center
TextField@WINDOW_HEIGHT:
X: 210
Width: 55
Height: 25
MaxLength: 5
Type: Integer
Label@WINDOW_CHANGES_DESC:
X: 60
Y: 27
Width: 200
Height: 15
Font: Tiny
Text: Video mode and window size changes require restart
Checkbox@FRAME_LIMIT_CHECKBOX:
X: 310
Y: 243
Width: 200
Height: 20
Font: Regular
Text: Enable Frame Limiter
Slider@FRAME_LIMIT_SLIDER:
X: 340
Y: 265
Width: 200
Height: 20
Ticks: 20
MinimumValue: 50
MaximumValue: 240
Container@AUDIO_PANEL: Container@AUDIO_PANEL:
X: 5 X: 5
Y: 50 Y: 50