try out different variants
This commit is contained in:
parent
8c5118e41d
commit
e1cd08d2f9
|
@ -677,16 +677,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
#crosspromo {
|
||||
position: absolute;
|
||||
@include S(bottom, 50px);
|
||||
@include S(right, 20px);
|
||||
@include S(width, 190px);
|
||||
@include S(height, 100px);
|
||||
pointer-events: all;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
|
|
|
@ -106,8 +106,8 @@ export const globalConfig = {
|
|||
// Global game speed
|
||||
gameSpeed: 1,
|
||||
|
||||
warmupTimeSecondsFast: 0.5,
|
||||
warmupTimeSecondsRegular: 1.5,
|
||||
warmupTimeSecondsFast: 0.25,
|
||||
warmupTimeSecondsRegular: 0.25,
|
||||
|
||||
smoothing: {
|
||||
smoothMainCanvas: smoothCanvas && true,
|
||||
|
|
|
@ -64,19 +64,10 @@ export class HUDStandaloneAdvantages extends BaseHUDPart {
|
|||
}
|
||||
|
||||
get showIntervalSeconds() {
|
||||
switch (this.root.app.gameAnalytics.abtVariant) {
|
||||
case "0":
|
||||
return 5 * 60;
|
||||
case "1":
|
||||
return 10 * 60;
|
||||
case "2":
|
||||
default:
|
||||
return 15 * 60;
|
||||
case "3":
|
||||
return 20 * 60;
|
||||
case "4":
|
||||
return 1e14;
|
||||
if (G_IS_STANDALONE) {
|
||||
return 20 * 60;
|
||||
}
|
||||
return 5 * 60;
|
||||
}
|
||||
|
||||
initialize() {
|
||||
|
@ -88,6 +79,10 @@ export class HUDStandaloneAdvantages extends BaseHUDPart {
|
|||
this.close();
|
||||
|
||||
this.lastShown = -1e10;
|
||||
|
||||
if (["1", "3"].includes(this.root.app.gameAnalytics.abtVariant)) {
|
||||
this.lastShown = 0;
|
||||
}
|
||||
}
|
||||
|
||||
show() {
|
||||
|
|
|
@ -17,7 +17,8 @@ const analyticsUrl = G_IS_DEV ? "http://localhost:8001" : "https://analytics.sha
|
|||
// Be sure to increment the ID whenever it changes
|
||||
const analyticsLocalFile = G_IS_STEAM_DEMO ? "shapez_token_steamdemo.bin" : "shapez_token_123.bin";
|
||||
|
||||
const currentABT = "abt_sa_si";
|
||||
const CURRENT_ABT = "abt_ilig";
|
||||
const CURRENT_ABT_COUNT = 4;
|
||||
|
||||
export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
||||
constructor(app) {
|
||||
|
@ -50,16 +51,16 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
|||
}
|
||||
|
||||
fetchABVariant() {
|
||||
return this.app.storage.readFileAsync("shapez_" + currentABT + ".bin").then(
|
||||
return this.app.storage.readFileAsync("shapez_" + CURRENT_ABT + ".bin").then(
|
||||
abt => {
|
||||
this.abtVariant = abt;
|
||||
logger.log("Got abtVariant:", abt);
|
||||
},
|
||||
err => {
|
||||
if (err === FILE_NOT_FOUND) {
|
||||
this.abtVariant = String(randomInt(0, 4));
|
||||
logger.log("Determing abt variant to", this.abtVariant);
|
||||
this.app.storage.writeFileAsync("shapez_" + currentABT + ".bin", this.abtVariant);
|
||||
this.abtVariant = String(randomInt(0, CURRENT_ABT_COUNT - 1));
|
||||
logger.log("Set", CURRENT_ABT, "to", this.abtVariant);
|
||||
this.app.storage.writeFileAsync("shapez_" + CURRENT_ABT + ".bin", this.abtVariant);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -84,7 +85,7 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
|||
"https://play.shapez.io/shapez_launch_" +
|
||||
this.environment +
|
||||
"_" +
|
||||
currentABT +
|
||||
CURRENT_ABT +
|
||||
"_" +
|
||||
this.abtVariant,
|
||||
{
|
||||
|
|
|
@ -25,6 +25,8 @@ import { T } from "../translations";
|
|||
|
||||
const trim = require("trim");
|
||||
|
||||
let firstPlayForwarded = false;
|
||||
|
||||
/**
|
||||
* @typedef {import("../savegame/savegame_typedefs").SavegameMetadata} SavegameMetadata
|
||||
* @typedef {import("../profile/setting_types").EnumSetting} EnumSetting
|
||||
|
@ -61,7 +63,6 @@ export class MainMenuState extends GameState {
|
|||
showDiscordLink = true;
|
||||
}
|
||||
|
||||
const showCrosspromo = !G_IS_STANDALONE && showExternalLinks;
|
||||
const showDemoAdvertisement =
|
||||
showExternalLinks && this.app.restrictionMgr.getIsStandaloneMarketingActive();
|
||||
|
||||
|
@ -233,11 +234,6 @@ export class MainMenuState extends GameState {
|
|||
</a></div>
|
||||
</div>
|
||||
|
||||
${
|
||||
showCrosspromo
|
||||
? `<iframe id="crosspromo" src="https://crosspromo.tobspr.io?src=shapez_web"></iframe>`
|
||||
: ""
|
||||
}
|
||||
`
|
||||
}
|
||||
`;
|
||||
|
@ -382,6 +378,16 @@ export class MainMenuState extends GameState {
|
|||
|
||||
this.renderMainMenu();
|
||||
this.renderSavegames();
|
||||
|
||||
if (
|
||||
this.app.restrictionMgr.isLimitedVersion() &&
|
||||
["0", "1"].includes(this.app.gameAnalytics.abtVariant) &&
|
||||
this.app.savegameMgr.getSavegamesMetaData().length === 0 &&
|
||||
!firstPlayForwarded
|
||||
) {
|
||||
firstPlayForwarded = true;
|
||||
this.onPlayButtonClicked();
|
||||
}
|
||||
}
|
||||
|
||||
renderMainMenu() {
|
||||
|
|
Loading…
Reference in New Issue