Set Allow Cheats on server creation
This commit is contained in:
@@ -56,6 +56,7 @@ namespace OpenRA.GameRules
|
||||
public int ExternalPort = 1234;
|
||||
public bool AdvertiseOnline = true;
|
||||
public string MasterServer = "http://open-ra.org/master/";
|
||||
public bool AllowCheats = false;
|
||||
|
||||
string SettingsFile;
|
||||
UserSettings defaults;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Widgets.Delegates
|
||||
Game.Settings.Save();
|
||||
|
||||
Server.Server.ServerMain(Game.Settings.AdvertiseOnline, Game.Settings.MasterServer, Game.Settings.LastServerTitle,
|
||||
Game.Settings.ListenPort, Game.Settings.ExternalPort, mods, map, Game.Settings.DeveloperMode);
|
||||
Game.Settings.ListenPort, Game.Settings.ExternalPort, mods, map, Game.Settings.AllowCheats);
|
||||
|
||||
Game.JoinServer(IPAddress.Loopback.ToString(), Game.Settings.ListenPort);
|
||||
return true;
|
||||
@@ -59,6 +59,12 @@ namespace OpenRA.Widgets.Delegates
|
||||
Game.Settings.Save();
|
||||
return true;
|
||||
};
|
||||
cs.GetWidget<CheckboxWidget>("CHECKBOX_CHEATS").Checked = () => Game.Settings.AllowCheats;
|
||||
cs.GetWidget<CheckboxWidget>("CHECKBOX_CHEATS").OnMouseDown = mi => {
|
||||
Game.Settings.AllowCheats ^=true;
|
||||
Game.Settings.Save();
|
||||
return true;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ Container@ROOT:
|
||||
X:(WINDOW_RIGHT - WIDTH)/2
|
||||
Y:(WINDOW_BOTTOM - HEIGHT)/2
|
||||
Width:400
|
||||
Height:210
|
||||
Height:240
|
||||
Visible:false
|
||||
Children:
|
||||
Label@LABEL_TITLE:
|
||||
@@ -72,6 +72,13 @@ Container@ROOT:
|
||||
Width:300
|
||||
Height:20
|
||||
Text:Advertise game Online
|
||||
Checkbox@CHECKBOX_CHEATS:
|
||||
Id:CHECKBOX_CHEATS
|
||||
X:165
|
||||
Y:160
|
||||
Width:300
|
||||
Height:20
|
||||
Text:Allow Cheats
|
||||
Button@BUTTON_START:
|
||||
Id:BUTTON_START
|
||||
X:130
|
||||
|
||||
@@ -6,7 +6,7 @@ Container@ROOT:
|
||||
X:(WINDOW_RIGHT - WIDTH)/2
|
||||
Y:(WINDOW_BOTTOM - HEIGHT)/2
|
||||
Width:400
|
||||
Height:210
|
||||
Height:240
|
||||
Visible:false
|
||||
Children:
|
||||
Label@LABEL_TITLE:
|
||||
@@ -72,6 +72,13 @@ Container@ROOT:
|
||||
Width:300
|
||||
Height:20
|
||||
Text:Advertise game Online
|
||||
Checkbox@CHECKBOX_CHEATS:
|
||||
Id:CHECKBOX_CHEATS
|
||||
X:165
|
||||
Y:160
|
||||
Width:300
|
||||
Height:20
|
||||
Text:Allow Cheats
|
||||
Button@BUTTON_START:
|
||||
Id:BUTTON_START
|
||||
X:130
|
||||
|
||||
Reference in New Issue
Block a user