Special options while running on iogames.space

pull/33/head
tobspr 4 years ago
parent a627fb9a94
commit 9033c9eb67

@ -19,6 +19,13 @@
.changes {
@include SuperSmallText;
@include S(padding-left, 20px);
strong {
background: $colorBlueBright;
color: #fff;
text-transform: uppercase;
@include S(padding, 1px, 2px);
@include S(margin-right, 3px);
}
}
}
}

@ -7,11 +7,14 @@
}
.changelogDialogEntry {
margin-top: 10px;
width: 100%;
flex-direction: column;
text-align: left;
padding: 10px;
box-sizing: border-box;
background: #eef1f4;
.version {
@include Heading;
}
@ -25,7 +28,14 @@
.changes {
@include SuperSmallText;
@include S(padding-left, 20px);
@include S(padding-left, 15px);
strong {
background: $colorBlueBright;
color: #fff;
text-transform: uppercase;
@include S(padding, 1px, 2px);
@include S(margin-right, 3px);
}
}
}

@ -3,7 +3,7 @@ export const CHANGELOG = [
version: "1.0.3",
date: "24.05.2020",
entries: [
"Balancing: I reduced the amount of shapes required for the first 5 levels, to make it easier to get into the game.",
"<strong>Balancing</strong> Reduced the amount of shapes required for the first 5 levels, to make it easier to get into the game.",
],
},
{

@ -1,5 +1,5 @@
import { Math_min } from "../../core/builtins";
import { globalConfig, IS_MOBILE } from "../../core/config";
import { globalConfig, IS_MOBILE, IS_DEBUG, IS_DEMO } from "../../core/config";
import { createLogger } from "../../core/logging";
import { queryParamOptions } from "../../core/query_parameters";
import { clamp } from "../../core/utils";
@ -19,6 +19,8 @@ export class PlatformWrapperImplBrowser extends PlatformWrapperInterface {
iframed: false,
externalLinks: true,
iogLink: true,
unlimitedSavegames: IS_DEMO ? false : true,
showDemoBadge: IS_DEMO,
};
if (!G_IS_STANDALONE && queryParamOptions.embedProvider) {
@ -35,6 +37,8 @@ export class PlatformWrapperImplBrowser extends PlatformWrapperInterface {
case "iogames.space": {
this.embedProvider.id = "iogames.space";
this.embedProvider.iogLink = true;
this.embedProvider.unlimitedSavegames = true;
this.embedProvider.showDemoBadge = false;
break;
}
@ -71,6 +75,14 @@ export class PlatformWrapperImplBrowser extends PlatformWrapperInterface {
return super.initialize().then(() => this.initializeAdProvider());
}
getHasUnlimitedSavegames() {
return this.embedProvider.unlimitedSavegames;
}
getShowDemoBadges() {
return this.embedProvider.showDemoBadge;
}
onSentryLoaded() {
logger.log("Initializing sentry");
window.Sentry.init({

@ -29,6 +29,17 @@ export class PlatformWrapperInterface {
return false;
}
/**
* Whether the user has unlimited savegames
*/
getHasUnlimitedSavegames() {
return true;
}
getShowDemoBadges() {
return false;
}
/**
* Returns the strength of touch pans with the mouse
*/

@ -54,7 +54,11 @@ export class MainMenuState extends GameState {
<div class="logo">
<img src="${cachebust("res/logo.png")}" alt="shapez.io Logo">
${IS_DEMO ? `<div class="demoBadge"></div>` : ""}
${
IS_DEMO && this.app.platformWrapper.getShowDemoBadges()
? `<div class="demoBadge"></div>`
: ""
}
</div>
@ -104,7 +108,11 @@ export class MainMenuState extends GameState {
}
requestImportSavegame() {
if (IS_DEMO && this.app.savegameMgr.getSavegamesMetaData().length > 0) {
if (
IS_DEMO &&
this.app.savegameMgr.getSavegamesMetaData().length > 0 &&
!this.app.platformWrapper.getHasUnlimitedSavegames()
) {
this.app.analytics.trackUiClick("importgame_slot_limit_show");
this.dialogs.showWarning(T.dialogs.oneSavegameLimit.title, T.dialogs.oneSavegameLimit.desc);
return;
@ -373,7 +381,11 @@ export class MainMenuState extends GameState {
}
onPlayButtonClicked() {
if (IS_DEMO && this.app.savegameMgr.getSavegamesMetaData().length > 0) {
if (
IS_DEMO &&
this.app.savegameMgr.getSavegamesMetaData().length > 0 &&
!this.app.platformWrapper.getHasUnlimitedSavegames()
) {
this.app.analytics.trackUiClick("startgame_slot_limit_show");
this.dialogs.showWarning(T.dialogs.oneSavegameLimit.title, T.dialogs.oneSavegameLimit.desc);
return;

Loading…
Cancel
Save