From ac8d5a957617f39d199a2244329cfc2b76bfe8fa Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 28 May 2019 19:39:47 +0200 Subject: [PATCH] Freeze Icon at all menues --- FloatingSpace/FloatingObject.js | 16 ++ FloatingSpace/StrategyPartConstructor.js | 252 +++++++++++++++++++++++ 2 files changed, 268 insertions(+) diff --git a/FloatingSpace/FloatingObject.js b/FloatingSpace/FloatingObject.js index b12632173..906770233 100644 --- a/FloatingSpace/FloatingObject.js +++ b/FloatingSpace/FloatingObject.js @@ -21,10 +21,13 @@ function newFloatingObject () { rawRadius: 0, // This is the radius of this floating object without zoom. targetRadius: 0, // This is the target radius of the floating object with zoom applied. It should be animated until reaching this value. isPinned: false, + isFrozen: false, getPinStatus: getPinStatus, + getFreezeStatus: getFreezeStatus, nearbyFloatingObjects: [], setPosition: setPosition, pinToggle: pinToggle, + freezeToggle: freezeToggle, physics: physics, initializeMass: initializeMass, initializeRadius: initializeRadius, @@ -116,6 +119,19 @@ function newFloatingObject () { return thisObject.isPinned } + function getFreezeStatus () { + return thisObject.isFrozen + } + + function freezeToggle () { + if (thisObject.isFrozen !== true) { + thisObject.isFrozen = true + } else { + thisObject.isFrozen = false + } + return thisObject.isFrozen + } + function physics () { thisObjectPhysics() thisObject.payload.uiObject.physics() diff --git a/FloatingSpace/StrategyPartConstructor.js b/FloatingSpace/StrategyPartConstructor.js index 2059943ed..a0cba8a10 100644 --- a/FloatingSpace/StrategyPartConstructor.js +++ b/FloatingSpace/StrategyPartConstructor.js @@ -90,6 +90,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Run Trading System', actionFunction: payload.uiObject.run, @@ -172,6 +186,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Missing Stages', actionFunction: payload.onMenuItemClick, @@ -226,6 +254,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Missing Events', actionFunction: payload.onMenuItemClick, @@ -280,6 +322,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Initial Definition', actionFunction: payload.onMenuItemClick, @@ -334,6 +390,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Missing Items', actionFunction: payload.onMenuItemClick, @@ -388,6 +458,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Delete Close Stage', actionFunction: payload.onMenuItemClick, @@ -430,6 +514,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Situation', actionFunction: payload.onMenuItemClick, @@ -485,6 +583,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Situation', actionFunction: payload.onMenuItemClick, @@ -540,6 +652,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Situation', actionFunction: payload.onMenuItemClick, @@ -595,6 +721,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Delete Initial Definition', actionFunction: payload.onMenuItemClick, @@ -637,6 +777,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Phase', actionFunction: payload.onMenuItemClick, @@ -692,6 +846,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Phase', actionFunction: payload.onMenuItemClick, @@ -747,6 +915,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Formula', actionFunction: payload.onMenuItemClick, @@ -820,6 +1002,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Edit Formula', actionFunction: strategyPart.codeEditor.activate, @@ -875,6 +1071,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Situation', actionFunction: payload.onMenuItemClick, @@ -930,6 +1140,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Condition', actionFunction: payload.onMenuItemClick, @@ -985,6 +1209,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Add Code', actionFunction: payload.onMenuItemClick, @@ -1045,6 +1283,20 @@ function newStrategyPartConstructor () { currentRadius: 0, angle: -135 }, + { + action: 'Freeze / Unfreeze', + actionFunction: floatingObject.freezeToggle, + actionStatus: floatingObject.getFreezeStatus, + currentStatus: true, + label: undefined, + visible: false, + iconPathOn: 'broken-link', + iconPathOff: 'security', + rawRadius: 8, + targetRadius: 0, + currentRadius: 0, + angle: 135 + }, { action: 'Edit Code', actionFunction: strategyPart.codeEditor.activate,