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

@@ -144,14 +144,18 @@ namespace OpenRA.Widgets
// Modified to use the ViewportEdgeScrollStep setting - Gecko
if (Keyboard.Includes(ScrollDirection.Up) || Edge.Includes(ScrollDirection.Up))
scroll += new float2(0, -(Game.Settings.Game.ViewportEdgeScrollStep * 100));
scroll += new float2(0, -1);
if (Keyboard.Includes(ScrollDirection.Right) || Edge.Includes(ScrollDirection.Right))
scroll += new float2((Game.Settings.Game.ViewportEdgeScrollStep * 100), 0);
scroll += new float2(1, 0);
if (Keyboard.Includes(ScrollDirection.Down) || Edge.Includes(ScrollDirection.Down))
scroll += new float2(0, (Game.Settings.Game.ViewportEdgeScrollStep * 100));
scroll += new float2(0, 1);
if (Keyboard.Includes(ScrollDirection.Left) || Edge.Includes(ScrollDirection.Left))
scroll += new float2(-(Game.Settings.Game.ViewportEdgeScrollStep * 100), 0);
scroll += new float2(-1, 0);
float length = scroll.Length;
scroll.X = (scroll.X / length) * Game.Settings.Game.ViewportEdgeScrollStep;
scroll.Y = (scroll.Y / length) * Game.Settings.Game.ViewportEdgeScrollStep;
Game.viewport.Scroll(scroll);
}
}