Add a text field next to the map editor actor initializer sliders.

This commit is contained in:
Niklas Holma
2020-09-27 18:49:17 +01:00
committed by abcdefg30
parent b5613acad8
commit 8596ce00cc
4 changed files with 33 additions and 5 deletions

View File

@@ -48,10 +48,12 @@ namespace OpenRA.Mods.Common.Widgets
GetValue = other.GetValue;
}
void UpdateValue(float newValue)
public void UpdateValue(float newValue)
{
var oldValue = Value;
Value = newValue.Clamp(MinimumValue, MaximumValue);
OnChange(Value);
if (oldValue != Value)
OnChange(Value);
}
public override bool HandleMouseInput(MouseInput mi)
@@ -114,7 +116,7 @@ namespace OpenRA.Mods.Common.Widgets
if (!IsVisible())
return;
Value = GetValue();
UpdateValue(GetValue());
var tr = ThumbRect;
var rb = RenderBounds;