File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ public CustomAxis(string name) : base(name)
8484 GlobalScope = false ;
8585 Running = false ;
8686 editor = new UI . CustomAxisEditor ( this ) ;
87+
88+ Game . OnSimulationToggle += ( bool value ) => { if ( ! value ) { Stop ( ) ; } } ;
8789 }
8890
8991 /// <summary>
@@ -108,9 +110,8 @@ protected override void Update()
108110 {
109111 if ( ! PythonEnvironment . Loaded ) return ;
110112 if ( ! Running && initialised )
111- { // Stops running if not initialised
112- initialised = false ;
113- Running = false ;
113+ {
114+ Stop ( ) ;
114115 }
115116 if ( ! Running ) return ;
116117 if ( initialised )
@@ -137,8 +138,7 @@ protected override void Update()
137138 { // On raised exception, it displays it and stops execution.
138139 if ( e . InnerException != null ) e = e . InnerException ;
139140 Error = PythonEnvironment . FormatException ( e ) ;
140- Running = false ;
141- initialised = false ;
141+ Stop ( ) ;
142142 }
143143 }
144144 else
@@ -193,6 +193,12 @@ protected override void Initialise()
193193 initialised = true ;
194194 }
195195
196+ private void Stop ( )
197+ {
198+ Running = false ;
199+ initialised = false ;
200+ }
201+
196202 /// <summary>
197203 /// Goes through all global names in scope and checks if they represent an InputAxis object.
198204 /// </summary>
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public override Version Version
2929 }
3030
3131 public override string VersionExtra { get ; } = "" ;
32- public override string BesiegeVersion { get ; } = "v0.32 " ;
32+ public override string BesiegeVersion { get ; } = "v0.35 " ;
3333 public override bool CanBeUnloaded { get ; } = true ;
3434 public override bool Preload { get ; } = false ;
3535#pragma warning restore CS1591
You can’t perform that action at this time.
0 commit comments