Misc improvements
This commit is contained in:
@@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
public bool HandleMouseInput(MouseInput mi)
|
||||
{
|
||||
// Exclusively uses left and right mouse buttons, but nothing else
|
||||
// Exclusively uses left and right mouse buttons, but nothing else.
|
||||
if (mi.Button != MouseButton.Left && mi.Button != MouseButton.Right)
|
||||
return false;
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
{
|
||||
this.editorLayer = editorLayer;
|
||||
|
||||
// Take an immutable copy of the reference
|
||||
// Take an immutable copy of the reference.
|
||||
this.actor = actor.Clone();
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
paintTiles.TrimExcess();
|
||||
}
|
||||
|
||||
public void Do()
|
||||
|
||||
@@ -130,6 +130,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
cellResources.TrimExcess();
|
||||
}
|
||||
|
||||
public void Do()
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Terrain;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
@@ -49,7 +48,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
terrainRenderer = world.WorldActor.Trait<ITiledTerrainRenderer>();
|
||||
|
||||
Template = id;
|
||||
TerrainTemplate = terrainInfo.Templates.First(t => t.Value.Id == id).Value;
|
||||
TerrainTemplate = terrainInfo.Templates[Template];
|
||||
cell = wr.Viewport.ViewToWorld(wr.Viewport.WorldToViewPx(Viewport.LastMousePos));
|
||||
UpdatePreview();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user