Change Settings defaults
This commit is contained in:
@@ -23,6 +23,7 @@ using OpenRA.FileFormats.Graphics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace OpenRA.GameRules
|
namespace OpenRA.GameRules
|
||||||
{
|
{
|
||||||
@@ -30,20 +31,21 @@ namespace OpenRA.GameRules
|
|||||||
{
|
{
|
||||||
// Debug settings
|
// Debug settings
|
||||||
public bool UnitDebug = false;
|
public bool UnitDebug = false;
|
||||||
public bool PathDebug = true;
|
public bool PathDebug = false;
|
||||||
public bool PerfDebug = true;
|
public bool PerfDebug = false;
|
||||||
public bool IndexDebug = false;
|
public bool IndexDebug = false;
|
||||||
public bool RecordSyncReports = true;
|
public bool RecordSyncReports = true;
|
||||||
|
|
||||||
// Window settings
|
// Window settings
|
||||||
public WindowMode WindowMode = WindowMode.PseudoFullscreen;
|
public WindowMode WindowMode = WindowMode.PseudoFullscreen;
|
||||||
public int2 FullscreenSize = new int2(0,0);
|
public int2 FullscreenSize = new int2(Screen.PrimaryScreen.Bounds.Width,Screen.PrimaryScreen.Bounds.Height);
|
||||||
public int2 WindowedSize = new int2(1024,768);
|
public int2 WindowedSize = new int2(1024,768);
|
||||||
|
public readonly static int2 MinResolution = new int2(800, 600);
|
||||||
|
|
||||||
//Sound Settings
|
//Sound Settings
|
||||||
public float SoundVolume = 0.5f;
|
public float SoundVolume = 0.5f;
|
||||||
public float MusicVolume = 0.5f;
|
public float MusicVolume = 0.5f;
|
||||||
public bool MusicPlayer = true;
|
public bool MusicPlayer = false;
|
||||||
|
|
||||||
// Internal game settings
|
// Internal game settings
|
||||||
public int Timestep = 40;
|
public int Timestep = 40;
|
||||||
@@ -52,7 +54,7 @@ namespace OpenRA.GameRules
|
|||||||
// External game settings
|
// External game settings
|
||||||
public string LastServer = "localhost:1234";
|
public string LastServer = "localhost:1234";
|
||||||
public string Replay = null;
|
public string Replay = null;
|
||||||
public string PlayerName = null;
|
public string PlayerName = "Newbie";
|
||||||
public string[] InitialMods = { "ra" };
|
public string[] InitialMods = { "ra" };
|
||||||
|
|
||||||
// Server settings
|
// Server settings
|
||||||
|
|||||||
@@ -69,12 +69,14 @@ namespace OpenRA.Widgets.Delegates
|
|||||||
};
|
};
|
||||||
|
|
||||||
var width = display.GetWidget<TextFieldWidget>("SCREEN_WIDTH");
|
var width = display.GetWidget<TextFieldWidget>("SCREEN_WIDTH");
|
||||||
|
Game.Settings.WindowedSize.X = (Game.Settings.WindowedSize.X < Game.Settings.MinResolution.X)?
|
||||||
|
Game.Settings.MinResolution.X : Game.Settings.WindowedSize.X;
|
||||||
width.Text = Game.Settings.WindowedSize.X.ToString();
|
width.Text = Game.Settings.WindowedSize.X.ToString();
|
||||||
width.OnLoseFocus = () =>
|
width.OnLoseFocus = () =>
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
var w = int.Parse(width.Text);
|
var w = int.Parse(width.Text);
|
||||||
if (w > 800 && w <= Screen.PrimaryScreen.Bounds.Size.Width)
|
if (w > Game.Settings.MinResolution.X && w <= Screen.PrimaryScreen.Bounds.Size.Width)
|
||||||
Game.Settings.WindowedSize = new int2(w, Game.Settings.WindowedSize.Y);
|
Game.Settings.WindowedSize = new int2(w, Game.Settings.WindowedSize.Y);
|
||||||
else
|
else
|
||||||
width.Text = Game.Settings.WindowedSize.X.ToString();
|
width.Text = Game.Settings.WindowedSize.X.ToString();
|
||||||
@@ -86,12 +88,14 @@ namespace OpenRA.Widgets.Delegates
|
|||||||
width.OnEnterKey = () => { width.LoseFocus(); return true; };
|
width.OnEnterKey = () => { width.LoseFocus(); return true; };
|
||||||
|
|
||||||
var height = display.GetWidget<TextFieldWidget>("SCREEN_HEIGHT");
|
var height = display.GetWidget<TextFieldWidget>("SCREEN_HEIGHT");
|
||||||
|
Game.Settings.WindowedSize.Y = (Game.Settings.WindowedSize.Y < Game.Settings.MinResolution.Y)?
|
||||||
|
Game.Settings.MinResolution.Y : Game.Settings.WindowedSize.Y;
|
||||||
height.Text = Game.Settings.WindowedSize.Y.ToString();
|
height.Text = Game.Settings.WindowedSize.Y.ToString();
|
||||||
height.OnLoseFocus = () =>
|
height.OnLoseFocus = () =>
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
var h = int.Parse(height.Text);
|
var h = int.Parse(height.Text);
|
||||||
if (h > 600 && h <= Screen.PrimaryScreen.Bounds.Size.Height)
|
if (h > Game.Settings.MinResolution.Y && h <= Screen.PrimaryScreen.Bounds.Size.Height)
|
||||||
Game.Settings.WindowedSize = new int2(Game.Settings.WindowedSize.X, h);
|
Game.Settings.WindowedSize = new int2(Game.Settings.WindowedSize.X, h);
|
||||||
else
|
else
|
||||||
height.Text = Game.Settings.WindowedSize.Y.ToString();
|
height.Text = Game.Settings.WindowedSize.Y.ToString();
|
||||||
|
|||||||
Reference in New Issue
Block a user