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:
@@ -6,8 +6,6 @@
|
||||
|
||||
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="64,0,64,128"/>
|
||||
|
||||
<trigger/>
|
||||
|
||||
<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"/>
|
||||
</MiniMap>
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Barotrauma
|
||||
|
||||
public override void End()
|
||||
{
|
||||
if (item.CurrentHull == null || item.Removed) return;
|
||||
if (item.CurrentHull == null || !item.CurrentHull.Submarine.AtEndPosition || item.Removed) return;
|
||||
item.Remove();
|
||||
|
||||
GiveReward();
|
||||
|
||||
@@ -172,11 +172,11 @@ namespace Barotrauma
|
||||
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++)
|
||||
{
|
||||
if (!children[i].UserData.Equals(selection)) continue;
|
||||
if (!children[i].UserData.Equals(userData)) continue;
|
||||
|
||||
Select(i, force);
|
||||
|
||||
|
||||
@@ -259,7 +259,6 @@ namespace Barotrauma
|
||||
particle.Size = particle.Size * Math.Min(Math.Abs(flowForce.X / 1000.0f), 5.0f);
|
||||
}
|
||||
|
||||
|
||||
if (Math.Abs(flowForce.X) > 300.0f)
|
||||
{
|
||||
pos.X += Math.Sign(flowForce.X) * 10.0f;
|
||||
@@ -387,7 +386,7 @@ namespace Barotrauma
|
||||
else if (dir == 1)
|
||||
{
|
||||
if (!(hull1.Volume > 0.0f)) return;
|
||||
//lowerSurface = hull2.Surface - hull2.WaveY[1];
|
||||
lowerSurface = hull2.Surface - hull2.WaveY[hull2.WaveY.Length - 1];
|
||||
|
||||
flowTargetHull = hull2;
|
||||
|
||||
|
||||
@@ -133,9 +133,10 @@ namespace Barotrauma
|
||||
if (Submarine!=null) drawPos += Submarine.DrawPosition;
|
||||
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;
|
||||
|
||||
|
||||
int iconX = iconIndices[(int)spawnType]*IconSize % iconTexture.Width;
|
||||
int iconY = (int)(Math.Floor(iconIndices[(int)spawnType]*IconSize / (float)iconTexture.Width))*IconSize;
|
||||
|
||||
|
||||
@@ -454,9 +454,9 @@ namespace Barotrauma
|
||||
{
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(0, 0, 0, 25),
|
||||
sub.Name,
|
||||
ToolBox.LimitString(sub.Name, GUI.Font, subList.Rect.Width - 80),
|
||||
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.UserData = sub;
|
||||
textBlock.ToolTip = sub.FilePath;
|
||||
|
||||
@@ -108,6 +108,8 @@ namespace Barotrauma
|
||||
|
||||
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);
|
||||
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.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();
|
||||
}
|
||||
|
||||
private bool StartGame(GUIButton button, object obj)
|
||||
private bool StartGame(GUIButton button, object userData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(saveNameBox.Text)) return false;
|
||||
|
||||
@@ -498,8 +522,12 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
Directory.CreateDirectory(SaveUtil.TempPath);
|
||||
|
||||
@@ -423,7 +423,11 @@ namespace Barotrauma
|
||||
GameMain.Server.Voting.ResetVotes(GameMain.Server.ConnectedClients);
|
||||
|
||||
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));
|
||||
}
|
||||
else if (GameMain.Client != null)
|
||||
|
||||
@@ -352,7 +352,8 @@ namespace Barotrauma
|
||||
{
|
||||
graphics.Clear(Color.CornflowerBlue);
|
||||
|
||||
GameMain.GameScreen.DrawMap(graphics, spriteBatch);
|
||||
GameMain.TitleScreen.DrawLoadingText = false;
|
||||
GameMain.TitleScreen.Draw(spriteBatch, graphics, (float)deltaTime);
|
||||
|
||||
spriteBatch.Begin();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user