@@ -146,7 +146,7 @@ export class App extends React.Component<AppProps, AppState> {
146146 constructor ( props : any ) {
147147 super ( props ) ;
148148
149- this . version = '1.4 ' ;
149+ this . version = '1.5 ' ;
150150
151151 this . appContext = {
152152 bluetoothApiIsAvailable : FeatureDetection . bluetoothApiIsAvailable ( )
@@ -488,6 +488,21 @@ export class App extends React.Component<AppProps, AppState> {
488488 }
489489 }
490490
491+ editingIsDisabled ( ) : boolean {
492+ return ! ( this . state . runningState === 'stopped'
493+ || this . state . runningState === 'paused' ) ;
494+ }
495+
496+ refreshIsDisabled ( ) : boolean {
497+ return this . state . runningState !== 'stopped' ;
498+ }
499+
500+ // API for Interpreter
501+
502+ getRunningState ( ) : RunningState {
503+ return this . state . runningState ;
504+ }
505+
491506 setRunningState ( runningState : RunningState ) : void {
492507 this . setState ( ( state ) => {
493508 // If stop is requested when we are in the 'paused' state,
@@ -500,37 +515,14 @@ export class App extends React.Component<AppProps, AppState> {
500515 } ) ;
501516 }
502517
503- // API for Interpreter
504-
505518 getProgramSequence ( ) : ProgramSequence {
506519 return this . state . programSequence ;
507520 }
508521
509- getRunningState ( ) : RunningState {
510- return this . state . runningState ;
511- }
512-
513- editingIsDisabled ( ) : boolean {
514- return ! ( this . state . runningState === 'stopped'
515- || this . state . runningState === 'paused' ) ;
516- }
517-
518- incrementProgramCounter ( callback : ( ) = > void ) : void {
519- this. setState ( ( state ) => {
520- return {
521- programSequence : state . programSequence . incrementProgramCounter ( )
522- }
523- } , callback ) ;
524- }
525-
526- refreshIsDisabled ( ) : boolean {
527- return this . state . runningState !== 'stopped' ;
528- }
529-
530- updateProgramCounterAndLoopIterationsLeft ( programCounter : number , loopIterationsLeft : Map < string , number > , callback : ( ) = > void ) : void {
522+ advanceProgramCounter ( callback : ( ) = > void ) : void {
531523 this. setState ( ( state ) => {
532524 return {
533- programSequence : state . programSequence . updateProgramCounterAndLoopIterationsLeft ( programCounter , loopIterationsLeft )
525+ programSequence : state . programSequence . advanceProgramCounter ( false )
534526 }
535527 } , callback ) ;
536528 }
@@ -1458,6 +1450,7 @@ export class App extends React.Component<AppProps, AppState> {
14581450 world = { this . state . settings . world }
14591451 startingX = { this . state . startingX }
14601452 startingY = { this . state . startingY }
1453+ runningState = { this . state . runningState }
14611454 />
14621455 </ div >
14631456 < div className = "App__world-container" >
@@ -1557,6 +1550,9 @@ export class App extends React.Component<AppProps, AppState> {
15571550 addNodeExpandedMode = { this . state . settings . addNodeExpandedMode }
15581551 theme = { this . state . settings . theme }
15591552 world = { this . state . settings . world }
1553+ scrollRightPaddingPx = { 256 }
1554+ scrollLeftPaddingPx = { 128 }
1555+ scrollTimeThresholdMs = { 400 }
15601556 onChangeProgramSequence = { this . handleProgramSequenceChange }
15611557 onInsertSelectedActionIntoProgram = { this . handleProgramBlockEditorInsertSelectedAction }
15621558 onDeleteProgramStep = { this . handleProgramBlockEditorDeleteStep }
0 commit comments