1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Wegame adjustments

This commit is contained in:
tobspr
2021-08-04 13:44:02 +02:00
parent 354bb63b0a
commit eb628526c9
12 changed files with 177 additions and 3 deletions

View File

@@ -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() {