Settings werden durch den Button wieder verlassen, hilfe-segmente werden richtig dargestellt
This commit is contained in:
parent
98fc403e9e
commit
9dce968eec
File diff suppressed because one or more lines are too long
@ -2005,6 +2005,22 @@ class SiteManager {
|
||||
return this.defaultActions;
|
||||
}
|
||||
|
||||
getCurrentSite(){
|
||||
if (Helper.isNotNull(this.currentSiteContainerToShow)){
|
||||
return this.currentSiteContainerToShow.getSite();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async findSite(filter){
|
||||
for (let i = this.siteContainerStack.length-1; i >= 0; i--) {
|
||||
if (await filter(this.siteContainerStack[i].getSite())){
|
||||
return this.siteContainerStack[i].getSite();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async startSite(siteConstructor, paramsPromise) {
|
||||
if (!(siteConstructor.prototype instanceof AbstractSite)) {
|
||||
throw {
|
||||
@ -2355,6 +2371,14 @@ class App {
|
||||
}
|
||||
}
|
||||
|
||||
getCurrentSite(){
|
||||
return this._siteManager.getCurrentSite();
|
||||
}
|
||||
|
||||
async findSite(filter){
|
||||
return this._siteManager.findSite(filter);
|
||||
}
|
||||
|
||||
static _extractParams(paramString) {
|
||||
if (Helper.isNull(paramString)) {
|
||||
return null;
|
||||
@ -4165,8 +4189,22 @@ InitPromise.addPromise(function (app) {
|
||||
app.addDeepLink("settings", SettingsSite);
|
||||
|
||||
if (Helper.isNull(SettingsSite.settingsAction)) {
|
||||
let settingsAction = new MenuAction("settings", function () {
|
||||
app.startSite(SettingsSite);
|
||||
let settingsAction = new MenuAction("settings", async () => {
|
||||
let currentSite = app.getCurrentSite();
|
||||
if (currentSite instanceof SettingsSite) {
|
||||
currentSite.finish();
|
||||
}
|
||||
else {
|
||||
let settingsSite = await app.findSite((site) => {
|
||||
return (site instanceof SettingsSite);
|
||||
});
|
||||
if (Helper.isNotNull(settingsSite)) {
|
||||
settingsSite.toForeground();
|
||||
}
|
||||
else {
|
||||
app.startSite(SettingsSite);
|
||||
}
|
||||
}
|
||||
}, MenuAction.SHOW_FOR_LARGE, 10000);
|
||||
settingsAction.setIcon("img/settings.png");
|
||||
SettingsSite.settingsAction = settingsAction;
|
||||
@ -6264,7 +6302,6 @@ class LevelSite extends WordRotatorBaseSite {
|
||||
let currentLevelInfo = localStorage.getItem("currentLevel");
|
||||
if (currentLevelInfo !== null) {
|
||||
currentLevelInfo = JSON.parse(currentLevelInfo);
|
||||
// console.log("LevelID: ", currentLevelInfo["id"]);
|
||||
|
||||
const db = WordRotatorDb.getInstance();
|
||||
const levelJson = await db.loadLevel(currentLevelInfo["id"]);
|
||||
@ -6426,7 +6463,6 @@ class LevelSite extends WordRotatorBaseSite {
|
||||
this.coinPromise = this.coinPromise.then(() => {
|
||||
return new Promise(r => {
|
||||
let timeout = 350;
|
||||
// console.log("coinPromise - won", this.wonParams);
|
||||
if (!this.wonParams.aborted) {
|
||||
coinElem.fadeIn(timeout / 1000);
|
||||
soundManager.play(SoundManager.CHANNELS.SOUND);
|
||||
@ -6478,7 +6514,6 @@ class LevelSite extends WordRotatorBaseSite {
|
||||
rotatables = rotatables.filter((segment) => {
|
||||
return (!segment.isSolved(false));
|
||||
});
|
||||
console.log(rotatables);
|
||||
|
||||
let index = Math.floor(Math.random() * rotatables.length);
|
||||
|
||||
@ -6528,8 +6563,6 @@ class LevelSite extends WordRotatorBaseSite {
|
||||
this._siteContent.classList.remove("step-2");
|
||||
localStorage.removeItem("tutorial-step");
|
||||
this.coinPromise = this.coinPromise.then(() => {
|
||||
console.log("coinPromise - tutorial", this.wonParams);
|
||||
|
||||
FlashMessenger.addMessage("extra-coins-after-first-level");
|
||||
localStorage.setItem("coins", parseInt(Helper.nonNull(localStorage.getItem("coins"), "0")) + 50);
|
||||
this.coinAction.setTitle(Helper.nonNull(localStorage.getItem("coins"), "0"));
|
||||
|
||||
@ -863,8 +863,22 @@ InitPromise.addPromise(function (app) {
|
||||
app.addDeepLink("settings", SettingsSite);
|
||||
|
||||
if (Helper.isNull(SettingsSite.settingsAction)) {
|
||||
let settingsAction = new MenuAction("settings", function () {
|
||||
app.startSite(SettingsSite);
|
||||
let settingsAction = new MenuAction("settings", async () => {
|
||||
let currentSite = app.getCurrentSite();
|
||||
if (currentSite instanceof SettingsSite) {
|
||||
currentSite.finish();
|
||||
}
|
||||
else {
|
||||
let settingsSite = await app.findSite((site) => {
|
||||
return (site instanceof SettingsSite);
|
||||
});
|
||||
if (Helper.isNotNull(settingsSite)) {
|
||||
settingsSite.toForeground();
|
||||
}
|
||||
else {
|
||||
app.startSite(SettingsSite);
|
||||
}
|
||||
}
|
||||
}, MenuAction.SHOW_FOR_LARGE, 10000);
|
||||
settingsAction.setIcon("img/settings.png");
|
||||
SettingsSite.settingsAction = settingsAction;
|
||||
|
||||
@ -2005,6 +2005,22 @@ class SiteManager {
|
||||
return this.defaultActions;
|
||||
}
|
||||
|
||||
getCurrentSite(){
|
||||
if (Helper.isNotNull(this.currentSiteContainerToShow)){
|
||||
return this.currentSiteContainerToShow.getSite();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async findSite(filter){
|
||||
for (let i = this.siteContainerStack.length-1; i >= 0; i--) {
|
||||
if (await filter(this.siteContainerStack[i].getSite())){
|
||||
return this.siteContainerStack[i].getSite();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async startSite(siteConstructor, paramsPromise) {
|
||||
if (!(siteConstructor.prototype instanceof AbstractSite)) {
|
||||
throw {
|
||||
@ -2355,6 +2371,14 @@ class App {
|
||||
}
|
||||
}
|
||||
|
||||
getCurrentSite(){
|
||||
return this._siteManager.getCurrentSite();
|
||||
}
|
||||
|
||||
async findSite(filter){
|
||||
return this._siteManager.findSite(filter);
|
||||
}
|
||||
|
||||
static _extractParams(paramString) {
|
||||
if (Helper.isNull(paramString)) {
|
||||
return null;
|
||||
|
||||
@ -105,7 +105,6 @@ export class LevelSite extends WordRotatorBaseSite {
|
||||
let currentLevelInfo = localStorage.getItem("currentLevel");
|
||||
if (currentLevelInfo !== null) {
|
||||
currentLevelInfo = JSON.parse(currentLevelInfo);
|
||||
// console.log("LevelID: ", currentLevelInfo["id"]);
|
||||
|
||||
const db = WordRotatorDb.getInstance();
|
||||
const levelJson = await db.loadLevel(currentLevelInfo["id"]);
|
||||
@ -267,7 +266,6 @@ export class LevelSite extends WordRotatorBaseSite {
|
||||
this.coinPromise = this.coinPromise.then(() => {
|
||||
return new Promise(r => {
|
||||
let timeout = 350;
|
||||
// console.log("coinPromise - won", this.wonParams);
|
||||
if (!this.wonParams.aborted) {
|
||||
coinElem.fadeIn(timeout / 1000);
|
||||
soundManager.play(SoundManager.CHANNELS.SOUND);
|
||||
@ -319,7 +317,6 @@ export class LevelSite extends WordRotatorBaseSite {
|
||||
rotatables = rotatables.filter((segment) => {
|
||||
return (!segment.isSolved(false));
|
||||
});
|
||||
console.log(rotatables);
|
||||
|
||||
let index = Math.floor(Math.random() * rotatables.length);
|
||||
|
||||
@ -369,8 +366,6 @@ export class LevelSite extends WordRotatorBaseSite {
|
||||
this._siteContent.classList.remove("step-2");
|
||||
localStorage.removeItem("tutorial-step");
|
||||
this.coinPromise = this.coinPromise.then(() => {
|
||||
console.log("coinPromise - tutorial", this.wonParams);
|
||||
|
||||
FlashMessenger.addMessage("extra-coins-after-first-level");
|
||||
localStorage.setItem("coins", parseInt(Helper.nonNull(localStorage.getItem("coins"), "0")) + 50);
|
||||
this.coinAction.setTitle(Helper.nonNull(localStorage.getItem("coins"), "0"));
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
border-color: #{map-get($theme, lightThemeColor)};
|
||||
background-color: #{map-get($theme, themeColor)} !important;
|
||||
> .child-container > .segment-leaf {
|
||||
border-color: #{map-get($theme, lightThemeColor)};
|
||||
background-color:#{map-get($theme, themeColor)} !important;
|
||||
//border-color: #{map-get($theme, lightThemeColor)};
|
||||
//background-color:#{map-get($theme, themeColor)} !important;
|
||||
}
|
||||
}
|
||||
.segment:not(.segment-row):not(.segment-triangle) {
|
||||
@ -89,9 +89,10 @@ body {
|
||||
}
|
||||
&.black{
|
||||
#site-content > :not(.won) .segment.locked {
|
||||
background-color: #9d9d9d;
|
||||
background-color: #9d9d9d !important;
|
||||
border-color: #6e6e6e !important;
|
||||
> .child-container > .segment-leaf {
|
||||
background-color: #9d9d9d !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -252,7 +252,7 @@ $coinTowerDimension: 28px;
|
||||
}
|
||||
|
||||
&.segment-leaf {
|
||||
background-color: transparent;
|
||||
background-color: transparent !important;
|
||||
min-width: 1em;
|
||||
padding: 0.8em;
|
||||
&:before {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import {Selector} from 'testcafe';
|
||||
import {ClientFunction} from 'testcafe';
|
||||
|
||||
let isLocal = true;
|
||||
let isLocal = false;
|
||||
|
||||
const goBack = ClientFunction(() => window.history.back());
|
||||
const testLocalStorageSet = ClientFunction((key, value) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user