Artifacts don't have to be inside the main sub when exiting, gap particle positioning bugfix, waypoints that aren't inside a hull are displayed in blue (easier to spot waypoint issues), a warning is displayed if trying to choose a shuttle as the submarine in SP, random sub selection in MP ignores shuttles

This commit is contained in:
Regalis
2016-08-13 18:26:40 +03:00
parent ec59c47041
commit 19d3d793e7
9 changed files with 48 additions and 17 deletions
@@ -6,8 +6,6 @@
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="64,0,64,128"/> <Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="64,0,64,128"/>
<trigger/>
<MiniMap MinVoltage="0.5" PowerConsumption="100" canbeselected = "true"> <MiniMap MinVoltage="0.5" PowerConsumption="100" canbeselected = "true">
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.8"/> <GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.8"/>
</MiniMap> </MiniMap>
@@ -78,7 +78,7 @@ namespace Barotrauma
public override void End() public override void End()
{ {
if (item.CurrentHull == null || item.Removed) return; if (item.CurrentHull == null || !item.CurrentHull.Submarine.AtEndPosition || item.Removed) return;
item.Remove(); item.Remove();
GiveReward(); GiveReward();
+2 -2
View File
@@ -172,11 +172,11 @@ namespace Barotrauma
scrollBar.BarScroll = 0.0f; scrollBar.BarScroll = 0.0f;
} }
public void Select(object selection, bool force = false) public void Select(object userData, bool force = false)
{ {
for (int i = 0; i < children.Count; i++) for (int i = 0; i < children.Count; i++)
{ {
if (!children[i].UserData.Equals(selection)) continue; if (!children[i].UserData.Equals(userData)) continue;
Select(i, force); Select(i, force);
+1 -2
View File
@@ -259,7 +259,6 @@ namespace Barotrauma
particle.Size = particle.Size * Math.Min(Math.Abs(flowForce.X / 1000.0f), 5.0f); particle.Size = particle.Size * Math.Min(Math.Abs(flowForce.X / 1000.0f), 5.0f);
} }
if (Math.Abs(flowForce.X) > 300.0f) if (Math.Abs(flowForce.X) > 300.0f)
{ {
pos.X += Math.Sign(flowForce.X) * 10.0f; pos.X += Math.Sign(flowForce.X) * 10.0f;
@@ -387,7 +386,7 @@ namespace Barotrauma
else if (dir == 1) else if (dir == 1)
{ {
if (!(hull1.Volume > 0.0f)) return; if (!(hull1.Volume > 0.0f)) return;
//lowerSurface = hull2.Surface - hull2.WaveY[1]; lowerSurface = hull2.Surface - hull2.WaveY[hull2.WaveY.Length - 1];
flowTargetHull = hull2; flowTargetHull = hull2;
+2 -1
View File
@@ -133,7 +133,8 @@ namespace Barotrauma
if (Submarine!=null) drawPos += Submarine.DrawPosition; if (Submarine!=null) drawPos += Submarine.DrawPosition;
drawPos.Y = -drawPos.Y; drawPos.Y = -drawPos.Y;
Color clr = (isSelected) ? Color.Red : Color.White; Color clr = currentHull == null ? Color.Blue : Color.White;
if (isSelected) clr = Color.Red;
if (isHighlighted) clr = Color.DarkRed; if (isHighlighted) clr = Color.DarkRed;
int iconX = iconIndices[(int)spawnType]*IconSize % iconTexture.Width; int iconX = iconIndices[(int)spawnType]*IconSize % iconTexture.Width;
+2 -2
View File
@@ -454,9 +454,9 @@ namespace Barotrauma
{ {
GUITextBlock textBlock = new GUITextBlock( GUITextBlock textBlock = new GUITextBlock(
new Rectangle(0, 0, 0, 25), new Rectangle(0, 0, 0, 25),
sub.Name, ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width - 80),
GUI.Style, GUI.Style,
Alignment.Left, Alignment.CenterY | Alignment.Right, subList); Alignment.Left, Alignment.CenterY | Alignment.Left, subList);
textBlock.Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f); textBlock.Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f);
textBlock.UserData = sub; textBlock.UserData = sub;
textBlock.ToolTip = sub.FilePath; textBlock.ToolTip = sub.FilePath;
+31 -3
View File
@@ -108,6 +108,8 @@ namespace Barotrauma
if (sub.HasTag(SubmarineTag.Shuttle)) if (sub.HasTag(SubmarineTag.Shuttle))
{ {
textBlock.TextColor = textBlock.TextColor * 0.85f;
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont); var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont);
shuttleText.TextColor = textBlock.TextColor * 0.8f; shuttleText.TextColor = textBlock.TextColor * 0.8f;
} }
@@ -129,7 +131,29 @@ namespace Barotrauma
button = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.BottomRight, GUI.Style, menuTabs[(int)Tab.NewGame]); button = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", Alignment.BottomRight, GUI.Style, menuTabs[(int)Tab.NewGame]);
button.OnClicked = StartGame; button.OnClicked = (GUIButton btn, object userData) =>
{
Submarine selectedSub = subList.SelectedData as Submarine;
if (selectedSub != null && selectedSub.HasTag(SubmarineTag.Shuttle))
{
var msgBox = new GUIMessageBox("Shuttle selected",
"Most shuttles are not adequately equipped to deal with the dangers of the Europan depths. "+
"Are you sure you want to choose a shuttle as your vessel?",
new string[] {"Yes", "No"});
msgBox.Buttons[0].OnClicked = StartGame;
msgBox.Buttons[0].OnClicked += msgBox.Close;
msgBox.Buttons[1].OnClicked = msgBox.Close;
return false;
}
StartGame(btn, userData);
return true;
};
// Submarine selectedSub = subList.SelectedData as Submarine;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@@ -485,7 +509,7 @@ namespace Barotrauma
spriteBatch.End(); spriteBatch.End();
} }
private bool StartGame(GUIButton button, object obj) private bool StartGame(GUIButton button, object userData)
{ {
if (string.IsNullOrEmpty(saveNameBox.Text)) return false; if (string.IsNullOrEmpty(saveNameBox.Text)) return false;
@@ -498,7 +522,11 @@ namespace Barotrauma
} }
Submarine selectedSub = subList.SelectedData as Submarine; Submarine selectedSub = subList.SelectedData as Submarine;
if (selectedSub == null) return false; if (selectedSub == null)
{
new GUIMessageBox("Submarine not selected", "Please select a submarine");
return false;
}
if (!Directory.Exists(SaveUtil.TempPath)) if (!Directory.Exists(SaveUtil.TempPath))
{ {
+5 -1
View File
@@ -423,7 +423,11 @@ namespace Barotrauma
GameMain.Server.Voting.ResetVotes(GameMain.Server.ConnectedClients); GameMain.Server.Voting.ResetVotes(GameMain.Server.ConnectedClients);
if (GameMain.Server.RandomizeSeed) LevelSeed = ToolBox.RandomSeed(8); if (GameMain.Server.RandomizeSeed) LevelSeed = ToolBox.RandomSeed(8);
if (GameMain.Server.SubSelectionMode == SelectionMode.Random) subList.Select(Rand.Range(0,subList.CountChildren)); if (GameMain.Server.SubSelectionMode == SelectionMode.Random)
{
var nonShuttles = subList.children.FindAll(c => c.UserData is Submarine && !((Submarine)c.UserData).HasTag(SubmarineTag.Shuttle));
subList.Select(nonShuttles[Rand.Range(0, nonShuttles.Count)].UserData);
}
if (GameMain.Server.ModeSelectionMode == SelectionMode.Random) modeList.Select(Rand.Range(0, modeList.CountChildren)); if (GameMain.Server.ModeSelectionMode == SelectionMode.Random) modeList.Select(Rand.Range(0, modeList.CountChildren));
} }
else if (GameMain.Client != null) else if (GameMain.Client != null)
@@ -352,7 +352,8 @@ namespace Barotrauma
{ {
graphics.Clear(Color.CornflowerBlue); graphics.Clear(Color.CornflowerBlue);
GameMain.GameScreen.DrawMap(graphics, spriteBatch); GameMain.TitleScreen.DrawLoadingText = false;
GameMain.TitleScreen.Draw(spriteBatch, graphics, (float)deltaTime);
spriteBatch.Begin(); spriteBatch.Begin();