Rename to solar
This commit is contained in:
parent
be10818d04
commit
5961c48ff6
|
@ -9,7 +9,8 @@
|
|||
"devDependencies": {
|
||||
"@types/react": "^18.2.21",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"bun-types": "latest"
|
||||
"bun-types": "latest",
|
||||
"postcss-import": "^15.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
|
@ -17,6 +18,7 @@
|
|||
"dependencies": {
|
||||
"mppclone-client": "^1.1.3",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
"react-dom": "^18.2.0",
|
||||
"tailwindcss": "^3.3.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ async function build() {
|
|||
.toString();
|
||||
const artifact = fs.readFileSync("build/index.js").toString();
|
||||
|
||||
fs.writeFileSync("build/Saturn.user.js", userscriptHeader + artifact);
|
||||
fs.writeFileSync("build/Solar.user.js", userscriptHeader + artifact);
|
||||
console.log("Done");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
// ==UserScript==
|
||||
// @name Saturn
|
||||
// @name Solar
|
||||
// @namespace MPP
|
||||
// @match https://mppclone.com/*
|
||||
// @match https://multiplayerpiano.net/*
|
||||
// @grant none
|
||||
// @version 1.0
|
||||
// @author Hri7566, Foonix
|
||||
// @author Hri7566
|
||||
// @description 9/15/2023, 6:42:49 AM
|
||||
// ==/UserScript==
|
||||
|
|
|
@ -8,5 +8,3 @@ export const help = new Command(
|
|||
return "help menu TODO";
|
||||
}
|
||||
);
|
||||
|
||||
console.log(help);
|
||||
|
|
|
@ -18,13 +18,20 @@ export class CommandHandler {
|
|||
public static commandGroups = new Array<CommandGroup>();
|
||||
|
||||
public static handleCommand(msg: CustomChatMessage) {
|
||||
let foundCommand: Command | undefined;
|
||||
|
||||
for (const group of this.commandGroups) {
|
||||
for (const command of group.commands) {
|
||||
command.callback(msg);
|
||||
for (const alias of command.aliases) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundCommand) return;
|
||||
|
||||
foundCommand.callback(msg);
|
||||
}
|
||||
|
||||
public static addCommandGroup(commandGroup: CommandGroup) {
|
||||
this.commandGroups.push(commandGroup);
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ export interface CustomChatMessage extends ChatMessage {
|
|||
}
|
||||
|
||||
export class ChatBot {
|
||||
public static prefixes = ["sat"];
|
||||
public static prefixes = ["sol"];
|
||||
|
||||
public static handleMessage(msg: ChatMessage) {
|
||||
console.log(`[Saturn] ${msg.p.name}: ${msg.a}`);
|
||||
console.log(`[Solar] ${msg.p.name}: ${msg.a}`);
|
||||
|
||||
let usedPrefix: string | undefined;
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
import ReactDOM from "react-dom/client";
|
||||
import React from "react";
|
||||
import { Chat } from "./chat";
|
||||
|
||||
export function App(props: React.PropsWithChildren) {
|
||||
return <Chat />;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import ReactDOM from "react-dom/client";
|
||||
import React from "react";
|
||||
|
||||
export function Chat() {
|
||||
return (
|
||||
<div id="#chat">
|
||||
<ul></ul>
|
||||
<input
|
||||
id="chat-input"
|
||||
type="text"
|
||||
className="translate"
|
||||
maxLength={512}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -1,12 +1,15 @@
|
|||
import ReactDOM from "react-dom/client";
|
||||
import React from "react";
|
||||
import { App } from "./App";
|
||||
|
||||
const document = (globalThis as any).document;
|
||||
const reactRoot = document.createElement("div");
|
||||
|
||||
reactRoot.setAttribute("id", "saturn");
|
||||
reactRoot.setAttribute("id", "solar");
|
||||
document.body.appendChild(reactRoot);
|
||||
const root = ReactDOM.createRoot(reactRoot);
|
||||
|
||||
const test = <p></p>;
|
||||
root.render(test);
|
||||
// document.querySelector("#chat").remove();
|
||||
|
||||
const r = <App></App>;
|
||||
root.render(r);
|
||||
|
|
Loading…
Reference in New Issue