From a7d40d8d0098851d97bc7ffed7fa8e3376771087 Mon Sep 17 00:00:00 2001 From: Lucia Ceionia Date: Mon, 28 Jul 2025 15:11:31 -0500 Subject: [PATCH] Slash command "hotfix" --- Godot/mods/Lucy.LucysTools/main.gd | 11 ++++++++--- LucysTools/Mod.cs | 26 +++++++++++++++++--------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Godot/mods/Lucy.LucysTools/main.gd b/Godot/mods/Lucy.LucysTools/main.gd index 7038542..655ba20 100644 --- a/Godot/mods/Lucy.LucysTools/main.gd +++ b/Godot/mods/Lucy.LucysTools/main.gd @@ -81,17 +81,22 @@ func process_message(text: String, local: bool, player, playerhud): LucysLib.send_message(msg, Color.aqua, false, null, "peers") return + var colon: bool = true # i don't know why the wag stuff toggles multiple times # and applies anywhere in string # i'm doing it once. if "/wag" in text: PlayerData.emit_signal("_wag_toggle") - text.replace("/wag","") + text = text.replace("/wag","") # /me has to be at beginning because i say so - var colon: bool = true - if text.begins_with("/me "): + elif text.begins_with("/me "): colon = false text = text.trim_prefix("/me ") + # return other slash command control to the original function + # for other mods to play with + elif text.begins_with("/"): + playerhud._lucy_original_send_message(text) + return # process message into bbcode nodes var msg := LucysLib.BBCode.parse_bbcode_text(text) diff --git a/LucysTools/Mod.cs b/LucysTools/Mod.cs index eafd256..77668ed 100644 --- a/LucysTools/Mod.cs +++ b/LucysTools/Mod.cs @@ -215,20 +215,20 @@ public class LucysChatChanges : IScriptMod CodeChange[] changes = { new CodeChange { name = "chat process intercept", - // color.to_html() - // - // END + // func _send_message(text): + // END multitoken_prefix = new Func[] { - t => t is IdentifierToken {Name: "color"}, - t => t.Type == TokenType.Period, - t => t is IdentifierToken {Name: "to_html"}, + t => t.Type == TokenType.PrFunction, + t => t is IdentifierToken {Name: "_send_message"}, t => t.Type == TokenType.ParenthesisOpen, + t => t is IdentifierToken {Name: "text"}, t => t.Type == TokenType.ParenthesisClose, - t => t.Type == TokenType.Newline, + t => t.Type == TokenType.Colon, t => t.Type == TokenType.Newline, }, - // $"/root/LucyLucysTools".process_message(text, chat_local, player, self) - // return + // $"/root/LucyLucysTools".process_message(text, chat_local, player, self) + // return + // func _lucy_original_send_message(text): code_to_add = new Token[] { new Token(TokenType.Dollar), new ConstantToken(new StringVariant("/root/LucyLucysTools")), @@ -246,6 +246,14 @@ public class LucysChatChanges : IScriptMod new Token(TokenType.Newline, 1), new Token(TokenType.CfReturn), + new Token(TokenType.Newline, 0), + + new Token(TokenType.PrFunction), + new IdentifierToken("_lucy_original_send_message"), + new Token(TokenType.ParenthesisOpen), + new IdentifierToken("text"), + new Token(TokenType.ParenthesisClose), + new Token(TokenType.Colon), new Token(TokenType.Newline, 1), } },