(7765c6989) Only show a bunch of pathfinder errors and warnings in debug builds.
This commit is contained in:
@@ -324,6 +324,8 @@ namespace Barotrauma
|
||||
|
||||
private GUILayoutGroup subPreviewContainer;
|
||||
|
||||
private GUILayoutGroup subPreviewContainer;
|
||||
|
||||
private GUIButton loadGameButton;
|
||||
|
||||
public Action<Submarine, string, string> StartNewGame;
|
||||
|
||||
@@ -2043,13 +2043,12 @@ namespace Barotrauma
|
||||
GUI.AddMessage(GetCharacterEditorTranslation("RagdollReset"), Color.WhiteSmoke, font: GUI.Font);
|
||||
return true;
|
||||
};
|
||||
Vector2 messageBoxRelSize = new Vector2(0.5f, 0.5f);
|
||||
int messageBoxWidth = GameMain.GraphicsWidth / 2;
|
||||
int messageBoxHeight = GameMain.GraphicsHeight / 2;
|
||||
var saveRagdollButton = new GUIButton(new RectTransform(buttonSize, layoutGroup.RectTransform), GetCharacterEditorTranslation("SaveRagdoll"));
|
||||
saveRagdollButton.OnClicked += (button, userData) =>
|
||||
{
|
||||
var box = new GUIMessageBox(GetCharacterEditorTranslation("SaveRagdoll"), $"{GetCharacterEditorTranslation("ProvideFileName")}: ", new string[] { TextManager.Get("Cancel"), TextManager.Get("Save") }, messageBoxRelSize);
|
||||
var box = new GUIMessageBox(GetCharacterEditorTranslation("SaveRagdoll"), $"{GetCharacterEditorTranslation("ProvideFileName")}: ", new string[] { TextManager.Get("Cancel"), TextManager.Get("Save") }, messageBoxWidth, messageBoxHeight);
|
||||
var inputField = new GUITextBox(new RectTransform(new Point(box.Content.Rect.Width, 30), box.Content.RectTransform, Anchor.Center), RagdollParams.Name);
|
||||
box.Buttons[0].OnClicked += (b, d) =>
|
||||
{
|
||||
@@ -2077,7 +2076,7 @@ namespace Barotrauma
|
||||
var loadRagdollButton = new GUIButton(new RectTransform(buttonSize, layoutGroup.RectTransform), GetCharacterEditorTranslation("LoadRagdoll"));
|
||||
loadRagdollButton.OnClicked += (button, userData) =>
|
||||
{
|
||||
var loadBox = new GUIMessageBox(GetCharacterEditorTranslation("LoadRagdoll"), "", new string[] { TextManager.Get("Cancel"), TextManager.Get("Load"), TextManager.Get("Delete") }, messageBoxRelSize);
|
||||
var loadBox = new GUIMessageBox(GetCharacterEditorTranslation("LoadRagdoll"), "", new string[] { TextManager.Get("Cancel"), TextManager.Get("Load"), TextManager.Get("Delete") }, messageBoxWidth, messageBoxHeight);
|
||||
loadBox.Buttons[0].OnClicked += loadBox.Close;
|
||||
var listBox = new GUIListBox(new RectTransform(new Vector2(0.9f, 0.6f), loadBox.Content.RectTransform, Anchor.TopCenter));
|
||||
var deleteButton = loadBox.Buttons[2];
|
||||
@@ -2123,7 +2122,7 @@ namespace Barotrauma
|
||||
var msgBox = new GUIMessageBox(
|
||||
TextManager.Get("DeleteDialogLabel"),
|
||||
TextManager.Get("DeleteDialogQuestion").Replace("[file]", selectedFile),
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("Cancel") });
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("Cancel") }, messageBoxWidth - 100, messageBoxHeight - 100);
|
||||
msgBox.Buttons[0].OnClicked += (b, d) =>
|
||||
{
|
||||
try
|
||||
@@ -2164,7 +2163,7 @@ namespace Barotrauma
|
||||
var saveAnimationButton = new GUIButton(new RectTransform(buttonSize, layoutGroup.RectTransform), GetCharacterEditorTranslation("SaveAnimation"));
|
||||
saveAnimationButton.OnClicked += (button, userData) =>
|
||||
{
|
||||
var box = new GUIMessageBox(GetCharacterEditorTranslation("SaveAnimation"), string.Empty, new string[] { TextManager.Get("Cancel"), TextManager.Get("Save") }, messageBoxRelSize);
|
||||
var box = new GUIMessageBox(GetCharacterEditorTranslation("SaveAnimation"), string.Empty, new string[] { TextManager.Get("Cancel"), TextManager.Get("Save") }, messageBoxWidth, messageBoxHeight);
|
||||
var textArea = new GUIFrame(new RectTransform(new Vector2(1, 0.1f), box.Content.RectTransform) { MinSize = new Point(350, 30) }, style: null);
|
||||
var inputLabel = new GUITextBlock(new RectTransform(new Vector2(0.3f, 1), textArea.RectTransform) { MinSize = new Point(250, 30) }, $"{GetCharacterEditorTranslation("ProvideFileName")}: ");
|
||||
var inputField = new GUITextBox(new RectTransform(new Vector2(0.5f, 1), textArea.RectTransform, Anchor.TopRight) { MinSize = new Point(100, 30) }, CurrentAnimation.Name);
|
||||
@@ -2212,7 +2211,7 @@ namespace Barotrauma
|
||||
var loadAnimationButton = new GUIButton(new RectTransform(buttonSize, layoutGroup.RectTransform), GetCharacterEditorTranslation("LoadAnimation"));
|
||||
loadAnimationButton.OnClicked += (button, userData) =>
|
||||
{
|
||||
var loadBox = new GUIMessageBox(GetCharacterEditorTranslation("LoadAnimation"), "", new string[] { TextManager.Get("Cancel"), TextManager.Get("Load"), TextManager.Get("Delete") }, messageBoxRelSize);
|
||||
var loadBox = new GUIMessageBox(GetCharacterEditorTranslation("LoadAnimation"), "", new string[] { TextManager.Get("Cancel"), TextManager.Get("Load"), TextManager.Get("Delete") }, messageBoxWidth, messageBoxHeight);
|
||||
loadBox.Buttons[0].OnClicked += loadBox.Close;
|
||||
var listBox = new GUIListBox(new RectTransform(new Vector2(0.9f, 0.6f), loadBox.Content.RectTransform));
|
||||
var deleteButton = loadBox.Buttons[2];
|
||||
@@ -2274,7 +2273,7 @@ namespace Barotrauma
|
||||
var msgBox = new GUIMessageBox(
|
||||
TextManager.Get("DeleteDialogLabel"),
|
||||
TextManager.Get("DeleteDialogQuestion").Replace("[file]", selectedFile),
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("Cancel") });
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("Cancel") }, messageBoxWidth - 100, messageBoxHeight - 100);
|
||||
msgBox.Buttons[0].OnClicked += (b, d) =>
|
||||
{
|
||||
try
|
||||
@@ -4426,7 +4425,7 @@ namespace Barotrauma
|
||||
|
||||
protected override GUIMessageBox Create()
|
||||
{
|
||||
var box = new GUIMessageBox(GetCharacterEditorTranslation("CreateNewCharacter"), string.Empty, new string[] { TextManager.Get("Cancel"), TextManager.Get("Next") }, new Vector2(0.5f, 1.0f));
|
||||
var box = new GUIMessageBox(GetCharacterEditorTranslation("CreateNewCharacter"), string.Empty, new string[] { TextManager.Get("Cancel"), TextManager.Get("Next") }, GameMain.GraphicsWidth / 2, GameMain.GraphicsHeight);
|
||||
box.Content.ChildAnchor = Anchor.TopCenter;
|
||||
box.Content.AbsoluteSpacing = 20;
|
||||
int elementSize = 30;
|
||||
@@ -4542,7 +4541,7 @@ namespace Barotrauma
|
||||
|
||||
protected override GUIMessageBox Create()
|
||||
{
|
||||
var box = new GUIMessageBox(GetCharacterEditorTranslation("DefineRagdoll"), string.Empty, new string[] { TextManager.Get("Previous"), TextManager.Get("Create") }, new Vector2(0.5f, 1.0f));
|
||||
var box = new GUIMessageBox(GetCharacterEditorTranslation("DefineRagdoll"), string.Empty, new string[] { TextManager.Get("Previous"), TextManager.Get("Create") }, GameMain.GraphicsWidth / 2, GameMain.GraphicsHeight);
|
||||
box.Content.ChildAnchor = Anchor.TopCenter;
|
||||
box.Content.AbsoluteSpacing = 20;
|
||||
int elementSize = 30;
|
||||
@@ -4622,7 +4621,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (htmlBox == null)
|
||||
{
|
||||
htmlBox = new GUIMessageBox(GetCharacterEditorTranslation("LoadHTML"), string.Empty, new string[] { TextManager.Get("Close"), TextManager.Get("Load") }, new Vector2(0.5f, 1.0f));
|
||||
htmlBox = new GUIMessageBox(GetCharacterEditorTranslation("LoadHTML"), string.Empty, new string[] { TextManager.Get("Close"), TextManager.Get("Load") }, GameMain.GraphicsWidth / 2, GameMain.GraphicsHeight);
|
||||
var element = new GUIFrame(new RectTransform(new Vector2(0.8f, 0.05f), htmlBox.Content.RectTransform), style: null, color: Color.Gray * 0.25f);
|
||||
new GUITextBlock(new RectTransform(new Vector2(0.5f, 1), element.RectTransform), GetCharacterEditorTranslation("HTMLPath"));
|
||||
var htmlPathElement = new GUITextBox(new RectTransform(new Vector2(0.5f, 1), element.RectTransform, Anchor.TopRight), $"Content/Characters/{Name}/{Name}.html");
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
@@ -8,7 +11,7 @@ namespace Barotrauma
|
||||
{
|
||||
private GUIListBox listBox;
|
||||
|
||||
private readonly float scrollSpeed;
|
||||
private float scrollSpeed;
|
||||
|
||||
public CreditsPlayer(RectTransform rectT, string configFile) : base(null, rectT)
|
||||
{
|
||||
|
||||
@@ -297,6 +297,7 @@ namespace Barotrauma
|
||||
{
|
||||
OnClicked = (btn, userdata) =>
|
||||
{
|
||||
GameMain.SpriteEditorScreen.RefreshLists();
|
||||
editingSprite = sprite;
|
||||
GameMain.SpriteEditorScreen.SelectSprite(editingSprite);
|
||||
return true;
|
||||
@@ -601,7 +602,7 @@ namespace Barotrauma
|
||||
public GUIMessageBox Create()
|
||||
{
|
||||
var box = new GUIMessageBox(TextManager.Get("LevelEditorCreateLevelObj"), string.Empty,
|
||||
new string[] { TextManager.Get("Cancel"), TextManager.Get("Done") }, new Vector2(0.5f, 0.8f));
|
||||
new string[] { TextManager.Get("Cancel"), TextManager.Get("Done") }, GameMain.GraphicsWidth / 2, (int)(GameMain.GraphicsHeight * 0.8f));
|
||||
|
||||
box.Content.ChildAnchor = Anchor.TopCenter;
|
||||
box.Content.AbsoluteSpacing = 20;
|
||||
@@ -675,8 +676,6 @@ namespace Barotrauma
|
||||
doc.WriteTo(writer);
|
||||
writer.Flush();
|
||||
}
|
||||
// Recreate the prefab so that the sprite loads correctly: TODO: consider a better way to do this
|
||||
newPrefab = new LevelObjectPrefab(newElement);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,15 +44,15 @@ namespace Barotrauma
|
||||
{
|
||||
backgroundVignette = new Sprite("Content/UI/MainMenuVignette.png", Vector2.Zero);
|
||||
|
||||
new GUIImage(new RectTransform(new Vector2(0.4f, 0.25f), Frame.RectTransform, Anchor.BottomRight)
|
||||
{ RelativeOffset = new Vector2(0.08f, 0.05f), AbsoluteOffset = new Point(-8, -8) },
|
||||
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) },
|
||||
style: "TitleText")
|
||||
{
|
||||
Color = Color.Black * 0.5f,
|
||||
CanBeFocused = false
|
||||
};
|
||||
titleText = new GUIImage(new RectTransform(new Vector2(0.4f, 0.25f), Frame.RectTransform, Anchor.BottomRight)
|
||||
{ RelativeOffset = new Vector2(0.08f, 0.05f) },
|
||||
titleText = new GUIImage(new RectTransform(new Vector2(0.35f, 0.2f), Frame.RectTransform, Anchor.BottomRight)
|
||||
{ RelativeOffset = new Vector2(0.05f, 0.1f) },
|
||||
style: "TitleText");
|
||||
|
||||
buttonsParent = new GUILayoutGroup(new RectTransform(new Vector2(0.3f, 0.85f), parent: Frame.RectTransform, anchor: Anchor.CenterLeft)
|
||||
@@ -354,12 +354,6 @@ namespace Barotrauma
|
||||
};
|
||||
var creditsContainer = new GUIFrame(new RectTransform(new Vector2(0.75f, 1.5f), menuTabs[(int)Tab.Credits].RectTransform, Anchor.CenterRight), style: "OuterGlow", color: Color.Black * 0.8f);
|
||||
creditsPlayer = new CreditsPlayer(new RectTransform(Vector2.One, creditsContainer.RectTransform), "Content/Texts/Credits.xml");
|
||||
|
||||
new GUIButton(new RectTransform(new Vector2(0.1f, 0.05f), menuTabs[(int)Tab.Credits].RectTransform, Anchor.BottomLeft) { RelativeOffset = new Vector2(0.25f, 0.02f) },
|
||||
TextManager.Get("Back"), style: "GUIButtonLarge")
|
||||
{
|
||||
OnClicked = SelectTab
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -389,9 +383,10 @@ namespace Barotrauma
|
||||
|
||||
private bool SelectTab(GUIButton button, object obj)
|
||||
{
|
||||
titleText.Visible = true;
|
||||
if (obj is Tab)
|
||||
{
|
||||
titleText.Visible = true;
|
||||
|
||||
if (GameMain.Config.UnsavedSettings)
|
||||
{
|
||||
var applyBox = new GUIMessageBox(
|
||||
@@ -789,10 +784,6 @@ namespace Barotrauma
|
||||
|
||||
GUI.Draw(Cam, spriteBatch);
|
||||
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, GameMain.ScissorTestEnable);
|
||||
|
||||
GUI.Draw(Cam, spriteBatch);
|
||||
|
||||
GUI.Draw(Cam, spriteBatch);
|
||||
|
||||
#if DEBUG
|
||||
|
||||
@@ -1212,7 +1212,7 @@ namespace Barotrauma
|
||||
};
|
||||
infoButton.OnClicked += (component, userdata) =>
|
||||
{
|
||||
((Submarine)userdata).CreatePreviewWindow(new GUIMessageBox("", "", new Vector2(0.25f, 0.25f), new Point(500, 400)));
|
||||
((Submarine)userdata).CreatePreviewWindow(new GUIMessageBox("", "", 550, 600));
|
||||
return true;
|
||||
};
|
||||
}
|
||||
@@ -2005,8 +2005,7 @@ namespace Barotrauma
|
||||
return false;
|
||||
}
|
||||
|
||||
var requestFileBox = new GUIMessageBox(TextManager.Get("DownloadSubLabel"), errorMsg,
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("No") })
|
||||
var requestFileBox = new GUIMessageBox(TextManager.Get("DownloadSubLabel"), errorMsg, new string[] { TextManager.Get("Yes"), TextManager.Get("No") }, 400, 300)
|
||||
{
|
||||
UserData = "request" + subName
|
||||
};
|
||||
|
||||
@@ -193,7 +193,50 @@ namespace Barotrauma
|
||||
{
|
||||
Sprite sprite = userData as Sprite;
|
||||
if (sprite == null) return false;
|
||||
SelectSprite(sprite);
|
||||
if (selectedSprites.Any(s => s.Texture != selectedTexture))
|
||||
{
|
||||
ResetWidgets();
|
||||
}
|
||||
if (Widget.EnableMultiSelect)
|
||||
{
|
||||
if (selectedSprites.Contains(sprite))
|
||||
{
|
||||
selectedSprites.Remove(sprite);
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedSprites.Add(sprite);
|
||||
dirtySprites.Add(sprite);
|
||||
lastSelected = sprite;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedSprites.Clear();
|
||||
selectedSprites.Add(sprite);
|
||||
dirtySprites.Add(sprite);
|
||||
lastSelected = sprite;
|
||||
}
|
||||
if (selectedTexture != sprite.Texture)
|
||||
{
|
||||
textureList.Select(sprite.Texture, autoScroll: false);
|
||||
UpdateScrollBar(textureList);
|
||||
}
|
||||
xmlPathText.Text = string.Empty;
|
||||
foreach (var s in selectedSprites)
|
||||
{
|
||||
texturePathText.Text = s.FilePath;
|
||||
var element = s.SourceElement;
|
||||
if (element != null)
|
||||
{
|
||||
string xmlPath = element.ParseContentPathFromUri();
|
||||
if (!xmlPathText.Text.Contains(xmlPath))
|
||||
{
|
||||
xmlPathText.Text += "\n" + xmlPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
xmlPathText.TextColor = Color.LightGray;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -567,56 +610,11 @@ namespace Barotrauma
|
||||
|
||||
public void SelectSprite(Sprite sprite)
|
||||
{
|
||||
if (!loadedSprites.Contains(sprite))
|
||||
{
|
||||
loadedSprites.Add(sprite);
|
||||
RefreshLists();
|
||||
}
|
||||
|
||||
if (selectedSprites.Any(s => s.Texture != selectedTexture))
|
||||
{
|
||||
ResetWidgets();
|
||||
}
|
||||
if (Widget.EnableMultiSelect)
|
||||
{
|
||||
if (selectedSprites.Contains(sprite))
|
||||
{
|
||||
selectedSprites.Remove(sprite);
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedSprites.Add(sprite);
|
||||
dirtySprites.Add(sprite);
|
||||
lastSelected = sprite;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedSprites.Clear();
|
||||
selectedSprites.Add(sprite);
|
||||
dirtySprites.Add(sprite);
|
||||
lastSelected = sprite;
|
||||
}
|
||||
if (selectedTexture != sprite.Texture)
|
||||
{
|
||||
textureList.Select(sprite.Texture, autoScroll: false);
|
||||
UpdateScrollBar(textureList);
|
||||
}
|
||||
xmlPathText.Text = string.Empty;
|
||||
foreach (var s in selectedSprites)
|
||||
{
|
||||
texturePathText.Text = s.FilePath;
|
||||
var element = s.SourceElement;
|
||||
if (element != null)
|
||||
{
|
||||
string xmlPath = element.ParseContentPathFromUri();
|
||||
if (!xmlPathText.Text.Contains(xmlPath))
|
||||
{
|
||||
xmlPathText.Text += "\n" + xmlPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
xmlPathText.TextColor = Color.LightGray;
|
||||
ResetWidgets();
|
||||
textureList.Select(sprite.Texture);
|
||||
ResetZoom();
|
||||
selectedSprites.Clear();
|
||||
selectedSprites.Add(sprite);
|
||||
}
|
||||
|
||||
public void RefreshLists()
|
||||
@@ -661,7 +659,6 @@ namespace Barotrauma
|
||||
|
||||
public void ResetZoom()
|
||||
{
|
||||
if (selectedTexture == null) { return; }
|
||||
var viewArea = GetViewArea;
|
||||
float width = viewArea.Width / (float)selectedTexture.Width;
|
||||
float height = viewArea.Height / (float)selectedTexture.Height;
|
||||
|
||||
Reference in New Issue
Block a user