New pump & railguncont sprites, saving fixes (disappearing items fixed?), moving LightManager.ViewPos to railgun when aiming, generating waypoints outside sub, easier wire node editing, characters stand when using a controller, shiftsummary crew status scrolling, stuff
This commit is contained in:
@@ -26,10 +26,10 @@ namespace Barotrauma
|
||||
get { return cam; }
|
||||
}
|
||||
|
||||
public string GetSubName()
|
||||
{
|
||||
return ((Submarine.Loaded == null) ? "" : Submarine.Loaded.Name);
|
||||
}
|
||||
//public string GetSubName()
|
||||
//{
|
||||
// return ((Submarine.Loaded == null) ? "" : Submarine.Loaded.Name);
|
||||
//}
|
||||
|
||||
private string GetItemCount()
|
||||
{
|
||||
@@ -64,6 +64,7 @@ namespace Barotrauma
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 20, 0, 20), "Submarine:", GUI.Style, GUIpanel);
|
||||
nameBox = new GUITextBox(new Rectangle(0, 40, 0, 20), GUI.Style, GUIpanel);
|
||||
nameBox.OnEnterPressed = ChangeSubName;
|
||||
//nameBlock.TextGetter = GetSubName;
|
||||
|
||||
GUIButton button = new GUIButton(new Rectangle(0,70,0,20), "Save", GUI.Style, GUIpanel);
|
||||
@@ -227,6 +228,8 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
Submarine.SaveCurrent(nameBox.Text + ".sub");
|
||||
|
||||
GUI.AddMessage("Submarine saved to " + Submarine.Loaded.FilePath, Color.DarkGreen, 3.0f);
|
||||
|
||||
|
||||
return false;
|
||||
@@ -271,6 +274,16 @@ namespace Barotrauma
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool ChangeSubName(GUITextBox textBox, string text)
|
||||
{
|
||||
if (Submarine.Loaded != null) Submarine.Loaded.Name = text;
|
||||
textBox.Deselect();
|
||||
|
||||
textBox.Text = text;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool SelectPrefab(GUIComponent component, object obj)
|
||||
{
|
||||
MapEntityPrefab.SelectPrefab(obj);
|
||||
|
||||
@@ -135,10 +135,10 @@ namespace Barotrauma
|
||||
while (Physics.accumulator >= Physics.step)
|
||||
{
|
||||
cam.MoveCamera((float)Physics.step);
|
||||
if (Character.Controlled != null)
|
||||
if (Character.Controlled != null && Lights.LightManager.ViewTarget != null)
|
||||
{
|
||||
cam.TargetPos = Character.Controlled.WorldPosition;
|
||||
Lights.LightManager.ViewPos = Character.Controlled.WorldPosition;
|
||||
cam.TargetPos = Lights.LightManager.ViewTarget.WorldPosition;
|
||||
//Lights.LightManager.ViewPos = Character.Controlled.WorldPosition;
|
||||
}
|
||||
|
||||
if (Submarine.Loaded != null) Submarine.Loaded.SetPrevTransform(Submarine.Loaded.Position);
|
||||
@@ -213,9 +213,11 @@ namespace Barotrauma
|
||||
GameMain.LightManager.ObstructVision = Character.Controlled != null && Character.Controlled.ObstructVision;
|
||||
|
||||
GameMain.LightManager.UpdateLightMap(graphics, spriteBatch, cam);
|
||||
GameMain.LightManager.UpdateObstructVision(graphics, spriteBatch, cam,
|
||||
Character.Controlled==null ? LightManager.ViewPos : Character.Controlled.CursorWorldPosition);
|
||||
|
||||
if (Character.Controlled!=null)
|
||||
{
|
||||
GameMain.LightManager.UpdateObstructVision(graphics, spriteBatch, cam, Character.Controlled.CursorWorldPosition);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//1. draw the background, characters and the parts of the submarine that are behind them
|
||||
@@ -335,7 +337,7 @@ namespace Barotrauma
|
||||
|
||||
spriteBatch.End();
|
||||
|
||||
GameMain.LightManager.DrawLOS(graphics, spriteBatch, cam, LightManager.ViewPos);
|
||||
GameMain.LightManager.DrawLOS(graphics, spriteBatch, cam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ namespace Barotrauma
|
||||
|
||||
private IEnumerable<object> ShiftLoading()
|
||||
{
|
||||
GameMain.GameSession.StartShift(selectedLevel, false);
|
||||
GameMain.GameSession.StartShift(selectedLevel, true);
|
||||
GameMain.GameScreen.Select();
|
||||
|
||||
yield return CoroutineStatus.Success;
|
||||
|
||||
@@ -3,6 +3,7 @@ using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Barotrauma.Networking;
|
||||
using System.Xml.Linq;
|
||||
using System.IO;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -474,6 +475,15 @@ namespace Barotrauma
|
||||
Submarine selectedSub = mapList.SelectedData as Submarine;
|
||||
if (selectedSub == null) return false;
|
||||
|
||||
if (!Directory.Exists(SaveUtil.TempPath))
|
||||
{
|
||||
Directory.CreateDirectory(SaveUtil.TempPath);
|
||||
}
|
||||
|
||||
File.Copy(selectedSub.FilePath, Path.Combine(SaveUtil.TempPath, "map.sub"), true);
|
||||
|
||||
selectedSub = new Submarine(Path.Combine(SaveUtil.TempPath, "map.sub"), "");
|
||||
|
||||
GameMain.GameSession = new GameSession(selectedSub, saveNameBox.Text, GameModePreset.list.Find(gm => gm.Name == "Single Player"));
|
||||
(GameMain.GameSession.gameMode as SinglePlayerMode).GenerateMap(seedBox.Text);
|
||||
|
||||
|
||||
@@ -859,7 +859,7 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
subList.Select(sub);
|
||||
subList.Select(sub, true);
|
||||
//map.Load();
|
||||
return true;
|
||||
}
|
||||
@@ -950,7 +950,7 @@ namespace Barotrauma
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(mapName) && !GameMain.NetworkMember.Voting.AllowSubVoting) TrySelectSub(mapName, md5Hash);
|
||||
|
||||
if (!GameMain.NetworkMember.Voting.AllowModeVoting) modeList.Select(modeIndex);
|
||||
if (!GameMain.NetworkMember.Voting.AllowModeVoting) modeList.Select(modeIndex, true);
|
||||
|
||||
autoRestartBox.Selected = autoRestart;
|
||||
autoRestartTimer = restartTimer;
|
||||
|
||||
Reference in New Issue
Block a user