(d404aba3e) Added background color to keybind inputs in the Controls settings layout, to help readability
This commit is contained in:
@@ -23,8 +23,6 @@ namespace Barotrauma
|
|||||||
protected float hudInfoTimer;
|
protected float hudInfoTimer;
|
||||||
protected bool hudInfoVisible;
|
protected bool hudInfoVisible;
|
||||||
|
|
||||||
private float pressureParticleTimer;
|
|
||||||
|
|
||||||
private float findFocusedTimer;
|
private float findFocusedTimer;
|
||||||
|
|
||||||
protected float lastRecvPositionUpdateTime;
|
protected float lastRecvPositionUpdateTime;
|
||||||
@@ -172,23 +170,13 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (needsAir &&
|
if (needsAir &&
|
||||||
pressureProtection < 80.0f &&
|
pressureProtection < 80.0f &&
|
||||||
(AnimController.CurrentHull == null || AnimController.CurrentHull.LethalPressure > 0.0f))
|
(AnimController.CurrentHull == null || AnimController.CurrentHull.LethalPressure > 50.0f))
|
||||||
{
|
{
|
||||||
float pressure = AnimController.CurrentHull == null ? 100.0f : AnimController.CurrentHull.LethalPressure;
|
float pressure = AnimController.CurrentHull == null ? 100.0f : AnimController.CurrentHull.LethalPressure;
|
||||||
if (pressure > 0.0f)
|
|
||||||
{
|
|
||||||
float zoomInEffectStrength = MathHelper.Clamp(pressure / 100.0f, 0.1f, 1.0f);
|
|
||||||
cam.Zoom = MathHelper.Lerp(cam.Zoom,
|
|
||||||
cam.DefaultZoom + (Math.Max(pressure, 10) / 150.0f) * Rand.Range(0.9f, 1.1f),
|
|
||||||
zoomInEffectStrength);
|
|
||||||
|
|
||||||
pressureParticleTimer += pressure * deltaTime;
|
cam.Zoom = MathHelper.Lerp(cam.Zoom,
|
||||||
if (pressureParticleTimer > 10.0f)
|
(pressure / 50.0f) * Rand.Range(1.0f, 1.05f),
|
||||||
{
|
(pressure - 50.0f) / 50.0f);
|
||||||
Particle p = GameMain.ParticleManager.CreateParticle("waterblood", WorldPosition + Rand.Vector(5.0f), Rand.Vector(10.0f));
|
|
||||||
pressureParticleTimer = 0.0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsHumanoid)
|
if (IsHumanoid)
|
||||||
|
|||||||
@@ -633,7 +633,7 @@ namespace Barotrauma
|
|||||||
var inputNames = Enum.GetValues(typeof(InputType));
|
var inputNames = Enum.GetValues(typeof(InputType));
|
||||||
for (int i = 0; i < inputNames.Length; i++)
|
for (int i = 0; i < inputNames.Length; i++)
|
||||||
{
|
{
|
||||||
var inputContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.06f), inputFrame.RectTransform)) { Stretch = true, IsHorizontal = true, RelativeSpacing = 0.05f };
|
var inputContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.06f), inputFrame.RectTransform)) { Stretch = true, IsHorizontal = true, RelativeSpacing = 0.05f, Color = Color.DarkGray * 0.25f };
|
||||||
new GUITextBlock(new RectTransform(new Vector2(0.3f, 1.0f), inputContainer.RectTransform, Anchor.TopLeft) { MinSize = new Point(150, 0) },
|
new GUITextBlock(new RectTransform(new Vector2(0.3f, 1.0f), inputContainer.RectTransform, Anchor.TopLeft) { MinSize = new Point(150, 0) },
|
||||||
TextManager.Get("InputType." + ((InputType)i)) + ": ", font: GUI.SmallFont) { ForceUpperCase = true };
|
TextManager.Get("InputType." + ((InputType)i)) + ": ", font: GUI.SmallFont) { ForceUpperCase = true };
|
||||||
var keyBox = new GUITextBox(new RectTransform(new Vector2(0.7f, 1.0f), inputContainer.RectTransform),
|
var keyBox = new GUITextBox(new RectTransform(new Vector2(0.7f, 1.0f), inputContainer.RectTransform),
|
||||||
@@ -643,6 +643,9 @@ namespace Barotrauma
|
|||||||
};
|
};
|
||||||
keyBox.OnSelected += KeyBoxSelected;
|
keyBox.OnSelected += KeyBoxSelected;
|
||||||
keyBox.SelectedColor = Color.Gold * 0.3f;
|
keyBox.SelectedColor = Color.Gold * 0.3f;
|
||||||
|
|
||||||
|
//spacing
|
||||||
|
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.005f), inputFrame.RectTransform), style: null);
|
||||||
}
|
}
|
||||||
GUITextBlock aimAssistText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.05f), controlsLayoutGroup.RectTransform), TextManager.Get("AimAssist"));
|
GUITextBlock aimAssistText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.05f), controlsLayoutGroup.RectTransform), TextManager.Get("AimAssist"));
|
||||||
GUIScrollBar aimAssistSlider = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.05f), controlsLayoutGroup.RectTransform),
|
GUIScrollBar aimAssistSlider = new GUIScrollBar(new RectTransform(new Vector2(1.0f, 0.05f), controlsLayoutGroup.RectTransform),
|
||||||
@@ -720,6 +723,25 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//spacing
|
||||||
|
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.02f), generalLayoutGroup.RectTransform), style: null);
|
||||||
|
|
||||||
|
new GUIButton(new RectTransform(new Vector2(0.4f, 1.0f), buttonArea.RectTransform, Anchor.BottomLeft),
|
||||||
|
TextManager.Get("Cancel"), style: "GUIButtonLarge")
|
||||||
|
{
|
||||||
|
IgnoreLayoutGroups = true,
|
||||||
|
OnClicked = (x, y) =>
|
||||||
|
{
|
||||||
|
if (UnsavedSettings)
|
||||||
|
{
|
||||||
|
LoadPlayerConfig();
|
||||||
|
}
|
||||||
|
if (Screen.Selected == GameMain.MainMenuScreen) GameMain.MainMenuScreen.ReturnToMainMenu(null, null);
|
||||||
|
GUI.SettingsMenuOpen = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
applyButton = new GUIButton(new RectTransform(new Vector2(0.4f, 1.0f), buttonArea.RectTransform, Anchor.BottomRight),
|
applyButton = new GUIButton(new RectTransform(new Vector2(0.4f, 1.0f), buttonArea.RectTransform, Anchor.BottomRight),
|
||||||
TextManager.Get("ApplySettingsButton"), style: "GUIButtonLarge")
|
TextManager.Get("ApplySettingsButton"), style: "GUIButtonLarge")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1913,7 +1913,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (PressureTimer >= 100.0f)
|
if (PressureTimer >= 100.0f)
|
||||||
{
|
{
|
||||||
if (Controlled == this) { cam.Zoom = 5.0f; }
|
if (Controlled == this) cam.Zoom = 5.0f;
|
||||||
if (GameMain.NetworkMember == null || !GameMain.NetworkMember.IsClient)
|
if (GameMain.NetworkMember == null || !GameMain.NetworkMember.IsClient)
|
||||||
{
|
{
|
||||||
Implode();
|
Implode();
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float CrushDepth { get; private set; }
|
public float CrushDepth { get; private set; }
|
||||||
public float PressureKillDelay { get; private set; } = 5.0f;
|
|
||||||
|
|
||||||
public float Vitality { get; private set; }
|
public float Vitality { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,6 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
private float blinkTimer;
|
private float blinkTimer;
|
||||||
|
|
||||||
private bool itemLoaded;
|
|
||||||
|
|
||||||
private float blinkTimer;
|
|
||||||
|
|
||||||
public PhysicsBody ParentBody;
|
public PhysicsBody ParentBody;
|
||||||
|
|
||||||
[Editable(MinValueFloat = 0.0f, MaxValueFloat = 2048.0f), Serialize(100.0f, true)]
|
[Editable(MinValueFloat = 0.0f, MaxValueFloat = 2048.0f), Serialize(100.0f, true)]
|
||||||
|
|||||||
@@ -1208,9 +1208,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public List<T> GetConnectedComponents<T>(bool recursive = false) where T : ItemComponent
|
public List<T> GetConnectedComponents<T>(bool recursive = false) where T : ItemComponent
|
||||||
{
|
{
|
||||||
List<T> connectedComponents = new List<T>();
|
base.FlipY(relativeToSub);
|
||||||
|
|
||||||
if (recursive)
|
if (Prefab.CanSpriteFlipY)
|
||||||
{
|
{
|
||||||
List<Item> alreadySearched = new List<Item>() { this };
|
List<Item> alreadySearched = new List<Item>() { this };
|
||||||
GetConnectedComponentsRecursive(alreadySearched, connectedComponents);
|
GetConnectedComponentsRecursive(alreadySearched, connectedComponents);
|
||||||
|
|||||||
@@ -646,6 +646,7 @@ namespace Barotrauma
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void ApplyForce(Vector2 force, float maxVelocity)
|
public void ApplyForce(Vector2 force, float maxVelocity)
|
||||||
{
|
{
|
||||||
|
if (!IsValidValue(force, "force", -1e10f, 1e10f)) return;
|
||||||
if (!IsValidValue(maxVelocity, "max velocity")) return;
|
if (!IsValidValue(maxVelocity, "max velocity")) return;
|
||||||
|
|
||||||
Vector2 velocityAddition = force / Mass * (float)Timing.Step;
|
Vector2 velocityAddition = force / Mass * (float)Timing.Step;
|
||||||
@@ -656,10 +657,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
newVelocity = newVelocity.ClampLength(maxVelocity);
|
newVelocity = newVelocity.ClampLength(maxVelocity);
|
||||||
}
|
}
|
||||||
|
body.ApplyForce((newVelocity - body.LinearVelocity) * Mass / (float)Timing.Step);
|
||||||
Vector2 clampedForce = (newVelocity - body.LinearVelocity) * Mass / (float)Timing.Step;
|
|
||||||
if (!IsValidValue(force, "clamped force", -1e10f, 1e10f)) return;
|
|
||||||
body.ApplyForce(force);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyForce(Vector2 force, Vector2 point)
|
public void ApplyForce(Vector2 force, Vector2 point)
|
||||||
|
|||||||
Reference in New Issue
Block a user