1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-13 18:21:51 +00:00
tobspr_shapez.io/mod_examples/pasting.js
2022-01-22 22:04:49 +01:00

24 lines
644 B
JavaScript

// @ts-nocheck
const METADATA = {
website: "https://tobspr.io",
author: "tobspr",
name: "Mod Example: Pasting",
version: "1",
id: "pasting",
description: "Shows how to properly receive paste events ingame",
minimumGameVersion: ">=1.5.0",
};
class Mod extends shapez.Mod {
init() {
this.signals.gameInitialized.add(root => {
root.gameState.inputReciever.paste.add(event => {
event.preventDefault();
const data = event.clipboardData.getData("text");
this.dialogs.showInfo("Pasted", `You pasted: '${data}'`);
});
});
}
}