(33ab1e038) Add buttons for resetting the settings to the defaults and setting the default keybindings. TODO: pressing the buttons should refresh the settings frame instead of closing it.

This commit is contained in:
Joonas Rikkonen
2019-04-04 11:10:14 +03:00
parent 371bcb11c1
commit b08a31a68f
63 changed files with 1069 additions and 668 deletions
@@ -568,7 +568,7 @@ namespace Barotrauma
public void Extinguish(float deltaTime, float amount, Vector2 position)
{
for (int i = FireSources.Count - 1; i >= 0; i--)
for (int i = FireSources.Count - 1; i >= 0; i-- )
{
FireSources[i].Extinguish(deltaTime, amount, position);
}
@@ -38,9 +38,6 @@ namespace Barotrauma
SerializableProperty.DeserializeProperties(this, configElement);
name = TextManager.Get("EntityName." + identifier, returnNull: true) ?? name;
Description = TextManager.Get("EntityDescription." + identifier, returnNull: true) ?? Description;
int minX = int.MaxValue, minY = int.MaxValue;
int maxX = int.MinValue, maxY = int.MinValue;
DisplayEntities = new List<Pair<MapEntityPrefab, Rectangle>>();
@@ -331,13 +331,13 @@ namespace Barotrauma
switch (subElement.Name.ToString().ToLowerInvariant())
{
case "sprite":
Sprite = new Sprite(subElement, lazyLoad: true);
Sprite = new Sprite(subElement);
break;
case "specularsprite":
SpecularSprite = new Sprite(subElement, lazyLoad: true);
SpecularSprite = new Sprite(subElement);
break;
case "deformablesprite":
DeformableSprite = new DeformableSprite(subElement, lazyLoad: true);
DeformableSprite = new DeformableSprite(subElement);
break;
case "overridecommonness":
string levelType = subElement.GetAttributeString("leveltype", "");
@@ -543,19 +543,19 @@ namespace Barotrauma
if (ForceVelocityLimit < 1000.0f)
body.ApplyForce(Force * currentForceFluctuation * distFactor, ForceVelocityLimit);
else
body.ApplyForce(Force * currentForceFluctuation * distFactor, maxVelocity: NetConfig.MaxPhysicsBodyVelocity);
body.ApplyForce(Force * currentForceFluctuation * distFactor);
break;
case TriggerForceMode.Acceleration:
if (ForceVelocityLimit < 1000.0f)
body.ApplyForce(Force * body.Mass * currentForceFluctuation * distFactor, ForceVelocityLimit);
else
body.ApplyForce(Force * body.Mass * currentForceFluctuation * distFactor, maxVelocity: NetConfig.MaxPhysicsBodyVelocity);
body.ApplyForce(Force * body.Mass * currentForceFluctuation * distFactor);
break;
case TriggerForceMode.Impulse:
if (ForceVelocityLimit < 1000.0f)
body.ApplyLinearImpulse(Force * currentForceFluctuation * distFactor, maxVelocity: ForceVelocityLimit);
body.ApplyLinearImpulse(Force * currentForceFluctuation * distFactor, ForceVelocityLimit);
else
body.ApplyLinearImpulse(Force * currentForceFluctuation * distFactor, maxVelocity: NetConfig.MaxPhysicsBodyVelocity);
body.ApplyLinearImpulse(Force * currentForceFluctuation * distFactor);
break;
case TriggerForceMode.LimitVelocity:
float maxVel = ForceVelocityLimit * currentForceFluctuation * distFactor;
@@ -563,8 +563,7 @@ namespace Barotrauma
{
body.ApplyForce(
Vector2.Normalize(-body.LinearVelocity) *
Force.Length() * body.Mass * currentForceFluctuation * distFactor,
maxVelocity: NetConfig.MaxPhysicsBodyVelocity);
Force.Length() * body.Mass * currentForceFluctuation * distFactor);
}
break;
}
@@ -126,7 +126,7 @@ namespace Barotrauma
CanChangeTo.Add(new LocationTypeChange(Identifier, subElement));
break;
case "portrait":
var portrait = new Sprite(subElement, lazyLoad: true);
var portrait = new Sprite(subElement);
if (portrait != null)
{
portraits.Add(portrait);
@@ -276,10 +276,9 @@ namespace Barotrauma
}
StairDirection = Prefab.StairDirection;
SerializableProperties = SerializableProperty.GetProperties(this);
InitProjSpecific();
if (Prefab.Body)
{
Bodies = new List<Body>();
@@ -308,8 +307,6 @@ namespace Barotrauma
InsertToList();
}
partial void InitProjSpecific();
public override string ToString()
{
return Name;