Unstable 0.15.22.0

This commit is contained in:
Markus Isberg
2021-12-17 00:19:56 +09:00
parent 7d43cb1e91
commit a864a98d4f
16 changed files with 78 additions and 33 deletions
@@ -660,17 +660,17 @@ namespace Barotrauma
GUITickBox vsyncTickBox = new GUITickBox(new RectTransform(tickBoxScale, leftColumn.RectTransform), TextManager.Get("EnableVSync")) GUITickBox vsyncTickBox = new GUITickBox(new RectTransform(tickBoxScale, leftColumn.RectTransform), TextManager.Get("EnableVSync"))
{ {
ToolTip = TextManager.Get("EnableVSyncToolTip"), ToolTip = TextManager.Get("EnableVSyncToolTip"),
OnSelected = (GUITickBox box) =>
{
VSyncEnabled = box.Selected;
GameMain.GraphicsDeviceManager.SynchronizeWithVerticalRetrace = VSyncEnabled;
GameMain.GraphicsDeviceManager.ApplyChanges();
UnsavedSettings = true;
return true;
},
Selected = VSyncEnabled Selected = VSyncEnabled
}; };
vsyncTickBox.OnSelected = (GUITickBox box) =>
{
VSyncEnabled = box.Selected;
GameMain.GraphicsDeviceManager.SynchronizeWithVerticalRetrace = VSyncEnabled;
GameMain.GraphicsDeviceManager.ApplyChanges();
UnsavedSettings = true;
return true;
};
GUITickBox textureCompressionTickBox = new GUITickBox(new RectTransform(tickBoxScale, leftColumn.RectTransform), TextManager.Get("EnableTextureCompression")) GUITickBox textureCompressionTickBox = new GUITickBox(new RectTransform(tickBoxScale, leftColumn.RectTransform), TextManager.Get("EnableTextureCompression"))
@@ -1456,6 +1456,7 @@ namespace Barotrauma
Step = 0.01f Step = 0.01f
}; };
textScaleScrollBar.OnMoved(textScaleScrollBar, textScaleScrollBar.BarScroll); textScaleScrollBar.OnMoved(textScaleScrollBar, textScaleScrollBar.BarScroll);
textScaleDirty = false;
/// Bottom buttons ------------------------------------------------------------- /// Bottom buttons -------------------------------------------------------------
new GUIButton(new RectTransform(new Vector2(0.3f, 1.0f), buttonArea.RectTransform, Anchor.BottomLeft), new GUIButton(new RectTransform(new Vector2(0.3f, 1.0f), buttonArea.RectTransform, Anchor.BottomLeft),
@@ -710,7 +710,7 @@ namespace Barotrauma.Items.Components
if (item.CurrentHull is { } currentHull && currentHull == hull) if (item.CurrentHull is { } currentHull && currentHull == hull)
{ {
Sprite pingCircle = GUI.Style.YouAreHereCircle.Sprite; Sprite? pingCircle = GUI.Style.YouAreHereCircle?.Sprite;
if (pingCircle is null) { continue; } if (pingCircle is null) { continue; }
Vector2 charPos = item.WorldPosition; Vector2 charPos = item.WorldPosition;
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>0.15.21.0</Version> <Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
+1 -1
View File
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>0.15.21.0</Version> <Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>0.15.21.0</Version> <Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>0.15.21.0</Version> <Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
+1 -1
View File
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>0.15.21.0</Version> <Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>0.15.21.0</Version> <Version>0.15.22.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
@@ -18,7 +18,7 @@ namespace Barotrauma.Abilities
{ {
if (abilityObject is AbilitySkillGain abilitySkillGain) if (abilityObject is AbilitySkillGain abilitySkillGain)
{ {
if (ignoreAbilitySkillGain && !abilitySkillGain.GainedFromAbility) { return; } if (ignoreAbilitySkillGain && abilitySkillGain.GainedFromAbility) { return; }
Character.Info?.IncreaseSkillLevel(skillIdentifier, abilitySkillGain.Value, gainedFromAbility: true); Character.Info?.IncreaseSkillLevel(skillIdentifier, abilitySkillGain.Value, gainedFromAbility: true);
} }
else else
@@ -17,7 +17,7 @@ namespace Barotrauma.Abilities
{ {
if (abilityObject is AbilitySkillGain abilitySkillGain && abilitySkillGain.Character != Character) if (abilityObject is AbilitySkillGain abilitySkillGain && abilitySkillGain.Character != Character)
{ {
if (ignoreAbilitySkillGain && !abilitySkillGain.GainedFromAbility) { return; } if (ignoreAbilitySkillGain && abilitySkillGain.GainedFromAbility) { return; }
Character.Info?.IncreaseSkillLevel(abilitySkillGain.String, 1.0f, gainedFromAbility: true); Character.Info?.IncreaseSkillLevel(abilitySkillGain.String, 1.0f, gainedFromAbility: true);
} }
} }
@@ -2341,10 +2341,11 @@ namespace Barotrauma
} }
if (e.InnerException != null) if (e.InnerException != null)
{ {
error += "\n\nInner exception: " + e.InnerException.Message + "\n"; var innermost = e.GetInnermost();
if (e.InnerException.StackTrace != null) error += "\n\nInner exception: " + innermost.Message + "\n";
if (innermost.StackTrace != null)
{ {
error += e.InnerException.StackTrace.CleanupStackTrace(); ; error += innermost.StackTrace.CleanupStackTrace(); ;
} }
} }
} }
@@ -203,12 +203,26 @@ namespace Barotrauma
private readonly Action? onQuit; private readonly Action? onQuit;
private void OnQuit() private void OnQuit()
{ {
if (assembly != null) { onQuit?.Invoke(); } try
{
if (assembly != null) { onQuit?.Invoke(); }
}
catch (Exception e)
{
e = e.GetInnermost();
DebugConsole.AddWarning($"Failed to call GameAnalytics.OnQuit: {e.Message} {e.StackTrace}");
//If this happens then GameAnalytics is just broken,
//let's just hope that it uninitialized correctly and
//allow the game to keep running
}
} }
public void Dispose() public void Dispose()
{ {
if (loadContext is null) { return; } if (loadContext is null) { return; }
OnQuit(); OnQuit();
loadContext?.Unload(); loadContext?.Unload();
loadContext = null; loadContext = null;
@@ -280,10 +280,7 @@ namespace Barotrauma.Items.Components
{ {
foreach (Item subItem in containedItem.ContainedItems.ToList()) foreach (Item subItem in containedItem.ContainedItems.ToList())
{ {
if (subItem.Combine(spawnedItem, null)) if (subItem.Combine(spawnedItem, null)) { break; }
{
break;
}
} }
} }
else if (containedItem?.Combine(spawnedItem, null) ?? false) else if (containedItem?.Combine(spawnedItem, null) ?? false)
@@ -302,12 +299,9 @@ namespace Barotrauma.Items.Components
foreach (ItemContainer ic in targetItem.GetComponents<ItemContainer>()) foreach (ItemContainer ic in targetItem.GetComponents<ItemContainer>())
{ {
if (ic?.Inventory == null || ic.RemoveContainedItemsOnDeconstruct) { continue; } if (ic?.Inventory == null || ic.RemoveContainedItemsOnDeconstruct) { continue; }
foreach (Item containedItem in ic.Inventory.AllItemsMod) foreach (Item outputItem in ic.Inventory.AllItemsMod)
{ {
if (!outputContainer.Inventory.TryPutItem(containedItem, user: null)) tryPutInOutputSlots(outputItem);
{
containedItem.Drop(dropper: null);
}
} }
} }
inputContainer.Inventory.RemoveItem(targetItem); inputContainer.Inventory.RemoveItem(targetItem);
@@ -317,13 +311,29 @@ namespace Barotrauma.Items.Components
} }
else else
{ {
if (!outputContainer.Inventory.CanBePut(targetItem) || (Entity.Spawner?.IsInRemoveQueue(targetItem) ?? false)) if (Entity.Spawner?.IsInRemoveQueue(targetItem) ?? false)
{ {
targetItem.Drop(dropper: null); targetItem.Drop(dropper: null);
} }
else else
{ {
outputContainer.Inventory.TryPutItem(targetItem, user: null, createNetworkEvent: true); tryPutInOutputSlots(targetItem);
}
}
void tryPutInOutputSlots(Item item)
{
for (int i = 0; i < outputContainer.Capacity; i++)
{
var containedItem = outputContainer.Inventory.GetItemAt(i);
if (containedItem?.OwnInventory != null && containedItem.OwnInventory.TryPutItem(item, user: null))
{
return;
}
}
if (!outputContainer.Inventory.TryPutItem(item, user: null))
{
item.Drop(dropper: null);
} }
} }
} }
@@ -704,5 +704,12 @@ namespace Barotrauma
Point topLeft = new Point(center.X - halfSize.X, center.Y + halfSize.Y); Point topLeft = new Point(center.X - halfSize.X, center.Y + halfSize.Y);
return new Rectangle(topLeft, size); return new Rectangle(topLeft, size);
} }
public static Exception GetInnermost(this Exception e)
{
while (e.InnerException != null) { e = e.InnerException; }
return e;
}
} }
} }
Binary file not shown.
+12
View File
@@ -1,3 +1,15 @@
---------------------------------------------------------------------------------------------------------
v0.15.22.0
---------------------------------------------------------------------------------------------------------
- Fixed crashing on startup on some versions of macOS.
- Fixed GameAnalytics consent prompt going outside the window on small resolutions and/or large text sizes.
- Fixed Kastrull's drone sometimes spawning inside the sub client-side in multiplayer.
- Fixed opening the settings menu resetting the game window, which caused screen capture software to stop capturing the window.
- Fixed certain mods that don't configure the "you are here" circle sprite for the status monitors causing crashes.
- Fixed abilities that give simultaneous skill gain (minor in mechanics, once upon a time in europa, apprenticeship) not giving the extra skill points.
- Fixed deconstructor not being able to put the items into containers in the output slots.
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------
v0.15.21.0 v0.15.21.0
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------