remove match timer configuration crap

This commit is contained in:
Chris Forbes
2011-09-24 20:17:27 +12:00
parent 3b2efc7b0b
commit 6c39f19a73
5 changed files with 52 additions and 88 deletions

View File

@@ -30,6 +30,7 @@ namespace OpenRA.GameRules
public string Map = null; public string Map = null;
public ServerSettings() { } public ServerSettings() { }
public ServerSettings(ServerSettings other) public ServerSettings(ServerSettings other)
{ {
Name = other.Name; Name = other.Name;
@@ -77,23 +78,19 @@ namespace OpenRA.GameRules
public class PlayerSettings public class PlayerSettings
{ {
public string Name = "Newbie"; public string Name = "Newbie";
[Obsolete] public Color Color1 = Color.FromArgb(255,160,238);
[Obsolete] public Color Color2 = Color.FromArgb(68,0,56);
public ColorRamp ColorRamp = new ColorRamp(75, 255, 180, 25); public ColorRamp ColorRamp = new ColorRamp(75, 255, 180, 25);
public string LastServer = "localhost:1234"; public string LastServer = "localhost:1234";
} }
public enum MouseScrollType { Disabled, Standard, Inverted } public enum MouseScrollType { Disabled, Standard, Inverted }
public class GameSettings public class GameSettings
{ {
public string[] Mods = { "ra" }; public string[] Mods = { "ra" };
public bool MatchTimer = true;
public bool ShellmapMusic = true; public bool ShellmapMusic = true;
// Chat settings
public bool TeamChatToggle = false; public bool TeamChatToggle = false;
// Behaviour settings
public bool ViewportEdgeScroll = true; public bool ViewportEdgeScroll = true;
public MouseScrollType MouseScroll = MouseScrollType.Standard; public MouseScrollType MouseScroll = MouseScrollType.Standard;
public float ViewportEdgeScrollStep = 10f; public float ViewportEdgeScrollStep = 10f;

View File

@@ -17,11 +17,6 @@ namespace OpenRA.Widgets
{ {
public Stopwatch Stopwatch; public Stopwatch Stopwatch;
public TimerWidget ()
{
IsVisible = () => Game.Settings.Game.MatchTimer;
}
public override void Draw() public override void Draw()
{ {
var s = WidgetUtils.FormatTime(Game.LocalTick); var s = WidgetUtils.FormatTime(Game.LocalTick);

View File

@@ -20,11 +20,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncSettingsLogic public class CncSettingsLogic
{ {
enum PanelType enum PanelType { General, Input }
{
General,
Input
}
PanelType Settings = PanelType.General; PanelType Settings = PanelType.General;
CncColorPickerPaletteModifier playerPalettePreview; CncColorPickerPaletteModifier playerPalettePreview;
@@ -72,10 +68,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
perfgraphCheckbox.IsChecked = () => debugSettings.PerfGraph; perfgraphCheckbox.IsChecked = () => debugSettings.PerfGraph;
perfgraphCheckbox.OnClick = () => debugSettings.PerfGraph ^= true; perfgraphCheckbox.OnClick = () => debugSettings.PerfGraph ^= true;
var matchtimerCheckbox = generalPane.GetWidget<CheckboxWidget>("MATCHTIME_CHECKBOX");
matchtimerCheckbox.IsChecked = () => gameSettings.MatchTimer;
matchtimerCheckbox.OnClick = () => gameSettings.MatchTimer ^= true;
var checkunsyncedCheckbox = generalPane.GetWidget<CheckboxWidget>("CHECKUNSYNCED_CHECKBOX"); var checkunsyncedCheckbox = generalPane.GetWidget<CheckboxWidget>("CHECKUNSYNCED_CHECKBOX");
checkunsyncedCheckbox.IsChecked = () => debugSettings.SanityCheckUnsyncedCode; checkunsyncedCheckbox.IsChecked = () => debugSettings.SanityCheckUnsyncedCode;
checkunsyncedCheckbox.OnClick = () => debugSettings.SanityCheckUnsyncedCode ^= true; checkunsyncedCheckbox.OnClick = () => debugSettings.SanityCheckUnsyncedCode ^= true;
@@ -114,7 +106,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
shellmapMusicCheckbox.IsChecked = () => gameSettings.ShellmapMusic; shellmapMusicCheckbox.IsChecked = () => gameSettings.ShellmapMusic;
shellmapMusicCheckbox.OnClick = () => gameSettings.ShellmapMusic ^= true; shellmapMusicCheckbox.OnClick = () => gameSettings.ShellmapMusic ^= true;
// Input pane // Input pane
var inputPane = panel.GetWidget("INPUT_CONTROLS"); var inputPane = panel.GetWidget("INPUT_CONTROLS");
inputPane.IsVisible = () => Settings == PanelType.Input; inputPane.IsVisible = () => Settings == PanelType.Input;
@@ -156,16 +147,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
bool ShowColorPicker(DropDownButtonWidget color, PlayerSettings s) bool ShowColorPicker(DropDownButtonWidget color, PlayerSettings s)
{ {
Action<ColorRamp> onSelect = c => Action<ColorRamp> onSelect = c => { s.ColorRamp = c; color.RemovePanel(); };
{ Action<ColorRamp> onChange = c => { playerPalettePreview.Ramp = c; };
s.ColorRamp = c;
color.RemovePanel();
};
Action<ColorRamp> onChange = c =>
{
playerPalettePreview.Ramp = c;
};
var colorChooser = Game.LoadWidget(world, "COLOR_CHOOSER", null, new WidgetArgs() var colorChooser = Game.LoadWidget(world, "COLOR_CHOOSER", null, new WidgetArgs()
{ {
@@ -200,7 +183,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
return true; return true;
} }
bool ShowMouseScrollDropdown(DropDownButtonWidget dropdown, GameSettings s) bool ShowMouseScrollDropdown(DropDownButtonWidget dropdown, GameSettings s)
{ {
var options = new Dictionary<string, MouseScrollType>() var options = new Dictionary<string, MouseScrollType>()

View File

@@ -106,8 +106,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
perfgraphCheckbox.IsChecked = () => Game.Settings.Debug.PerfGraph; perfgraphCheckbox.IsChecked = () => Game.Settings.Debug.PerfGraph;
perfgraphCheckbox.OnClick = () => Game.Settings.Debug.PerfGraph ^= true; perfgraphCheckbox.OnClick = () => Game.Settings.Debug.PerfGraph ^= true;
Game.Settings.Game.MatchTimer = true;
var checkunsyncedCheckbox = debug.GetWidget<CheckboxWidget>("CHECKUNSYNCED_CHECKBOX"); var checkunsyncedCheckbox = debug.GetWidget<CheckboxWidget>("CHECKUNSYNCED_CHECKBOX");
checkunsyncedCheckbox.IsChecked = () => Game.Settings.Debug.SanityCheckUnsyncedCode; checkunsyncedCheckbox.IsChecked = () => Game.Settings.Debug.SanityCheckUnsyncedCode;
checkunsyncedCheckbox.OnClick = () => Game.Settings.Debug.SanityCheckUnsyncedCode ^= true; checkunsyncedCheckbox.OnClick = () => Game.Settings.Debug.SanityCheckUnsyncedCode ^= true;

View File

@@ -77,18 +77,10 @@ Container@SETTINGS_PANEL:
Height:20 Height:20
Font:Regular Font:Regular
Text:Show Performance Graph Text:Show Performance Graph
Checkbox@MATCHTIME_CHECKBOX:
Id:MATCHTIME_CHECKBOX
X:15
Y:180
Width:300
Height:20
Font:Regular
Text:Show Match Timer
Checkbox@CHECKUNSYNCED_CHECKBOX: Checkbox@CHECKUNSYNCED_CHECKBOX:
Id:CHECKUNSYNCED_CHECKBOX Id:CHECKUNSYNCED_CHECKBOX
X:15 X:15
Y:210 Y:180
Width:300 Width:300
Height:20 Height:20
Font:Regular Font:Regular