Strategy Parts showing up
This commit is contained in:
1 parent
7426b5d9cf
commit
462dfd8ae3
5 files changed
+58
-12
No files matched your search
@@ -11,6 +11,8 @@ function newFloatingLayer () {
|
||||
to specify the location of a bot instance.
|
||||
|
||||
2. Notes: Notes are a rectangular area where some text is posted. It has a subject and a body.
|
||||
|
||||
3. Strategy Parts: These are small balls that represent parts of an strategy.
|
||||
*/
|
||||
|
||||
const MODULE_NAME = 'Floating Layer'
|
||||
@@ -210,6 +212,21 @@ function newFloatingLayer () {
|
||||
pFloatingObject.payload = payload
|
||||
break
|
||||
}
|
||||
case 'Strategy Part': {
|
||||
if (pFloatingObject.payload.profile.visible === false) { return }
|
||||
|
||||
payload.profile = {
|
||||
position: {
|
||||
x: pFloatingObject.payload.profile.position.x,
|
||||
y: pFloatingObject.payload.profile.position.y
|
||||
},
|
||||
visible: pFloatingObject.payload.profile.visible,
|
||||
botAvatar: pFloatingObject.payload.profile.botAvatar
|
||||
}
|
||||
|
||||
pFloatingObject.payload = payload
|
||||
break
|
||||
}
|
||||
default: {
|
||||
break
|
||||
}
|
||||
@@ -339,6 +356,11 @@ function newFloatingLayer () {
|
||||
|
||||
break
|
||||
}
|
||||
case 'Strategy Part': {
|
||||
payload.position = floatingObject.payload.profile.position
|
||||
payload.visible = floatingObject.payload.profile.visible
|
||||
break
|
||||
}
|
||||
default: {
|
||||
break
|
||||
}
|
||||
@@ -481,7 +503,11 @@ function newFloatingLayer () {
|
||||
payload.position = floatingObject.payload.notes[floatingObject.payloadNoteIndex].position
|
||||
payload.visible = floatingObject.payload.notes[floatingObject.payloadNoteIndex].visible
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
case 'Strategy Part': {
|
||||
payload.position = floatingObject.payload.profile.position
|
||||
payload.visible = floatingObject.payload.profile.visible
|
||||
break
|
||||
}
|
||||
default: {
|
||||
@@ -543,6 +569,10 @@ function newFloatingLayer () {
|
||||
payload.visible = floatingObject.payload.notes[floatingObject.payloadNoteIndex].visible
|
||||
break
|
||||
}
|
||||
case 'Strategy Part': {
|
||||
payload.visible = floatingObject.payload.profile.visible
|
||||
break
|
||||
}
|
||||
default: {
|
||||
break
|
||||
}
|
||||
@@ -768,6 +798,10 @@ function newFloatingLayer () {
|
||||
payload.position = floatingObject2.payload.notes[floatingObject2.payloadNoteIndex].position
|
||||
break
|
||||
}
|
||||
case 'Strategy Part': {
|
||||
payload.position = floatingObject2.payload.profile.position
|
||||
break
|
||||
}
|
||||
default: {
|
||||
break
|
||||
}
|
||||
@@ -991,4 +1025,3 @@ function newFloatingLayer () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,20 @@ function newFloatingObject () {
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
case 'Strategy Part': {
|
||||
underlayingObject = newStrategyPart()
|
||||
underlayingObject.initialize(onInitialized)
|
||||
|
||||
function onInitialized (err) {
|
||||
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
default: {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> Unsopported type received -> pType = ' + pType) }
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
function newProfileBalls () {
|
||||
const MODULE_NAME = 'Profile Balls'
|
||||
const INFO_LOG = false
|
||||
@@ -6,11 +6,11 @@ function newProfileBalls () {
|
||||
const logger = newWebDebugLog()
|
||||
logger.fileName = MODULE_NAME
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
This object deals with Profile Balls, a type of Floating Object that shows profile info in a floating ball.
|
||||
This object deals with Profile Balls, a type of Floating Object that shows profile info in a floating ball.
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
let thisObject = {
|
||||
|
||||
@@ -58,7 +58,7 @@ function newProfileBalls () {
|
||||
|
||||
floatingLayer.addFloatingObject(floatingObject)
|
||||
|
||||
callBackFunction(GLOBAL.CUSTOM_OK_RESPONSE, floatingObject.handle)
|
||||
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE, floatingObject.handle)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ function newStrategyParts () {
|
||||
|
||||
function createNewStrategyPart (pPayload, callBackFunction) {
|
||||
let floatingObject = newFloatingObject()
|
||||
floatingObject.initialize('Profile Ball', onInitialized)
|
||||
floatingObject.initialize('Strategy Part', onInitialized)
|
||||
|
||||
function onInitialized (err) {
|
||||
floatingObject.payload = pPayload
|
||||
|
||||
@@ -49,17 +49,17 @@ function newStrategyCollectionItem () {
|
||||
notes: []
|
||||
}
|
||||
|
||||
let imageId = 'My Image.png'
|
||||
let imageId // 'My Image.png'
|
||||
|
||||
payload.profile.upLabel = thisObject.strategy.name
|
||||
payload.profile.downLabel = thisObject.strategy.name
|
||||
payload.profile.imageId = imageId
|
||||
payload.profile.botAvatar = 'dont know what this is'
|
||||
|
||||
canvas.floatingSpace.profileBalls.createNewProfileBall(payload, onProfileBallCreated)
|
||||
canvas.floatingSpace.strategyParts.createNewStrategyPart(payload, onStrategyPartCreated)
|
||||
|
||||
function onProfileBallCreated (err, pProfileHandle) {
|
||||
handle = pProfileHandle
|
||||
function onStrategyPartCreated (err, pPartHandle) {
|
||||
handle = pPartHandle
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user