Merge remote-tracking branch 'upstream/master' into develop

This commit is contained in:
EvilFactory
2024-04-26 12:31:21 -03:00
16 changed files with 97 additions and 50 deletions

View File

@@ -2331,6 +2331,29 @@ namespace Barotrauma
}
}));
commands.Add(new Command("converttowreck", "", (string[] args) =>
{
if (Screen.Selected is not SubEditorScreen)
{
ThrowError("The command can only be used in the submarine editor.");
return;
}
if (Submarine.MainSub == null)
{
ThrowError("Load a submarine first to convert it to a wreck.");
return;
}
if (Submarine.MainSub.Info.SubmarineElement == null)
{
ThrowError("The submarine must be saved before you can convert it to a wreck.");
return;
}
var wreckedSubmarineInfo = new SubmarineInfo(filePath: string.Empty, element: WreckConverter.ConvertToWreck(Submarine.MainSub.Info.SubmarineElement));
wreckedSubmarineInfo.Name += "_Wrecked";
wreckedSubmarineInfo.Type = SubmarineType.Wreck;
GameMain.SubEditorScreen.LoadSub(wreckedSubmarineInfo);
}));
#if DEBUG
commands.Add(new Command("listspamfilters", "Lists filters that are in the global spam filter.", (string[] args) =>
{
@@ -2444,29 +2467,6 @@ namespace Barotrauma
}
}));
commands.Add(new Command("converttowreck", "", (string[] args) =>
{
if (Screen.Selected is not SubEditorScreen)
{
ThrowError("The command can only be used in the submarine editor.");
return;
}
if (Submarine.MainSub == null)
{
ThrowError("Load a submarine first to convert it to a wreck.");
return;
}
if (Submarine.MainSub.Info.SubmarineElement == null)
{
ThrowError("The submarine must be saved before you can convert it to a wreck.");
return;
}
var wreckedSubmarineInfo = new SubmarineInfo(filePath: string.Empty, element: WreckConverter.ConvertToWreck(Submarine.MainSub.Info.SubmarineElement));
wreckedSubmarineInfo.Name += "_Wrecked";
wreckedSubmarineInfo.Type = SubmarineType.Wreck;
GameMain.SubEditorScreen.LoadSub(wreckedSubmarineInfo);
}));
commands.Add(new Command("camerasettings", "camerasettings [defaultzoom] [zoomsmoothness] [movesmoothness] [minzoom] [maxzoom]: debug command for testing camera settings. The values default to 1.1, 8.0, 8.0, 0.1 and 2.0.", (string[] args) =>
{
float defaultZoom = Screen.Selected.Cam.DefaultZoom;