Removed build and global variables for china, wegame

pull/1489/head
Thomas B 2 years ago
parent ed6922f912
commit 39198187b9

@ -4,71 +4,26 @@
* environment?: 'dev' | 'staging' | 'prod',
* electronBaseDir?: string,
* steamAppId?: number,
* executableName?: string,
* buildArgs: {
* chineseVersion?: boolean,
* wegameVersion?: boolean,
* steamDemo?: boolean,
* gogVersion?: boolean
* }}>}
* executableName?: string
* }>}
*/
const BUILD_VARIANTS = {
"web-localhost": {
standalone: false,
environment: "dev",
buildArgs: {},
},
"web-shapezio-beta": {
standalone: false,
environment: "staging",
buildArgs: {},
},
"web-shapezio": {
standalone: false,
environment: "prod",
buildArgs: {},
},
"standalone-steam": {
standalone: true,
executableName: "shapez",
steamAppId: 1318690,
buildArgs: {},
},
"standalone-steam-china": {
standalone: true,
steamAppId: 1318690,
buildArgs: {
chineseVersion: true,
},
},
"standalone-steam-demo": {
standalone: true,
steamAppId: 1930750,
buildArgs: {
steamDemo: true,
},
},
"standalone-steam-china-demo": {
standalone: true,
steamAppId: 1930750,
buildArgs: {
steamDemo: true,
chineseVersion: true,
},
},
"standalone-wegame": {
standalone: true,
electronBaseDir: "electron_wegame",
buildArgs: {
wegameVersion: true,
},
},
"standalone-gog": {
standalone: true,
electronBaseDir: "electron_gog",
buildArgs: {
gogVersion: true,
},
},
};
module.exports = { BUILD_VARIANTS };

@ -294,23 +294,7 @@ gulp.task(
);
gulp.task(
"bundle.steam.from-windows",
gulp.series(
"utils.cleanBuildOutputFolder",
"bundle.standalone-steam.from-windows",
"bundle.standalone-steam-china.from-windows"
)
);
gulp.task(
"bundle.steam-demo.from-darwin",
gulp.series("utils.cleanBuildOutputFolder", "bundle.standalone-steam-demo.from-darwin")
);
gulp.task(
"bundle.steam-demo.from-windows",
gulp.series(
"utils.cleanBuildOutputFolder",
"bundle.standalone-steam-demo.from-windows",
"bundle.standalone-steam-china-demo.from-windows"
)
gulp.series("utils.cleanBuildOutputFolder", "bundle.standalone-steam.from-windows")
);
// Default task (dev, localhost)

@ -55,24 +55,6 @@ function gulptasksHTML($, gulp, buildFolder) {
}
document.head.appendChild(css);
// Google analytics
if (googleAnalytics && false) {
const tagManagerScript = document.createElement("script");
tagManagerScript.src =
"https://www.googletagmanager.com/gtag/js?id=UA-165342524-1";
tagManagerScript.setAttribute("async", "");
document.head.appendChild(tagManagerScript);
const initScript = document.createElement("script");
initScript.textContent = `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-165342524-1', { anonymize_ip: true });
`;
document.head.appendChild(initScript);
}
// Do not need to preload in app or standalone
if (!hasLocalFiles) {
// Preload essentials

@ -27,7 +27,6 @@ function gulptasksJS($, gulp, buildFolder, browserSync) {
.pipe(
$.webpackStream(
requireUncached("./webpack.config.js")({
...data.buildArgs,
standalone: data.standalone,
watch: true,
})
@ -43,13 +42,7 @@ function gulptasksJS($, gulp, buildFolder, browserSync) {
gulp.task("js." + variant + ".dev", () => {
return gulp
.src("../src/js/main.js")
.pipe(
$.webpackStream(
requireUncached("./webpack.config.js")({
...data.buildArgs,
})
)
)
.pipe($.webpackStream(requireUncached("./webpack.config.js")()))
.pipe(gulp.dest(buildFolder));
});
@ -61,7 +54,6 @@ function gulptasksJS($, gulp, buildFolder, browserSync) {
requireUncached("./webpack.production.config.js")({
es6: false,
environment: data.environment,
...data.buildArgs,
})
)
)
@ -77,7 +69,6 @@ function gulptasksJS($, gulp, buildFolder, browserSync) {
requireUncached("./webpack.production.config.js")({
es6: true,
environment: data.environment,
...data.buildArgs,
})
)
)
@ -98,7 +89,6 @@ function gulptasksJS($, gulp, buildFolder, browserSync) {
.pipe(
$.webpackStream(
requireUncached("./webpack.config.js")({
...data.buildArgs,
standalone: true,
})
)
@ -111,7 +101,6 @@ function gulptasksJS($, gulp, buildFolder, browserSync) {
.pipe(
$.webpackStream(
requireUncached("./webpack.production.config.js")({
...data.buildArgs,
environment: "prod",
es6: true,
standalone: true,

@ -36,8 +36,6 @@ function gulptasksStandalone($, gulp) {
const requiredFiles = [
path.join(electronBaseDir, "node_modules", "**", "*.*"),
path.join(electronBaseDir, "node_modules", "**", ".*"),
path.join(electronBaseDir, "wegame_sdk", "**", "*.*"),
path.join(electronBaseDir, "wegame_sdk", "**", ".*"),
path.join(electronBaseDir, "favicon*"),
];
return gulp.src(requiredFiles, { base: electronBaseDir }).pipe(gulp.dest(tempDestBuildDir));

@ -1,14 +0,0 @@
"appbuild"
{
"appid" "1930750"
"desc" "$BUILD_DESC$"
"buildoutput" "$TMP_DIR$"
"contentroot" ""
"setlive" ""
"preview" "0"
"local" ""
"depots"
{
"1930756" "$VDF_DIR$/demo-darwin.vdf"
}
}

@ -1,17 +0,0 @@
"appbuild"
{
"appid" "1930750"
"desc" "$BUILD_DESC$"
"buildoutput" "$TMP_DIR$"
"contentroot" ""
"setlive" ""
"preview" "0"
"local" ""
"depots"
{
"1930753" "$VDF_DIR$/demo-windows.vdf"
"1930754" "$VDF_DIR$/demo-china-windows.vdf"
"1930752" "$VDF_DIR$/demo-linux.vdf"
"1930755" "$VDF_DIR$/demo-china-linux.vdf"
}
}

@ -1,12 +0,0 @@
"DepotBuildConfig"
{
"DepotID" "1930755"
"contentroot" "$BUNDLE_DIR$\standalone-steam-china-demo\shapez-linux-x64"
"FileMapping"
{
"LocalPath" "*"
"DepotPath" "."
"recursive" "1"
}
"FileExclusion" "*.pdb"
}

@ -1,12 +0,0 @@
"DepotBuildConfig"
{
"DepotID" "1930754"
"contentroot" "$BUNDLE_DIR$\standalone-steam-china-demo\shapez-win32-x64"
"FileMapping"
{
"LocalPath" "*"
"DepotPath" "."
"recursive" "1"
}
"FileExclusion" "*.pdb"
}

@ -1,12 +0,0 @@
"DepotBuildConfig"
{
"DepotID" "1930756"
"contentroot" "$BUNDLE_DIR$\standalone-steam-demo\shapez-darwin-x64"
"FileMapping"
{
"LocalPath" "*"
"DepotPath" "."
"recursive" "1"
}
"FileExclusion" "*.pdb"
}

@ -1,12 +0,0 @@
"DepotBuildConfig"
{
"DepotID" "1930752"
"contentroot" "$BUNDLE_DIR$\standalone-steam-demo\shapez-linux-x64"
"FileMapping"
{
"LocalPath" "*"
"DepotPath" "."
"recursive" "1"
}
"FileExclusion" "*.pdb"
}

@ -1,12 +0,0 @@
"DepotBuildConfig"
{
"DepotID" "1930753"
"contentroot" "$BUNDLE_DIR$\standalone-steam-demo\shapez-win32-x64"
"FileMapping"
{
"LocalPath" "*"
"DepotPath" "."
"recursive" "1"
}
"FileExclusion" "*.pdb"
}

@ -1,12 +0,0 @@
"DepotBuildConfig"
{
"DepotID" "1318695"
"contentroot" "$BUNDLE_DIR$\standalone-steam-china\shapez-linux-x64"
"FileMapping"
{
"LocalPath" "*"
"DepotPath" "."
"recursive" "1"
}
"FileExclusion" "*.pdb"
}

@ -1,12 +0,0 @@
"DepotBuildConfig"
{
"DepotID" "1318694"
"contentroot" "$BUNDLE_DIR$\standalone-steam-china\shapez-win32-x64"
"FileMapping"
{
"LocalPath" "*"
"DepotPath" "."
"recursive" "1"
}
"FileExclusion" "*.pdb"
}

@ -5,14 +5,7 @@ const webpack = require("webpack");
const { getRevision, getVersion, getAllResourceImages } = require("./buildutils");
const CircularDependencyPlugin = require("circular-dependency-plugin");
module.exports = ({
watch = false,
standalone = false,
chineseVersion = false,
wegameVersion = false,
steamDemo = false,
gogVersion = false,
}) => {
module.exports = ({ watch = false, standalone = false }) => {
return {
mode: "development",
devtool: "cheap-source-map",
@ -37,14 +30,10 @@ module.exports = ({
"window.assert(false, 'abstract method called of: ' + (this.name || (this.constructor && this.constructor.name)));",
G_HAVE_ASSERT: "true",
G_APP_ENVIRONMENT: JSON.stringify("dev"),
G_CHINA_VERSION: JSON.stringify(chineseVersion),
G_WEGAME_VERSION: JSON.stringify(wegameVersion),
G_GOG_VERSION: JSON.stringify(gogVersion),
G_IS_DEV: "true",
G_IS_RELEASE: "false",
G_IS_BROWSER: "true",
G_IS_STANDALONE: JSON.stringify(standalone),
G_IS_STEAM_DEMO: JSON.stringify(steamDemo),
G_BUILD_TIME: "" + new Date().getTime(),
G_BUILD_COMMIT_HASH: JSON.stringify(getRevision()),
G_BUILD_VERSION: JSON.stringify(getVersion()),

@ -14,11 +14,6 @@ module.exports = ({
standalone = false,
isBrowser = true,
chineseVersion = false,
wegameVersion = false,
steamDemo = false,
gogVersion = false,
}) => {
const globalDefs = {
assert: "false && window.assert",
@ -26,12 +21,8 @@ module.exports = ({
abstract: "window.assert(false, 'abstract method called');",
G_IS_DEV: "false",
G_CHINA_VERSION: JSON.stringify(chineseVersion),
G_WEGAME_VERSION: JSON.stringify(wegameVersion),
G_GOG_VERSION: JSON.stringify(gogVersion),
G_IS_RELEASE: environment === "prod" ? "true" : "false",
G_IS_STANDALONE: standalone ? "true" : "false",
G_IS_STEAM_DEMO: JSON.stringify(steamDemo),
G_IS_BROWSER: isBrowser ? "true" : "false",
G_APP_ENVIRONMENT: JSON.stringify(environment),
G_HAVE_ASSERT: "false",

@ -7,7 +7,7 @@
"license": "MIT",
"private": true,
"scripts": {
"dev": "cd gulp && yarn gulp main.serveDev",
"dev": "cd gulp && yarn gulp",
"devStandalone": "cd gulp && yarn gulp main.serveStandalone",
"tslint": "cd src/js && tsc",
"lint": "eslint src/js",

@ -153,12 +153,8 @@ export class Application {
Loader.linkAppAfterBoot(this);
if (G_WEGAME_VERSION) {
this.stateMgr.moveToState("WegameSplashState");
}
// Check for mobile
else if (IS_MOBILE) {
if (IS_MOBILE) {
this.stateMgr.moveToState("MobileWarningState");
} else {
this.stateMgr.moveToState("PreloadState");

@ -104,25 +104,6 @@ export const CHANGELOG = [
"Preparations for the <a href='https://store.steampowered.com/app/1625400/shapezio__Puzzle_DLC/?utm_medium=changelog2' target='_blank'>Puzzle DLC</a>, coming June 22nd!",
],
},
{
version: "1.3.1",
date: "16.04.2021",
entries: G_CHINA_VERSION
? [
"第13关的交付目标更改为中国古代指南针。感谢玩家凯风入心 创作并提供",
"第17关的交付目标更改为永乐通宝。感谢玩家金天赐 创作并提供",
"第22关的交付目标更改为凤凰。感谢玩家我没得眼镜 创作并提供",
"第23关的交付目标更改为古代车轮。感谢玩家我没得眼镜 创作并提供",
"第24关的交付目标更改为大熊猫。感谢玩家窝囸倪现任 创作并提供",
"修复了一些特定情况下偶尔会发生的存档损坏问题",
"修复了成就更新后有时候游戏崩溃的问题",
]
: [
"Fixed savegames getting corrupt in rare conditions",
"Fixed game crashing sometimes since the achievements update",
],
},
{
version: "1.3.0",
date: "12.03.2020",

@ -41,8 +41,7 @@ export const THIRDPARTY_URLS = {
*/
export function openStandaloneLink(app, campaign) {
const discount = globalConfig.currentDiscount > 0 ? "_discount" + globalConfig.currentDiscount : "";
const steamSuffix = G_IS_STEAM_DEMO ? "_steamdemo" : "";
const event = campaign + discount + steamSuffix;
const event = campaign + discount;
app.platformWrapper.openExternalLink(THIRDPARTY_URLS.standaloneCampaignLink.replace("$campaign", event));
app.gameAnalytics.noteMinor("g.stdlink." + event);
}

@ -19,8 +19,6 @@ export function setGlobalApp(app) {
export const BUILD_OPTIONS = {
HAVE_ASSERT: G_HAVE_ASSERT,
APP_ENVIRONMENT: G_APP_ENVIRONMENT,
CHINA_VERSION: G_CHINA_VERSION,
WEGAME_VERSION: G_WEGAME_VERSION,
IS_DEV: G_IS_DEV,
IS_RELEASE: G_IS_RELEASE,
IS_BROWSER: G_IS_BROWSER,

@ -107,17 +107,6 @@ export class FormElementInput extends FormElement {
updateErrorState() {
this.element.classList.toggle("errored", !this.isValid());
// profanity filter
if (G_WEGAME_VERSION) {
const value = String(this.element.value);
ipcRenderer.invoke("profanity-check", value).then(newValue => {
if (value !== newValue && this.element) {
this.element.value = newValue;
}
});
}
}
isValid() {

@ -56,10 +56,6 @@ export class RestrictionManager extends ReadWriteProxy {
* @returns {boolean}
*/
isLimitedVersion() {
if (G_IS_STEAM_DEMO) {
return true;
}
if (G_IS_STANDALONE) {
// Standalone is never limited
return false;

@ -694,10 +694,6 @@ const romanLiteralsCache = ["0"];
* @returns {string}
*/
export function getRomanNumber(number) {
if (G_WEGAME_VERSION) {
return String(number);
}
number = Math.max(0, Math.round(number));
if (romanLiteralsCache[number]) {
return romanLiteralsCache[number];
@ -753,18 +749,6 @@ export function getRomanNumber(number) {
* Returns the appropriate logo sprite path
*/
export function getLogoSprite() {
if (G_WEGAME_VERSION) {
return "logo_wegame.png";
}
if (G_IS_STEAM_DEMO) {
return "logo_demo.png";
}
if (G_CHINA_VERSION) {
return "logo_cn.png";
}
if (G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED) {
return "logo.png";
}

@ -188,12 +188,9 @@ export class HUDInteractiveTutorial extends BaseHUDPart {
onHintChanged(hintId) {
this.elementDescription.innerHTML = T.ingame.interactiveTutorial.hints[hintId];
document.documentElement.setAttribute("data-tutorial-step", hintId);
const folder = G_WEGAME_VERSION
? "interactive_tutorial.cn.noinline"
: "interactive_tutorial.noinline";
this.elementGif.style.backgroundImage =
"url('" + cachebust("res/ui/" + folder + "/" + hintId + ".gif") + "')";
"url('" + cachebust("res/ui/interactive_tutorial.noinline/" + hintId + ".gif") + "')";
this.element.classList.toggle("animEven");
this.element.classList.toggle("animOdd");
if (hintId) {

@ -233,19 +233,15 @@ export class HUDPinnedShapes extends BaseHUDPart {
// Show small info icon
let infoDetector;
if (!G_WEGAME_VERSION) {
const infoButton = document.createElement("button");
infoButton.classList.add("infoButton");
element.appendChild(infoButton);
infoDetector = new ClickDetector(infoButton, {
consumeEvents: true,
preventDefault: true,
targetOnly: true,
});
infoDetector.click.add(() =>
this.root.hud.signals.viewShapeDetailsRequested.dispatch(definition)
);
}
const infoButton = document.createElement("button");
infoButton.classList.add("infoButton");
element.appendChild(infoButton);
infoDetector = new ClickDetector(infoButton, {
consumeEvents: true,
preventDefault: true,
targetOnly: true,
});
infoDetector.click.add(() => this.root.hud.signals.viewShapeDetailsRequested.dispatch(definition));
const amountLabel = makeDiv(element, null, ["amountLabel"], "");

@ -4,7 +4,6 @@ import { BaseHUDPart } from "../base_hud_part";
export class HUDPuzzleDLCLogo extends BaseHUDPart {
createElements(parent) {
this.element = makeDiv(parent, "ingame_HUD_PuzzleDLCLogo");
this.element.classList.toggle("china", G_CHINA_VERSION || G_WEGAME_VERSION);
parent.appendChild(this.element);
}

@ -123,18 +123,16 @@ export class HUDShop extends BaseHUDPart {
container.appendChild(pinButton);
let infoDetector;
if (!G_WEGAME_VERSION) {
const viewInfoButton = document.createElement("button");
viewInfoButton.classList.add("showInfo");
container.appendChild(viewInfoButton);
infoDetector = new ClickDetector(viewInfoButton, {
consumeEvents: true,
preventDefault: true,
});
infoDetector.click.add(() =>
this.root.hud.signals.viewShapeDetailsRequested.dispatch(shapeDef)
);
}
const viewInfoButton = document.createElement("button");
viewInfoButton.classList.add("showInfo");
container.appendChild(viewInfoButton);
infoDetector = new ClickDetector(viewInfoButton, {
consumeEvents: true,
preventDefault: true,
});
infoDetector.click.add(() =>
this.root.hud.signals.viewShapeDetailsRequested.dispatch(shapeDef)
);
const currentGoalShape = this.root.hubGoals.currentGoal.definition.getHash();
if (shape === currentGoalShape) {

@ -49,7 +49,7 @@ export class HUDStandaloneAdvantages extends BaseHUDPart {
: ""
}
</button>
<button class="otherCloseButton" data-btn-variant="${G_IS_STEAM_DEMO ? "steam-demo" : "prod"}">${
<button class="otherCloseButton" data-btn-variant="prod">${
T.ingame.standaloneAdvantages.no_thanks
}</button>
</div>
@ -99,15 +99,9 @@ export class HUDStandaloneAdvantages extends BaseHUDPart {
this.inputReciever = new InputReceiver("standalone-advantages");
this.close();
// On standalone, show popup instant - but don't do so on web, since it increases
// the amount of clicks to get into the game
if (G_IS_STEAM_DEMO) {
// show instant
this.lastShown = -1e10;
} else {
// wait for next interval
this.lastShown = 0;
}
// On standalone, show popup instant
// wait for next interval
this.lastShown = 0;
this.root.signals.gameRestored.add(() => {
if (

@ -45,7 +45,7 @@ export class HUDWaypoints extends BaseHUDPart {
*/
createElements(parent) {
// Create the helper box on the lower right when zooming out
if (this.root.app.settings.getAllSettings().offerHints && !G_WEGAME_VERSION) {
if (this.root.app.settings.getAllSettings().offerHints) {
this.hintElement = makeDiv(
parent,
"ingame_HUD_Waypoints_Hint",
@ -121,12 +121,10 @@ export class HUDWaypoints extends BaseHUDPart {
}
// Catch mouse and key events
if (!G_WEGAME_VERSION) {
this.root.camera.downPreHandler.add(this.onMouseDown, this);
this.root.keyMapper
.getBinding(KEYMAPPINGS.navigation.createMarker)
.add(() => this.requestSaveMarker({}));
}
this.root.camera.downPreHandler.add(this.onMouseDown, this);
this.root.keyMapper
.getBinding(KEYMAPPINGS.navigation.createMarker)
.add(() => this.requestSaveMarker({}));
/**
* Stores at how much opacity the markers should be rendered on the map.

@ -5,7 +5,6 @@ import { WEB_STEAM_SSO_AUTHENTICATED } from "../../core/steam_sso";
import { enumHubGoalRewards } from "../tutorial_goals";
export const finalGameShape = "RuCw--Cw:----Ru--";
const chinaShapes = G_WEGAME_VERSION || G_CHINA_VERSION;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
@ -255,7 +254,7 @@ const STANDALONE_LEVELS = () => [
// 13
// Tunnel Tier 2
{
shape: chinaShapes ? "CuCuCuCu:CwCwCwCw:Sb--Sr--" : "RpRpRpRp:CwCwCwCw", // painting t3
shape: "RpRpRpRp:CwCwCwCw", // painting t3
required: 3800,
reward: enumHubGoalRewards.reward_underground_belt_tier_2,
},
@ -288,7 +287,7 @@ const STANDALONE_LEVELS = () => [
// 17
// Double painter
{
shape: chinaShapes ? "CyCyCyCy:CyCyCyCy:RyRyRyRy:RuRuRuRu" : "CbRbRbCb:CwCwCwCw:WbWbWbWb", // miner t4 (two variants)
shape: "CbRbRbCb:CwCwCwCw:WbWbWbWb", // miner t4 (two variants)
required: 20000,
reward: enumHubGoalRewards.reward_painter_double,
},
@ -328,7 +327,7 @@ const STANDALONE_LEVELS = () => [
// 22
// Constant signal
{
shape: chinaShapes ? "RrSySrSy:RyCrCwCr:CyCyRyCy" : "Cg----Cr:Cw----Cw:Sy------:Cy----Cy",
shape: "Cg----Cr:Cw----Cw:Sy------:Cy----Cy",
required: 25000,
reward: enumHubGoalRewards.reward_constant_signal,
},
@ -336,14 +335,14 @@ const STANDALONE_LEVELS = () => [
// 23
// Display
{
shape: chinaShapes ? "CrCrCrCr:CwCwCwCw:WwWwWwWw:CrCrCrCr" : "CcSyCcSy:SyCcSyCc:CcSyCcSy",
shape: "CcSyCcSy:SyCcSyCc:CcSyCcSy",
required: 25000,
reward: enumHubGoalRewards.reward_display,
},
// 24 Logic gates
{
shape: chinaShapes ? "Su----Su:RwRwRwRw:Cu----Cu:CwCwCwCw" : "CcRcCcRc:RwCwRwCw:Sr--Sw--:CyCyCyCy",
shape: "CcRcCcRc:RwCwRwCw:Sr--Sw--:CyCyCyCy",
required: 25000,
reward: enumHubGoalRewards.reward_logic_gates,
},
@ -367,9 +366,7 @@ const STANDALONE_LEVELS = () => [
* Generates the level definitions
*/
export function generateLevelsForVariant(app) {
if (G_IS_STEAM_DEMO) {
return STEAM_DEMO_LEVELS();
} else if (G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED) {
if (G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED) {
return STANDALONE_LEVELS();
}
return WEB_DEMO_LEVELS(app);

@ -65,8 +65,6 @@ const preparementShape = "CpRpCp--:SwSwSwSw";
// Tiers need % of the previous tier as requirement too
const tierGrowth = 2.5;
const chinaShapes = G_WEGAME_VERSION || G_CHINA_VERSION;
const upgradesCache = {};
/**
@ -151,9 +149,7 @@ function generateUpgrades(limitedVersion = false, difficulty = 1) {
{
required: [
{
shape: chinaShapes
? "CyCyCyCy:CyCyCyCy:RyRyRyRy:RuRuRuRu"
: "CbRbRbCb:CwCwCwCw:WbWbWbWb",
shape: "CbRbRbCb:CwCwCwCw:WbWbWbWb",
amount: 50000,
},
],
@ -212,7 +208,7 @@ function generateUpgrades(limitedVersion = false, difficulty = 1) {
{
required: [
{
shape: chinaShapes ? "CuCuCuCu:CwCwCwCw:Sb--Sr--" : "RpRpRpRp:CwCwCwCw",
shape: "RpRpRpRp:CwCwCwCw",
amount: 6500,
},
],
@ -362,9 +358,7 @@ export class RegularGameMode extends GameMode {
}
if (this.root.app.settings.getAllSettings().offerHints) {
if (!G_WEGAME_VERSION) {
this.additionalHudParts.tutorialHints = HUDPartTutorialHints;
}
this.additionalHudParts.tutorialHints = HUDPartTutorialHints;
this.additionalHudParts.interactiveTutorial = HUDInteractiveTutorial;
}
@ -379,9 +373,6 @@ export class RegularGameMode extends GameMode {
get difficultyMultiplicator() {
if (G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED) {
if (G_IS_STEAM_DEMO) {
return 0.75;
}
return 1;
}
return 0.5;

@ -10,7 +10,6 @@ declare const G_APP_ENVIRONMENT: string;
declare const G_HAVE_ASSERT: boolean;
declare const G_BUILD_TIME: number;
declare const G_IS_STANDALONE: boolean;
declare const G_IS_STEAM_DEMO: boolean;
declare const G_IS_BROWSER: boolean;
declare const G_BUILD_COMMIT_HASH: string;
@ -18,10 +17,6 @@ declare const G_BUILD_VERSION: string;
declare const G_ALL_UI_IMAGES: Array<string>;
declare const G_IS_RELEASE: boolean;
declare const G_CHINA_VERSION: boolean;
declare const G_WEGAME_VERSION: boolean;
declare const G_GOG_VERSION: boolean;
declare const shapez: any;
declare const ipcRenderer: any;

@ -12,9 +12,7 @@ export const LANGUAGES = {
"zh-CN": {
// simplified chinese
name: "简体中文",
data: G_WEGAME_VERSION
? require("./built-temp/base-zh-CN-ISBN.json")
: require("./built-temp/base-zh-CN.json"),
data: require("./built-temp/base-zh-CN.json"),
code: "zh",
region: "CN",
},

@ -105,10 +105,6 @@ export class ModLoader {
}
exposeExports() {
if (G_IS_STEAM_DEMO) {
return;
}
if (G_IS_DEV || G_IS_STANDALONE) {
let exports = {};
const modules = require.context("../", true, /\.js$/);
@ -140,11 +136,6 @@ export class ModLoader {
}
async initMods() {
if (G_IS_STEAM_DEMO) {
this.initialized = true;
return;
}
if (!G_IS_STANDALONE && !G_IS_DEV) {
this.initialized = true;
return;

@ -17,7 +17,7 @@ const logger = createLogger("game_analytics");
const analyticsUrl = G_IS_DEV ? "http://localhost:8001" : "https://analytics.shapez.io";
// 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 = "shapez_token_123.bin";
const CURRENT_ABT = "abt_bsl2";
const CURRENT_ABT_COUNT = 1;
@ -33,10 +33,6 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
return "dev";
}
if (G_IS_STEAM_DEMO) {
return "steam-demo";
}
if (G_IS_STANDALONE) {
return "steam";
}
@ -114,10 +110,6 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
initialize() {
this.syncKey = null;
if (G_WEGAME_VERSION) {
return;
}
window.setAbt = abt => {
this.app.storage.writeFileAsync("shapez_" + CURRENT_ABT + ".bin", String(abt));
window.location.reload();
@ -158,7 +150,7 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
let authTicket = Promise.resolve(undefined);
if (G_IS_STANDALONE && !G_IS_STEAM_DEMO) {
if (G_IS_STANDALONE) {
logger.log("Will retrieve auth ticket");
authTicket = ipcRenderer.invoke("steam:get-ticket");
}
@ -173,7 +165,6 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
environment: this.environment,
standalone:
G_IS_STANDALONE &&
!G_IS_STEAM_DEMO &&
this.app.achievementProvider instanceof SteamAchievementProvider,
commit: G_BUILD_COMMIT_HASH,
ticket,
@ -221,10 +212,6 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
* @returns {Promise<any>}
*/
sendToApi(endpoint, data) {
if (G_WEGAME_VERSION) {
return Promise.resolve();
}
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => reject("Request to " + endpoint + " timed out"), 20000);
@ -263,10 +250,6 @@ export class ShapezGameAnalytics extends GameAnalyticsInterface {
* @param {string} value
*/
sendGameEvent(category, value) {
if (G_WEGAME_VERSION) {
return;
}
if (G_IS_DEV) {
return;
}

@ -104,10 +104,6 @@ export class SteamAchievementProvider extends AchievementProviderInterface {
return Promise.resolve();
}
if (G_WEGAME_VERSION) {
return Promise.resolve();
}
return ipcRenderer.invoke("steam:is-initialized").then(initialized => {
this.initialized = initialized;
@ -126,10 +122,6 @@ export class SteamAchievementProvider extends AchievementProviderInterface {
activate(key) {
let promise;
if (G_WEGAME_VERSION) {
return Promise.resolve();
}
if (!this.initialized) {
promise = Promise.resolve();
} else {

@ -70,10 +70,6 @@ export class PlatformWrapperImplElectron extends PlatformWrapperImplBrowser {
}
initializeDlcStatus() {
if (G_WEGAME_VERSION) {
return Promise.resolve();
}
logger.log("Checking DLC ownership ...");
// @todo: Don't hardcode the app id
return ipcRenderer.invoke("steam:check-app-ownership", 1625400).then(

@ -140,7 +140,7 @@ function initializeSettings() {
options: Object.keys(LANGUAGES),
valueGetter: key => key,
textGetter: key => LANGUAGES[key].name,
category: G_CHINA_VERSION || G_WEGAME_VERSION ? null : enumCategories.general,
category: enumCategories.general,
restartRequired: true,
changeCb: (app, id) => null,
magicValue: "auto-detect",

@ -39,43 +39,25 @@ export class MainMenuState extends GameState {
}
getInnerHTML() {
const showLanguageIcon = !G_CHINA_VERSION && !G_WEGAME_VERSION;
const showExitAppButton = G_IS_STANDALONE;
const showPuzzleDLC =
!G_WEGAME_VERSION &&
(G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED) &&
!G_IS_STEAM_DEMO &&
!G_GOG_VERSION;
const showWegameFooter = G_WEGAME_VERSION;
const showPuzzleDLC = G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED;
const hasMods = MODS.anyModsActive();
const hasSteamBridge = !G_GOG_VERSION && !G_IS_STEAM_DEMO;
let showExternalLinks = true;
if (G_IS_STANDALONE) {
if (G_WEGAME_VERSION || G_CHINA_VERSION) {
showExternalLinks = false;
}
} else {
if (!G_IS_STANDALONE) {
const wrapper = /** @type {PlatformWrapperImplBrowser} */ (this.app.platformWrapper);
if (!wrapper.embedProvider.externalLinks) {
showExternalLinks = false;
}
}
let showDiscordLink = showExternalLinks;
if (G_CHINA_VERSION) {
showDiscordLink = true;
}
const showDemoAdvertisement =
(showExternalLinks || G_CHINA_VERSION) &&
this.app.restrictionMgr.getIsStandaloneMarketingActive();
showExternalLinks && this.app.restrictionMgr.getIsStandaloneMarketingActive();
const ownsPuzzleDLC =
WEB_STEAM_SSO_AUTHENTICATED ||
(G_IS_STANDALONE &&
!G_IS_STEAM_DEMO &&
/** @type { PlatformWrapperImplElectron}*/ (this.app.platformWrapper).dlcs.puzzle);
const showShapez2 = showExternalLinks && MODS.mods.length === 0;
@ -110,17 +92,12 @@ export class MainMenuState extends GameState {
}
Play shapez on Steam
</a>
${!G_IS_STEAM_DEMO ? `<div class="onlinePlayerCount"></div>` : ""}
<div class="onlinePlayerCount"></div>
`;
return `
<div class="topButtons">
${
showLanguageIcon
? `<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>
<button class="settingsButton" aria-label="Settings"></button>
${showExitAppButton ? `<button class="exitAppButton" aria-label="Exit App"></button>` : ""}
@ -144,7 +121,7 @@ export class MainMenuState extends GameState {
<div class="buttons"></div>
<div class="savegamesMount"></div>
${
hasSteamBridge && (G_IS_STANDALONE || !WEB_STEAM_SSO_AUTHENTICATED)
G_IS_STANDALONE || !WEB_STEAM_SSO_AUTHENTICATED
? `<div class="steamSso">
<span class="description">${
G_IS_STANDALONE
@ -158,7 +135,7 @@ export class MainMenuState extends GameState {
: ""
}
${
hasSteamBridge && WEB_STEAM_SSO_AUTHENTICATED
WEB_STEAM_SSO_AUTHENTICATED
? `
<div class="steamSso">
<span class="description">${T.mainMenu.playingFullVersion}</span>
@ -252,27 +229,11 @@ export class MainMenuState extends GameState {
</div>
${
showWegameFooter
? `
<div class='footer wegameDisclaimer'>
<div class="disclaimer">
健康游戏忠告
<br>
抵制不良游戏,拒绝盗版游戏注意自我保护,谨防受骗上当<br>
适度游戏益脑,沉迷游戏伤身合理安排时间,享受健康生活
</div>
<div class="rating"></div>
</div>
`
: `
<div class="footer ${showExternalLinks ? "" : "noLinks"} ">
<div class="socialLinks">
${
showExternalLinks && !G_IS_STEAM_DEMO
showExternalLinks
? `<a class="patreonLink boxLink" target="_blank">
<span class="thirdpartyLogo patreonLogo"></span>
<span class="label">Patreon</span>
@ -280,7 +241,7 @@ export class MainMenuState extends GameState {
: ""
}
${
showExternalLinks && (!G_IS_STANDALONE || G_IS_STEAM_DEMO)
showExternalLinks && !G_IS_STANDALONE
? `<a class="steamLinkSocial boxLink" target="_blank">
<span class="thirdpartyLogo steamLogo"></span>
<span class="label">steam</span>
@ -288,7 +249,7 @@ export class MainMenuState extends GameState {
: ""
}
${
showExternalLinks && !G_IS_STEAM_DEMO
showExternalLinks
? `
<a class="githubLink boxLink" target="_blank">
<span class="thirdpartyLogo githubLogo"></span>
@ -299,7 +260,7 @@ export class MainMenuState extends GameState {
${
showDiscordLink
showExternalLinks
? `<a class="discordLink boxLink" target="_blank">
<span class="thirdpartyLogo discordLogo"></span>
<span class="label">Discord</span>
@ -346,9 +307,6 @@ export class MainMenuState extends GameState {
</a></div>
</div>
`
}
`;
}
@ -549,6 +507,7 @@ export class MainMenuState extends GameState {
}
fetchPlayerCount() {
/** @type {HTMLDivElement} */
const element = this.htmlElement.querySelector(".onlinePlayerCount");
if (!element) {
return;
@ -715,13 +674,11 @@ export class MainMenuState extends GameState {
downloadButton.setAttribute("aria-label", "Download");
elem.appendChild(downloadButton);
if (!G_WEGAME_VERSION) {
const renameButton = document.createElement("button");
renameButton.classList.add("styledButton", "renameGame");
renameButton.setAttribute("aria-label", "Rename Savegame");
name.appendChild(renameButton);
this.trackClicks(renameButton, () => this.requestRenameSavegame(games[i]));
}
const renameButton = document.createElement("button");
renameButton.classList.add("styledButton", "renameGame");
renameButton.setAttribute("aria-label", "Rename Savegame");
name.appendChild(renameButton);
this.trackClicks(renameButton, () => this.requestRenameSavegame(games[i]));
const resumeButton = document.createElement("button");
resumeButton.classList.add("styledButton", "resumeGame");

@ -16,7 +16,6 @@ export class ModsState extends TextualGameState {
get modsSupported() {
return (
!WEB_STEAM_SSO_AUTHENTICATED &&
!G_IS_STEAM_DEMO &&
(G_IS_STANDALONE || (G_IS_DEV && !window.location.href.includes("demo")))
);
}

@ -40,7 +40,9 @@ export class PreloadState extends GameState {
this.lastHintShown = -1000;
this.nextHintDuration = 0;
/** @type {HTMLElement} */
this.statusText = this.htmlElement.querySelector("#ll_preload_status");
/** @type {HTMLElement} */
this.progressElement = this.htmlElement.querySelector("#ll_progressbar span");
this.startLoading();
@ -63,7 +65,7 @@ export class PreloadState extends GameState {
}
async sendBeacon() {
if (G_IS_STANDALONE && !G_IS_STEAM_DEMO) {
if (G_IS_STANDALONE) {
return;
}
if (queryParamOptions.campaign) {
@ -158,10 +160,6 @@ export class PreloadState extends GameState {
.then(() => this.setStatus("Initializing language", 25))
.then(() => {
if (G_CHINA_VERSION || G_WEGAME_VERSION) {
return this.app.settings.updateLanguage("zh-CN");
}
if (this.app.settings.getLanguage() === "auto-detect") {
const language = autoDetectLanguageId();
logger.log("Setting language to", language);
@ -222,11 +220,7 @@ export class PreloadState extends GameState {
return;
}
if (G_CHINA_VERSION || G_WEGAME_VERSION) {
return;
}
if (G_IS_STEAM_DEMO || !G_IS_STANDALONE) {
if (!G_IS_STANDALONE) {
return;
}
@ -289,9 +283,6 @@ export class PreloadState extends GameState {
}
update() {
if (G_CHINA_VERSION || G_WEGAME_VERSION) {
return;
}
const now = performance.now();
if (now - this.lastHintShown > this.nextHintDuration) {
this.lastHintShown = now;
@ -323,9 +314,6 @@ export class PreloadState extends GameState {
setStatus(text, progress) {
logger.log("✅ " + text);
if (G_CHINA_VERSION || G_WEGAME_VERSION) {
return Promise.resolve();
}
this.currentStatus = text;
this.statusText.innerText = text;
this.progressElement.style.width = 80 + (progress / 100) * 20 + "%";

@ -30,29 +30,16 @@ export class SettingsState extends TextualGameState {
: ""
}
${
G_WEGAME_VERSION
? ""
: `
<button class="styledButton categoryButton manageMods">${T.mods.title}
<span class="newBadge">${T.settings.newBadge}</span>
</button>`
}
<button class="styledButton categoryButton manageMods">${T.mods.title}
<span class="newBadge">${T.settings.newBadge}</span>
</button>
<div class="other ${G_CHINA_VERSION || G_WEGAME_VERSION ? "noabout" : ""}">
${
G_CHINA_VERSION || G_WEGAME_VERSION
? ""
: `
<div class="other">
<button class="styledButton about">${T.about.title}</button>
<button class="styledButton privacy">Privacy Policy</button>
`
}
<div class="versionbar">
${G_WEGAME_VERSION ? "" : `<div class="buildVersion">${T.global.loading} ...</div>`}
<div class="buildVersion">${T.global.loading} ...</div>
</div>
</div>
</div>
@ -122,14 +109,12 @@ export class SettingsState extends TextualGameState {
onEnter(payload) {
this.renderBuildText();
if (!G_CHINA_VERSION && !G_WEGAME_VERSION) {
this.trackClicks(this.htmlElement.querySelector(".about"), this.onAboutClicked, {
preventDefault: false,
});
this.trackClicks(this.htmlElement.querySelector(".privacy"), this.onPrivacyClicked, {
preventDefault: false,
});
}
this.trackClicks(this.htmlElement.querySelector(".about"), this.onAboutClicked, {
preventDefault: false,
});
this.trackClicks(this.htmlElement.querySelector(".privacy"), this.onPrivacyClicked, {
preventDefault: false,
});
const keybindingsButton = this.htmlElement.querySelector(".editKeybindings");

Loading…
Cancel
Save