diff --git a/FloatingSpace/ConditionEditor.js b/FloatingSpace/ConditionEditor.js index f0b2cbef7..b01dca956 100644 --- a/FloatingSpace/ConditionEditor.js +++ b/FloatingSpace/ConditionEditor.js @@ -202,23 +202,27 @@ function newConditionEditor () { function initializePickersSet (logicOperand, comparisonOperand, algebraOperand) { /* Get the ySign */ - let ySign - if (algebraOperand.index === 0) { - ySign = -1 + let yComparisionSign + if (comparisonOperand.index === 0) { + yComparisionSign = -1 } - if (algebraOperand.index === 1) { - ySign = 1 + if (comparisonOperand.index === 1) { + yComparisionSign = 1 } + const LOGIC_SEPARATION = 100 + const COMPARISON_SEPARATION = 50 + const ALGEBRA_SEPARATION = 50 let properties let parent let current + let yOffset = (logicOperand.index - 1) * LOGIC_SEPARATION + yComparisionSign * COMPARISON_SEPARATION + (algebraOperand.index - 1) * ALGEBRA_SEPARATION algebraOperand.whenPicker = newPicker() algebraOperand.whenPicker.name = 'When' algebraOperand.whenPicker.container.connectToParent(thisObject.container) algebraOperand.whenPicker.container.frame.position.x = 0 - algebraOperand.whenPicker.container.frame.width / 2 - algebraOperand.whenPicker.container.frame.width * 1.0 - algebraOperand.whenPicker.container.frame.position.y = 0 - algebraOperand.whenPicker.container.frame.height / 2 + algebraOperand.whenPicker.container.frame.height * ySign + algebraOperand.whenPicker.container.frame.position.y = 0 - algebraOperand.whenPicker.container.frame.height / 2 + yOffset current = ['Current', '1 Previous', '2 Previous', '3 Previous', '4 Previous', '5 Previous'] algebraOperand.whenPicker.initialize(current, current) algebraOperand.whenPicker.visible = true @@ -227,7 +231,7 @@ function newConditionEditor () { algebraOperand.algebraicPicker.name = 'Algebraic' algebraOperand.algebraicPicker.container.connectToParent(thisObject.container) algebraOperand.algebraicPicker.container.frame.position.x = 0 - algebraOperand.algebraicPicker.container.frame.width / 2 + algebraOperand.algebraicPicker.container.frame.width * 3.0 - algebraOperand.algebraicPicker.container.frame.position.y = 0 - algebraOperand.algebraicPicker.container.frame.height / 2 + algebraOperand.algebraicPicker.container.frame.height * ySign + algebraOperand.algebraicPicker.container.frame.position.y = 0 - algebraOperand.algebraicPicker.container.frame.height / 2 + yOffset current = ['+ - * /', 'Plus', 'Minus', 'Times', 'Divided by'] algebraOperand.algebraicPicker.initialize(current, current) algebraOperand.algebraicPicker.visible = true @@ -236,7 +240,7 @@ function newConditionEditor () { algebraOperand.dataMinePicker.name = 'Data Mine' algebraOperand.dataMinePicker.container.connectToParent(thisObject.container) algebraOperand.dataMinePicker.container.frame.position.x = 0 - algebraOperand.dataMinePicker.container.frame.width / 2 - algebraOperand.dataMinePicker.container.frame.width * 3.0 - algebraOperand.dataMinePicker.container.frame.position.y = 0 - algebraOperand.dataMinePicker.container.frame.height / 2 + algebraOperand.dataMinePicker.container.frame.height * ySign + algebraOperand.dataMinePicker.container.frame.position.y = 0 - algebraOperand.dataMinePicker.container.frame.height / 2 + yOffset current = scanResult properties = Object.keys(current) algebraOperand.dataMinePicker.initialize(properties, current) @@ -247,7 +251,7 @@ function newConditionEditor () { algebraOperand.botPicker.name = 'Bot' algebraOperand.botPicker.container.connectToParent(thisObject.container) algebraOperand.botPicker.container.frame.position.x = 0 - algebraOperand.botPicker.container.frame.width / 2 - algebraOperand.botPicker.container.frame.width * 2.0 - algebraOperand.botPicker.container.frame.position.y = 0 - algebraOperand.botPicker.container.frame.height / 2 + algebraOperand.dataMinePicker.container.frame.height * ySign + algebraOperand.botPicker.container.frame.position.y = 0 - algebraOperand.botPicker.container.frame.height / 2 + yOffset current = parent[properties[0]] properties = Object.keys(current) algebraOperand.botPicker.initialize(properties, current, parent) @@ -258,7 +262,7 @@ function newConditionEditor () { algebraOperand.productPicker.name = 'Product' algebraOperand.productPicker.container.connectToParent(thisObject.container) algebraOperand.productPicker.container.frame.position.x = 0 - algebraOperand.productPicker.container.frame.width / 2 + algebraOperand.productPicker.container.frame.width * 0.0 - algebraOperand.productPicker.container.frame.position.y = 0 - algebraOperand.productPicker.container.frame.height / 2 + algebraOperand.dataMinePicker.container.frame.height * ySign + algebraOperand.productPicker.container.frame.position.y = 0 - algebraOperand.productPicker.container.frame.height / 2 + yOffset current = parent[properties[0]] properties = Object.keys(current) algebraOperand.productPicker.initialize(properties, current, parent) @@ -272,7 +276,7 @@ function newConditionEditor () { algebraOperand.propertyPicker.name = 'Property' algebraOperand.propertyPicker.container.connectToParent(thisObject.container) algebraOperand.propertyPicker.container.frame.position.x = 0 - algebraOperand.propertyPicker.container.frame.width / 2 + algebraOperand.propertyPicker.container.frame.width * 1.0 - algebraOperand.propertyPicker.container.frame.position.y = 0 - algebraOperand.propertyPicker.container.frame.height / 2 + algebraOperand.dataMinePicker.container.frame.height * ySign + algebraOperand.propertyPicker.container.frame.position.y = 0 - algebraOperand.propertyPicker.container.frame.height / 2 + yOffset current = productParent[productProperties[0]] current = current.properties properties = Object.keys(current) @@ -284,7 +288,7 @@ function newConditionEditor () { algebraOperand.valuePicker.name = 'Value' algebraOperand.valuePicker.container.connectToParent(thisObject.container) algebraOperand.valuePicker.container.frame.position.x = 0 - algebraOperand.valuePicker.container.frame.width / 2 - algebraOperand.valuePicker.container.frame.position.y = 0 - algebraOperand.valuePicker.container.frame.height / 2 + algebraOperand.valuePicker.container.frame.height * 1 + algebraOperand.valuePicker.container.frame.position.y = 0 - algebraOperand.valuePicker.container.frame.height / 2 + yOffset current = parent[properties[0]] properties = current.possibleValues algebraOperand.valuePicker.initialize(properties, current, parent, 'possibleValues') @@ -295,7 +299,7 @@ function newConditionEditor () { algebraOperand.timeFramePicker.name = 'Time Frame' algebraOperand.timeFramePicker.container.connectToParent(thisObject.container) algebraOperand.timeFramePicker.container.frame.position.x = 0 - algebraOperand.timeFramePicker.container.frame.width / 2 + algebraOperand.timeFramePicker.container.frame.width * 2.0 - algebraOperand.timeFramePicker.container.frame.position.y = 0 - algebraOperand.timeFramePicker.container.frame.height / 2 + algebraOperand.timeFramePicker.container.frame.height * ySign + algebraOperand.timeFramePicker.container.frame.position.y = 0 - algebraOperand.timeFramePicker.container.frame.height / 2 + yOffset current = productParent[productProperties[0]] properties = current.validTimeFrames algebraOperand.timeFramePicker.initialize(properties, current, productParent, 'validTimeFrames') diff --git a/FloatingSpace/Picker.js b/FloatingSpace/Picker.js index 885b01c11..de438fcf2 100644 --- a/FloatingSpace/Picker.js +++ b/FloatingSpace/Picker.js @@ -25,8 +25,8 @@ function newPicker () { thisObject.container.frame.radius = 0 thisObject.container.frame.position.x = 0 thisObject.container.frame.position.y = 0 - thisObject.container.frame.width = 200 - thisObject.container.frame.height = 120 + thisObject.container.frame.width = 100 + thisObject.container.frame.height = 100 let isMouseOver let optionsList @@ -175,7 +175,7 @@ function newPicker () { } function drawForeground () { - const FONT_SIZE = 20 + const FONT_SIZE = 15 const VISIBLE_LABELS = 5 let fontSize let fontColor @@ -190,11 +190,11 @@ function newPicker () { fontColor = UI_COLOR.LIGHT_GREY switch (i) { case 0: - fontSize = FONT_SIZE - 10 + fontSize = FONT_SIZE - 5 opacity = 0.4 break case 1: - fontSize = FONT_SIZE - 5 + fontSize = FONT_SIZE - 3 opacity = 0.5 break case 2: @@ -203,11 +203,11 @@ function newPicker () { opacity = 1 break case 3: - fontSize = FONT_SIZE - 5 + fontSize = FONT_SIZE - 3 opacity = 0.5 break case 4: - fontSize = FONT_SIZE - 10 + fontSize = FONT_SIZE - 5 opacity = 0.4 break } diff --git a/FloatingSpace/UiObject.js b/FloatingSpace/UiObject.js index 8cc05dbf8..2dd1f2db3 100644 --- a/FloatingSpace/UiObject.js +++ b/FloatingSpace/UiObject.js @@ -1205,7 +1205,26 @@ function newUiObject () { } } + function isEditorVisible () { + if (thisObject.codeEditor !== undefined) { + if (thisObject.codeEditor.visible === true) { return true } + } + + if (thisObject.configEditor !== undefined) { + if (thisObject.configEditor.visible === true) { return true } + } + + if (thisObject.conditionEditor !== undefined) { + if (thisObject.conditionEditor.visible === true) { return true } + } + + if (thisObject.formulaEditor !== undefined) { + if (thisObject.formulaEditor.visible === true) { return true } + } + } + function drawText () { + if (isEditorVisible() === true) { return } /* Text Follows */ let position = { x: 0,