DevTeam and Bot topButton implemented and tested
This commit is contained in:
1 parent
13159013ee
commit
073045e20a
3 files changed
+86
-9
No files matched your search
+12
-4
@@ -31,6 +31,14 @@ function newTopSpace() {
|
||||
|
||||
function initialize() {
|
||||
|
||||
let sharedStatus = {
|
||||
currentDevTeamIndex: 0,
|
||||
currentUserBotIndex: 0,
|
||||
currentProcessIndex: 0,
|
||||
currentBotType: "",
|
||||
eventHandler: newEventHandler()
|
||||
};
|
||||
|
||||
thisObject.companyLogo = newCompanyLogo();
|
||||
thisObject.companyLogo.initialize();
|
||||
|
||||
@@ -38,16 +46,16 @@ function newTopSpace() {
|
||||
thisObject.endUser.initialize();
|
||||
|
||||
thisObject.devTeam = newDevTeam();
|
||||
thisObject.devTeam.initialize();
|
||||
thisObject.devTeam.initialize(sharedStatus);
|
||||
|
||||
thisObject.currentBot = newCurrentBot();
|
||||
thisObject.currentBot.initialize();
|
||||
thisObject.currentBot.initialize(sharedStatus);
|
||||
|
||||
thisObject.currentProcess = newCurrentProcess();
|
||||
thisObject.currentProcess.initialize();
|
||||
thisObject.currentProcess.initialize(sharedStatus);
|
||||
|
||||
thisObject.currentStartMode = newCurrentStartMode();
|
||||
thisObject.currentStartMode.initialize();
|
||||
thisObject.currentStartMode.initialize(sharedStatus);
|
||||
|
||||
thisObject.playStopButton = newPlayStopButton();
|
||||
thisObject.playStopButton.initialize();
|
||||
|
||||
+47
-3
@@ -19,15 +19,59 @@ function newCurrentBot() {
|
||||
container.frame.position.y = 0;
|
||||
|
||||
container.isDraggeable = false;
|
||||
container.isClickeable = true;
|
||||
|
||||
let sharedStatus;
|
||||
|
||||
return thisObject;
|
||||
|
||||
function initialize() {
|
||||
function initialize(pSharedStatus) {
|
||||
|
||||
window.CURRENT_BOT = window.localStorage.getItem("currentBot");
|
||||
sharedStatus = pSharedStatus;
|
||||
|
||||
if (window.CURRENT_BOT === null) {
|
||||
if (window.USER_PROFILE.devTeams.length === 0) {
|
||||
window.CURRENT_BOT = "You have no Bots";
|
||||
} else {
|
||||
|
||||
if (window.USER_PROFILE.devTeams[sharedStatus.currentDevTeamIndex].userBots.length === 0) {
|
||||
window.CURRENT_BOT = "You have no Bots";
|
||||
} else {
|
||||
window.CURRENT_BOT = window.USER_PROFILE.devTeams[sharedStatus.currentDevTeamIndex].userBots[sharedStatus.currentUserBotIndex].displayName;
|
||||
}
|
||||
}
|
||||
|
||||
thisObject.container.eventHandler.listenToEvent("onMouseClick", onClick);
|
||||
sharedStatus.eventHandler.listenToEvent("devTeam Changed", onDevTeamChanged);
|
||||
}
|
||||
|
||||
function onDevTeamChanged() {
|
||||
|
||||
if (window.USER_PROFILE.devTeams[sharedStatus.currentDevTeamIndex].userBots.length > 0) {
|
||||
|
||||
sharedStatus.currentUserBotIndex = 0;
|
||||
window.CURRENT_BOT = window.USER_PROFILE.devTeams[sharedStatus.currentDevTeamIndex].userBots[sharedStatus.currentUserBotIndex].displayName;
|
||||
|
||||
} else {
|
||||
|
||||
window.CURRENT_BOT = "You have no Bots";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function onClick() {
|
||||
|
||||
if (sharedStatus.currentUserBotIndex + 1 === window.USER_PROFILE.devTeams.length) {
|
||||
|
||||
sharedStatus.currentUserBotIndex = 0;
|
||||
window.CURRENT_BOT = window.USER_PROFILE.devTeams[sharedStatus.currentDevTeamIndex].userBots[sharedStatus.currentUserBotIndex].displayName;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sharedStatus.currentUserBotIndex + 1 < window.USER_PROFILE.devTeams.length) {
|
||||
|
||||
sharedStatus.currentUserBotIndex++;
|
||||
window.CURRENT_BOT = window.USER_PROFILE.devTeams[sharedStatus.currentDevTeamIndex].userBots[sharedStatus.currentUserBotIndex].displayName;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+27
-2
@@ -19,17 +19,42 @@ function newDevTeam() {
|
||||
container.frame.position.y = 0;
|
||||
|
||||
container.isDraggeable = false;
|
||||
container.isClickeable = true;
|
||||
|
||||
let sharedStatus;
|
||||
|
||||
return thisObject;
|
||||
|
||||
function initialize() {
|
||||
function initialize(pSharedStatus) {
|
||||
|
||||
sharedStatus = pSharedStatus;
|
||||
|
||||
if (window.USER_PROFILE.devTeams.length === 0) {
|
||||
window.DEV_TEAM = "Not a devTeam Member";
|
||||
} else {
|
||||
window.DEV_TEAM = window.USER_PROFILE.devTeams[0];
|
||||
window.DEV_TEAM = window.USER_PROFILE.devTeams[sharedStatus.currentDevTeamIndex].displayName;
|
||||
}
|
||||
|
||||
thisObject.container.eventHandler.listenToEvent("onMouseClick", onClick);
|
||||
}
|
||||
|
||||
function onClick() {
|
||||
|
||||
if (sharedStatus.currentDevTeamIndex + 1 === window.USER_PROFILE.devTeams.length) {
|
||||
|
||||
sharedStatus.currentDevTeamIndex = 0;
|
||||
window.DEV_TEAM = window.USER_PROFILE.devTeams[sharedStatus.currentDevTeamIndex].displayName;
|
||||
sharedStatus.eventHandler.raiseEvent("devTeam Changed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sharedStatus.currentDevTeamIndex + 1 < window.USER_PROFILE.devTeams.length) {
|
||||
|
||||
sharedStatus.currentDevTeamIndex++;
|
||||
window.DEV_TEAM = window.USER_PROFILE.devTeams[sharedStatus.currentDevTeamIndex].displayName;
|
||||
sharedStatus.eventHandler.raiseEvent("devTeam Changed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function getContainer(point) {
|
||||
|
||||
Reference in new issue
Block a user