Add INotifyEditorPlacementInfo interface.
This allows TraitInfos to act when the actor preview is placed in the editor, returning arbitrary data which the editor stores and gives back if the preview is removed.
This commit is contained in:
@@ -140,6 +140,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
foreach (var cell in footprint)
|
||||
AddPreviewLocation(preview, cell);
|
||||
|
||||
preview.AddedToEditor();
|
||||
|
||||
if (!initialSetup)
|
||||
{
|
||||
UpdateNeighbours(preview.Footprint);
|
||||
@@ -171,6 +173,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
cellMap.Remove(cell);
|
||||
}
|
||||
|
||||
preview.RemovedFromEditor();
|
||||
UpdateNeighbours(preview.Footprint);
|
||||
|
||||
if (preview.Info.Name == "mpspawn")
|
||||
|
||||
Reference in New Issue
Block a user