1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Special options while running on iogames.space

This commit is contained in:
tobspr
2020-05-24 17:49:12 +02:00
parent a627fb9a94
commit 9033c9eb67
6 changed files with 58 additions and 6 deletions

View File

@@ -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({

View File

@@ -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
*/