From 40ab33192f71f07ba62f5848b8c142eb509531bf Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 6 Jul 2019 12:17:34 +0200 Subject: [PATCH] Improvement: Re Calculate Buttom appears only when Execution Focus is set --- CockpitSpace/RestartSimulation.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CockpitSpace/RestartSimulation.js b/CockpitSpace/RestartSimulation.js index c32947f52..3c85d0917 100644 --- a/CockpitSpace/RestartSimulation.js +++ b/CockpitSpace/RestartSimulation.js @@ -30,6 +30,8 @@ function newRestartSimulation () { let counterTillNextState = 0 let productCardsToTurnOn = [] + + let executionFocusExists = false return thisObject function finalize () { @@ -53,7 +55,7 @@ function newRestartSimulation () { } function getContainer (point, purpose) { - if (thisObject.visible !== true || thisObject.status !== 'Ready') { return } + if (thisObject.visible !== true || thisObject.status !== 'Ready' || executionFocusExists === false) { return } if (thisObject.container.frame.isThisPointHere(point, true) === true) { return thisObject.container @@ -180,6 +182,15 @@ function newRestartSimulation () { } positionPhysics() + executionFocusPhysics() + } + + function executionFocusPhysics () { + if (canvas.strategySpace.workspace.tradingSystem !== undefined) { + executionFocusExists = true + } else { + executionFocusExists = false + } } function positionPhysics () { @@ -188,7 +199,7 @@ function newRestartSimulation () { } function draw () { - if (thisObject.visible !== true) { return } + if (thisObject.visible !== true || executionFocusExists === false) { return } drawBackground() drawText() }