Compare commits

...

2 Commits

Author SHA1 Message Date
tobspr 52166fdd86 Fix discount still being active 2022-07-07 20:40:47 +02:00
tobspr b67f925f4f Update since summer sale ended 2022-07-07 20:36:05 +02:00
3 changed files with 13 additions and 17 deletions

View File

@ -49,7 +49,6 @@ export class HUDStandaloneAdvantages extends BaseHUDPart {
: "" : ""
} }
</button> </button>
${!G_IS_STEAM_DEMO ? `<span class="specialOffer">${T.global.discountSummerSale}</span>` : ""}
<button class="otherCloseButton" data-btn-variant="${G_IS_STEAM_DEMO ? "steam-demo" : "prod"}">${ <button class="otherCloseButton" data-btn-variant="${G_IS_STEAM_DEMO ? "steam-demo" : "prod"}">${
T.ingame.standaloneAdvantages.no_thanks T.ingame.standaloneAdvantages.no_thanks
}</button> }</button>

View File

@ -110,7 +110,6 @@ export class MainMenuState extends GameState {
} }
Play shapez on Steam Play shapez on Steam
</a> </a>
${!G_IS_STEAM_DEMO ? `<span class="specialOffer">${T.global.discountSummerSale}</span>` : ""}
${!G_IS_STEAM_DEMO ? `<div class="onlinePlayerCount"></div>` : ""} ${!G_IS_STEAM_DEMO ? `<div class="onlinePlayerCount"></div>` : ""}
`; `;

View File

@ -47,21 +47,19 @@ export class PreloadState extends GameState {
} }
async fetchDiscounts() { async fetchDiscounts() {
// Summer sale specific await timeoutPromise(
globalConfig.currentDiscount = 60; fetch("https://analytics.shapez.io/v1/discounts")
.then(res => res.json())
// Regular .then(data => {
// await timeoutPromise( globalConfig.currentDiscount = Number(
// fetch("https://analytics.shapez.io/v1/discounts") data["1318690"].data.price_overview.discount_percent
// .then(res => res.json()) );
// .then(data => { logger.log("Fetched current discount:", globalConfig.currentDiscount);
// globalConfig.currentDiscount = Number(data["1318690"].data.price_overview.discount_percent); }),
// logger.log("Fetched current discount:", globalConfig.currentDiscount); 2000
// }), ).catch(err => {
// 2000 logger.warn("Failed to fetch current discount:", err);
// ).catch(err => { });
// logger.warn("Failed to fetch current discount:", err);
// });
} }
async sendBeacon() { async sendBeacon() {