Rename to solar

This commit is contained in:
Hri7566 2023-10-27 14:54:18 -04:00
parent be10818d04
commit 5961c48ff6
10 changed files with 47 additions and 13 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -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"
}
}

View File

@ -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");
}

View File

@ -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==

View File

@ -8,5 +8,3 @@ export const help = new Command(
return "help menu TODO";
}
);
console.log(help);

View File

@ -18,11 +18,18 @@ 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) {

View File

@ -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;

7
src/ui/App.tsx Normal file
View File

@ -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 />;
}

16
src/ui/chat/index.tsx Normal file
View File

@ -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>
);
}

View File

@ -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);