diff --git a/FloatingSpace/CircularMenu.js b/FloatingSpace/CircularMenu.js index 93a940068..12b10a3b0 100644 --- a/FloatingSpace/CircularMenu.js +++ b/FloatingSpace/CircularMenu.js @@ -7,6 +7,7 @@ function newCircularMenu () { isDeployed: undefined, internalClick: internalClick, physics: physics, + invisiblePhysics: invisiblePhysics, drawBackground: drawBackground, drawForeground: drawForeground, getContainer: getContainer, @@ -171,6 +172,13 @@ function newCircularMenu () { } } + function invisiblePhysics () { + for (let i = 0; i < menuItems.length; i++) { + let menuItem = menuItems[i] + menuItem.invisiblePhysics() + } + } + function physics () { for (let i = 0; i < menuItems.length; i++) { let menuItem = menuItems[i] diff --git a/FloatingSpace/CircularMenuItem.js b/FloatingSpace/CircularMenuItem.js index ce0cd313e..ecebc02f7 100644 --- a/FloatingSpace/CircularMenuItem.js +++ b/FloatingSpace/CircularMenuItem.js @@ -41,6 +41,7 @@ function newCircularMenuItem () { isEnabled: true, internalClick: internalClick, physics: physics, + invisiblePhysics: invisiblePhysics, drawBackground: drawBackground, drawForeground: drawForeground, getContainer: getContainer, @@ -133,6 +134,24 @@ function newCircularMenuItem () { } } + function invisiblePhysics () { + temporaryStatusPhysics() + } + + function temporaryStatusPhysics () { + /* Temporary Status impacts on the label to use and the background of that label */ + if (temporaryStatusCounter > 0) { + temporaryStatusCounter-- + } + + if (temporaryStatusCounter === 0) { + temporaryStatus = STATUS_NO_ACTION_TAKEN_YET + labelToPrint = thisObject.label + backgroundColorToUse = defaultBackgroudColor + thisObject.nextAction = thisObject.action + } + } + function physics () { if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return } @@ -173,17 +192,7 @@ function newCircularMenuItem () { thisObject.container.frame.position.x = thisObject.container.frame.radius * radiusGrowthFactor / 7 * Math.cos(toRadians(thisObject.angle)) - thisObject.currentRadius * 1.5 thisObject.container.frame.position.y = thisObject.container.frame.radius * radiusGrowthFactor / 7 * Math.sin(toRadians(thisObject.angle)) - thisObject.container.frame.height / 2 - /* Temporary Status impacts on the label to use and the background of that label */ - if (temporaryStatusCounter > 0) { - temporaryStatusCounter-- - } - - if (temporaryStatusCounter === 0) { - temporaryStatus = STATUS_NO_ACTION_TAKEN_YET - labelToPrint = thisObject.label - backgroundColorToUse = defaultBackgroudColor - thisObject.nextAction = thisObject.action - } + temporaryStatusPhysics() /* Here we will check if we need to monitor a property that influences the status of the Menu Item. */ if (thisObject.disableIfPropertyIsDefined === true) { diff --git a/FloatingSpace/UiObject.js b/FloatingSpace/UiObject.js index 9f6999404..86c66d73c 100644 --- a/FloatingSpace/UiObject.js +++ b/FloatingSpace/UiObject.js @@ -263,6 +263,7 @@ function newUiObject () { } function invisiblePhysics () { + thisObject.menu.invisiblePhysics() childrenRunningPhysics() } @@ -1723,4 +1724,3 @@ function newUiObject () { } } } -