Admin can play in multiplayer, backgroundsprites, fixrequirement bugfix, the condition of the reactor won't detoriate when it's running
This commit is contained in:
@@ -16,6 +16,8 @@ namespace Subsurface
|
||||
|
||||
readonly Sprite background, backgroundTop;
|
||||
|
||||
private BackgroundSpriteManager backgroundSpriteManager;
|
||||
|
||||
public Camera Cam
|
||||
{
|
||||
get { return cam; }
|
||||
@@ -32,6 +34,8 @@ namespace Subsurface
|
||||
|
||||
background = new Sprite("Content/Map/background.png", Vector2.Zero);
|
||||
backgroundTop = new Sprite("Content/Map/background2.png", Vector2.Zero);
|
||||
|
||||
backgroundSpriteManager = new BackgroundSpriteManager("Content/BackgroundSprites/BackgroundSpritePrefabs.xml");
|
||||
}
|
||||
|
||||
public override void Select()
|
||||
@@ -71,6 +75,8 @@ namespace Subsurface
|
||||
|
||||
Character.UpdateAll(cam, (float)deltaTime);
|
||||
|
||||
backgroundSpriteManager.Update((float)deltaTime);
|
||||
|
||||
Game1.ParticleManager.Update((float)deltaTime);
|
||||
|
||||
StatusEffect.UpdateAll((float)deltaTime);
|
||||
@@ -175,12 +181,20 @@ namespace Subsurface
|
||||
|
||||
spriteBatch.End();
|
||||
|
||||
spriteBatch.Begin(SpriteSortMode.BackToFront,
|
||||
BlendState.AlphaBlend,
|
||||
null, null, null, null,
|
||||
cam.Transform);
|
||||
|
||||
backgroundSpriteManager.Draw(spriteBatch);
|
||||
|
||||
spriteBatch.End();
|
||||
|
||||
spriteBatch.Begin(SpriteSortMode.BackToFront,
|
||||
BlendState.AlphaBlend,
|
||||
null, null, null, null,
|
||||
cam.Transform);
|
||||
|
||||
|
||||
Submarine.DrawBack(spriteBatch);
|
||||
|
||||
foreach (Character c in Character.CharacterList) c.Draw(spriteBatch);
|
||||
|
||||
@@ -278,18 +278,20 @@ namespace Subsurface
|
||||
modeList.OnSelected += Game1.Server.UpdateNetLobby;
|
||||
durationBar.OnMoved = Game1.Server.UpdateNetLobby;
|
||||
|
||||
if (subList.CountChildren > 0) subList.Select(-1);
|
||||
if (GameModePreset.list.Count > 0) modeList.Select(0);
|
||||
if (subList.CountChildren > 0 && subList.Selected == null) subList.Select(-1);
|
||||
if (GameModePreset.list.Count > 0 && modeList.Selected == null) modeList.Select(-1);
|
||||
|
||||
var playYourself = new GUITickBox(new Rectangle(0, -20, 20, 20), "Play yourself", Alignment.TopLeft, playerFrame);
|
||||
playYourself.OnSelected = TogglePlayYourself;
|
||||
if (infoFrame.children.Find(c => c.UserData as string == "playyourself") == null)
|
||||
{
|
||||
var playYourself = new GUITickBox(new Rectangle(0, -20, 20, 20), "Play yourself", Alignment.TopLeft, playerFrame);
|
||||
playYourself.OnSelected = TogglePlayYourself;
|
||||
playYourself.UserData = "playyourself";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdatePlayerFrame(Game1.Client.CharacterInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
base.Select();
|
||||
}
|
||||
@@ -302,8 +304,10 @@ namespace Subsurface
|
||||
|
||||
if (IsServer && Game1.Server != null)
|
||||
{
|
||||
var playYourself = new GUITickBox(new Rectangle(0, -20, 200, 30), "Play yourself", Alignment.TopLeft, playerFrame);
|
||||
var playYourself = new GUITickBox(new Rectangle(0, -20, 20, 20), "Play yourself", Alignment.TopLeft, playerFrame);
|
||||
playYourself.Selected = Game1.Server.CharacterInfo != null;
|
||||
playYourself.OnSelected = TogglePlayYourself;
|
||||
playYourself.UserData = "playyourself";
|
||||
}
|
||||
|
||||
new GUITextBlock(new Rectangle(60, 0, 200, 30), "Name: ", GUI.style, playerFrame);
|
||||
@@ -368,7 +372,9 @@ namespace Subsurface
|
||||
|
||||
if (IsServer && Game1.Server != null)
|
||||
{
|
||||
var playYourself = new GUITickBox(new Rectangle(0, -20, 200, 30), "Play yourself", Alignment.TopLeft, playerFrame);
|
||||
Game1.Server.CharacterInfo = null;
|
||||
|
||||
var playYourself = new GUITickBox(new Rectangle(0, -20, 20, 20), "Play yourself", Alignment.TopLeft, playerFrame);
|
||||
playYourself.OnSelected = TogglePlayYourself;
|
||||
}
|
||||
}
|
||||
@@ -615,7 +621,7 @@ namespace Subsurface
|
||||
(listBox.children[i] as GUITextBlock).Text = (i+1) + ". " + (listBox.children[i].UserData as JobPrefab).Name;
|
||||
}
|
||||
|
||||
Game1.Client.SendCharacterData();
|
||||
if (Game1.Client!=null) Game1.Client.SendCharacterData();
|
||||
}
|
||||
|
||||
public bool TrySelectMap(string mapName, string md5Hash)
|
||||
|
||||
Reference in New Issue
Block a user