Renamed a couple of properties for consistency & removed unnecessary CPR blood particle scaling
This commit is contained in:
@@ -394,26 +394,26 @@ namespace Barotrauma.Networking
|
||||
var traitorRatioText = new GUITextBlock(new Rectangle(20, y + 20, 20, 20), "Traitor ratio: 20 %", "", settingsTabs[1], GUI.SmallFont);
|
||||
var traitorRatioSlider = new GUIScrollBar(new Rectangle(150, y + 22, 100, 15), "", 0.1f, settingsTabs[1]);
|
||||
//Prepare the slider before the tick box
|
||||
if (traitorUseRatio)
|
||||
if (TraitorUseRatio)
|
||||
{
|
||||
traitorRatioSlider.UserData = traitorRatioText;
|
||||
traitorRatioSlider.Step = 0.01f; //Lots of fine-tuning
|
||||
traitorRatioSlider.BarScroll = (traitorRatio - 0.1f) / 0.9f;
|
||||
traitorRatioSlider.BarScroll = (TraitorRatio - 0.1f) / 0.9f;
|
||||
}
|
||||
else
|
||||
{
|
||||
traitorRatioSlider.UserData = traitorRatioText;
|
||||
traitorRatioSlider.Step = 1f / (maxPlayers-1);
|
||||
traitorRatioSlider.BarScroll = MathUtils.Round(traitorRatio, 1f);
|
||||
traitorRatioSlider.BarScroll = MathUtils.Round(TraitorRatio, 1f);
|
||||
}
|
||||
//Slider END
|
||||
|
||||
traitorRatioBox.Selected = traitorUseRatio;
|
||||
traitorRatioBox.Selected = TraitorUseRatio;
|
||||
traitorRatioBox.OnSelected = (GUITickBox) =>
|
||||
{
|
||||
traitorUseRatio = GUITickBox.Selected;
|
||||
TraitorUseRatio = GUITickBox.Selected;
|
||||
//Affect the slider graphics
|
||||
if (traitorUseRatio)
|
||||
if (TraitorUseRatio)
|
||||
{
|
||||
traitorRatioSlider.UserData = traitorRatioText;
|
||||
traitorRatioSlider.Step = 0.01f; //Lots of fine-tuning
|
||||
@@ -432,15 +432,15 @@ namespace Barotrauma.Networking
|
||||
traitorRatioSlider.OnMoved = (GUIScrollBar scrollBar, float barScroll) =>
|
||||
{
|
||||
GUITextBlock traitorText = scrollBar.UserData as GUITextBlock;
|
||||
if (traitorUseRatio)
|
||||
if (TraitorUseRatio)
|
||||
{
|
||||
traitorRatio = barScroll * 0.9f + 0.1f;
|
||||
traitorText.Text = "Traitor ratio: " + (int)MathUtils.Round(traitorRatio * 100.0f, 1.0f) + " %";
|
||||
TraitorRatio = barScroll * 0.9f + 0.1f;
|
||||
traitorText.Text = "Traitor ratio: " + (int)MathUtils.Round(TraitorRatio * 100.0f, 1.0f) + " %";
|
||||
}
|
||||
else
|
||||
{
|
||||
traitorRatio = MathUtils.Round(barScroll * (maxPlayers-1), 1f) + 1;
|
||||
traitorText.Text = "Traitor count: " + traitorRatio;
|
||||
TraitorRatio = MathUtils.Round(barScroll * (maxPlayers-1), 1f) + 1;
|
||||
traitorText.Text = "Traitor count: " + TraitorRatio;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -1001,16 +1001,10 @@ namespace Barotrauma
|
||||
target.AddDamage(CauseOfDeath.Bloodloss, 1.0f, character);
|
||||
#if CLIENT
|
||||
SoundPlayer.PlayDamageSound(DamageSoundType.LimbBlunt, 25.0f, targetTorso.body);
|
||||
float bloodParticleAmount = 4;
|
||||
float bloodParticleSize = 1.0f;
|
||||
|
||||
for (int i = 0; i < bloodParticleAmount; i++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
var blood = GameMain.ParticleManager.CreateParticle(inWater ? "waterblood" : "blood", targetTorso.WorldPosition, Rand.Vector(10.0f), 0.0f, target.AnimController.CurrentHull);
|
||||
if (blood != null)
|
||||
{
|
||||
blood.Size *= bloodParticleSize;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -221,14 +221,14 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
|
||||
[Serialize(true, true)]
|
||||
public bool traitorUseRatio
|
||||
public bool TraitorUseRatio
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
[Serialize(0.2f, true)]
|
||||
public float traitorRatio
|
||||
public float TraitorRatio
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
|
||||
Reference in New Issue
Block a user