You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tobspr_shapez.io/src/js/game/hud/parts/steam_capsule.js

28 lines
873 B

import { openStandaloneLink } from "../../../core/config";
import { makeDiv } from "../../../core/utils";
import { BaseHUDPart } from "../base_hud_part";
import { DynamicDomAttach } from "../dynamic_dom_attach";
const showCapsuleAfter = 30 * 60;
export class HUDSteamCapsule extends BaseHUDPart {
createElements(parent) {
this.element = makeDiv(parent, "ingame_HUD_SteamCapsule");
}
initialize() {
this.domAttach = new DynamicDomAttach(this.root, this.element);
this.trackClicks(this.element, () => {
openStandaloneLink(this.root.app, "shapez_steamcapsule");
});
}
update() {
if (this.root.app.gameAnalytics.abtVariant === "0") {
// only show in original variant
this.domAttach.update(this.root.time.now() > showCapsuleAfter);
}
}
}