Progress on tutorial, gap tweaking (water flows faster from room to room), UPnP error messages, input keys in array, underwater aiming tweaking, tons of misc stuff commit more often ffs

This commit is contained in:
Regalis
2015-08-31 19:57:49 +03:00
parent 1e990784b2
commit f739808520
150 changed files with 15933 additions and 588 deletions
+4 -4
View File
@@ -118,7 +118,7 @@ namespace Subsurface
new GUITextBlock(new Rectangle(0, 100, 0, 30), "Server port:", GUI.style, Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tabs.HostServer]);
portBox = new GUITextBox(new Rectangle(160, 100, 200, 30), null, null, Alignment.TopLeft, Alignment.Left, GUI.style, menuTabs[(int)Tabs.HostServer]);
portBox.Text = NetworkMember.DefaultPort.ToString();
portBox.Text = NetConfig.DefaultPort.ToString();
portBox.ToolTip = "Server port";
new GUITextBlock(new Rectangle(0, 150, 100, 30), "Max players:", GUI.style, Alignment.TopLeft, Alignment.Left, menuTabs[(int)Tabs.HostServer]);
@@ -210,7 +210,7 @@ namespace Subsurface
int port;
if (!int.TryParse(portBox.Text, out port) || port < 0 || port > 65535)
{
portBox.Text = NetworkMember.DefaultPort.ToString();
portBox.Text = NetConfig.DefaultPort.ToString();
portBox.Flash();
return false;
@@ -219,7 +219,7 @@ namespace Subsurface
Game1.NetworkMember = new GameServer(name, port, isPublicBox.Selected, passwordBox.Text, useUpnpBox.Selected, int.Parse(maxPlayersBox.Text));
Game1.NetLobbyScreen.IsServer = true;
Game1.NetLobbyScreen.Select();
//Game1.NetLobbyScreen.Select();
return true;
}
@@ -320,7 +320,7 @@ namespace Subsurface
}
private void RemoveSaveFrame()
{
{
GUIComponent prevFrame = null;
foreach (GUIComponent child in menuTabs[(int)Tabs.LoadGame].children)
{
+52 -12
View File
@@ -279,23 +279,44 @@ namespace Subsurface
durationBar.OnMoved = Game1.Server.UpdateNetLobby;
if (subList.CountChildren > 0) subList.Select(-1);
if (GameModePreset.list.Count > 0) modeList.Select(0);
if (GameModePreset.list.Count > 0) modeList.Select(0);
var playYourself = new GUITickBox(new Rectangle(0, -20, 20, 20), "Play yourself", Alignment.TopLeft, playerFrame);
playYourself.OnSelected = TogglePlayYourself;
}
else if (playerFrame.children.Count==0)
{
else
{
UpdatePlayerFrame(Game1.Client.CharacterInfo);
}
base.Select();
}
private void UpdatePlayerFrame(CharacterInfo characterInfo)
{
if (playerFrame.children.Count <= 1)
{
playerFrame.ClearChildren();
if (IsServer && Game1.Server != null)
{
var playYourself = new GUITickBox(new Rectangle(0, -20, 200, 30), "Play yourself", Alignment.TopLeft, playerFrame);
playYourself.OnSelected = TogglePlayYourself;
}
new GUITextBlock(new Rectangle(60, 0, 200, 30), "Name: ", GUI.style, playerFrame);
GUITextBox playerName = new GUITextBox(new Rectangle(60, 30, 0, 20),
Alignment.TopLeft, GUI.style, playerFrame);
playerName.Text = Game1.Client.CharacterInfo.Name;
playerName.Text = characterInfo.Name;
playerName.OnEnter += ChangeCharacterName;
new GUITextBlock(new Rectangle(0, 70, 200, 30), "Gender: ", GUI.style, playerFrame);
GUIButton maleButton = new GUIButton(new Rectangle(0, 100, 70, 20), "Male",
Alignment.TopLeft, GUI.style,playerFrame);
GUIButton maleButton = new GUIButton(new Rectangle(0, 100, 70, 20), "Male",
Alignment.TopLeft, GUI.style, playerFrame);
maleButton.UserData = Gender.Male;
maleButton.OnClicked += SwitchGender;
@@ -313,7 +334,7 @@ namespace Subsurface
int i = 1;
foreach (JobPrefab job in JobPrefab.List)
{
GUITextBlock jobText = new GUITextBlock(new Rectangle(0,0,0,20), i+". "+job.Name, GUI.style, Alignment.Left, Alignment.Right, jobList);
GUITextBlock jobText = new GUITextBlock(new Rectangle(0, 0, 0, 20), i + ". " + job.Name, GUI.style, Alignment.Left, Alignment.Right, jobList);
jobText.UserData = job;
GUIButton upButton = new GUIButton(new Rectangle(0, 0, 15, 15), "u", GUI.style, jobText);
@@ -329,10 +350,29 @@ namespace Subsurface
//UpdatePreviewPlayer(Game1.Client.CharacterInfo);
UpdatePreviewPlayer(Game1.Client.CharacterInfo);
UpdatePreviewPlayer(characterInfo);
}
}
base.Select();
private bool TogglePlayYourself(object obj)
{
GUITickBox tickBox = obj as GUITickBox;
if (tickBox.Selected)
{
Game1.Server.CharacterInfo = new CharacterInfo(Character.HumanConfigFile, Game1.Server.Name);
UpdatePlayerFrame(Game1.Server.CharacterInfo);
}
else
{
playerFrame.ClearChildren();
if (IsServer && Game1.Server != null)
{
var playYourself = new GUITickBox(new Rectangle(0, -20, 200, 30), "Play yourself", Alignment.TopLeft, playerFrame);
playYourself.OnSelected = TogglePlayYourself;
}
}
return false;
}
private bool SelectMap(object obj)
@@ -590,10 +630,10 @@ namespace Subsurface
}
else
{
if (map.Hash.Hash != md5Hash)
if (map.MD5Hash.Hash != md5Hash)
{
DebugConsole.ThrowError("Your version of the map file ''" + map.Name + "'' doesn't match the server's version!");
DebugConsole.ThrowError("Your file: " + map.Name + "(MD5 hash : " + map.Hash.Hash + ")");
DebugConsole.ThrowError("Your file: " + map.Name + "(MD5 hash : " + map.MD5Hash.Hash + ")");
DebugConsole.ThrowError("Server's file: " + mapName + "(MD5 hash : " + md5Hash + ")");
return false;
}
@@ -618,7 +658,7 @@ namespace Subsurface
else
{
msg.Write(Path.GetFileName(selectedMap.Name));
msg.Write(selectedMap.Hash.Hash);
msg.Write(selectedMap.MD5Hash.Hash);
}
msg.Write(ServerName);
@@ -130,7 +130,7 @@ namespace Subsurface
refreshDisableTimer = DateTime.Now + AllowedRefreshInterval;
yield return Status.Success;
yield return CoroutineStatus.Success;
}
private void UpdateServerList(string masterServerData)
@@ -197,14 +197,14 @@ namespace Subsurface
RestClient client = null;
try
{
client = new RestClient(NetworkMember.MasterServerUrl);
client = new RestClient(NetConfig.MasterServerUrl);
}
catch (Exception e)
{
DebugConsole.ThrowError("Error while connecting to master server", e);
}
if (client == null) yield return Status.Success;
if (client == null) yield return CoroutineStatus.Success;
var request = new RestRequest("masterserver.php", Method.GET);
@@ -231,10 +231,10 @@ namespace Subsurface
restRequestHandle.Abort();
DebugConsole.ThrowError("Couldn't connect to master server (request timed out)");
}
yield return Status.Running;
yield return CoroutineStatus.Running;
}
yield return Status.Success;
yield return CoroutineStatus.Success;
}
@@ -296,7 +296,7 @@ namespace Subsurface
while (GUIMessageBox.MessageBoxes.Contains(msgBox))
{
okButton.Enabled = !string.IsNullOrWhiteSpace(passwordBox.Text);
yield return Status.Running;
yield return CoroutineStatus.Running;
}
selectedPassword = passwordBox.Text;
@@ -305,9 +305,7 @@ namespace Subsurface
Game1.NetworkMember = new GameClient(clientNameBox.Text);
Game1.Client.ConnectToServer(ip, selectedPassword);
Game1.NetLobbyScreen.Select();
yield return Status.Success;
yield return CoroutineStatus.Success;
}
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)