diff --git a/bun.lockb b/bun.lockb index 59b7915..b8c79ed 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 777e1fe..16ab89c 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/scripts/build.ts b/scripts/build.ts index e2111ca..ce89ef6 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -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"); } diff --git a/scripts/userscriptHeader.js b/scripts/userscriptHeader.js index 0eaab06..704682d 100644 --- a/scripts/userscriptHeader.js +++ b/scripts/userscriptHeader.js @@ -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== diff --git a/src/chat/commands/general/help.ts b/src/chat/commands/general/help.ts index fed4fab..2bae05d 100644 --- a/src/chat/commands/general/help.ts +++ b/src/chat/commands/general/help.ts @@ -8,5 +8,3 @@ export const help = new Command( return "help menu TODO"; } ); - -console.log(help); diff --git a/src/chat/commands/index.ts b/src/chat/commands/index.ts index 0d8630f..cafee4a 100644 --- a/src/chat/commands/index.ts +++ b/src/chat/commands/index.ts @@ -18,11 +18,18 @@ export class CommandHandler { public static commandGroups = new Array(); 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) { diff --git a/src/chat/index.ts b/src/chat/index.ts index 9876ba4..7afc20a 100644 --- a/src/chat/index.ts +++ b/src/chat/index.ts @@ -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; diff --git a/src/ui/App.tsx b/src/ui/App.tsx new file mode 100644 index 0000000..660935c --- /dev/null +++ b/src/ui/App.tsx @@ -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 ; +} diff --git a/src/ui/chat/index.tsx b/src/ui/chat/index.tsx new file mode 100644 index 0000000..31238e5 --- /dev/null +++ b/src/ui/chat/index.tsx @@ -0,0 +1,16 @@ +import ReactDOM from "react-dom/client"; +import React from "react"; + +export function Chat() { + return ( +
+
    + +
    + ); +} diff --git a/src/ui/index.tsx b/src/ui/index.tsx index 8786b3b..f50919b 100644 --- a/src/ui/index.tsx +++ b/src/ui/index.tsx @@ -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 =

    ; -root.render(test); +// document.querySelector("#chat").remove(); + +const r = ; +root.render(r);