Introduce ActorPreviewWidget.
This commit is contained in:
@@ -502,6 +502,10 @@ namespace OpenRA
|
||||
|
||||
using (new PerfSample("render_widgets"))
|
||||
{
|
||||
Game.Renderer.WorldVoxelRenderer.BeginFrame();
|
||||
Ui.PrepareRenderables();
|
||||
Game.Renderer.WorldVoxelRenderer.EndFrame();
|
||||
|
||||
Ui.Draw();
|
||||
|
||||
if (ModData != null && ModData.CursorProvider != null)
|
||||
|
||||
@@ -108,7 +108,11 @@ namespace OpenRA.Graphics
|
||||
public void BeginFrame(int2 scroll, float zoom)
|
||||
{
|
||||
Device.Clear();
|
||||
SetViewportParams(scroll, zoom);
|
||||
}
|
||||
|
||||
public void SetViewportParams(int2 scroll, float zoom)
|
||||
{
|
||||
var resolutionChanged = lastResolution != Resolution;
|
||||
if (resolutionChanged)
|
||||
{
|
||||
|
||||
@@ -72,6 +72,8 @@ namespace OpenRA.Widgets
|
||||
|
||||
public static void Tick() { Root.TickOuter(); }
|
||||
|
||||
public static void PrepareRenderables() { Root.PrepareRenderablesOuter(); }
|
||||
|
||||
public static void Draw() { Root.DrawOuter(); }
|
||||
|
||||
public static bool HandleInput(MouseInput mi)
|
||||
@@ -387,6 +389,18 @@ namespace OpenRA.Widgets
|
||||
return handled;
|
||||
}
|
||||
|
||||
public virtual void PrepareRenderables() { }
|
||||
|
||||
public virtual void PrepareRenderablesOuter()
|
||||
{
|
||||
if (IsVisible())
|
||||
{
|
||||
PrepareRenderables();
|
||||
foreach (var child in Children)
|
||||
child.PrepareRenderablesOuter();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Draw() { }
|
||||
|
||||
public virtual void DrawOuter()
|
||||
|
||||
Reference in New Issue
Block a user