Unstable 0.17.2.0

This commit is contained in:
Markus Isberg
2022-03-18 04:20:02 +09:00
parent 6d410cc1b7
commit cefac171f5
33 changed files with 214 additions and 135 deletions
@@ -243,9 +243,8 @@ namespace Barotrauma.CharacterEditor
character.AnimController.ForceSelectAnimationType = AnimationType.NotDefined;
}
public override void Deselect()
protected override void DeselectEditorSpecific()
{
base.Deselect();
SoundPlayer.OverrideMusicType = Identifier.Empty;
GameMain.SoundManager.SetCategoryGainMultiplier("waterambience", GameSettings.CurrentConfig.Audio.SoundVolume, 0);
GUI.ForceMouseOn(null);
@@ -7,6 +7,18 @@ namespace Barotrauma
public static Color BackgroundColor = GameSettings.CurrentConfig.SubEditorBackground;
public override bool IsEditor => true;
public override sealed void Deselect()
{
DeselectEditorSpecific();
//reset cheats the player might have used in the editor
GameMain.LightManager.LightingEnabled = true;
GameMain.LightManager.LosEnabled = true;
Hull.EditFire = false;
Hull.EditWater = false;
}
protected virtual void DeselectEditorSpecific() { }
public void CreateBackgroundColorPicker()
{
var msgBox = new GUIMessageBox(TextManager.Get("CharacterEditor.EditBackgroundColor"), "", new[] { TextManager.Get("Reset"), TextManager.Get("OK")}, new Vector2(0.2f, 0.175f), minSize: new Point(300, 175));
@@ -519,11 +519,6 @@ namespace Barotrauma
base.Select();
}
public override void Deselect()
{
base.Deselect();
}
public override void AddToGUIUpdateList()
{
GuiFrame.AddToGUIUpdateList();
@@ -289,9 +289,8 @@ namespace Barotrauma
UpdateLevelObjectsList();
}
public override void Deselect()
protected override void DeselectEditorSpecific()
{
base.Deselect();
pointerLightSource?.Remove();
pointerLightSource = null;
}
@@ -153,9 +153,8 @@ namespace Barotrauma
RefreshPrefabList();
}
public override void Deselect()
protected override void DeselectEditorSpecific()
{
base.Deselect();
GameMain.ParticleManager.Camera = GameMain.GameScreen.Cam;
filterBox.Text = "";
}
@@ -850,9 +850,8 @@ namespace Barotrauma
spriteList.Select(0, autoScroll: false);
}
public override void Deselect()
protected override void DeselectEditorSpecific()
{
base.Deselect();
loadedSprites.ForEach(s => s.Remove());
loadedSprites.Clear();
ResetWidgets();
@@ -22,7 +22,7 @@ namespace Barotrauma
public const int MaxStructures = 2000;
public const int MaxWalls = 500;
public const int MaxItems = 5000;
public const int MaxLights = 300;
public const int MaxLights = 600;
public const int MaxShadowCastingLights = 60;
private static Submarine MainSub
@@ -852,7 +852,7 @@ namespace Barotrauma
lightCount += item.GetComponents<LightComponent>().Count();
}
lightCountText.TextColor = lightCount > MaxLights ? GUIStyle.Red : Color.Lerp(GUIStyle.Green, GUIStyle.Orange, lightCount / (float)MaxLights);
return lightCount.ToString();
return lightCount.ToString() + "/" + MaxLights;
};
var shadowCastingLightCountLabel = new GUITextBlock(new RectTransform(new Vector2(0.75f, 0.0f), paddedEntityCountPanel.RectTransform), TextManager.Get("SubEditorShadowCastingLights"),
textAlignment: Alignment.CenterLeft, font: GUIStyle.SmallFont, wrap: true);
@@ -863,10 +863,10 @@ namespace Barotrauma
foreach (Item item in Item.ItemList)
{
if (item.ParentInventory != null) { continue; }
lightCount += item.GetComponents<LightComponent>().Count(l => l.CastShadows);
lightCount += item.GetComponents<LightComponent>().Count(l => l.CastShadows && !l.DrawBehindSubs);
}
shadowCastingLightCountText.TextColor = lightCount > MaxShadowCastingLights ? GUIStyle.Red : Color.Lerp(GUIStyle.Green, GUIStyle.Orange, lightCount / (float)MaxShadowCastingLights);
return lightCount.ToString();
return lightCount.ToString() + "/" + MaxShadowCastingLights;
};
entityCountPanel.RectTransform.NonScaledSize =
new Point(
@@ -1508,10 +1508,8 @@ namespace Barotrauma
yield return CoroutineStatus.Success;
}
public override void Deselect()
protected override void DeselectEditorSpecific()
{
base.Deselect();
CloseItem();
autoSaveLabel?.Parent?.RemoveChild(autoSaveLabel);