mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-14 02:31:51 +00:00
Remove the restriction manager
Restriction manager is completely removed as it's only useful for demo version. Lots of other demo-related things are left, such as ad support or extended telemetry. This should be cleaned up later.
This commit is contained in:
parent
a2d1e434bb
commit
b55001dd1a
@ -1,293 +0,0 @@
|
|||||||
#ingame_HUD_StandaloneAdvantages {
|
|
||||||
.content {
|
|
||||||
@include S(width, 500px);
|
|
||||||
@include S(min-height, 300px);
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
@include PlainText;
|
|
||||||
}
|
|
||||||
|
|
||||||
.points {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
@include S(grid-column-gap, 5px);
|
|
||||||
@include S(grid-row-gap, 5px);
|
|
||||||
@include S(margin, 10px, 0, 10px);
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
@include Heading;
|
|
||||||
text-transform: none;
|
|
||||||
text-align: center;
|
|
||||||
color: $colorRedBright;
|
|
||||||
}
|
|
||||||
.subTitle {
|
|
||||||
@include PlainText;
|
|
||||||
text-transform: none;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lowerBar {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
> button {
|
|
||||||
transition: opacity 0.12s ease-in-out;
|
|
||||||
&:hover {
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.otherCloseButton {
|
|
||||||
@include SuperSmallText;
|
|
||||||
@include S(margin-right, 30px);
|
|
||||||
color: #aaa;
|
|
||||||
@include S(margin, 0);
|
|
||||||
@include IncreasedClickArea(0px);
|
|
||||||
@include S(margin-top, 15px);
|
|
||||||
|
|
||||||
&[data-btn-variant="prod"] {
|
|
||||||
@include InlineAnimation(11s ease-in-out) {
|
|
||||||
0% {
|
|
||||||
opacity: 0.05;
|
|
||||||
}
|
|
||||||
80% {
|
|
||||||
opacity: 0.05;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&[data-btn-variant="steam-demo"] {
|
|
||||||
@include InlineAnimation(5s ease-in-out) {
|
|
||||||
0% {
|
|
||||||
opacity: 0.05;
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
opacity: 0.05;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.playtimeDisclaimer {
|
|
||||||
@include S(margin-bottom, 15px);
|
|
||||||
@include PlainText;
|
|
||||||
}
|
|
||||||
|
|
||||||
.playtimeDisclaimerDownload {
|
|
||||||
@include SuperSmallText;
|
|
||||||
box-sizing: border-box;
|
|
||||||
text-align: center;
|
|
||||||
@include S(border-radius, $globalBorderRadius);
|
|
||||||
@include S(padding, 8px, 10px, 8px, 20px);
|
|
||||||
@include S(margin-bottom, 15px);
|
|
||||||
pointer-events: all;
|
|
||||||
transition: background-color 0.12s ease-in-out;
|
|
||||||
color: rgba(#000, 0.5);
|
|
||||||
|
|
||||||
width: 100%;
|
|
||||||
background: rgba($colorGreenBright, 0.2);
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: auto 1fr;
|
|
||||||
@include S(grid-gap, 5px);
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: "";
|
|
||||||
display: inline-flex;
|
|
||||||
@include S(width, 15px);
|
|
||||||
@include S(height, 15px);
|
|
||||||
& {
|
|
||||||
/* load-async */
|
|
||||||
background: uiResource("icons/savegame_correct.png") center center / contain no-repeat;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
strong {
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.steamLinkButton {
|
|
||||||
@include IncreasedClickArea(5px);
|
|
||||||
@include S(margin, 0);
|
|
||||||
@include S(width, 180px);
|
|
||||||
@include S(height, 40px);
|
|
||||||
background: #171a23 center center / contain no-repeat;
|
|
||||||
|
|
||||||
box-shadow: 0 D(3px) D(10px) rgba(96, 163, 136, 0.5);
|
|
||||||
overflow: visible;
|
|
||||||
@include S(border-radius, $globalBorderRadius);
|
|
||||||
|
|
||||||
@include InlineAnimation(1s ease-in-out infinite) {
|
|
||||||
50% {
|
|
||||||
transform: scale(1.02, 1.03);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
opacity: 0.94 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .discount {
|
|
||||||
position: absolute;
|
|
||||||
@include S(top, -12px);
|
|
||||||
@include S(right, -15px);
|
|
||||||
background: #4c6b22;
|
|
||||||
color: #c5ea3f;
|
|
||||||
@include S(border-radius, $globalBorderRadius);
|
|
||||||
@include S(padding, 1px, 3px, 1px, 4px);
|
|
||||||
@include PlainText;
|
|
||||||
text-transform: uppercase;
|
|
||||||
transform: rotate(3deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.specialOffer {
|
|
||||||
color: #000000;
|
|
||||||
@include PlainText;
|
|
||||||
align-self: center;
|
|
||||||
text-align: center;
|
|
||||||
@include S(margin-top, 5px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.point {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: #{D(50px)} auto;
|
|
||||||
grid-template-rows: D(20px) D(20px);
|
|
||||||
background: #eff2f4 #{D(12px)} center / #{D(30px)} no-repeat;
|
|
||||||
|
|
||||||
@include S(border-radius, $globalBorderRadius);
|
|
||||||
align-items: center;
|
|
||||||
@include S(padding, 10px, 4px, 4px);
|
|
||||||
@include S(height, 40px);
|
|
||||||
|
|
||||||
> strong {
|
|
||||||
grid-column: 2 / 3;
|
|
||||||
grid-row: 1 / 2;
|
|
||||||
@include PlainText;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
> p {
|
|
||||||
grid-column: 2 / 3;
|
|
||||||
grid-row: 2 / 3;
|
|
||||||
@include SuperSmallText;
|
|
||||||
line-height: 1em;
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.levels {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_new_levels.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #f13555;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.upgrades {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_upgrades.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #8a00ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.buildings {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_buildings.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #3fce8b;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.wires {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_wires.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #ef2fdb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.markers {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_markers.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #4294ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.mods {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_mods.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #8a00ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.savegames {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_savegames.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #ff9500;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.darkmode {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_dark_mode.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #292c32;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.support {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_support.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #e72d2d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.achievements {
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/advantage_achievements.png");
|
|
||||||
}
|
|
||||||
> strong {
|
|
||||||
color: #ffac0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,107 +0,0 @@
|
|||||||
#ingame_HUD_Watermark {
|
|
||||||
position: absolute;
|
|
||||||
|
|
||||||
@include S(border-radius, $globalBorderRadius);
|
|
||||||
@include S(top, 70px);
|
|
||||||
pointer-events: all;
|
|
||||||
cursor: pointer;
|
|
||||||
left: 50%;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
background: rgba(207, 65, 65, 0.8);
|
|
||||||
color: #fff;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
@include PlainText;
|
|
||||||
@include S(padding, 10px);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
transform: translateX(-50%) scale(1.02) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
> strong {
|
|
||||||
@include PlainText;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
> p {
|
|
||||||
@include SuperSmallText;
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
&.visible {
|
|
||||||
@include InlineAnimation(0.5s ease-in-out) {
|
|
||||||
0% {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(.visible) {
|
|
||||||
@include InlineAnimation(0.5s ease-in-out) {
|
|
||||||
0% {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ingame_HUD_WatermarkClicker {
|
|
||||||
@include S(top, 55px);
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%) !important;
|
|
||||||
@include SuperSmallText;
|
|
||||||
color: $colorBlueBright;
|
|
||||||
text-transform: uppercase;
|
|
||||||
pointer-events: all;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
@include S(margin-left, 4px);
|
|
||||||
content: "";
|
|
||||||
@include S(width, 10px);
|
|
||||||
@include S(height, 10px);
|
|
||||||
display: inline-flex;
|
|
||||||
background: center center / contain no-repeat;
|
|
||||||
& {
|
|
||||||
/* @load-async */
|
|
||||||
background-image: uiResource("res/ui/icons/demo_steam_link_indicator.png");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.withDiscount {
|
|
||||||
color: #4c6b22;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .discount {
|
|
||||||
// position: absolute;
|
|
||||||
@include S(margin, 0, 5px);
|
|
||||||
|
|
||||||
background: rgba(#4c6b22, 1);
|
|
||||||
color: #c5ea3f;
|
|
||||||
@include S(border-radius, $globalBorderRadius);
|
|
||||||
@include S(padding, 0px, 2px, 0px, 3px);
|
|
||||||
@include SuperSmallText;
|
|
||||||
text-transform: uppercase;
|
|
||||||
transform: rotate(0deg);
|
|
||||||
@include InlineAnimation(1.3s ease-in-out infinite) {
|
|
||||||
50% {
|
|
||||||
transform: rotate(0.5deg) scale(1.05);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -48,14 +48,12 @@
|
|||||||
@import "ingame_hud/debug_info";
|
@import "ingame_hud/debug_info";
|
||||||
@import "ingame_hud/entity_debugger";
|
@import "ingame_hud/entity_debugger";
|
||||||
@import "ingame_hud/tutorial_hints";
|
@import "ingame_hud/tutorial_hints";
|
||||||
@import "ingame_hud/watermark";
|
|
||||||
@import "ingame_hud/blueprint_placer";
|
@import "ingame_hud/blueprint_placer";
|
||||||
@import "ingame_hud/waypoints";
|
@import "ingame_hud/waypoints";
|
||||||
@import "ingame_hud/interactive_tutorial";
|
@import "ingame_hud/interactive_tutorial";
|
||||||
@import "ingame_hud/color_blind_helper";
|
@import "ingame_hud/color_blind_helper";
|
||||||
@import "ingame_hud/shape_viewer";
|
@import "ingame_hud/shape_viewer";
|
||||||
@import "ingame_hud/sandbox_controller";
|
@import "ingame_hud/sandbox_controller";
|
||||||
@import "ingame_hud/standalone_advantages";
|
|
||||||
@import "ingame_hud/puzzle_back_to_menu";
|
@import "ingame_hud/puzzle_back_to_menu";
|
||||||
@import "ingame_hud/puzzle_editor_review";
|
@import "ingame_hud/puzzle_editor_review";
|
||||||
@import "ingame_hud/puzzle_dlc_logo";
|
@import "ingame_hud/puzzle_dlc_logo";
|
||||||
@ -101,7 +99,6 @@ ingame_HUD_wires_toolbar,
|
|||||||
ingame_HUD_BlueprintPlacer,
|
ingame_HUD_BlueprintPlacer,
|
||||||
ingame_HUD_Waypoints_Hint,
|
ingame_HUD_Waypoints_Hint,
|
||||||
ingame_HUD_WatermarkClicker,
|
ingame_HUD_WatermarkClicker,
|
||||||
ingame_HUD_Watermark,
|
|
||||||
ingame_HUD_ColorBlindBelowTileHelper,
|
ingame_HUD_ColorBlindBelowTileHelper,
|
||||||
ingame_HUD_SandboxController,
|
ingame_HUD_SandboxController,
|
||||||
|
|
||||||
@ -112,7 +109,6 @@ ingame_HUD_BetaOverlay,
|
|||||||
ingame_HUD_Shop,
|
ingame_HUD_Shop,
|
||||||
ingame_HUD_Statistics,
|
ingame_HUD_Statistics,
|
||||||
ingame_HUD_ShapeViewer,
|
ingame_HUD_ShapeViewer,
|
||||||
ingame_HUD_StandaloneAdvantages,
|
|
||||||
ingame_HUD_UnlockNotification,
|
ingame_HUD_UnlockNotification,
|
||||||
ingame_HUD_PuzzleCompleteNotification,
|
ingame_HUD_PuzzleCompleteNotification,
|
||||||
ingame_HUD_SettingsMenu,
|
ingame_HUD_SettingsMenu,
|
||||||
@ -129,7 +125,9 @@ $zindex: 100;
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.uiHidden {
|
body.uiHidden {
|
||||||
> div:not(.ingameDialog):not(#ingame_HUD_SettingsMenu):not(#ingame_HUD_ModalDialogs):not(#ingame_HUD_UnlockNotification):not(#ingame_HUD_PuzzleCompleteNotification) {
|
> div:not(.ingameDialog):not(#ingame_HUD_SettingsMenu):not(#ingame_HUD_ModalDialogs):not(
|
||||||
|
#ingame_HUD_UnlockNotification
|
||||||
|
):not(#ingame_HUD_PuzzleCompleteNotification) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,6 @@ import { MobileWarningState } from "./states/mobile_warning";
|
|||||||
import { PreloadState } from "./states/preload";
|
import { PreloadState } from "./states/preload";
|
||||||
import { SettingsState } from "./states/settings";
|
import { SettingsState } from "./states/settings";
|
||||||
import { ShapezGameAnalytics } from "./platform/browser/game_analytics";
|
import { ShapezGameAnalytics } from "./platform/browser/game_analytics";
|
||||||
import { RestrictionManager } from "./core/restriction_manager";
|
|
||||||
import { PuzzleMenuState } from "./states/puzzle_menu";
|
import { PuzzleMenuState } from "./states/puzzle_menu";
|
||||||
import { ClientAPI } from "./platform/api";
|
import { ClientAPI } from "./platform/api";
|
||||||
import { LoginState } from "./states/login";
|
import { LoginState } from "./states/login";
|
||||||
@ -94,9 +93,6 @@ export class Application {
|
|||||||
this.backgroundResourceLoader = new BackgroundResourcesLoader(this);
|
this.backgroundResourceLoader = new BackgroundResourcesLoader(this);
|
||||||
this.clientApi = new ClientAPI(this);
|
this.clientApi = new ClientAPI(this);
|
||||||
|
|
||||||
// Restrictions (Like demo etc)
|
|
||||||
this.restrictionMgr = new RestrictionManager(this);
|
|
||||||
|
|
||||||
// Platform dependent stuff
|
// Platform dependent stuff
|
||||||
|
|
||||||
/** @type {StorageInterface} */
|
/** @type {StorageInterface} */
|
||||||
|
|||||||
@ -1,130 +0,0 @@
|
|||||||
/* typehints:start */
|
|
||||||
import { Application } from "../application";
|
|
||||||
/* typehints:end */
|
|
||||||
import { ExplainedResult } from "./explained_result";
|
|
||||||
import { ReadWriteProxy } from "./read_write_proxy";
|
|
||||||
import { WEB_STEAM_SSO_AUTHENTICATED } from "./steam_sso";
|
|
||||||
|
|
||||||
export class RestrictionManager extends ReadWriteProxy {
|
|
||||||
/**
|
|
||||||
* @param {Application} app
|
|
||||||
*/
|
|
||||||
constructor(app) {
|
|
||||||
super(app, "restriction-flags.bin");
|
|
||||||
|
|
||||||
this.currentData = this.getDefaultData();
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- RW Proxy Impl
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {any} data
|
|
||||||
*/
|
|
||||||
verify(data) {
|
|
||||||
return ExplainedResult.good();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
getDefaultData() {
|
|
||||||
return {
|
|
||||||
version: this.getCurrentVersion(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
getCurrentVersion() {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {any} data
|
|
||||||
*/
|
|
||||||
migrate(data) {
|
|
||||||
return ExplainedResult.good();
|
|
||||||
}
|
|
||||||
|
|
||||||
initialize() {
|
|
||||||
return this.readAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- End RW Proxy Impl
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if the app is currently running as the limited version
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
isLimitedVersion() {
|
|
||||||
if (G_IS_STANDALONE) {
|
|
||||||
// Standalone is never limited
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (WEB_STEAM_SSO_AUTHENTICATED) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (G_IS_DEV) {
|
|
||||||
return typeof window !== "undefined" && window.location.search.indexOf("demo") >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if the app markets the standalone version on steam
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
getIsStandaloneMarketingActive() {
|
|
||||||
return this.isLimitedVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if exporting the base as a screenshot is possible
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
getIsExportingScreenshotsPossible() {
|
|
||||||
return !this.isLimitedVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the maximum number of supported waypoints
|
|
||||||
* @returns {number}
|
|
||||||
*/
|
|
||||||
getMaximumWaypoints() {
|
|
||||||
return this.isLimitedVersion() ? 2 : 1e20;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if the user has unlimited savegames
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
getHasUnlimitedSavegames() {
|
|
||||||
return !this.isLimitedVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if the app has all settings available
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
getHasExtendedSettings() {
|
|
||||||
return !this.isLimitedVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if all upgrades are available
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
getHasExtendedUpgrades() {
|
|
||||||
return !this.isLimitedVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if all levels & freeplay is available
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
getHasExtendedLevelsAndFreeplay() {
|
|
||||||
return !this.isLimitedVersion();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -197,12 +197,6 @@ export class HubGoals extends BasicSerializableObject {
|
|||||||
if (G_IS_DEV && globalConfig.debug.allBuildingsUnlocked) {
|
if (G_IS_DEV && globalConfig.debug.allBuildingsUnlocked) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (
|
|
||||||
reward === enumHubGoalRewards.reward_blueprints &&
|
|
||||||
this.root.app.restrictionMgr.isLimitedVersion()
|
|
||||||
) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.root.gameMode.getLevelDefinitions().length < 1) {
|
if (this.root.gameMode.getLevelDefinitions().length < 1) {
|
||||||
// no story, so always unlocked
|
// no story, so always unlocked
|
||||||
|
|||||||
4
src/js/game/hud/hud_parts.d.ts
vendored
4
src/js/game/hud/hud_parts.d.ts
vendored
@ -31,13 +31,11 @@ import type { HUDSettingsMenu } from "./parts/settings_menu.js";
|
|||||||
import type { HUDShapeTooltip } from "./parts/shape_tooltip.js";
|
import type { HUDShapeTooltip } from "./parts/shape_tooltip.js";
|
||||||
import type { HUDShapeViewer } from "./parts/shape_viewer.js";
|
import type { HUDShapeViewer } from "./parts/shape_viewer.js";
|
||||||
import type { HUDShop } from "./parts/shop.js";
|
import type { HUDShop } from "./parts/shop.js";
|
||||||
import type { HUDStandaloneAdvantages } from "./parts/standalone_advantages.js";
|
|
||||||
import type { HUDStatistics } from "./parts/statistics.js";
|
import type { HUDStatistics } from "./parts/statistics.js";
|
||||||
import type { HUDPartTutorialHints } from "./parts/tutorial_hints.js";
|
import type { HUDPartTutorialHints } from "./parts/tutorial_hints.js";
|
||||||
import type { HUDTutorialVideoOffer } from "./parts/tutorial_video_offer.js";
|
import type { HUDTutorialVideoOffer } from "./parts/tutorial_video_offer.js";
|
||||||
import type { HUDUnlockNotification } from "./parts/unlock_notification.js";
|
import type { HUDUnlockNotification } from "./parts/unlock_notification.js";
|
||||||
import type { HUDVignetteOverlay } from "./parts/vignette_overlay.js";
|
import type { HUDVignetteOverlay } from "./parts/vignette_overlay.js";
|
||||||
import type { HUDWatermark } from "./parts/watermark.js";
|
|
||||||
import type { HUDWaypoints } from "./parts/waypoints.js";
|
import type { HUDWaypoints } from "./parts/waypoints.js";
|
||||||
import type { HUDWiresOverlay } from "./parts/wires_overlay.js";
|
import type { HUDWiresOverlay } from "./parts/wires_overlay.js";
|
||||||
import type { HUDWiresToolbar } from "./parts/wires_toolbar.js";
|
import type { HUDWiresToolbar } from "./parts/wires_toolbar.js";
|
||||||
@ -87,8 +85,6 @@ export interface HudParts {
|
|||||||
tutorialVideoOffer?: HUDTutorialVideoOffer;
|
tutorialVideoOffer?: HUDTutorialVideoOffer;
|
||||||
gameMenu?: HUDGameMenu;
|
gameMenu?: HUDGameMenu;
|
||||||
keybindingOverlay?: HUDKeybindingOverlay;
|
keybindingOverlay?: HUDKeybindingOverlay;
|
||||||
watermark?: HUDWatermark;
|
|
||||||
standaloneAdvantages?: HUDStandaloneAdvantages;
|
|
||||||
tutorialHints?: HUDPartTutorialHints;
|
tutorialHints?: HUDPartTutorialHints;
|
||||||
interactiveTutorial?: HUDInteractiveTutorial;
|
interactiveTutorial?: HUDInteractiveTutorial;
|
||||||
|
|
||||||
|
|||||||
@ -99,31 +99,6 @@ export class HUDModalDialogs extends BaseHUDPart {
|
|||||||
return dialog.buttonSignals;
|
return dialog.buttonSignals;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} feature
|
|
||||||
* @param {string} textPrefab
|
|
||||||
*/
|
|
||||||
showFeatureRestrictionInfo(feature, textPrefab = T.dialogs.featureRestriction.desc) {
|
|
||||||
const dialog = new Dialog({
|
|
||||||
app: this.app,
|
|
||||||
title: T.dialogs.featureRestriction.title,
|
|
||||||
contentHTML: textPrefab.replace("<feature>", feature),
|
|
||||||
buttons: ["cancel:bad", "getStandalone:good"],
|
|
||||||
type: "warning",
|
|
||||||
});
|
|
||||||
this.internalShowDialog(dialog);
|
|
||||||
|
|
||||||
if (this.app) {
|
|
||||||
this.app.sound.playUiSound(SOUNDS.dialogOk);
|
|
||||||
}
|
|
||||||
|
|
||||||
dialog.buttonSignals.getStandalone.add(() => {
|
|
||||||
openStandaloneLink(this.app, "shapez_demo_dialog");
|
|
||||||
});
|
|
||||||
|
|
||||||
return dialog.buttonSignals;
|
|
||||||
}
|
|
||||||
|
|
||||||
showOptionChooser(title, options) {
|
showOptionChooser(title, options) {
|
||||||
const dialog = new DialogOptionChooser({
|
const dialog = new DialogOptionChooser({
|
||||||
app: this.app,
|
app: this.app,
|
||||||
|
|||||||
@ -19,11 +19,6 @@ export class HUDScreenshotExporter extends BaseHUDPart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startExport() {
|
startExport() {
|
||||||
if (!this.root.app.restrictionMgr.getIsExportingScreenshotsPossible()) {
|
|
||||||
this.root.hud.parts.dialogs.showFeatureRestrictionInfo(T.demo.features.exportingBase);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { ok } = this.root.hud.parts.dialogs.showInfo(
|
const { ok } = this.root.hud.parts.dialogs.showInfo(
|
||||||
T.dialogs.exportScreenshotWarning.title,
|
T.dialogs.exportScreenshotWarning.title,
|
||||||
T.dialogs.exportScreenshotWarning.desc,
|
T.dialogs.exportScreenshotWarning.desc,
|
||||||
|
|||||||
@ -1,154 +0,0 @@
|
|||||||
import { globalConfig, openStandaloneLink } from "../../../core/config";
|
|
||||||
import { InputReceiver } from "../../../core/input_receiver";
|
|
||||||
import { ReadWriteProxy } from "../../../core/read_write_proxy";
|
|
||||||
import { generateFileDownload, makeDiv } from "../../../core/utils";
|
|
||||||
import { T } from "../../../translations";
|
|
||||||
import { BaseHUDPart } from "../base_hud_part";
|
|
||||||
import { DynamicDomAttach } from "../dynamic_dom_attach";
|
|
||||||
|
|
||||||
export class HUDStandaloneAdvantages extends BaseHUDPart {
|
|
||||||
createElements(parent) {
|
|
||||||
this.background = makeDiv(parent, "ingame_HUD_StandaloneAdvantages", ["ingameDialog"]);
|
|
||||||
|
|
||||||
// DIALOG Inner / Wrapper
|
|
||||||
this.dialogInner = makeDiv(this.background, null, ["dialogInner"]);
|
|
||||||
this.title = makeDiv(this.dialogInner, null, ["title"], "");
|
|
||||||
this.subTitle = makeDiv(this.dialogInner, null, ["subTitle"], T.ingame.standaloneAdvantages.titleV2);
|
|
||||||
|
|
||||||
this.contentDiv = makeDiv(
|
|
||||||
this.dialogInner,
|
|
||||||
null,
|
|
||||||
["content"],
|
|
||||||
`
|
|
||||||
<div class="points">
|
|
||||||
${Object.entries(T.ingame.standaloneAdvantages.points)
|
|
||||||
.map(
|
|
||||||
([key, trans]) => `
|
|
||||||
<div class="point ${key}">
|
|
||||||
<strong>${trans.title}</strong>
|
|
||||||
<p>${trans.desc}</p>
|
|
||||||
</div>`
|
|
||||||
)
|
|
||||||
.join("")}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="lowerBar">
|
|
||||||
|
|
||||||
<div class="playtimeDisclaimerDownload"><span class="inner">${
|
|
||||||
T.demoBanners.playtimeDisclaimerDownload
|
|
||||||
}</span></div>
|
|
||||||
|
|
||||||
<button class="steamLinkButton steam_dlbtn_0">
|
|
||||||
${
|
|
||||||
globalConfig.currentDiscount > 0
|
|
||||||
? `<span class='discount'>${T.global.discount.replace(
|
|
||||||
"<percentage>",
|
|
||||||
String(globalConfig.currentDiscount)
|
|
||||||
)}</span>`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
</button>
|
|
||||||
<button class="otherCloseButton" data-btn-variant="prod">${
|
|
||||||
T.ingame.standaloneAdvantages.no_thanks
|
|
||||||
}</button>
|
|
||||||
</div>
|
|
||||||
`
|
|
||||||
);
|
|
||||||
|
|
||||||
this.trackClicks(this.contentDiv.querySelector("button.steamLinkButton"), () => {
|
|
||||||
openStandaloneLink(this.root.app, "shapez_std_advg");
|
|
||||||
this.close();
|
|
||||||
});
|
|
||||||
this.trackClicks(this.contentDiv.querySelector("button.otherCloseButton"), () => {
|
|
||||||
this.close();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.trackClicks(this.contentDiv.querySelector(".playtimeDisclaimerDownload"), () => {
|
|
||||||
this.root.gameState.savegame.updateData(this.root);
|
|
||||||
const data = ReadWriteProxy.serializeObject(this.root.gameState.savegame.currentData);
|
|
||||||
const filename = "shapez-demo-savegame.bin";
|
|
||||||
generateFileDownload(filename, data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
get showIntervalSeconds() {
|
|
||||||
if (G_IS_STANDALONE) {
|
|
||||||
return 20 * 60;
|
|
||||||
}
|
|
||||||
return 15 * 60;
|
|
||||||
}
|
|
||||||
|
|
||||||
shouldPauseGame() {
|
|
||||||
return this.visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
shouldPauseRendering() {
|
|
||||||
return this.visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
hasBlockingOverlayOpen() {
|
|
||||||
return this.visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
initialize() {
|
|
||||||
this.domAttach = new DynamicDomAttach(this.root, this.background, {
|
|
||||||
attachClass: "visible",
|
|
||||||
});
|
|
||||||
|
|
||||||
this.inputReciever = new InputReceiver("standalone-advantages");
|
|
||||||
this.close();
|
|
||||||
|
|
||||||
// On standalone, show popup instant
|
|
||||||
// wait for next interval
|
|
||||||
this.lastShown = 0;
|
|
||||||
|
|
||||||
this.root.signals.gameRestored.add(() => {
|
|
||||||
if (
|
|
||||||
this.root.hubGoals.level >= this.root.gameMode.getLevelDefinitions().length - 1 &&
|
|
||||||
this.root.app.restrictionMgr.getIsStandaloneMarketingActive()
|
|
||||||
) {
|
|
||||||
this.show(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
show(final = false) {
|
|
||||||
if (!this.visible) {
|
|
||||||
this.root.app.gameAnalytics.noteMinor("game.std_advg.show");
|
|
||||||
this.root.app.gameAnalytics.noteMinor("game.std_advg.show-" + (final ? "final" : "nonfinal"));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.lastShown = this.root.time.now();
|
|
||||||
this.visible = true;
|
|
||||||
this.final = final;
|
|
||||||
this.root.app.inputMgr.makeSureAttachedAndOnTop(this.inputReciever);
|
|
||||||
|
|
||||||
if (this.final) {
|
|
||||||
this.title.innerText = T.ingame.standaloneAdvantages.titleExpiredV2;
|
|
||||||
} else if (this.root.time.now() < 120) {
|
|
||||||
this.title.innerText = "";
|
|
||||||
} else {
|
|
||||||
this.title.innerText = T.ingame.standaloneAdvantages.titleEnjoyingDemo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
close() {
|
|
||||||
if (this.final) {
|
|
||||||
this.root.gameState.goBackToMenu();
|
|
||||||
} else {
|
|
||||||
this.visible = false;
|
|
||||||
this.root.app.inputMgr.makeSureDetached(this.inputReciever);
|
|
||||||
|
|
||||||
this.update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
update() {
|
|
||||||
if (!this.visible && this.root.time.now() - this.lastShown > this.showIntervalSeconds) {
|
|
||||||
this.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.domAttach.update(this.visible);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -139,13 +139,6 @@ export class HUDUnlockNotification extends BaseHUDPart {
|
|||||||
|
|
||||||
this.root.hud.signals.unlockNotificationFinished.dispatch();
|
this.root.hud.signals.unlockNotificationFinished.dispatch();
|
||||||
|
|
||||||
if (
|
|
||||||
this.root.hubGoals.level > this.root.gameMode.getLevelDefinitions().length - 1 &&
|
|
||||||
this.root.app.restrictionMgr.getIsStandaloneMarketingActive()
|
|
||||||
) {
|
|
||||||
this.root.hud.parts.standaloneAdvantages.show(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.root.app.settings.getAllSettings().offerHints) {
|
if (!this.root.app.settings.getAllSettings().offerHints) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,49 +0,0 @@
|
|||||||
import { globalConfig, openStandaloneLink } from "../../../core/config";
|
|
||||||
import { makeDiv } from "../../../core/utils";
|
|
||||||
import { T } from "../../../translations";
|
|
||||||
import { BaseHUDPart } from "../base_hud_part";
|
|
||||||
|
|
||||||
export class HUDWatermark extends BaseHUDPart {
|
|
||||||
createElements(parent) {
|
|
||||||
let linkText = T.ingame.watermark.get_on_steam;
|
|
||||||
|
|
||||||
this.linkElement = makeDiv(
|
|
||||||
parent,
|
|
||||||
"ingame_HUD_WatermarkClicker",
|
|
||||||
globalConfig.currentDiscount > 0 ? ["withDiscount"] : [],
|
|
||||||
linkText +
|
|
||||||
(globalConfig.currentDiscount > 0
|
|
||||||
? `<span class='discount'>${T.global.discount.replace(
|
|
||||||
"<percentage>",
|
|
||||||
String(globalConfig.currentDiscount)
|
|
||||||
)}</span>`
|
|
||||||
: "")
|
|
||||||
);
|
|
||||||
this.trackClicks(this.linkElement, () => {
|
|
||||||
openStandaloneLink(this.root.app, "shapez_watermark");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
initialize() {}
|
|
||||||
|
|
||||||
update() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {import("../../../core/draw_utils").DrawParameters} parameters
|
|
||||||
*/
|
|
||||||
drawOverlays(parameters) {
|
|
||||||
const w = this.root.gameWidth;
|
|
||||||
|
|
||||||
parameters.context.fillStyle = "rgba(20, 30, 40, 0.25)";
|
|
||||||
parameters.context.font = "bold " + this.root.app.getEffectiveUiScale() * 40 + "px GameFont";
|
|
||||||
parameters.context.textAlign = "center";
|
|
||||||
parameters.context.fillText(
|
|
||||||
T.demoBanners.title.toUpperCase(),
|
|
||||||
w / 2,
|
|
||||||
this.root.app.getEffectiveUiScale() * 50
|
|
||||||
);
|
|
||||||
|
|
||||||
parameters.context.textAlign = "left";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -311,17 +311,6 @@ export class HUDWaypoints extends BaseHUDPart {
|
|||||||
const center = worldPos || this.root.camera.center;
|
const center = worldPos || this.root.camera.center;
|
||||||
|
|
||||||
dialog.buttonSignals.ok.add(() => {
|
dialog.buttonSignals.ok.add(() => {
|
||||||
// Show info that you can have only N markers in the demo,
|
|
||||||
// actually show this *after* entering the name so you want the
|
|
||||||
// standalone even more (I'm evil :P)
|
|
||||||
if (this.waypoints.length > this.root.app.restrictionMgr.getMaximumWaypoints()) {
|
|
||||||
this.root.hud.parts.dialogs.showFeatureRestrictionInfo(
|
|
||||||
"",
|
|
||||||
T.dialogs.markerDemoLimit.desc
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Actually create the waypoint
|
// Actually create the waypoint
|
||||||
this.addWaypoint(markerNameInput.getValue(), center);
|
this.addWaypoint(markerNameInput.getValue(), center);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -29,8 +29,6 @@ import { HUDGameMenu } from "../hud/parts/game_menu";
|
|||||||
import { HUDConstantSignalEdit } from "../hud/parts/constant_signal_edit";
|
import { HUDConstantSignalEdit } from "../hud/parts/constant_signal_edit";
|
||||||
import { IS_MOBILE } from "../../core/config";
|
import { IS_MOBILE } from "../../core/config";
|
||||||
import { HUDKeybindingOverlay } from "../hud/parts/keybinding_overlay";
|
import { HUDKeybindingOverlay } from "../hud/parts/keybinding_overlay";
|
||||||
import { HUDWatermark } from "../hud/parts/watermark";
|
|
||||||
import { HUDStandaloneAdvantages } from "../hud/parts/standalone_advantages";
|
|
||||||
import { HUDPartTutorialHints } from "../hud/parts/tutorial_hints";
|
import { HUDPartTutorialHints } from "../hud/parts/tutorial_hints";
|
||||||
import { HUDInteractiveTutorial } from "../hud/parts/interactive_tutorial";
|
import { HUDInteractiveTutorial } from "../hud/parts/interactive_tutorial";
|
||||||
import { MetaBlockBuilding } from "../buildings/block";
|
import { MetaBlockBuilding } from "../buildings/block";
|
||||||
@ -69,14 +67,16 @@ const upgradesCache = {};
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates all upgrades
|
* Generates all upgrades
|
||||||
* @returns {Object<string, UpgradeTiers>} */
|
* @returns {Object<string, UpgradeTiers>}
|
||||||
|
*/
|
||||||
function generateUpgrades(limitedVersion = false, difficulty = 1) {
|
function generateUpgrades(limitedVersion = false, difficulty = 1) {
|
||||||
|
// TODO: Remove the limitedVersion parameter
|
||||||
if (upgradesCache[limitedVersion]) {
|
if (upgradesCache[limitedVersion]) {
|
||||||
return upgradesCache[limitedVersion];
|
return upgradesCache[limitedVersion];
|
||||||
}
|
}
|
||||||
|
|
||||||
const fixedImprovements = [0.5, 0.5, 1, 1, 2, 1, 1];
|
const fixedImprovements = [0.5, 0.5, 1, 1, 2, 1, 1];
|
||||||
const numEndgameUpgrades = limitedVersion ? 0 : 1000 - fixedImprovements.length - 1;
|
const numEndgameUpgrades = 1000 - fixedImprovements.length - 1;
|
||||||
|
|
||||||
function generateInfiniteUnlocks() {
|
function generateInfiniteUnlocks() {
|
||||||
return new Array(numEndgameUpgrades).fill(null).map((_, i) => ({
|
return new Array(numEndgameUpgrades).fill(null).map((_, i) => ({
|
||||||
@ -352,11 +352,6 @@ export class RegularGameMode extends GameMode {
|
|||||||
this.additionalHudParts.keybindingOverlay = HUDKeybindingOverlay;
|
this.additionalHudParts.keybindingOverlay = HUDKeybindingOverlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.root.app.restrictionMgr.getIsStandaloneMarketingActive()) {
|
|
||||||
this.additionalHudParts.watermark = HUDWatermark;
|
|
||||||
this.additionalHudParts.standaloneAdvantages = HUDStandaloneAdvantages;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.root.app.settings.getAllSettings().offerHints) {
|
if (this.root.app.settings.getAllSettings().offerHints) {
|
||||||
this.additionalHudParts.tutorialHints = HUDPartTutorialHints;
|
this.additionalHudParts.tutorialHints = HUDPartTutorialHints;
|
||||||
this.additionalHudParts.interactiveTutorial = HUDInteractiveTutorial;
|
this.additionalHudParts.interactiveTutorial = HUDInteractiveTutorial;
|
||||||
@ -383,10 +378,7 @@ export class RegularGameMode extends GameMode {
|
|||||||
* @returns {Object<string, UpgradeTiers>}
|
* @returns {Object<string, UpgradeTiers>}
|
||||||
*/
|
*/
|
||||||
getUpgrades() {
|
getUpgrades() {
|
||||||
return generateUpgrades(
|
return generateUpgrades(false, this.difficultyMultiplicator);
|
||||||
!this.root.app.restrictionMgr.getHasExtendedUpgrades(),
|
|
||||||
this.difficultyMultiplicator
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -403,7 +395,7 @@ export class RegularGameMode extends GameMode {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
getIsFreeplayAvailable() {
|
getIsFreeplayAvailable() {
|
||||||
return this.root.app.restrictionMgr.getHasExtendedLevelsAndFreeplay();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {boolean} */
|
/** @returns {boolean} */
|
||||||
|
|||||||
@ -79,27 +79,7 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
note(action) {
|
note(action) {
|
||||||
if (this.app.restrictionMgr.isLimitedVersion()) {
|
// TODO: Remove game analytics altogether
|
||||||
fetch(
|
|
||||||
"https://analytics.shapez.io/campaign/" +
|
|
||||||
"action_" +
|
|
||||||
this.environment +
|
|
||||||
"_" +
|
|
||||||
action +
|
|
||||||
"_" +
|
|
||||||
CURRENT_ABT +
|
|
||||||
"_" +
|
|
||||||
this.abtVariant +
|
|
||||||
"?lpurl=nocontent",
|
|
||||||
{
|
|
||||||
method: "GET",
|
|
||||||
mode: "no-cors",
|
|
||||||
cache: "no-cache",
|
|
||||||
referrer: "no-referrer",
|
|
||||||
credentials: "omit",
|
|
||||||
}
|
|
||||||
).catch(err => {});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
noteMinor(action, payload = "") {}
|
noteMinor(action, payload = "") {}
|
||||||
@ -114,25 +94,6 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
|
|||||||
return this.fetchABVariant().then(() => {
|
return this.fetchABVariant().then(() => {
|
||||||
setInterval(() => this.sendTimePoints(), 60 * 1000);
|
setInterval(() => this.sendTimePoints(), 60 * 1000);
|
||||||
|
|
||||||
if (this.app.restrictionMgr.isLimitedVersion() && !G_IS_DEV) {
|
|
||||||
fetch(
|
|
||||||
"https://analytics.shapez.io/campaign/" +
|
|
||||||
this.environment +
|
|
||||||
"_" +
|
|
||||||
CURRENT_ABT +
|
|
||||||
"_" +
|
|
||||||
this.abtVariant +
|
|
||||||
"?lpurl=nocontent",
|
|
||||||
{
|
|
||||||
method: "GET",
|
|
||||||
mode: "no-cors",
|
|
||||||
cache: "no-cache",
|
|
||||||
referrer: "no-referrer",
|
|
||||||
credentials: "omit",
|
|
||||||
}
|
|
||||||
).catch(err => {});
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.app.storage.readFileAsync(analyticsLocalFile).then(
|
return this.app.storage.readFileAsync(analyticsLocalFile).then(
|
||||||
syncKey => {
|
syncKey => {
|
||||||
this.syncKey = syncKey;
|
this.syncKey = syncKey;
|
||||||
|
|||||||
@ -217,9 +217,6 @@ function initializeSettings() {
|
|||||||
applyGameTheme(id);
|
applyGameTheme(id);
|
||||||
document.documentElement.setAttribute("data-theme", id);
|
document.documentElement.setAttribute("data-theme", id);
|
||||||
},
|
},
|
||||||
enabledCb: /**
|
|
||||||
* @param {Application} app
|
|
||||||
*/ app => app.restrictionMgr.getHasExtendedSettings(),
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
new EnumSetting("autosaveInterval", {
|
new EnumSetting("autosaveInterval", {
|
||||||
@ -278,9 +275,6 @@ function initializeSettings() {
|
|||||||
category: enumCategories.performance,
|
category: enumCategories.performance,
|
||||||
restartRequired: false,
|
restartRequired: false,
|
||||||
changeCb: (app, id) => {},
|
changeCb: (app, id) => {},
|
||||||
enabledCb: /**
|
|
||||||
* @param {Application} app
|
|
||||||
*/ app => app.restrictionMgr.getHasExtendedSettings(),
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
new BoolSetting("lowQualityMapResources", enumCategories.performance, (app, value) => {}),
|
new BoolSetting("lowQualityMapResources", enumCategories.performance, (app, value) => {}),
|
||||||
@ -513,7 +507,7 @@ export class ApplicationSettings extends ReadWriteProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MODS
|
// MODS
|
||||||
if (!THEMES[data.settings.theme] || !this.app.restrictionMgr.getHasExtendedSettings()) {
|
if (!THEMES[data.settings.theme]) {
|
||||||
console.log("Resetting theme because its no longer available: " + data.settings.theme);
|
console.log("Resetting theme because its no longer available: " + data.settings.theme);
|
||||||
data.settings.theme = "light";
|
data.settings.theme = "light";
|
||||||
}
|
}
|
||||||
@ -705,7 +699,7 @@ export class ApplicationSettings extends ReadWriteProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MODS
|
// MODS
|
||||||
if (!THEMES[data.settings.theme] || !this.app.restrictionMgr.getHasExtendedSettings()) {
|
if (!THEMES[data.settings.theme]) {
|
||||||
console.log("Resetting theme because its no longer available: " + data.settings.theme);
|
console.log("Resetting theme because its no longer available: " + data.settings.theme);
|
||||||
data.settings.theme = "light";
|
data.settings.theme = "light";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,9 +50,6 @@ export class MainMenuState extends GameState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDemoAdvertisement =
|
|
||||||
showExternalLinks && this.app.restrictionMgr.getIsStandaloneMarketingActive();
|
|
||||||
|
|
||||||
const ownsPuzzleDLC =
|
const ownsPuzzleDLC =
|
||||||
WEB_STEAM_SSO_AUTHENTICATED ||
|
WEB_STEAM_SSO_AUTHENTICATED ||
|
||||||
(G_IS_STANDALONE &&
|
(G_IS_STANDALONE &&
|
||||||
@ -60,39 +57,6 @@ export class MainMenuState extends GameState {
|
|||||||
|
|
||||||
const showShapez2 = showExternalLinks && MODS.mods.length === 0;
|
const showShapez2 = showExternalLinks && MODS.mods.length === 0;
|
||||||
|
|
||||||
const bannerHtml = `
|
|
||||||
<h3>${T.demoBanners.titleV2}</h3>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="points">
|
|
||||||
${Array.from(Object.entries(T.ingame.standaloneAdvantages.points))
|
|
||||||
.slice(0, 6)
|
|
||||||
.map(
|
|
||||||
([key, trans]) => `
|
|
||||||
<div class="point ${key}">
|
|
||||||
<strong>${trans.title}</strong>
|
|
||||||
<p>${trans.desc}</p>
|
|
||||||
</div>`
|
|
||||||
)
|
|
||||||
.join("")}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<a href="#" class="steamLink steam_dlbtn_0" target="_blank">
|
|
||||||
${
|
|
||||||
globalConfig.currentDiscount > 0
|
|
||||||
? `<span class='discount'>${T.global.discount.replace(
|
|
||||||
"<percentage>",
|
|
||||||
String(globalConfig.currentDiscount)
|
|
||||||
)}</span>`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
Play shapez on Steam
|
|
||||||
</a>
|
|
||||||
<div class="onlinePlayerCount"></div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<div class="topButtons">
|
<div class="topButtons">
|
||||||
<button aria-label="Choose Language" class="languageChoose" data-languageicon="${this.app.settings.getLanguage()}"></button>
|
<button aria-label="Choose Language" class="languageChoose" data-languageicon="${this.app.settings.getLanguage()}"></button>
|
||||||
@ -114,7 +78,7 @@ export class MainMenuState extends GameState {
|
|||||||
${/*showUpdateLabel ? `<span class="updateLabel">MODS UPDATE!</span>` : ""*/ ""}
|
${/*showUpdateLabel ? `<span class="updateLabel">MODS UPDATE!</span>` : ""*/ ""}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mainWrapper" data-columns="${showDemoAdvertisement || showPuzzleDLC ? 2 : 1}">
|
<div class="mainWrapper" data-columns="${showPuzzleDLC ? 2 : 1}">
|
||||||
<div class="mainContainer">
|
<div class="mainContainer">
|
||||||
<div class="buttons"></div>
|
<div class="buttons"></div>
|
||||||
<div class="savegamesMount"></div>
|
<div class="savegamesMount"></div>
|
||||||
@ -149,8 +113,6 @@ export class MainMenuState extends GameState {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sideContainer">
|
<div class="sideContainer">
|
||||||
${showDemoAdvertisement ? `<div class="standaloneBanner">${bannerHtml}</div>` : ""}
|
|
||||||
|
|
||||||
${
|
${
|
||||||
showShapez2
|
showShapez2
|
||||||
? `<div class="mainNews shapez2">
|
? `<div class="mainNews shapez2">
|
||||||
@ -312,14 +274,6 @@ export class MainMenuState extends GameState {
|
|||||||
* Asks the user to import a savegame
|
* Asks the user to import a savegame
|
||||||
*/
|
*/
|
||||||
requestImportSavegame() {
|
requestImportSavegame() {
|
||||||
if (
|
|
||||||
this.app.savegameMgr.getSavegamesMetaData().length > 0 &&
|
|
||||||
!this.app.restrictionMgr.getHasUnlimitedSavegames()
|
|
||||||
) {
|
|
||||||
this.showSavegameSlotLimit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.app.gameAnalytics.note("startimport");
|
this.app.gameAnalytics.note("startimport");
|
||||||
|
|
||||||
// Create a 'fake' file-input to accept savegames
|
// Create a 'fake' file-input to accept savegames
|
||||||
@ -870,15 +824,6 @@ export class MainMenuState extends GameState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onPlayButtonClicked() {
|
onPlayButtonClicked() {
|
||||||
if (
|
|
||||||
this.app.savegameMgr.getSavegamesMetaData().length > 0 &&
|
|
||||||
!this.app.restrictionMgr.getHasUnlimitedSavegames()
|
|
||||||
) {
|
|
||||||
this.app.gameAnalytics.noteMinor("menu.slotlimit");
|
|
||||||
this.showSavegameSlotLimit();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.app.adProvider.showVideoAd().then(() => {
|
this.app.adProvider.showVideoAd().then(() => {
|
||||||
this.app.gameAnalytics.noteMinor("menu.play");
|
this.app.gameAnalytics.noteMinor("menu.play");
|
||||||
const savegame = this.app.savegameMgr.createNewSavegame();
|
const savegame = this.app.savegameMgr.createNewSavegame();
|
||||||
|
|||||||
@ -180,11 +180,6 @@ export class PreloadState extends GameState {
|
|||||||
return this.app.sound.initialize();
|
return this.app.sound.initialize();
|
||||||
})
|
})
|
||||||
|
|
||||||
.then(() => this.setStatus("Initializing restrictions", 34))
|
|
||||||
.then(() => {
|
|
||||||
return this.app.restrictionMgr.initialize();
|
|
||||||
})
|
|
||||||
|
|
||||||
.then(() => this.setStatus("Initializing savegames", 38))
|
.then(() => this.setStatus("Initializing savegames", 38))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return this.app.savegameMgr.initialize().catch(err => {
|
return this.app.savegameMgr.initialize().catch(err => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user