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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user