(1e5573bea) new outpost
This commit is contained in:
@@ -188,7 +188,6 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\CampaignSetupUI.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\CampaignSetupUI.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\CampaignUI.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\CampaignUI.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\CharacterEditorScreen.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\CharacterEditorScreen.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\CreditsPlayer.cs" />
|
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\GameScreen.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\GameScreen.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\LevelEditorScreen.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\LevelEditorScreen.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\LobbyScreen.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\Screens\LobbyScreen.cs" />
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ namespace Barotrauma
|
|||||||
set { enabled = value; }
|
set { enabled = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool TileSprites;
|
||||||
|
|
||||||
private static GUITextBlock toolTipBlock;
|
private static GUITextBlock toolTipBlock;
|
||||||
|
|
||||||
public Vector2 Center
|
public Vector2 Center
|
||||||
|
|||||||
@@ -12,10 +12,6 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private XElement configElement;
|
private XElement configElement;
|
||||||
|
|
||||||
private GraphicsDevice graphicsDevice;
|
|
||||||
|
|
||||||
private ScalableFont defaultFont;
|
|
||||||
|
|
||||||
public ScalableFont Font { get; private set; }
|
public ScalableFont Font { get; private set; }
|
||||||
public ScalableFont SmallFont { get; private set; }
|
public ScalableFont SmallFont { get; private set; }
|
||||||
public ScalableFont LargeFont { get; private set; }
|
public ScalableFont LargeFont { get; private set; }
|
||||||
@@ -87,26 +83,6 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the default font of the currently selected language
|
|
||||||
/// </summary>
|
|
||||||
public ScalableFont LoadCurrentDefaultFont()
|
|
||||||
{
|
|
||||||
defaultFont?.Dispose();
|
|
||||||
defaultFont = null;
|
|
||||||
foreach (XElement subElement in configElement.Elements())
|
|
||||||
{
|
|
||||||
switch (subElement.Name.ToString().ToLowerInvariant())
|
|
||||||
{
|
|
||||||
case "font":
|
|
||||||
defaultFont = LoadFont(subElement, graphicsDevice);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return defaultFont;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void RescaleFonts()
|
private void RescaleFonts()
|
||||||
{
|
{
|
||||||
foreach (XElement subElement in configElement.Elements())
|
foreach (XElement subElement in configElement.Elements())
|
||||||
|
|||||||
@@ -5,13 +5,12 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Barotrauma.Media;
|
using Barotrauma.Media;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
class LoadingScreen
|
class LoadingScreen
|
||||||
{
|
{
|
||||||
private Texture2D backgroundTexture;
|
private Texture2D backgroundTexture, monsterTexture, titleTexture;
|
||||||
|
|
||||||
private RenderTarget2D renderTarget;
|
private RenderTarget2D renderTarget;
|
||||||
|
|
||||||
@@ -45,6 +44,17 @@ namespace Barotrauma
|
|||||||
private object loadMutex = new object();
|
private object loadMutex = new object();
|
||||||
private float? loadState;
|
private float? loadState;
|
||||||
|
|
||||||
|
public Vector2 TitleSize
|
||||||
|
{
|
||||||
|
get { return new Vector2(titleTexture.Width, titleTexture.Height); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float Scale
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
public float? LoadState
|
public float? LoadState
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -93,7 +103,7 @@ namespace Barotrauma
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
DrawSplashScreen(spriteBatch);
|
DrawSplashScreen(spriteBatch);
|
||||||
if (SplashScreen != null && SplashScreen.IsPlaying) return;
|
if (SplashScreen!=null && SplashScreen.IsPlaying) return;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -102,26 +112,19 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var titleStyle = GUI.Style?.GetComponentStyle("TitleText");
|
|
||||||
Sprite titleSprite = null;
|
|
||||||
if (titleStyle != null && titleStyle.Sprites.ContainsKey(GUIComponent.ComponentState.None))
|
|
||||||
{
|
|
||||||
titleSprite = titleStyle.Sprites[GUIComponent.ComponentState.None].First()?.Sprite;
|
|
||||||
}
|
|
||||||
|
|
||||||
drawn = true;
|
drawn = true;
|
||||||
|
|
||||||
graphics.SetRenderTarget(renderTarget);
|
graphics.SetRenderTarget(renderTarget);
|
||||||
|
|
||||||
float backgroundScale = GameMain.GraphicsHeight / 1500.0f;
|
Scale = GameMain.GraphicsHeight / 1500.0f;
|
||||||
float titleScale = MathHelper.SmoothStep(0.8f, 1.0f, state / 10.0f) * GameMain.GraphicsHeight / 1000.0f;
|
|
||||||
|
|
||||||
state += deltaTime;
|
state += deltaTime;
|
||||||
|
|
||||||
if (DrawLoadingText)
|
if (DrawLoadingText)
|
||||||
{
|
{
|
||||||
BackgroundPosition = new Vector2(GameMain.GraphicsWidth * 0.3f, GameMain.GraphicsHeight * 0.45f);
|
CenterPosition = new Vector2(GameMain.GraphicsWidth * 0.3f, GameMain.GraphicsHeight / 2.0f);
|
||||||
TitlePosition = new Vector2(GameMain.GraphicsWidth * 0.5f, GameMain.GraphicsHeight * 0.45f);
|
TitlePosition = CenterPosition + new Vector2(-0.0f + (float)Math.Sqrt(state) * 220.0f, 0.0f) * Scale;
|
||||||
|
TitlePosition.X = Math.Min(TitlePosition.X, (float)GameMain.GraphicsWidth / 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
|
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
|
||||||
@@ -129,9 +132,15 @@ namespace Barotrauma
|
|||||||
|
|
||||||
spriteBatch.Draw(backgroundTexture, BackgroundPosition, null, Color.White * Math.Min(state / 5.0f, 1.0f), 0.0f,
|
spriteBatch.Draw(backgroundTexture, BackgroundPosition, null, Color.White * Math.Min(state / 5.0f, 1.0f), 0.0f,
|
||||||
new Vector2(backgroundTexture.Width / 2.0f, backgroundTexture.Height / 2.0f),
|
new Vector2(backgroundTexture.Width / 2.0f, backgroundTexture.Height / 2.0f),
|
||||||
backgroundScale * 1.5f, SpriteEffects.None, 0.2f);
|
Scale * 1.5f, SpriteEffects.None, 0.2f);
|
||||||
|
|
||||||
titleSprite?.Draw(spriteBatch, TitlePosition, Color.White * Math.Min((state - 1.0f) / 5.0f, 1.0f), scale: titleScale);
|
spriteBatch.Draw(monsterTexture,
|
||||||
|
CenterPosition + new Vector2((state % 40) * 100.0f - 1800.0f, (state % 40) * 30.0f - 200.0f) * Scale, null,
|
||||||
|
Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0.1f);
|
||||||
|
|
||||||
|
spriteBatch.Draw(titleTexture,
|
||||||
|
TitlePosition, null,
|
||||||
|
Color.White * Math.Min((state - 1.0f) / 5.0f, 1.0f), 0.0f, new Vector2(titleTexture.Width / 2.0f, titleTexture.Height / 2.0f), Scale, SpriteEffects.None, 0.0f);
|
||||||
|
|
||||||
spriteBatch.End();
|
spriteBatch.End();
|
||||||
|
|
||||||
@@ -145,7 +154,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
|
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
|
||||||
|
|
||||||
titleSprite?.Draw(spriteBatch, TitlePosition, Color.White * Math.Min((state - 1.0f) / 5.0f, 1.0f), scale: titleScale);
|
spriteBatch.Draw(titleTexture,
|
||||||
|
TitlePosition, null,
|
||||||
|
Color.White * Math.Min((state - 3.0f) / 5.0f, 1.0f), 0.0f, new Vector2(titleTexture.Width / 2.0f, titleTexture.Height / 2.0f), Scale, SpriteEffects.None, 0.0f);
|
||||||
|
|
||||||
if (DrawLoadingText)
|
if (DrawLoadingText)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -140,15 +140,11 @@ namespace Barotrauma
|
|||||||
string newLanguage = obj as string;
|
string newLanguage = obj as string;
|
||||||
if (newLanguage == Language) return true;
|
if (newLanguage == Language) return true;
|
||||||
|
|
||||||
|
UnsavedSettings = true;
|
||||||
Language = newLanguage;
|
Language = newLanguage;
|
||||||
ApplySettings();
|
ApplySettings();
|
||||||
|
|
||||||
var msgBox = new GUIMessageBox(TextManager.Get("RestartRequiredLabel"), TextManager.Get("RestartRequiredLanguage"));
|
new GUIMessageBox(TextManager.Get("RestartRequiredLabel"), TextManager.Get("RestartRequiredLanguage"));
|
||||||
//change fonts to the default font of the new language to make sure
|
|
||||||
//they can be displayed when for example changing from English to Chinese
|
|
||||||
var defaultFont = GUI.Style.LoadCurrentDefaultFont();
|
|
||||||
msgBox.Header.Font = defaultFont;
|
|
||||||
msgBox.Text.Font = defaultFont;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -214,10 +214,6 @@ namespace Barotrauma
|
|||||||
sb.AppendLine("Level seed: " + ((Level.Loaded == null) ? "no level loaded" : Level.Loaded.Seed));
|
sb.AppendLine("Level seed: " + ((Level.Loaded == null) ? "no level loaded" : Level.Loaded.Seed));
|
||||||
sb.AppendLine("Loaded submarine: " + ((Submarine.MainSub == null) ? "None" : Submarine.MainSub.Name + " (" + Submarine.MainSub.MD5Hash + ")"));
|
sb.AppendLine("Loaded submarine: " + ((Submarine.MainSub == null) ? "None" : Submarine.MainSub.Name + " (" + Submarine.MainSub.MD5Hash + ")"));
|
||||||
sb.AppendLine("Selected screen: " + (Screen.Selected == null ? "None" : Screen.Selected.ToString()));
|
sb.AppendLine("Selected screen: " + (Screen.Selected == null ? "None" : Screen.Selected.ToString()));
|
||||||
if (SteamManager.IsInitialized)
|
|
||||||
{
|
|
||||||
sb.AppendLine("SteamManager initialized");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GameMain.Client != null)
|
if (GameMain.Client != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
class MainMenuScreen : Screen
|
class MainMenuScreen : Screen
|
||||||
{
|
{
|
||||||
public enum Tab { NewGame = 1, LoadGame = 2, HostServer = 3, Settings = 4, Tutorials = 5, JoinServer = 6, CharacterEditor = 7, SubmarineEditor = 8, QuickStartDev = 9, SteamWorkshop = 10, Credits = 11 }
|
public enum Tab { NewGame = 1, LoadGame = 2, HostServer = 3, Settings = 4, Tutorials = 5, JoinServer = 6, CharacterEditor = 7, SubmarineEditor = 8, QuickStartDev = 9, SteamWorkshop = 10 }
|
||||||
|
|
||||||
private GUIComponent buttonsParent;
|
private GUIComponent buttonsParent;
|
||||||
|
|
||||||
@@ -34,27 +34,22 @@ namespace Barotrauma
|
|||||||
private Sprite backgroundSprite;
|
private Sprite backgroundSprite;
|
||||||
private Sprite backgroundVignette;
|
private Sprite backgroundVignette;
|
||||||
|
|
||||||
private GUIComponent titleText;
|
|
||||||
|
|
||||||
private CreditsPlayer creditsPlayer;
|
|
||||||
|
|
||||||
#region Creation
|
#region Creation
|
||||||
public MainMenuScreen(GameMain game)
|
public MainMenuScreen(GameMain game)
|
||||||
{
|
{
|
||||||
backgroundVignette = new Sprite("Content/UI/MainMenuVignette.png", Vector2.Zero);
|
backgroundVignette = new Sprite("Content/UI/MainMenuVignette.png", Vector2.Zero);
|
||||||
|
|
||||||
new GUIImage(new RectTransform(new Vector2(0.35f, 0.2f), Frame.RectTransform, Anchor.BottomRight)
|
new GUIImage(new RectTransform(new Vector2(0.35f, 0.2f), Frame.RectTransform, Anchor.BottomRight)
|
||||||
{ RelativeOffset = new Vector2(0.05f, 0.1f), AbsoluteOffset = new Point(-8, -8) },
|
{ RelativeOffset = new Vector2(0.05f, 0.05f), AbsoluteOffset = new Point(-5, -5) },
|
||||||
style: "TitleText")
|
style: "TitleText")
|
||||||
{
|
{
|
||||||
Color = Color.Black * 0.5f,
|
Color = Color.Black * 0.5f,
|
||||||
CanBeFocused = false
|
CanBeFocused = false
|
||||||
};
|
};
|
||||||
titleText = new GUIImage(new RectTransform(new Vector2(0.35f, 0.2f), Frame.RectTransform, Anchor.BottomRight)
|
new GUIImage(new RectTransform(new Vector2(0.35f, 0.2f), Frame.RectTransform, Anchor.BottomRight) { RelativeOffset = new Vector2(0.05f, 0.05f) },
|
||||||
{ RelativeOffset = new Vector2(0.05f, 0.1f) },
|
|
||||||
style: "TitleText");
|
style: "TitleText");
|
||||||
|
|
||||||
buttonsParent = new GUILayoutGroup(new RectTransform(new Vector2(0.3f, 0.85f), parent: Frame.RectTransform, anchor: Anchor.CenterLeft)
|
buttonsParent = new GUILayoutGroup(new RectTransform(new Vector2(0.3f, 0.85f), parent: Frame.RectTransform, anchor: Anchor.BottomLeft, pivot: Pivot.BottomLeft)
|
||||||
{
|
{
|
||||||
AbsoluteOffset = new Point(50, 0)
|
AbsoluteOffset = new Point(50, 0)
|
||||||
})
|
})
|
||||||
@@ -227,7 +222,7 @@ namespace Barotrauma
|
|||||||
};
|
};
|
||||||
|
|
||||||
// === OPTION
|
// === OPTION
|
||||||
var optionHolder = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.8f), parent: buttonsParent.RectTransform), isHorizontal: true);
|
var optionHolder = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.5f), parent: buttonsParent.RectTransform), isHorizontal: true);
|
||||||
|
|
||||||
new GUIImage(new RectTransform(new Vector2(0.15f, 0.6f), optionHolder.RectTransform), "MainMenuOptionIcon")
|
new GUIImage(new RectTransform(new Vector2(0.15f, 0.6f), optionHolder.RectTransform), "MainMenuOptionIcon")
|
||||||
{
|
{
|
||||||
@@ -237,9 +232,9 @@ namespace Barotrauma
|
|||||||
//spacing
|
//spacing
|
||||||
new GUIFrame(new RectTransform(new Vector2(0.01f, 0.0f), optionHolder.RectTransform), style: null);
|
new GUIFrame(new RectTransform(new Vector2(0.01f, 0.0f), optionHolder.RectTransform), style: null);
|
||||||
|
|
||||||
var optionButtons = new GUILayoutGroup(new RectTransform(new Vector2(0.8f, 1.0f), parent: optionHolder.RectTransform) { RelativeOffset = new Vector2(0.0f, 0.0f) });
|
var optionButtons = new GUILayoutGroup(new RectTransform(new Vector2(0.8f, 1.0f), parent: optionHolder.RectTransform) { RelativeOffset = new Vector2(0.0f, 0.05f) });
|
||||||
|
|
||||||
var optionList = new GUILayoutGroup(new RectTransform(new Vector2(0.8f, 0.25f), parent: optionButtons.RectTransform))
|
var optionList = new GUILayoutGroup(new RectTransform(new Vector2(0.8f, 0.3f), parent: optionButtons.RectTransform))
|
||||||
{
|
{
|
||||||
Stretch = false,
|
Stretch = false,
|
||||||
RelativeSpacing = 0.035f
|
RelativeSpacing = 0.035f
|
||||||
@@ -251,13 +246,6 @@ namespace Barotrauma
|
|||||||
UserData = Tab.Settings,
|
UserData = Tab.Settings,
|
||||||
OnClicked = SelectTab
|
OnClicked = SelectTab
|
||||||
};
|
};
|
||||||
//TODO: translate
|
|
||||||
new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), optionList.RectTransform), "Credits", textAlignment: Alignment.Left, style: "MainMenuGUIButton")
|
|
||||||
{
|
|
||||||
ForceUpperCase = true,
|
|
||||||
UserData = Tab.Credits,
|
|
||||||
OnClicked = SelectTab
|
|
||||||
};
|
|
||||||
new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), optionList.RectTransform), TextManager.Get("QuitButton"), textAlignment: Alignment.Left, style: "MainMenuGUIButton")
|
new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), optionList.RectTransform), TextManager.Get("QuitButton"), textAlignment: Alignment.Left, style: "MainMenuGUIButton")
|
||||||
{
|
{
|
||||||
ForceUpperCase = true,
|
ForceUpperCase = true,
|
||||||
@@ -266,7 +254,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
//debug button for quickly starting a new round
|
//debug button for quickly starting a new round
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
new GUIButton(new RectTransform(new Point(300, 30), Frame.RectTransform, Anchor.TopRight) { AbsoluteOffset = new Point(40, 40) },
|
new GUIButton(new RectTransform(new Vector2(0.8f, 0.1f), buttonsParent.RectTransform, Anchor.TopLeft, Pivot.BottomLeft) { AbsoluteOffset = new Point(0, -40) },
|
||||||
"Quickstart (dev)", style: "GUIButtonLarge", color: Color.Red)
|
"Quickstart (dev)", style: "GUIButtonLarge", color: Color.Red)
|
||||||
{
|
{
|
||||||
IgnoreLayoutGroups = true,
|
IgnoreLayoutGroups = true,
|
||||||
@@ -384,8 +372,6 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (obj is Tab)
|
if (obj is Tab)
|
||||||
{
|
{
|
||||||
titleText.Visible = true;
|
|
||||||
|
|
||||||
if (GameMain.Config.UnsavedSettings)
|
if (GameMain.Config.UnsavedSettings)
|
||||||
{
|
{
|
||||||
var applyBox = new GUIMessageBox(
|
var applyBox = new GUIMessageBox(
|
||||||
@@ -462,9 +448,6 @@ namespace Barotrauma
|
|||||||
if (!Steam.SteamManager.IsInitialized) return false;
|
if (!Steam.SteamManager.IsInitialized) return false;
|
||||||
GameMain.SteamWorkshopScreen.Select();
|
GameMain.SteamWorkshopScreen.Select();
|
||||||
break;
|
break;
|
||||||
case Tab.Credits:
|
|
||||||
titleText.Visible = false;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -718,6 +701,11 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public override void Update(double deltaTime)
|
public override void Update(double deltaTime)
|
||||||
{
|
{
|
||||||
|
GameMain.TitleScreen.TitlePosition =
|
||||||
|
Vector2.Lerp(GameMain.TitleScreen.TitlePosition, new Vector2(
|
||||||
|
GameMain.TitleScreen.TitleSize.X / 2.0f * GameMain.TitleScreen.Scale + 30.0f,
|
||||||
|
GameMain.TitleScreen.TitleSize.Y / 2.0f * GameMain.TitleScreen.Scale + 30.0f),
|
||||||
|
0.1f);
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
#if !OSX
|
#if !OSX
|
||||||
if (Steam.SteamManager.USE_STEAM)
|
if (Steam.SteamManager.USE_STEAM)
|
||||||
@@ -789,30 +777,27 @@ namespace Barotrauma
|
|||||||
GUI.Font.DrawString(spriteBatch, "Barotrauma v" + GameMain.Version, new Vector2(10, GameMain.GraphicsHeight - 20), Color.White * 0.7f);
|
GUI.Font.DrawString(spriteBatch, "Barotrauma v" + GameMain.Version, new Vector2(10, GameMain.GraphicsHeight - 20), Color.White * 0.7f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (selectedTab != Tab.Credits)
|
Vector2 textPos = new Vector2(GameMain.GraphicsWidth - 10, GameMain.GraphicsHeight - 10);
|
||||||
|
for (int i = legalCrap.Length - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
Vector2 textPos = new Vector2(GameMain.GraphicsWidth - 10, GameMain.GraphicsHeight - 10);
|
Vector2 textSize = GUI.SmallFont.MeasureString(legalCrap[i]);
|
||||||
for (int i = legalCrap.Length - 1; i >= 0; i--)
|
bool mouseOn = i == 0 &&
|
||||||
|
PlayerInput.MousePosition.X > textPos.X - textSize.X && PlayerInput.MousePosition.X < textPos.X &&
|
||||||
|
PlayerInput.MousePosition.Y > textPos.Y - textSize.Y && PlayerInput.MousePosition.Y < textPos.Y;
|
||||||
|
|
||||||
|
GUI.SmallFont.DrawString(spriteBatch,
|
||||||
|
legalCrap[i], textPos - textSize,
|
||||||
|
mouseOn ? Color.White : Color.White * 0.7f);
|
||||||
|
|
||||||
|
if (i == 0)
|
||||||
{
|
{
|
||||||
Vector2 textSize = GUI.SmallFont.MeasureString(legalCrap[i]);
|
GUI.DrawLine(spriteBatch, textPos, textPos - Vector2.UnitX * textSize.X, mouseOn ? Color.White : Color.White * 0.7f);
|
||||||
bool mouseOn = i == 0 &&
|
if (mouseOn && PlayerInput.LeftButtonClicked())
|
||||||
PlayerInput.MousePosition.X > textPos.X - textSize.X && PlayerInput.MousePosition.X < textPos.X &&
|
|
||||||
PlayerInput.MousePosition.Y > textPos.Y - textSize.Y && PlayerInput.MousePosition.Y < textPos.Y;
|
|
||||||
|
|
||||||
GUI.SmallFont.DrawString(spriteBatch,
|
|
||||||
legalCrap[i], textPos - textSize,
|
|
||||||
mouseOn ? Color.White : Color.White * 0.7f);
|
|
||||||
|
|
||||||
if (i == 0)
|
|
||||||
{
|
{
|
||||||
GUI.DrawLine(spriteBatch, textPos, textPos - Vector2.UnitX * textSize.X, mouseOn ? Color.White : Color.White * 0.7f);
|
Process.Start("http://privacypolicy.daedalic.com");
|
||||||
if (mouseOn && PlayerInput.LeftButtonClicked())
|
|
||||||
{
|
|
||||||
Process.Start("http://privacypolicy.daedalic.com");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
textPos.Y -= textSize.Y;
|
|
||||||
}
|
}
|
||||||
|
textPos.Y -= textSize.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
spriteBatch.End();
|
spriteBatch.End();
|
||||||
|
|||||||
@@ -1433,8 +1433,6 @@ namespace Barotrauma
|
|||||||
|
|
||||||
selectedSub.Load(true);
|
selectedSub.Load(true);
|
||||||
Submarine.MainSub = selectedSub;
|
Submarine.MainSub = selectedSub;
|
||||||
Submarine.MainSub.SetPrevTransform(Submarine.MainSub.Position);
|
|
||||||
Submarine.MainSub.UpdateTransform();
|
|
||||||
|
|
||||||
cam.Position = Submarine.MainSub.Position + Submarine.MainSub.HiddenSubPosition;
|
cam.Position = Submarine.MainSub.Position + Submarine.MainSub.HiddenSubPosition;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
private static Regex csvSplit = new Regex("(?:^|,)(\"(?:[^\"])*\"|[^,]*)", RegexOptions.Compiled); // Handling commas inside data fields surrounded by ""
|
private static Regex csvSplit = new Regex("(?:^|,)(\"(?:[^\"])*\"|[^,]*)", RegexOptions.Compiled); // Handling commas inside data fields surrounded by ""
|
||||||
private static List<int> conversationClosingIndent = new List<int>();
|
private static List<int> conversationClosingIndent = new List<int>();
|
||||||
private static char[] separator = new char[1] { '|' };
|
private static char[] separator = new char[1] { ',' };
|
||||||
|
|
||||||
private const string conversationsPath = "Content/NPCConversations";
|
private const string conversationsPath = "Content/NPCConversations";
|
||||||
private const string infoTextPath = "Content/Texts";
|
private const string infoTextPath = "Content/Texts";
|
||||||
@@ -151,7 +151,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
for (int i = traitStart + NPCPersonalityTrait.List.Count; i < csvContent.Length; i++) // Conversations
|
for (int i = traitStart + NPCPersonalityTrait.List.Count; i < csvContent.Length; i++) // Conversations
|
||||||
{
|
{
|
||||||
string[] presplit = csvContent[i].Split(separator); // Handling speaker index fetching, somehow doesn't work with the regex
|
string[] presplit = csvContent[i].Split(','); // Handling speaker index fetching, somehow doesn't work with the regex
|
||||||
string[] split = SplitCSV(csvContent[i]);
|
string[] split = SplitCSV(csvContent[i]);
|
||||||
|
|
||||||
int emptyFields = 0;
|
int emptyFields = 0;
|
||||||
@@ -257,7 +257,7 @@ namespace Barotrauma
|
|||||||
list.Add("");
|
list.Add("");
|
||||||
}
|
}
|
||||||
|
|
||||||
list.Add(curr.TrimStart(separator));
|
list.Add(curr.TrimStart(','));
|
||||||
}
|
}
|
||||||
|
|
||||||
return list.ToArray();
|
return list.ToArray();
|
||||||
|
|||||||
@@ -107,42 +107,24 @@ namespace Barotrauma
|
|||||||
|
|
||||||
text = text.Replace("\n", " \n ");
|
text = text.Replace("\n", " \n ");
|
||||||
|
|
||||||
List<string> words = new List<string>();
|
string[] words;
|
||||||
string currWord = "";
|
if (TextManager.NoWhiteSpace)
|
||||||
for (int i = 0; i < text.Length; i++)
|
|
||||||
{
|
{
|
||||||
if (isCJK.IsMatch(text[i].ToString()))
|
words = new string[text.Length];
|
||||||
|
for (int i = 0; i < text.Length; i++)
|
||||||
{
|
{
|
||||||
if (currWord.Length > 0)
|
words[i] = text[i].ToString();
|
||||||
{
|
|
||||||
words.Add(currWord);
|
|
||||||
currWord = "";
|
|
||||||
}
|
|
||||||
words.Add(text[i].ToString());
|
|
||||||
}
|
|
||||||
else if (text[i] == ' ')
|
|
||||||
{
|
|
||||||
if (currWord.Length > 0)
|
|
||||||
{
|
|
||||||
words.Add(currWord);
|
|
||||||
currWord = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
currWord += text[i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currWord.Length > 0)
|
else
|
||||||
{
|
{
|
||||||
words.Add(currWord);
|
words = text.Split(' ');
|
||||||
currWord = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder wrappedText = new StringBuilder();
|
StringBuilder wrappedText = new StringBuilder();
|
||||||
float linePos = 0f;
|
float linePos = 0f;
|
||||||
Vector2 spaceSize = font.MeasureString(" ") * textScale;
|
Vector2 spaceSize = font.MeasureString(" ") * textScale;
|
||||||
for (int i = 0; i < words.Count; ++i)
|
for (int i = 0; i < words.Length; ++i)
|
||||||
{
|
{
|
||||||
if (words[i].Length == 0)
|
if (words[i].Length == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
<Character file="Content/Characters/Watcher/Watcher.xml" />
|
<Character file="Content/Characters/Watcher/Watcher.xml" />
|
||||||
<Character file="Content/Characters/Hammerhead/Hammerhead.xml" />
|
<Character file="Content/Characters/Hammerhead/Hammerhead.xml" />
|
||||||
<Outpost file="Content/Map/Outposts/Outpost.sub" />
|
<Outpost file="Content/Map/Outposts/Outpost.sub" />
|
||||||
|
<Outpost file="Content/Map/Outposts/Outpost2.sub" />
|
||||||
<Submarine file="Submarines/Orca.sub" />
|
<Submarine file="Submarines/Orca.sub" />
|
||||||
<Submarine file="Submarines/Typhon.sub" />
|
<Submarine file="Submarines/Typhon.sub" />
|
||||||
<Submarine file="Submarines/Selkie.sub" />
|
<Submarine file="Submarines/Selkie.sub" />
|
||||||
@@ -83,12 +84,8 @@
|
|||||||
<Submarine file="Submarines/Remora.sub" />
|
<Submarine file="Submarines/Remora.sub" />
|
||||||
<Submarine file="Submarines/RemoraDrone.sub" />
|
<Submarine file="Submarines/RemoraDrone.sub" />
|
||||||
<Text file="Content/Texts/EnglishVanilla.xml" />
|
<Text file="Content/Texts/EnglishVanilla.xml" />
|
||||||
<Text file="Content/Texts/GermanVanilla.xml" />
|
<Text file="Content/Texts/RussianVanillaTest.xml" />
|
||||||
<Text file="Content/Texts/FrenchVanilla.xml" />
|
<Text file="Content/Texts/ChineseVanillaTest.xml" />
|
||||||
<Text file="Content/Texts/RussianVanilla.xml" />
|
|
||||||
<Text file="Content/Texts/BrazilianPortugueseVanilla.xml" />
|
|
||||||
<Text file="Content/Texts/SimplifiedChineseVanilla.xml" />
|
|
||||||
<Text file="Content/Texts/TraditionalChineseVanilla.xml" />
|
|
||||||
<UIStyle file="Content/UI/style.xml"/>
|
<UIStyle file="Content/UI/style.xml"/>
|
||||||
<Afflictions file="Content/Afflictions.xml"/>
|
<Afflictions file="Content/Afflictions.xml"/>
|
||||||
<Structure file="Content/Map/StructurePrefabs.xml" />
|
<Structure file="Content/Map/StructurePrefabs.xml" />
|
||||||
|
|||||||
@@ -361,12 +361,6 @@
|
|||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Effects\waterbump.png">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Effects\waterbump.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Fonts\NotoSans\NotoSansCJKsc-Bold.otf">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Fonts\NotoSans\NotoSansCJKsc-Medium.otf">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Fonts\NotoSans\NotoSansTC-Bold.otf">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Fonts\NotoSans\NotoSansTC-Bold.otf">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -505,25 +499,10 @@
|
|||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Map\OutpostWall_C.png">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Map\OutpostWall_C.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Texts\BrazilianPortugueseVanilla.xml">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Texts\ChineseVanillaTest.xml">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Texts\Credits.xml">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Texts\RussianVanillaTest.xml">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Texts\FrenchVanilla.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Texts\GermanVanilla.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Texts\RussianVanilla.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Texts\SimplifiedChineseVanilla.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Texts\TraditionalChineseVanilla.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\TutorialVideos\tutorial_command.mp4">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\TutorialVideos\tutorial_command.mp4">
|
||||||
@@ -577,9 +556,6 @@
|
|||||||
<Content Include="$(MSBuildThisFileDirectory)Content\UI\tutorialAtlas.png">
|
<Content Include="$(MSBuildThisFileDirectory)Content\UI\tutorialAtlas.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<None Include="$(MSBuildThisFileDirectory)Concentus_LICENSE">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="$(MSBuildThisFileDirectory)Content\Fonts\BebasNeue-Regular.otf">
|
<None Include="$(MSBuildThisFileDirectory)Content\Fonts\BebasNeue-Regular.otf">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
@@ -109,11 +109,6 @@ namespace Barotrauma
|
|||||||
if (!ParseTexturePath(path, file)) { return; }
|
if (!ParseTexturePath(path, file)) { return; }
|
||||||
Name = SourceElement.GetAttributeString("name", null);
|
Name = SourceElement.GetAttributeString("name", null);
|
||||||
Vector4 sourceVector = SourceElement.GetAttributeVector4("sourcerect", Vector4.Zero);
|
Vector4 sourceVector = SourceElement.GetAttributeVector4("sourcerect", Vector4.Zero);
|
||||||
var overrideElement = GetLocalizationOverrideElement();
|
|
||||||
if (overrideElement != null && overrideElement.Attribute("sourcerect") != null)
|
|
||||||
{
|
|
||||||
sourceVector = overrideElement.GetAttributeVector4("sourcerect", Vector4.Zero);
|
|
||||||
}
|
|
||||||
preMultipliedAlpha = preMultiplyAlpha ?? SourceElement.GetAttributeBool("premultiplyalpha", true);
|
preMultipliedAlpha = preMultiplyAlpha ?? SourceElement.GetAttributeBool("premultiplyalpha", true);
|
||||||
bool shouldReturn = false;
|
bool shouldReturn = false;
|
||||||
if (!lazyLoad)
|
if (!lazyLoad)
|
||||||
@@ -245,12 +240,8 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
if (SourceElement != null)
|
if (SourceElement != null)
|
||||||
{
|
{
|
||||||
sourceRect = SourceElement.GetAttributeRect("sourcerect", Rectangle.Empty);
|
Vector4 sourceVector = SourceElement.GetAttributeVector4("sourcerect", Vector4.Zero);
|
||||||
var overrideElement = GetLocalizationOverrideElement();
|
sourceRect = new Rectangle((int)sourceVector.X, (int)sourceVector.Y, (int)sourceVector.Z, (int)sourceVector.W);
|
||||||
if (overrideElement != null && overrideElement.Attribute("sourcerect") != null)
|
|
||||||
{
|
|
||||||
sourceRect = overrideElement.GetAttributeRect("sourcerect", Rectangle.Empty);
|
|
||||||
}
|
|
||||||
size = SourceElement.GetAttributeVector2("size", Vector2.One);
|
size = SourceElement.GetAttributeVector2("size", Vector2.One);
|
||||||
size.X *= sourceRect.Width;
|
size.X *= sourceRect.Width;
|
||||||
size.Y *= sourceRect.Height;
|
size.Y *= sourceRect.Height;
|
||||||
@@ -265,12 +256,6 @@ namespace Barotrauma
|
|||||||
if (file == "")
|
if (file == "")
|
||||||
{
|
{
|
||||||
file = SourceElement.GetAttributeString("texture", "");
|
file = SourceElement.GetAttributeString("texture", "");
|
||||||
var overrideElement = GetLocalizationOverrideElement();
|
|
||||||
if (overrideElement != null)
|
|
||||||
{
|
|
||||||
string overrideFile = overrideElement.GetAttributeString("texture", "");
|
|
||||||
if (!string.IsNullOrEmpty(overrideFile)) { file = overrideFile; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (file == "")
|
if (file == "")
|
||||||
{
|
{
|
||||||
@@ -288,22 +273,6 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private XElement GetLocalizationOverrideElement()
|
|
||||||
{
|
|
||||||
foreach (XElement subElement in SourceElement.Elements())
|
|
||||||
{
|
|
||||||
if (subElement.Name.ToString().ToLowerInvariant() == "override")
|
|
||||||
{
|
|
||||||
string language = subElement.GetAttributeString("language", "");
|
|
||||||
if (TextManager.Language.ToLower() == language.ToLower())
|
|
||||||
{
|
|
||||||
return subElement;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,14 @@ namespace Barotrauma
|
|||||||
private static string[] serverMessageCharacters = new string[] { "~", "[", "]", "=" };
|
private static string[] serverMessageCharacters = new string[] { "~", "[", "]", "=" };
|
||||||
|
|
||||||
public static string Language;
|
public static string Language;
|
||||||
|
public static bool NoWhiteSpace
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!textPacks.ContainsKey(Language)) { return false; }
|
||||||
|
return textPacks[Language].Any(t => t.NoWhiteSpace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static HashSet<string> availableLanguages = new HashSet<string>();
|
private static HashSet<string> availableLanguages = new HashSet<string>();
|
||||||
public static IEnumerable<string> AvailableLanguages
|
public static IEnumerable<string> AvailableLanguages
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private Dictionary<string, List<string>> texts;
|
private Dictionary<string, List<string>> texts;
|
||||||
|
|
||||||
|
public readonly bool NoWhiteSpace;
|
||||||
|
|
||||||
private readonly string filePath;
|
private readonly string filePath;
|
||||||
|
|
||||||
public TextPack(string filePath)
|
public TextPack(string filePath)
|
||||||
@@ -23,6 +25,7 @@ namespace Barotrauma
|
|||||||
if (doc == null || doc.Root == null) return;
|
if (doc == null || doc.Root == null) return;
|
||||||
|
|
||||||
Language = doc.Root.GetAttributeString("language", "Unknown");
|
Language = doc.Root.GetAttributeString("language", "Unknown");
|
||||||
|
NoWhiteSpace = doc.Root.GetAttributeBool("nowhitespace", false);
|
||||||
|
|
||||||
foreach (XElement subElement in doc.Root.Elements())
|
foreach (XElement subElement in doc.Root.Elements())
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user