mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Update targets on an undo
This commit is contained in:
parent
36732ed4d4
commit
c0d20f847d
@ -250,6 +250,7 @@ namespace ConformalDecals {
|
|||||||
if (HighLogic.LoadedSceneIsEditor) {
|
if (HighLogic.LoadedSceneIsEditor) {
|
||||||
GameEvents.onEditorPartEvent.Add(OnEditorEvent);
|
GameEvents.onEditorPartEvent.Add(OnEditorEvent);
|
||||||
GameEvents.onVariantApplied.Add(OnVariantApplied);
|
GameEvents.onVariantApplied.Add(OnVariantApplied);
|
||||||
|
GameEvents.onEditorUndo.Add(OnEditorUndo);
|
||||||
|
|
||||||
UpdateTweakables();
|
UpdateTweakables();
|
||||||
}
|
}
|
||||||
@ -287,6 +288,7 @@ namespace ConformalDecals {
|
|||||||
if (HighLogic.LoadedSceneIsEditor) {
|
if (HighLogic.LoadedSceneIsEditor) {
|
||||||
GameEvents.onEditorPartEvent.Remove(OnEditorEvent);
|
GameEvents.onEditorPartEvent.Remove(OnEditorEvent);
|
||||||
GameEvents.onVariantApplied.Remove(OnVariantApplied);
|
GameEvents.onVariantApplied.Remove(OnVariantApplied);
|
||||||
|
GameEvents.onEditorUndo.Remove(OnEditorUndo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HighLogic.LoadedSceneIsFlight) {
|
if (HighLogic.LoadedSceneIsFlight) {
|
||||||
@ -350,6 +352,10 @@ namespace ConformalDecals {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void OnEditorUndo(ShipConstruct sc) {
|
||||||
|
UpdateTargets();
|
||||||
|
}
|
||||||
|
|
||||||
protected void OnPartWillDie(Part willDie) {
|
protected void OnPartWillDie(Part willDie) {
|
||||||
if (willDie == part.parent) {
|
if (willDie == part.parent) {
|
||||||
this.Log("Parent part about to be destroyed! Killing decal part.");
|
this.Log("Parent part about to be destroyed! Killing decal part.");
|
||||||
|
Loading…
Reference in New Issue
Block a user