Slash command "hotfix"

This commit is contained in:
2025-07-28 15:11:31 -05:00
parent f6676d6771
commit a7d40d8d00
2 changed files with 25 additions and 12 deletions

View File

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

View File

@@ -215,20 +215,20 @@ public class LucysChatChanges : IScriptMod
CodeChange[] changes = {
new CodeChange {
name = "chat process intercept",
// color.to_html()
//
// func _send_message(text):
// END
multitoken_prefix = new Func<Token, bool>[] {
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
// 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),
}
},