Clamp, scroll, scrollspeed, sliders

Reduced clamp duplication
Fixed scrolling speed issue
Modified scrollspeed slider to use a range
Fixed scrollspeed, volume, and sound sliders not showing current setting.
This commit is contained in:
Caleb Anderson
2010-10-06 02:37:20 -05:00
committed by Chris Forbes
parent ab431fe9ee
commit c85503811c
7 changed files with 21 additions and 31 deletions

View File

@@ -67,15 +67,5 @@ namespace OpenRA
Log.Write("perf", text, x, dt * 1000, Game.LocalTick);
});
}
public static T Clamp<T>(this T val, T min, T max) where T : IComparable<T>
{
if (val.CompareTo(min) < 0)
return min;
else if (val.CompareTo(max) > 0)
return max;
else
return val;
}
}
}