Unstable 0.1500.0.0
This commit is contained in:
@@ -466,7 +466,7 @@ namespace Barotrauma
|
||||
{
|
||||
var sub = child.UserData as SubmarineInfo;
|
||||
if (sub == null) { return; }
|
||||
child.Visible = string.IsNullOrEmpty(filter) ? true : sub.DisplayName.ToLower().Contains(filter.ToLower());
|
||||
child.Visible = string.IsNullOrEmpty(filter) || sub.DisplayName.ToLower().Contains(filter.ToLower());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -628,7 +628,7 @@ namespace Barotrauma
|
||||
{
|
||||
TextGetter = () =>
|
||||
{
|
||||
return TextManager.AddPunctuation(':', TextManager.Get("Missions"), $"{Campaign.NumberOfMissionsAtLocation(destination)}/{Campaign.Settings.MaxMissionCount}");
|
||||
return TextManager.AddPunctuation(':', TextManager.Get("Missions"), $"{Campaign.NumberOfMissionsAtLocation(destination)}/{Campaign.Settings.TotalMaxMissionCount}");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -735,7 +735,7 @@ namespace Barotrauma
|
||||
|
||||
private void UpdateMaxMissions(Location location)
|
||||
{
|
||||
hasMaxMissions = Campaign.NumberOfMissionsAtLocation(location) >= Campaign.Settings.MaxMissionCount;
|
||||
hasMaxMissions = Campaign.NumberOfMissionsAtLocation(location) >= Campaign.Settings.TotalMaxMissionCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace Barotrauma.CharacterEditor
|
||||
{
|
||||
FileSelection.OnFileSelected = (file) =>
|
||||
{
|
||||
string relativePath = UpdaterUtil.GetRelativePath(Path.GetFullPath(file), Environment.CurrentDirectory);
|
||||
string relativePath = Path.GetRelativePath(Environment.CurrentDirectory, Path.GetFullPath(file));
|
||||
string destinationPath = relativePath;
|
||||
|
||||
//copy file to XML path if it's not located relative to the game's files
|
||||
|
||||
@@ -541,7 +541,7 @@ namespace Barotrauma
|
||||
|
||||
private XElement? ExportXML()
|
||||
{
|
||||
XElement mainElement = new XElement("ScriptedEvent", new XAttribute("identifier", projectName.RemoveWhitespace().ToLower()));
|
||||
XElement mainElement = new XElement("ScriptedEvent", new XAttribute("identifier", projectName.RemoveWhitespace().ToLowerInvariant()));
|
||||
EditorNode? startNode = null;
|
||||
foreach (EditorNode eventNode in nodeList.Where(node => node is EventNode || node is SpecialNode))
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Barotrauma
|
||||
public Effect PostProcessEffect { get; private set; }
|
||||
public Effect GradientEffect { get; private set; }
|
||||
public Effect GrainEffect { get; private set; }
|
||||
public Effect BlueprintEffect { get; set; }
|
||||
|
||||
public GameScreen(GraphicsDevice graphics, ContentManager content)
|
||||
{
|
||||
@@ -43,12 +44,14 @@ namespace Barotrauma
|
||||
PostProcessEffect = content.Load<Effect>("Effects/postprocess_opengl");
|
||||
GradientEffect = content.Load<Effect>("Effects/gradientshader_opengl");
|
||||
GrainEffect = content.Load<Effect>("Effects/grainshader_opengl");
|
||||
BlueprintEffect = content.Load<Effect>("Effects/blueprintshader_opengl");
|
||||
#else
|
||||
//var blurEffect = content.Load<Effect>("Effects/blurshader");
|
||||
damageEffect = content.Load<Effect>("Effects/damageshader");
|
||||
PostProcessEffect = content.Load<Effect>("Effects/postprocess");
|
||||
GradientEffect = content.Load<Effect>("Effects/gradientshader");
|
||||
GrainEffect = content.Load<Effect>("Effects/grainshader");
|
||||
BlueprintEffect = content.Load<Effect>("Effects/blueprintshader");
|
||||
#endif
|
||||
|
||||
damageStencil = TextureLoader.FromFile("Content/Map/walldamage.png");
|
||||
|
||||
@@ -2020,7 +2020,8 @@ namespace Barotrauma
|
||||
var playerFrame = (GUITextBlock)PlayerList.Content.FindChild(client);
|
||||
if (playerFrame == null) { return; }
|
||||
playerFrame.Text = client.Name;
|
||||
|
||||
|
||||
playerFrame.ToolTip = "";
|
||||
Color color = Color.White;
|
||||
if (SelectedMode == GameModePreset.PvP)
|
||||
{
|
||||
@@ -2028,15 +2029,28 @@ namespace Barotrauma
|
||||
{
|
||||
case CharacterTeamType.Team1:
|
||||
color = new Color(0, 110, 150, 255);
|
||||
playerFrame.ToolTip = TextManager.GetWithVariable("teampreference", "[team]", TextManager.Get("teampreference.team1"));
|
||||
break;
|
||||
case CharacterTeamType.Team2:
|
||||
color = new Color(150, 110, 0, 255);
|
||||
playerFrame.ToolTip = TextManager.GetWithVariable("teampreference", "[team]", TextManager.Get("teampreference.team2"));
|
||||
break;
|
||||
default:
|
||||
playerFrame.ToolTip = TextManager.GetWithVariable("teampreference", "[team]", TextManager.Get("none"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (JobPrefab.Prefabs.ContainsKey(client.PreferredJob))
|
||||
else
|
||||
{
|
||||
color = JobPrefab.Prefabs[client.PreferredJob].UIColor;
|
||||
if (JobPrefab.Prefabs.ContainsKey(client.PreferredJob))
|
||||
{
|
||||
color = JobPrefab.Prefabs[client.PreferredJob].UIColor;
|
||||
playerFrame.ToolTip = TextManager.GetWithVariable("jobpreference", "[job]", JobPrefab.Prefabs[client.PreferredJob].Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
playerFrame.ToolTip = TextManager.GetWithVariable("jobpreference", "[job]", TextManager.Get("none"));
|
||||
}
|
||||
}
|
||||
playerFrame.Color = color * 0.4f;
|
||||
playerFrame.HoverColor = color * 0.6f;
|
||||
|
||||
@@ -24,7 +24,8 @@ namespace Barotrauma
|
||||
private GUIFrame menu;
|
||||
|
||||
private GUIListBox serverList;
|
||||
private GUIFrame serverPreview;
|
||||
private GUIFrame serverPreviewContainer;
|
||||
private GUIListBox serverPreview;
|
||||
|
||||
private GUIButton joinButton;
|
||||
private ServerInfo selectedServer;
|
||||
@@ -340,11 +341,11 @@ namespace Barotrauma
|
||||
void RecalculateHolder()
|
||||
{
|
||||
float listContainerSubtract = filtersHolder.Visible ? sidebarWidth : 0.0f;
|
||||
listContainerSubtract += serverPreview.Visible ? sidebarWidth : 0.0f;
|
||||
listContainerSubtract += serverPreviewContainer.Visible ? sidebarWidth : 0.0f;
|
||||
|
||||
float toggleButtonsSubtract = 1.1f * filterToggle.Rect.Width / serverListHolder.Rect.Width;
|
||||
listContainerSubtract += filterToggle.Visible ? toggleButtonsSubtract : 0.0f;
|
||||
listContainerSubtract += serverPreviewToggleButton.Visible ? toggleButtonsSubtract : 0.0f;
|
||||
listContainerSubtract += serverPreviewContainer.Visible ? toggleButtonsSubtract : 0.0f;
|
||||
|
||||
serverListContainer.RectTransform.RelativeSize = new Vector2(1.0f - listContainerSubtract, 1.0f);
|
||||
serverListHolder.Recalculate();
|
||||
@@ -567,17 +568,17 @@ namespace Barotrauma
|
||||
{
|
||||
joinButton.Enabled = true;
|
||||
selectedServer = serverInfo;
|
||||
if (!serverPreview.Visible)
|
||||
if (!serverPreviewContainer.Visible)
|
||||
{
|
||||
serverPreview.RectTransform.RelativeSize = new Vector2(sidebarWidth, 1.0f);
|
||||
serverPreviewContainer.RectTransform.RelativeSize = new Vector2(sidebarWidth, 1.0f);
|
||||
serverPreviewToggleButton.Visible = true;
|
||||
serverPreviewToggleButton.IgnoreLayoutGroups = false;
|
||||
serverPreview.Visible = true;
|
||||
serverPreview.IgnoreLayoutGroups = false;
|
||||
serverPreviewContainer.Visible = true;
|
||||
serverPreviewContainer.IgnoreLayoutGroups = false;
|
||||
RecalculateHolder();
|
||||
}
|
||||
serverInfo.CreatePreviewWindow(serverPreview);
|
||||
btn.Children.ForEach(c => c.SpriteEffects = serverPreview.Visible ? SpriteEffects.None : SpriteEffects.FlipHorizontally);
|
||||
serverInfo.CreatePreviewWindow(serverPreview.Content);
|
||||
btn.Children.ForEach(c => c.SpriteEffects = serverPreviewContainer.Visible ? SpriteEffects.None : SpriteEffects.FlipHorizontally);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -592,24 +593,28 @@ namespace Barotrauma
|
||||
Visible = false,
|
||||
OnClicked = (btn, userdata) =>
|
||||
{
|
||||
serverPreview.RectTransform.RelativeSize = new Vector2(0.2f, 1.0f);
|
||||
serverPreview.Visible = !serverPreview.Visible;
|
||||
serverPreview.IgnoreLayoutGroups = !serverPreview.Visible;
|
||||
serverPreviewContainer.RectTransform.RelativeSize = new Vector2(0.2f, 1.0f);
|
||||
serverPreviewContainer.Visible = !serverPreviewContainer.Visible;
|
||||
serverPreviewContainer.IgnoreLayoutGroups = !serverPreviewContainer.Visible;
|
||||
|
||||
RecalculateHolder();
|
||||
|
||||
btn.Children.ForEach(c => c.SpriteEffects = serverPreview.Visible ? SpriteEffects.None : SpriteEffects.FlipHorizontally);
|
||||
btn.Children.ForEach(c => c.SpriteEffects = serverPreviewContainer.Visible ? SpriteEffects.None : SpriteEffects.FlipHorizontally);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
serverPreview = new GUIFrame(new RectTransform(new Vector2(sidebarWidth, 1.0f), serverListHolder.RectTransform, Anchor.Center), style: null)
|
||||
serverPreviewContainer = new GUIFrame(new RectTransform(new Vector2(sidebarWidth, 1.0f), serverListHolder.RectTransform, Anchor.Center), style: null)
|
||||
{
|
||||
Color = new Color(12, 14, 15, 255) * 0.5f,
|
||||
OutlineColor = Color.Black,
|
||||
IgnoreLayoutGroups = true,
|
||||
Visible = false
|
||||
};
|
||||
serverPreview = new GUIListBox(new RectTransform(Vector2.One, serverPreviewContainer.RectTransform, Anchor.Center))
|
||||
{
|
||||
Padding = Vector4.One * 10 * GUI.Scale
|
||||
};
|
||||
|
||||
// Spacing
|
||||
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.02f), bottomRow.RectTransform), style: null);
|
||||
@@ -1697,7 +1702,7 @@ namespace Barotrauma
|
||||
UpdateFriendsList();
|
||||
|
||||
serverList.ClearChildren();
|
||||
serverPreview.ClearChildren();
|
||||
serverPreview.Content.ClearChildren();
|
||||
joinButton.Enabled = false;
|
||||
selectedServer = null;
|
||||
|
||||
|
||||
@@ -1604,7 +1604,7 @@ namespace Barotrauma
|
||||
if (string.IsNullOrEmpty(file) || !File.Exists(file)) { continue; }
|
||||
|
||||
string modFolder = Path.GetDirectoryName(itemContentPackage.Path);
|
||||
string filePathRelativeToModFolder = UpdaterUtil.GetRelativePath(file, Path.Combine(Environment.CurrentDirectory, modFolder));
|
||||
string filePathRelativeToModFolder = Path.GetRelativePath(Path.Combine(Environment.CurrentDirectory, modFolder), file);
|
||||
|
||||
//file is not inside the mod folder, we need to move it
|
||||
if (filePathRelativeToModFolder.StartsWith("..") ||
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Barotrauma.Items.Components;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
/*
|
||||
* This screen only exists because I'm going mental without access to EnC on Linux.
|
||||
* This is fucking stupid and horrible.
|
||||
* Remember to remove this crap eventually.
|
||||
* - Markus
|
||||
*/
|
||||
namespace Barotrauma
|
||||
{
|
||||
class TestScreen : EditorScreen
|
||||
{
|
||||
public override Camera Cam { get; }
|
||||
|
||||
private Item? miniMapItem;
|
||||
|
||||
private Submarine? submarine;
|
||||
private Character? dummyCharacter;
|
||||
public static Effect BlueprintEffect;
|
||||
|
||||
public TestScreen()
|
||||
{
|
||||
Cam = new Camera();
|
||||
BlueprintEffect = GameMain.GameScreen.BlueprintEffect;
|
||||
|
||||
new GUIButton(new RectTransform(new Point(256, 256), Frame.RectTransform), "Reload shader")
|
||||
{
|
||||
OnClicked = (button, o) =>
|
||||
{
|
||||
BlueprintEffect.Dispose();
|
||||
GameMain.Instance.Content.Unload();
|
||||
BlueprintEffect = GameMain.Instance.Content.Load<Effect>("Effects/blueprintshader_opengl");
|
||||
GameMain.GameScreen.BlueprintEffect = BlueprintEffect;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public override void Select()
|
||||
{
|
||||
base.Select();
|
||||
|
||||
if (dummyCharacter is { Removed: false })
|
||||
{
|
||||
dummyCharacter?.Remove();
|
||||
}
|
||||
|
||||
// ????????
|
||||
submarine = new Submarine(SubmarineInfo.SavedSubmarines.FirstOrDefault(info => info.Name.Equals("Kastrull", StringComparison.OrdinalIgnoreCase)));
|
||||
miniMapItem = new Item(ItemPrefab.Find(null, "statusmonitor"), Vector2.Zero, submarine);
|
||||
MiniMap miniMap = miniMapItem.GetComponent<MiniMap>();
|
||||
miniMap.PowerConsumption = 0;
|
||||
|
||||
dummyCharacter = Character.Create(CharacterPrefab.HumanSpeciesName, Vector2.Zero, "", id: Entity.DummyID, hasAi: false);
|
||||
dummyCharacter.Info.Name = "Galldren";
|
||||
dummyCharacter.Inventory.CreateSlots();
|
||||
|
||||
Character.Controlled = dummyCharacter;
|
||||
GameMain.World.ProcessChanges();
|
||||
}
|
||||
|
||||
public override void AddToGUIUpdateList()
|
||||
{
|
||||
Frame.AddToGUIUpdateList();
|
||||
CharacterHUD.AddToGUIUpdateList(dummyCharacter);
|
||||
dummyCharacter?.SelectedConstruction?.AddToGUIUpdateList();
|
||||
}
|
||||
|
||||
public override void Update(double deltaTime)
|
||||
{
|
||||
base.Update(deltaTime);
|
||||
|
||||
if (dummyCharacter is { } dummy && miniMapItem is { } item)
|
||||
{
|
||||
if (dummy.SelectedConstruction != item)
|
||||
{
|
||||
dummy.SelectedConstruction = item;
|
||||
}
|
||||
dummy.SelectedConstruction?.UpdateHUD(Cam, dummy, (float)deltaTime);
|
||||
Vector2 pos = FarseerPhysics.ConvertUnits.ToSimUnits(item.Position);
|
||||
foreach (Limb limb in dummy.AnimController.Limbs)
|
||||
{
|
||||
limb.body.SetTransform(pos, 0.0f);
|
||||
}
|
||||
|
||||
if (dummy.AnimController?.Collider is { } collider)
|
||||
{
|
||||
collider.SetTransform(pos, 0);
|
||||
}
|
||||
|
||||
dummy.ControlLocalPlayer((float)deltaTime, Cam, false);
|
||||
dummy.Control((float)deltaTime, Cam);
|
||||
dummy.Submarine = submarine;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
|
||||
{
|
||||
base.Draw(deltaTime, graphics, spriteBatch);
|
||||
graphics.Clear(BackgroundColor);
|
||||
|
||||
spriteBatch.Begin(SpriteSortMode.BackToFront, transformMatrix: Cam.Transform);
|
||||
miniMapItem?.Draw(spriteBatch, false);
|
||||
if (dummyCharacter is { } dummy)
|
||||
{
|
||||
dummyCharacter.DrawFront(spriteBatch, Cam);
|
||||
dummyCharacter.Draw(spriteBatch, Cam);
|
||||
}
|
||||
spriteBatch.End();
|
||||
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, samplerState: GUI.SamplerState);
|
||||
|
||||
GUI.Draw(Cam, spriteBatch);
|
||||
|
||||
dummyCharacter?.DrawHUD(spriteBatch, Cam, false);
|
||||
|
||||
spriteBatch.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user