Progress:

- Input fields for vectors & colors in SerializableEntityEditor.
- SerializableProperty tooltips.
- GUINumberInput supports floats.
- EditingHUD for structures (atm the only editable property is the color of the sprite)
This commit is contained in:
Joonas Rikkonen
2017-11-12 20:24:11 +02:00
parent 8e556f1c76
commit f7298c241e
15 changed files with 514 additions and 130 deletions
@@ -267,18 +267,20 @@ namespace Barotrauma.Networking
int cargoVal = 0;
extraCargo.TryGetValue(pf.Name, out cargoVal);
var amountInput = new GUINumberInput(new Rectangle(160, 0, 50, 20), "", 0, 100, textBlock);
amountInput.Value = cargoVal;
var amountInput = new GUINumberInput(new Rectangle(160, 0, 50, 20), "", GUINumberInput.NumberType.Int, textBlock);
amountInput.MinValueInt = 0;
amountInput.MaxValueInt = 100;
amountInput.IntValue = cargoVal;
amountInput.OnValueChanged += (numberInput, value) =>
amountInput.OnValueChanged += (numberInput) =>
{
if (extraCargo.ContainsKey(pf.Name))
{
extraCargo[pf.Name] = value;
extraCargo[pf.Name] = numberInput.IntValue;
}
else
{
extraCargo.Add(pf.Name, value);
extraCargo.Add(pf.Name, numberInput.IntValue);
}
};
}
@@ -182,10 +182,14 @@ namespace Barotrauma.Networking
};
new GUITextBlock(new Rectangle(0, 0, 30, 20), "Days:", "", Alignment.TopLeft, Alignment.CenterLeft, durationContainer);
durationInputDays = new GUINumberInput(new Rectangle(40, 0, 50, 20), "", 0, 1000, durationContainer);
durationInputDays = new GUINumberInput(new Rectangle(40, 0, 50, 20), "", GUINumberInput.NumberType.Int, durationContainer);
durationInputDays.MinValueInt = 0;
durationInputDays.MaxValueFloat = 1000;
new GUITextBlock(new Rectangle(100, 0, 30, 20), "Hours:", "", Alignment.TopLeft, Alignment.CenterLeft, durationContainer);
durationInputHours = new GUINumberInput(new Rectangle(150, 0, 50, 20), "", 0, 24, durationContainer);
durationInputHours = new GUINumberInput(new Rectangle(150, 0, 50, 20), "", GUINumberInput.NumberType.Int, durationContainer);
durationInputDays.MinValueInt = 0;
durationInputDays.MaxValueFloat = 24;
}
banReasonPrompt.Buttons[0].OnClicked += (btn, userData) =>
@@ -194,7 +198,7 @@ namespace Barotrauma.Networking
{
if (!permaBanTickBox.Selected)
{
TimeSpan banDuration = new TimeSpan(durationInputDays.Value, durationInputHours.Value, 0, 0);
TimeSpan banDuration = new TimeSpan(durationInputDays.IntValue, durationInputHours.IntValue, 0, 0);
BanPlayer(clientName, banReasonBox.Text, ban, banDuration);
}
else