(e42047dc1) Tester's build, January 30th 2020
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Barotrauma
|
||||
@@ -14,41 +15,43 @@ namespace Barotrauma
|
||||
CreateLabeledTickBox(parent, "ResetKarmaBetweenRounds");
|
||||
}
|
||||
|
||||
CreateLabeledSlider(parent, 0.0f, 40.0f, 1.0f, "KickBanThreshold");
|
||||
CreateLabeledSlider(parent, 0.0f, 40.0f, 1.0f, nameof(KickBanThreshold));
|
||||
if (TextManager.ContainsTag("Karma.KicksBeforeBan"))
|
||||
{
|
||||
CreateLabeledNumberInput(parent, 0, 10, "KicksBeforeBan");
|
||||
CreateLabeledNumberInput(parent, 0, 10, nameof(KicksBeforeBan));
|
||||
}
|
||||
CreateLabeledSlider(parent, 0.0f, 50.0f, 1.0f, "HerpesThreshold");
|
||||
CreateLabeledSlider(parent, 0.0f, 50.0f, 1.0f, nameof(HerpesThreshold));
|
||||
|
||||
CreateLabeledSlider(parent, 0.0f, 0.5f, 0.01f, "KarmaDecay");
|
||||
CreateLabeledSlider(parent, 50.0f, 100.0f, 1.0f, "KarmaDecayThreshold");
|
||||
CreateLabeledSlider(parent, 0.0f, 0.5f, 0.01f, "KarmaIncrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 50.0f, 1.0f, "KarmaIncreaseThreshold");
|
||||
CreateLabeledSlider(parent, 0.0f, 0.5f, 0.01f, nameof(KarmaDecay));
|
||||
CreateLabeledSlider(parent, 50.0f, 100.0f, 1.0f, nameof(KarmaDecayThreshold));
|
||||
CreateLabeledSlider(parent, 0.0f, 0.5f, 0.01f, nameof(KarmaIncrease));
|
||||
CreateLabeledSlider(parent, 0.0f, 50.0f, 1.0f, nameof(KarmaIncreaseThreshold));
|
||||
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.12f), parent.RectTransform), TextManager.Get("Karma.PositiveActions"), textAlignment: Alignment.Center)
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.12f), parent.RectTransform), TextManager.Get("Karma.PositiveActions"),
|
||||
textAlignment: Alignment.Center, font: GUI.SubHeadingFont)
|
||||
{
|
||||
CanBeFocused = false
|
||||
};
|
||||
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, "StructureRepairKarmaIncrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, "HealFriendlyKarmaIncrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, "DamageEnemyKarmaIncrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, "ItemRepairKarmaIncrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 10.0f, 0.05f, "ExtinguishFireKarmaIncrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, nameof(StructureRepairKarmaIncrease));
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, nameof(HealFriendlyKarmaIncrease));
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, nameof(DamageEnemyKarmaIncrease));
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, nameof(ItemRepairKarmaIncrease));
|
||||
CreateLabeledSlider(parent, 0.0f, 10.0f, 0.05f, nameof(ExtinguishFireKarmaIncrease));
|
||||
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.12f), parent.RectTransform), TextManager.Get("Karma.NegativeActions"), textAlignment: Alignment.Center)
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.12f), parent.RectTransform), TextManager.Get("Karma.NegativeActions"),
|
||||
textAlignment: Alignment.Center, font: GUI.SubHeadingFont)
|
||||
{
|
||||
CanBeFocused = false
|
||||
};
|
||||
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, "StructureDamageKarmaDecrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, "DamageFriendlyKarmaDecrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 100.0f, 1.0f, "ReactorMeltdownKarmaDecrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 10.0f, 0.05f, "ReactorOverheatKarmaDecrease");
|
||||
CreateLabeledNumberInput(parent, 0, 20, "AllowedWireDisconnectionsPerMinute");
|
||||
CreateLabeledSlider(parent, 0.0f, 20.0f, 0.5f, "WireDisconnectionKarmaDecrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 30.0f, 1.0f, "SpamFilterKarmaDecrease");
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, nameof(StructureDamageKarmaDecrease));
|
||||
CreateLabeledSlider(parent, 0.0f, 1.0f, 0.01f, nameof(DamageFriendlyKarmaDecrease));
|
||||
CreateLabeledSlider(parent, 0.0f, 100.0f, 1.0f, nameof(ReactorMeltdownKarmaDecrease));
|
||||
CreateLabeledSlider(parent, 0.0f, 10.0f, 0.05f, nameof(ReactorOverheatKarmaDecrease));
|
||||
CreateLabeledNumberInput(parent, 0, 20, nameof(AllowedWireDisconnectionsPerMinute));
|
||||
CreateLabeledSlider(parent, 0.0f, 20.0f, 0.5f, nameof(WireDisconnectionKarmaDecrease));
|
||||
CreateLabeledSlider(parent, 0.0f, 30.0f, 1.0f, nameof(SpamFilterKarmaDecrease));
|
||||
}
|
||||
|
||||
private void CreateLabeledSlider(GUIComponent parent, float min, float max, float step, string propertyName)
|
||||
@@ -61,13 +64,13 @@ namespace Barotrauma
|
||||
};
|
||||
|
||||
string labelText = TextManager.Get("Karma." + propertyName);
|
||||
var label = new GUITextBlock(new RectTransform(new Vector2(0.7f, 0.8f), container.RectTransform),
|
||||
labelText, font: GUI.SmallFont)
|
||||
var label = new GUITextBlock(new RectTransform(new Vector2(0.7f, 1.0f), container.RectTransform),
|
||||
labelText, textAlignment: Alignment.CenterLeft, font: GUI.SmallFont)
|
||||
{
|
||||
ToolTip = TextManager.Get("Karma." + propertyName + "ToolTip")
|
||||
};
|
||||
|
||||
var slider = new GUIScrollBar(new RectTransform(new Vector2(0.3f, 0.8f), container.RectTransform), barSize: 0.1f)
|
||||
var slider = new GUIScrollBar(new RectTransform(new Vector2(0.3f, 1.0f), container.RectTransform), barSize: 0.1f, style: "GUISlider")
|
||||
{
|
||||
Step = step <= 0.0f ? 0.0f : step / (max - min),
|
||||
Range = new Vector2(min, max),
|
||||
@@ -80,6 +83,7 @@ namespace Barotrauma
|
||||
return true;
|
||||
}
|
||||
};
|
||||
container.RectTransform.MinSize = new Point(0, container.RectTransform.Children.Max(c => c.MinSize.Y));
|
||||
GameMain.NetworkMember.ServerSettings.AssignGUIComponent(propertyName, slider);
|
||||
slider.OnMoved(slider, slider.BarScroll);
|
||||
}
|
||||
@@ -94,16 +98,18 @@ namespace Barotrauma
|
||||
};
|
||||
|
||||
string labelText = TextManager.Get("Karma." + propertyName);
|
||||
new GUITextBlock(new RectTransform(new Vector2(0.7f, 0.8f), container.RectTransform), labelText, font: GUI.SmallFont)
|
||||
new GUITextBlock(new RectTransform(new Vector2(0.7f, 1.0f), container.RectTransform), labelText, textAlignment: Alignment.CenterLeft, font: GUI.SmallFont)
|
||||
{
|
||||
ToolTip = TextManager.Get("Karma." + propertyName + "ToolTip")
|
||||
};
|
||||
|
||||
var numInput = new GUINumberInput(new RectTransform(new Vector2(0.3f, 0.8f), container.RectTransform), GUINumberInput.NumberType.Int)
|
||||
var numInput = new GUINumberInput(new RectTransform(new Vector2(0.3f, 1.0f), container.RectTransform), GUINumberInput.NumberType.Int)
|
||||
{
|
||||
MinValueInt = min,
|
||||
MaxValueInt = max
|
||||
};
|
||||
|
||||
container.RectTransform.MinSize = new Point(0, container.RectTransform.Children.Max(c => c.MinSize.Y));
|
||||
GameMain.NetworkMember.ServerSettings.AssignGUIComponent(propertyName, numInput);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user