Collapsing implemented at Trading System only
This commit is contained in:
1 parent
589e2a594a
commit
64e154d165
3 files changed
+50
-2
No files matched your search
@@ -23,14 +23,18 @@ function newFloatingObject () {
|
||||
isPinned: false,
|
||||
isFrozen: false,
|
||||
isTensed: false,
|
||||
isCollapsed: false,
|
||||
frozenManually: false,
|
||||
collapsedManually: false,
|
||||
getPinStatus: getPinStatus,
|
||||
getFreezeStatus: getFreezeStatus,
|
||||
getCollapseStatus: getCollapseStatus,
|
||||
getTensionStatus: getTensionStatus,
|
||||
nearbyFloatingObjects: [],
|
||||
setPosition: setPosition,
|
||||
pinToggle: pinToggle,
|
||||
freezeToggle: freezeToggle,
|
||||
collapseToggle: collapseToggle,
|
||||
tensionToggle: tensionToggle,
|
||||
physics: physics,
|
||||
initializeMass: initializeMass,
|
||||
@@ -128,6 +132,10 @@ function newFloatingObject () {
|
||||
return thisObject.isFrozen
|
||||
}
|
||||
|
||||
function getCollapseStatus () {
|
||||
return thisObject.isCollapsed
|
||||
}
|
||||
|
||||
function getTensionStatus () {
|
||||
return thisObject.isTensed
|
||||
}
|
||||
@@ -143,6 +151,17 @@ function newFloatingObject () {
|
||||
return thisObject.isFrozen
|
||||
}
|
||||
|
||||
function collapseToggle () {
|
||||
if (thisObject.isCollapsed !== true) {
|
||||
thisObject.isCollapsed = true
|
||||
thisObject.collapsedManually = true
|
||||
} else {
|
||||
thisObject.isCollapsed = false
|
||||
thisObject.collapsedManually = false
|
||||
}
|
||||
return thisObject.isCollapsed
|
||||
}
|
||||
|
||||
function tensionToggle () {
|
||||
if (thisObject.isTensed !== true) {
|
||||
thisObject.isTensed = true
|
||||
@@ -158,6 +177,7 @@ function newFloatingObject () {
|
||||
thisObjectPhysics()
|
||||
thisObject.payload.uiObject.physics()
|
||||
frozenPhysics()
|
||||
collapsePhysics()
|
||||
tensionPhysics()
|
||||
}
|
||||
|
||||
@@ -170,6 +190,15 @@ function newFloatingObject () {
|
||||
}
|
||||
}
|
||||
|
||||
function collapsePhysics () {
|
||||
if (thisObject.collapsedManually === false) {
|
||||
let parent = thisObject.payload.chainParent
|
||||
if (parent !== undefined) {
|
||||
thisObject.isCollapsed = parent.payload.floatingObject.isCollapsed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function tensionPhysics () {
|
||||
/* Tension Effect */
|
||||
if (thisObject.isTensed === true) {
|
||||
|
||||
@@ -137,6 +137,8 @@ function newStrategyPart () {
|
||||
}
|
||||
|
||||
function getContainer (point) {
|
||||
if (thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) { return }
|
||||
|
||||
let container
|
||||
|
||||
if (isDragging === false && thisObject.isOnFocus === true) {
|
||||
@@ -379,7 +381,7 @@ function newStrategyPart () {
|
||||
|
||||
function detachingPhysics () {
|
||||
if (isDragging !== true) { return }
|
||||
if (thisObject.isFrozen === true) { return }
|
||||
if (thisObject.payload.floatingObject.isFrozen === true) { return }
|
||||
if (rightDragging === false) { return }
|
||||
|
||||
let distanceToChainParent = Math.sqrt(Math.pow(thisObject.payload.position.x - thisObject.payload.targetPosition.x, 2) + Math.pow(thisObject.payload.position.y - thisObject.payload.targetPosition.y, 2))
|
||||
@@ -520,6 +522,7 @@ function newStrategyPart () {
|
||||
}
|
||||
|
||||
function drawBackground () {
|
||||
if (thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) { return }
|
||||
if (thisObject.isOnFocus === false) {
|
||||
drawConnectingLine()
|
||||
|
||||
@@ -530,6 +533,7 @@ function newStrategyPart () {
|
||||
}
|
||||
|
||||
function drawMiddleground () {
|
||||
if (thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) { return }
|
||||
if (thisObject.isOnFocus === false) {
|
||||
drawValue()
|
||||
drawText()
|
||||
@@ -538,6 +542,7 @@ function newStrategyPart () {
|
||||
}
|
||||
|
||||
function drawForeground () {
|
||||
if (thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) { return }
|
||||
if (thisObject.isOnFocus === false) {
|
||||
drawBodyAndPicture()
|
||||
if (isDragging === false) {
|
||||
|
||||
@@ -145,7 +145,7 @@ function newStrategyPartConstructor () {
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 180
|
||||
angle: -165
|
||||
},
|
||||
{
|
||||
action: 'Freeze / Unfreeze',
|
||||
@@ -159,6 +159,20 @@ function newStrategyPartConstructor () {
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 165
|
||||
},
|
||||
{
|
||||
action: 'Collapse / Uncollapse',
|
||||
actionFunction: floatingObject.collapseToggle,
|
||||
actionStatus: floatingObject.getCollapeseStatus,
|
||||
currentStatus: false,
|
||||
label: undefined,
|
||||
visible: false,
|
||||
iconPathOn: 'tap',
|
||||
iconPathOff: 'layout',
|
||||
rawRadius: 8,
|
||||
targetRadius: 0,
|
||||
currentRadius: 0,
|
||||
angle: 135
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user