From b32538fa1ea3556d888c6011f8d8aebb289bfedc Mon Sep 17 00:00:00 2001 From: ZiwKerman Date: Thu, 3 Mar 2016 09:17:43 +0000 Subject: [PATCH] Fixing Revert to Hangar Bug and keys for multiple sequences --- IRSequencer/IRSequencer/Gui/SequencerGUI.cs | 2 +- .../IRSequencer/Module/ModuleSequencer.cs | 25 +++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/IRSequencer/IRSequencer/Gui/SequencerGUI.cs b/IRSequencer/IRSequencer/Gui/SequencerGUI.cs index 86a9488..c24c245 100644 --- a/IRSequencer/IRSequencer/Gui/SequencerGUI.cs +++ b/IRSequencer/IRSequencer/Gui/SequencerGUI.cs @@ -345,7 +345,7 @@ private void OnEditorShipModified(ShipConstruct ship) { var seqModule = sequencerParts[i].FindModuleImplementing(); sequencers.Add(seqModule); - seqModule.LoadData (); + seqModule.loadPending = true; } } diff --git a/IRSequencer/IRSequencer/Module/ModuleSequencer.cs b/IRSequencer/IRSequencer/Module/ModuleSequencer.cs index 66b0318..0615f34 100644 --- a/IRSequencer/IRSequencer/Module/ModuleSequencer.cs +++ b/IRSequencer/IRSequencer/Module/ModuleSequencer.cs @@ -28,7 +28,7 @@ public class ModuleSequencer : PartModule private float lastKeyPressedTime = 0f; private const float keyCooldown = 0.2f; - private bool loadPending = false; + internal bool loadPending = false; private float lastSavedUT = 0f; public SequencerState currentState; @@ -187,7 +187,7 @@ public bool TryParseState(string s, out SequencerState st) { if (s == "" || !s.Contains(":")) { - Logger.Log("TryParseSequence, invalid format s=" + s, Logger.Level.Debug); + Logger.Log("TryParseState, invalid format s=" + s, Logger.Level.Debug); st = null; return false; } @@ -403,6 +403,8 @@ protected void CheckInputs() if (sequences == null) return; + + bool keyTriggered = false; for(int i=0; i