Fixed Field outline not disappearing when switching tools
This commit is contained in:
@@ -19,6 +19,7 @@ public partial class InteractionArea2D : Node2D
|
||||
[Export] private int _id = -1; // TODO: remove
|
||||
|
||||
private Material[] _backupMaterials;
|
||||
private bool _initializationComplete;
|
||||
|
||||
[Signal] public delegate void InteractedToolEventHandler(int id); // TODO: remove
|
||||
|
||||
@@ -33,6 +34,8 @@ public partial class InteractionArea2D : Node2D
|
||||
Visible = value;
|
||||
_selectionChangeListener.ProcessMode = value ? ProcessModeEnum.Inherit : ProcessModeEnum.Disabled;
|
||||
_active = value;
|
||||
if(!_active && _initializationComplete)
|
||||
ResetHighlight();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +51,7 @@ public partial class InteractionArea2D : Node2D
|
||||
if (_useOutline)
|
||||
{
|
||||
_backupMaterials = _spritesToOutline.Select(s => s.Material).ToArray();
|
||||
_initializationComplete = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user