Allow custom CncCheckbox fonts. Tweak CncScrollbar rendering.

This commit is contained in:
Paul Chote
2011-05-14 13:44:54 +12:00
parent 665b6c2b8e
commit 76545db7fd

View File

@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Cnc.Widgets
RenderBounds.Contains(Viewport.LastMousePos) ? "button-hover" : RenderBounds.Contains(Viewport.LastMousePos) ? "button-hover" :
"button"; "button";
var font = Game.Renderer.BoldFont; var font = Game.Renderer.Fonts[Font];
var rect = RenderBounds; var rect = RenderBounds;
WidgetUtils.DrawPanel(state, new Rectangle(rect.Location, new Size(Bounds.Height, Bounds.Height))); WidgetUtils.DrawPanel(state, new Rectangle(rect.Location, new Size(Bounds.Height, Bounds.Height)));
@@ -257,11 +257,11 @@ namespace OpenRA.Mods.Cnc.Widgets
{ {
var tickRect = new Rectangle(trackOrigin - 1 + (int)(i * trackWidth * 1f / (Ticks - 1)), var tickRect = new Rectangle(trackOrigin - 1 + (int)(i * trackWidth * 1f / (Ticks - 1)),
RenderBounds.Y + RenderBounds.Height / 2, 2, RenderBounds.Height / 2); RenderBounds.Y + RenderBounds.Height / 2, 2, RenderBounds.Height / 2);
WidgetUtils.DrawPanel("button-hover", tickRect); WidgetUtils.DrawPanel("panel-gray", tickRect);
} }
// Track // Track
WidgetUtils.DrawPanel("button-pressed", trackRect); WidgetUtils.DrawPanel("panel-gray", trackRect);
// Thumb // Thumb
var state = IsDisabled() ? "button-disabled" : var state = IsDisabled() ? "button-disabled" :