mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Wegame adjustments
This commit is contained in:
parent
354bb63b0a
commit
eb628526c9
@ -1,5 +1,5 @@
|
||||
const railsdk = require("./wegame_sdk/railsdk.js");
|
||||
const { dialog, remote } = require("electron");
|
||||
const { dialog, remote, ipcMain } = require("electron");
|
||||
|
||||
function init(isDev) {
|
||||
console.log("Step 1: wegame: init");
|
||||
@ -47,6 +47,14 @@ function init(isDev) {
|
||||
|
||||
function listen() {
|
||||
console.log("wegame: listen");
|
||||
ipcMain.handle("profanity-check", async (event, data) => {
|
||||
const result = railsdk.RailUtils.DirtyWordsFilter(data, true);
|
||||
if (result.check_result.dirty_type !== 0 /** kRailDirtyWordsTypeNormalAllowWords */) {
|
||||
return result.check_result;
|
||||
}
|
||||
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { init, listen };
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 37 KiB |
BIN
res/ui/wegame_isbn_rating.jpg
Normal file
BIN
res/ui/wegame_isbn_rating.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
@ -21,6 +21,7 @@
|
||||
@import "adinplay";
|
||||
@import "changelog_skins";
|
||||
|
||||
@import "states/wegame_splash";
|
||||
@import "states/preload";
|
||||
@import "states/main_menu";
|
||||
@import "states/ingame";
|
||||
|
@ -565,6 +565,40 @@
|
||||
grid-template-columns: auto 1fr;
|
||||
}
|
||||
|
||||
&.wegameDisclaimer {
|
||||
@include SuperSmallText;
|
||||
display: grid;
|
||||
justify-content: center;
|
||||
grid-template-columns: 1fr auto 1fr;
|
||||
|
||||
> .disclaimer {
|
||||
grid-column: 2 / 3;
|
||||
|
||||
@include DarkThemeOverride {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
> .rating {
|
||||
grid-column: 3 / 4;
|
||||
justify-self: end;
|
||||
align-self: end;
|
||||
|
||||
@include S(width, 32px);
|
||||
@include S(height, 40px);
|
||||
background: green;
|
||||
cursor: pointer !important;
|
||||
pointer-events: all;
|
||||
@include S(border-radius, 4px);
|
||||
overflow: hidden;
|
||||
|
||||
& {
|
||||
/* @load-async */
|
||||
background: #fff uiResource("wegame_isbn_rating.jpg") center center / contain no-repeat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.author {
|
||||
flex-grow: 1;
|
||||
text-align: right;
|
||||
|
38
src/css/states/wegame_splash.scss
Normal file
38
src/css/states/wegame_splash.scss
Normal file
@ -0,0 +1,38 @@
|
||||
#state_WegameSplashState {
|
||||
background: #000 !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.wrapper {
|
||||
opacity: 0;
|
||||
@include InlineAnimation(5.9s ease-in-out) {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
20% {
|
||||
opacity: 1;
|
||||
}
|
||||
90% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
@include Heading;
|
||||
|
||||
strong {
|
||||
display: block;
|
||||
@include SuperHeading;
|
||||
@include S(margin-bottom, 20px);
|
||||
}
|
||||
|
||||
div {
|
||||
@include S(margin-bottom, 10px);
|
||||
}
|
||||
}
|
||||
}
|
@ -34,6 +34,7 @@ import { RestrictionManager } from "./core/restriction_manager";
|
||||
import { PuzzleMenuState } from "./states/puzzle_menu";
|
||||
import { ClientAPI } from "./platform/api";
|
||||
import { LoginState } from "./states/login";
|
||||
import { WegameSplashState } from "./states/wegame_splash";
|
||||
|
||||
/**
|
||||
* @typedef {import("./platform/achievement_provider").AchievementProviderInterface} AchievementProviderInterface
|
||||
@ -155,6 +156,7 @@ export class Application {
|
||||
registerStates() {
|
||||
/** @type {Array<typeof GameState>} */
|
||||
const states = [
|
||||
WegameSplashState,
|
||||
PreloadState,
|
||||
MobileWarningState,
|
||||
MainMenuState,
|
||||
@ -330,8 +332,12 @@ export class Application {
|
||||
|
||||
Loader.linkAppAfterBoot(this);
|
||||
|
||||
if (G_WEGAME_VERSION) {
|
||||
this.stateMgr.moveToState("WegameSplashState");
|
||||
}
|
||||
|
||||
// Check for mobile
|
||||
if (IS_MOBILE) {
|
||||
else if (IS_MOBILE) {
|
||||
this.stateMgr.moveToState("MobileWarningState");
|
||||
} else {
|
||||
this.stateMgr.moveToState("PreloadState");
|
||||
|
@ -1,4 +1,15 @@
|
||||
export const CHANGELOG = [
|
||||
{
|
||||
version: "1.4.3",
|
||||
date: "unreleased",
|
||||
entries: [
|
||||
"Edit signal dialog now has the previous signal filled (Thanks to EmeraldBlock)",
|
||||
"Further performance improvements (Thanks to PFedak)",
|
||||
"Improved puzzle validation (Thanks to Sense101)",
|
||||
"Input fields in dialogs should now automatically focus",
|
||||
"Updated translations",
|
||||
],
|
||||
},
|
||||
{
|
||||
version: "1.4.2",
|
||||
date: "24.06.2021",
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { BaseItem } from "../game/base_item";
|
||||
import { ClickDetector } from "./click_detector";
|
||||
import { Signal } from "./signal";
|
||||
import { getIPCRenderer } from "./utils";
|
||||
|
||||
/*
|
||||
* ***************************************************
|
||||
@ -107,6 +108,19 @@ 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);
|
||||
|
||||
getIPCRenderer()
|
||||
.invoke("profanity-check", value)
|
||||
.then(newValue => {
|
||||
if (value !== newValue && this.element) {
|
||||
this.element.value = newValue;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
isValid() {
|
||||
|
@ -111,6 +111,10 @@ 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);
|
||||
|
||||
|
@ -130,7 +130,17 @@ export class MainMenuState extends GameState {
|
||||
|
||||
${
|
||||
G_WEGAME_VERSION
|
||||
? "<div class='footer wegame'></div>"
|
||||
? `<div class='footer wegameDisclaimer'>
|
||||
<div class="disclaimer">
|
||||
健康游戏忠告
|
||||
<br>
|
||||
抵制不良游戏,拒绝盗版游戏。注意自我保护,谨防受骗上当。<br>
|
||||
适度游戏益脑,沉迷游戏伤身。合理安排时间,享受健康生活。
|
||||
</div>
|
||||
|
||||
<div class="rating"></div>
|
||||
</div>
|
||||
`
|
||||
: `
|
||||
<div class="footer ${G_CHINA_VERSION ? "china" : ""} ">
|
||||
|
||||
@ -341,6 +351,11 @@ export class MainMenuState extends GameState {
|
||||
if (puzzleWishlistButton) {
|
||||
this.trackClicks(puzzleWishlistButton, () => this.onPuzzleWishlistButtonClicked());
|
||||
}
|
||||
|
||||
const wegameRating = qs(".wegameDisclaimer > .rating");
|
||||
if (wegameRating) {
|
||||
this.trackClicks(wegameRating, () => this.onWegameRatingClicked());
|
||||
}
|
||||
}
|
||||
|
||||
renderMainMenu() {
|
||||
@ -675,6 +690,22 @@ export class MainMenuState extends GameState {
|
||||
});
|
||||
}
|
||||
|
||||
onWegameRatingClicked() {
|
||||
this.dialogs.showInfo(
|
||||
"",
|
||||
`
|
||||
1)本游戏是一款休闲建造类单机游戏,适用于年满8周岁及以上的用户。<br>
|
||||
2)本游戏模拟简单的生产流水线,剧情简单且积极向上,没有基于真实
|
||||
历史和现实事件的改编内容。游戏玩法为摆放简单的部件,完成生产目标。
|
||||
游戏为单机作品,没有基于文字和语音的陌生人社交系统。<br>
|
||||
3)游戏中有用户实名认证系统,认证为未成年人的用户将接受以下管理:
|
||||
游戏为买断制,不存在后续充值付费内容。未成年人用户每日22点到次日
|
||||
8点不得使用,法定节假日每天不得使用超过3小时,其它时间每天使用游
|
||||
戏不得超过1.5小时。
|
||||
`
|
||||
);
|
||||
}
|
||||
|
||||
onContinueButtonClicked() {
|
||||
let latestLastUpdate = 0;
|
||||
let latestInternalId;
|
||||
|
27
src/js/states/wegame_splash.js
Normal file
27
src/js/states/wegame_splash.js
Normal file
@ -0,0 +1,27 @@
|
||||
import { GameState } from "../core/game_state";
|
||||
|
||||
export class WegameSplashState extends GameState {
|
||||
constructor() {
|
||||
super("WegameSplashState");
|
||||
}
|
||||
|
||||
getInnerHTML() {
|
||||
return `
|
||||
<div class="wrapper">
|
||||
<strong>健康游戏忠告</strong>
|
||||
<div>抵制不良游戏,拒绝盗版游戏。</div>
|
||||
<div>注意自我保护,谨防受骗上当。</div>
|
||||
<div>适度游戏益脑,沉迷游戏伤身。</div>
|
||||
<div>适度游戏益脑,沉迷游戏伤身。</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
onEnter() {
|
||||
setTimeout(
|
||||
() => {
|
||||
this.app.stateMgr.moveToState("PreloadState");
|
||||
},
|
||||
G_IS_DEV ? 1 : 6000
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user