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 {
|
.footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
|
@ -106,8 +106,8 @@ export const globalConfig = {
|
||||||
// Global game speed
|
// Global game speed
|
||||||
gameSpeed: 1,
|
gameSpeed: 1,
|
||||||
|
|
||||||
warmupTimeSecondsFast: 0.5,
|
warmupTimeSecondsFast: 0.25,
|
||||||
warmupTimeSecondsRegular: 1.5,
|
warmupTimeSecondsRegular: 0.25,
|
||||||
|
|
||||||
smoothing: {
|
smoothing: {
|
||||||
smoothMainCanvas: smoothCanvas && true,
|
smoothMainCanvas: smoothCanvas && true,
|
||||||
|
|
|
@ -64,19 +64,10 @@ export class HUDStandaloneAdvantages extends BaseHUDPart {
|
||||||
}
|
}
|
||||||
|
|
||||||
get showIntervalSeconds() {
|
get showIntervalSeconds() {
|
||||||
switch (this.root.app.gameAnalytics.abtVariant) {
|
if (G_IS_STANDALONE) {
|
||||||
case "0":
|
|
||||||
return 5 * 60;
|
|
||||||
case "1":
|
|
||||||
return 10 * 60;
|
|
||||||
case "2":
|
|
||||||
default:
|
|
||||||
return 15 * 60;
|
|
||||||
case "3":
|
|
||||||
return 20 * 60;
|
return 20 * 60;
|
||||||
case "4":
|
|
||||||
return 1e14;
|
|
||||||
}
|
}
|
||||||
|
return 5 * 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize() {
|
initialize() {
|
||||||
|
@ -88,6 +79,10 @@ export class HUDStandaloneAdvantages extends BaseHUDPart {
|
||||||
this.close();
|
this.close();
|
||||||
|
|
||||||
this.lastShown = -1e10;
|
this.lastShown = -1e10;
|
||||||
|
|
||||||
|
if (["1", "3"].includes(this.root.app.gameAnalytics.abtVariant)) {
|
||||||
|
this.lastShown = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
show() {
|
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
|
// Be sure to increment the ID whenever it changes
|
||||||
const analyticsLocalFile = G_IS_STEAM_DEMO ? "shapez_token_steamdemo.bin" : "shapez_token_123.bin";
|
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 {
|
export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
||||||
constructor(app) {
|
constructor(app) {
|
||||||
|
@ -50,16 +51,16 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchABVariant() {
|
fetchABVariant() {
|
||||||
return this.app.storage.readFileAsync("shapez_" + currentABT + ".bin").then(
|
return this.app.storage.readFileAsync("shapez_" + CURRENT_ABT + ".bin").then(
|
||||||
abt => {
|
abt => {
|
||||||
this.abtVariant = abt;
|
this.abtVariant = abt;
|
||||||
logger.log("Got abtVariant:", abt);
|
logger.log("Got abtVariant:", abt);
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
if (err === FILE_NOT_FOUND) {
|
if (err === FILE_NOT_FOUND) {
|
||||||
this.abtVariant = String(randomInt(0, 4));
|
this.abtVariant = String(randomInt(0, CURRENT_ABT_COUNT - 1));
|
||||||
logger.log("Determing abt variant to", this.abtVariant);
|
logger.log("Set", CURRENT_ABT, "to", this.abtVariant);
|
||||||
this.app.storage.writeFileAsync("shapez_" + currentABT + ".bin", 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_" +
|
"https://play.shapez.io/shapez_launch_" +
|
||||||
this.environment +
|
this.environment +
|
||||||
"_" +
|
"_" +
|
||||||
currentABT +
|
CURRENT_ABT +
|
||||||
"_" +
|
"_" +
|
||||||
this.abtVariant,
|
this.abtVariant,
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,8 @@ import { T } from "../translations";
|
||||||
|
|
||||||
const trim = require("trim");
|
const trim = require("trim");
|
||||||
|
|
||||||
|
let firstPlayForwarded = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import("../savegame/savegame_typedefs").SavegameMetadata} SavegameMetadata
|
* @typedef {import("../savegame/savegame_typedefs").SavegameMetadata} SavegameMetadata
|
||||||
* @typedef {import("../profile/setting_types").EnumSetting} EnumSetting
|
* @typedef {import("../profile/setting_types").EnumSetting} EnumSetting
|
||||||
|
@ -61,7 +63,6 @@ export class MainMenuState extends GameState {
|
||||||
showDiscordLink = true;
|
showDiscordLink = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const showCrosspromo = !G_IS_STANDALONE && showExternalLinks;
|
|
||||||
const showDemoAdvertisement =
|
const showDemoAdvertisement =
|
||||||
showExternalLinks && this.app.restrictionMgr.getIsStandaloneMarketingActive();
|
showExternalLinks && this.app.restrictionMgr.getIsStandaloneMarketingActive();
|
||||||
|
|
||||||
|
@ -233,11 +234,6 @@ export class MainMenuState extends GameState {
|
||||||
</a></div>
|
</a></div>
|
||||||
</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.renderMainMenu();
|
||||||
this.renderSavegames();
|
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() {
|
renderMainMenu() {
|
||||||
|
|
Loading…
Reference in New Issue