isTensed to tensionLevel
This commit is contained in:
1 parent
c33cca3166
commit
567fecbc9c
5 files changed
+16
-16
No files matched your search
@@ -145,7 +145,7 @@ function newNodeCloning () {
|
||||
isPinned: node.payload.floatingObject.isPinned,
|
||||
isFrozen: (node.payload.floatingObject.isFrozen && node.payload.floatingObject.frozenManually),
|
||||
isCollapsed: (node.payload.floatingObject.isCollapsed && node.payload.floatingObject.collapsedManually),
|
||||
isTensed: (node.payload.floatingObject.isTensed)
|
||||
tensionLevel: (node.payload.floatingObject.tensionLevel)
|
||||
},
|
||||
uiObject: {
|
||||
isRunning: node.payload.uiObject.isRunning,
|
||||
|
||||
@@ -148,7 +148,7 @@ function newProtocolNode () {
|
||||
isPinned: node.payload.floatingObject.isPinned,
|
||||
isFrozen: (node.payload.floatingObject.isFrozen && node.payload.floatingObject.frozenManually),
|
||||
isCollapsed: (node.payload.floatingObject.isCollapsed && node.payload.floatingObject.collapsedManually),
|
||||
isTensed: (node.payload.floatingObject.isTensed)
|
||||
tensionLevel: (node.payload.floatingObject.tensionLevel)
|
||||
},
|
||||
uiObject: {
|
||||
isRunning: node.payload.uiObject.isRunning,
|
||||
|
||||
@@ -22,7 +22,7 @@ function newFloatingObject () {
|
||||
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,
|
||||
isTensed: TENSION_LEVEL.NO_TENSION,
|
||||
tensionLevel: TENSION_LEVEL.NO_TENSION,
|
||||
isCollapsed: false,
|
||||
isParentCollapsed: false,
|
||||
frozenManually: false,
|
||||
@@ -139,7 +139,7 @@ function newFloatingObject () {
|
||||
}
|
||||
|
||||
function getTensionStatus () {
|
||||
return thisObject.isTensed
|
||||
return thisObject.tensionLevel
|
||||
}
|
||||
|
||||
function freezeToggle () {
|
||||
@@ -165,25 +165,25 @@ function newFloatingObject () {
|
||||
}
|
||||
|
||||
function tensionToggle () {
|
||||
switch (thisObject.isTensed) {
|
||||
switch (thisObject.tensionLevel) {
|
||||
case TENSION_LEVEL.NO_TENSION:
|
||||
thisObject.isTensed = TENSION_LEVEL.LEVEL_360
|
||||
thisObject.tensionLevel = TENSION_LEVEL.LEVEL_360
|
||||
break
|
||||
case TENSION_LEVEL.LEVEL_360:
|
||||
thisObject.isTensed = TENSION_LEVEL.LEVEL_180
|
||||
thisObject.tensionLevel = TENSION_LEVEL.LEVEL_180
|
||||
break
|
||||
case TENSION_LEVEL.LEVEL_180:
|
||||
thisObject.isTensed = TENSION_LEVEL.LEVEL_90
|
||||
thisObject.tensionLevel = TENSION_LEVEL.LEVEL_90
|
||||
break
|
||||
case TENSION_LEVEL.LEVEL_90:
|
||||
thisObject.isTensed = TENSION_LEVEL.LEVEL_45
|
||||
thisObject.tensionLevel = TENSION_LEVEL.LEVEL_45
|
||||
break
|
||||
case TENSION_LEVEL.LEVEL_45:
|
||||
thisObject.isTensed = TENSION_LEVEL.NO_TENSION
|
||||
thisObject.tensionLevel = TENSION_LEVEL.NO_TENSION
|
||||
break
|
||||
}
|
||||
|
||||
return thisObject.isTensed
|
||||
return thisObject.tensionLevel
|
||||
}
|
||||
|
||||
function physics () {
|
||||
@@ -223,7 +223,7 @@ function newFloatingObject () {
|
||||
function tensionPhysics () {
|
||||
/* Tension Effect */
|
||||
|
||||
if (thisObject.isTensed !== TENSION_LEVEL.NO_TENSION) {
|
||||
if (thisObject.tensionLevel !== TENSION_LEVEL.NO_TENSION) {
|
||||
let parent = thisObject.payload.chainParent
|
||||
if (parent === undefined) { return }
|
||||
if (parent.payload === undefined) { return }
|
||||
|
||||
@@ -864,7 +864,7 @@ function newUiObject () {
|
||||
/* Target Line */
|
||||
|
||||
let LINE_STYLE = UI_COLOR.TITANIUM_YELLOW
|
||||
if (thisObject.payload.floatingObject.isTensed !== TENSION_LEVEL.NO_TENSION) {
|
||||
if (thisObject.payload.floatingObject.tensionLevel !== TENSION_LEVEL.NO_TENSION) {
|
||||
LINE_STYLE = UI_COLOR.GOLDEN_ORANGE
|
||||
}
|
||||
if (thisObject.payload.floatingObject.isFrozen === true) {
|
||||
|
||||
@@ -57,12 +57,12 @@ function newUiObjectConstructor () {
|
||||
if (payload.node.savedPayload.floatingObject.isCollapsed === true) {
|
||||
floatingObject.collapseToggle()
|
||||
}
|
||||
floatingObject.isTensed = payload.node.savedPayload.floatingObject.isTensed
|
||||
floatingObject.tensionLevel = payload.node.savedPayload.floatingObject.tensionLevel
|
||||
}
|
||||
|
||||
/* For brand new objects being created directly by the user, we will make them inherit some properties from their parents. */
|
||||
if (userAddingNew === true) {
|
||||
floatingObject.isTensed = payload.parentNode.payload.floatingObject.isTensed
|
||||
floatingObject.tensionLevel = payload.parentNode.payload.floatingObject.tensionLevel
|
||||
}
|
||||
|
||||
let uiObject = newUiObject()
|
||||
@@ -310,7 +310,7 @@ function newUiObjectConstructor () {
|
||||
switch (payload.node.type) {
|
||||
case 'Workspace': {
|
||||
level_0()
|
||||
floatingObject.isTensed = TENSION_LEVEL.LEVEL_360
|
||||
floatingObject.tensionLevel = TENSION_LEVEL.LEVEL_360
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user