5 Commits
0.1 ... 0.3

Author SHA1 Message Date
e6f1a0ee3e 0.3 features 2024-11-03 23:23:04 -06:00
8bac7851c7 fix spawns oops 2024-11-02 23:59:50 -06:00
1ac84a76c5 oh yea 2024-11-02 19:38:02 -05:00
f9777340af 0.2 release 2024-11-02 18:54:39 -05:00
24883547ac refactor; 0.2 features 2024-11-02 18:49:03 -05:00
8 changed files with 1163 additions and 721 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ Godot/export_presets.cfg
Godot/icon.png
Godot/icon.png.import
build/LucysTools.pck
build

19
CHANGELOG.md Normal file
View File

@@ -0,0 +1,19 @@
0.1
----
initial release
0.2
----
- BBCode controlled by server host
- Spawning requires host
- Clear chat button
0.2.1
----
- fix spawning oops
0.3
----
- log settings
- custom color
- server name & join message previews

View File

@@ -7,15 +7,32 @@ func setup(manager):
get_node("%lucy_bbcode").pressed = manager.allow_bbcode
get_node("%lucy_punchback").pressed = manager.do_punchback
get_node("%lucy_servername").text = manager.custom_server_name
get_node("%lucy_servername_preview").bbcode_text = manager.custom_server_name + "'s Lobby"
get_node("%lucy_servermsg").text = manager.server_join_message
get_node("%lucy_servermsg_preview").bbcode_text = manager.server_join_message
get_node("%lucy_fpackets").value = manager.frame_packets
get_node("%lucy_bpackets").value = manager.bulk_packets
get_node("%lucy_binterval").value = manager.bulk_interval
get_node("%lucy_finterval").value = manager.full_interval
get_node("%lucy_chatcolor_bool").pressed = manager.custom_color_enabled
get_node("%lucy_chatcolor").color = Color(manager.custom_color)
update()
func update():
get_node("%lucy_srv_allow_bbcode").text = "Yes" if MANAGER.srv_allow_bbcode else "No"
func _ready():
print("[LUCY] Menu Ready")
get_node("%lucy_bbcode").disabled = MANAGER.host_required and not Network.GAME_MASTER
get_node("%lucy_raincloud").disabled = not Network.GAME_MASTER or not MANAGER.ingame
get_node("%lucy_meteor").disabled = not Network.GAME_MASTER or not MANAGER.ingame
get_node("%lucy_freezerain").disabled = not Network.GAME_MASTER or not MANAGER.ingame
get_node("%lucy_clearrain").disabled = not Network.GAME_MASTER or not MANAGER.ingame
get_node("%lucy_clearmeteor").disabled = not Network.GAME_MASTER or not MANAGER.ingame
func _input(event):
if event is InputEventKey and event.scancode == KEY_F5 && event.pressed:
visible = !visible
@@ -34,8 +51,10 @@ func _on_lucy_bbcode_toggled(button_pressed):
func _on_lucy_punchback_toggled(button_pressed):
MANAGER.do_punchback = button_pressed
func _on_lucy_servername_text_changed(new_text):
get_node("%lucy_servername_preview").bbcode_text = new_text + "'s Lobby"
MANAGER.custom_server_name = new_text
func _on_lucy_servermsg_text_changed(new_text):
get_node("%lucy_servermsg_preview").bbcode_text = new_text
MANAGER.server_join_message = new_text
func _on_lucy_fpackets_value_changed(value):
MANAGER.frame_packets = value
@@ -45,6 +64,10 @@ func _on_lucy_binterval_value_changed(value):
MANAGER.bulk_interval = value
func _on_lucy_finterval_value_changed(value):
MANAGER.full_interval = value
func _on_lucy_chatcolor_bool_toggled(button_pressed):
MANAGER.custom_color_enabled = button_pressed
func _on_lucy_chatcolor_color_changed(color):
MANAGER.custom_color = color
func _on_lucy_raincloud_pressed():
if not MANAGER.ingame: return
@@ -56,6 +79,7 @@ func _on_lucy_raincloud_pressed():
func _on_lucy_meteor_pressed():
if not MANAGER.ingame: return
if get_tree().get_nodes_in_group("meteor").size() > 10: return
print("[LUCY] Spawning meteor")
var player_pos = MANAGER.get_player().global_transform.origin
var dist = INF
@@ -83,4 +107,14 @@ func _on_lucy_clearrain_pressed():
for cloud in get_tree().get_nodes_in_group("raincloud"):
cloud._deinstantiate(true)
func _on_lucy_clearchat_pressed():
Network.GAMECHAT = ""
Network.LOCAL_GAMECHAT = ""
Network.emit_signal("_chat_update")
func _on_lucy_clearmeteor_pressed():
if not MANAGER.ingame or not Network.GAME_MASTER: return
print("[LUCY] Clearing meteor")
for meteor in get_tree().get_nodes_in_group("meteor"):
meteor._deinstantiate(true)

View File

@@ -10,12 +10,13 @@ script = ExtResource( 1 )
[node name="PanelContainer" type="PanelContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_bottom = 71.0
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 7.0
margin_top = 7.0
margin_right = 793.0
margin_bottom = 322.0
margin_bottom = 393.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer"]
margin_right = 786.0
@@ -58,10 +59,33 @@ margin_left = 509.0
margin_right = 585.0
margin_bottom = 40.0
[node name="HFlowContainer4" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
[node name="HFlowContainer3" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 70.0
margin_right = 786.0
margin_bottom = 94.0
margin_bottom = 84.0
rect_pivot_offset = Vector2( -141, -49 )
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer3"]
margin_right = 196.0
margin_bottom = 14.0
text = "Server Allows BBCode in Chat: "
[node name="lucy_srv_allow_bbcode" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer3"]
unique_name_in_owner = true
margin_left = 200.0
margin_right = 218.0
margin_bottom = 14.0
text = "No"
[node name="HSeparator3" type="HSeparator" parent="PanelContainer/VBoxContainer"]
margin_top = 88.0
margin_right = 786.0
margin_bottom = 92.0
[node name="HFlowContainer4" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 96.0
margin_right = 786.0
margin_bottom = 120.0
rect_pivot_offset = Vector2( -141, -49 )
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer4"]
@@ -73,15 +97,43 @@ text = "Custom Server Name"
[node name="lucy_servername" type="LineEdit" parent="PanelContainer/VBoxContainer/HFlowContainer4"]
unique_name_in_owner = true
margin_left = 139.0
margin_right = 197.0
margin_right = 786.0
margin_bottom = 24.0
size_flags_horizontal = 3
expand_to_text_length = true
placeholder_text = "Name"
[node name="HFlowContainer5" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 98.0
[node name="HFlowContainer6" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 124.0
margin_right = 786.0
margin_bottom = 122.0
margin_bottom = 138.0
rect_pivot_offset = Vector2( -141, -49 )
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer6"]
margin_right = 144.0
margin_bottom = 14.0
text = "Server Name Preview: "
[node name="lucy_servername_preview" type="RichTextLabel" parent="PanelContainer/VBoxContainer/HFlowContainer6"]
unique_name_in_owner = true
margin_left = 148.0
margin_right = 786.0
margin_bottom = 14.0
size_flags_horizontal = 3
bbcode_enabled = true
bbcode_text = "'s Lobby"
text = "'s Lobby"
scroll_active = false
[node name="HSeparator4" type="HSeparator" parent="PanelContainer/VBoxContainer"]
margin_top = 142.0
margin_right = 786.0
margin_bottom = 146.0
[node name="HFlowContainer5" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 150.0
margin_right = 786.0
margin_bottom = 174.0
rect_pivot_offset = Vector2( -141, -49 )
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer5"]
@@ -93,48 +145,119 @@ text = "Server Join Message"
[node name="lucy_servermsg" type="LineEdit" parent="PanelContainer/VBoxContainer/HFlowContainer5"]
unique_name_in_owner = true
margin_left = 131.0
margin_right = 189.0
margin_right = 786.0
margin_bottom = 24.0
size_flags_horizontal = 3
expand_to_text_length = true
placeholder_text = "Message"
[node name="HFlowContainer2" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 126.0
[node name="HFlowContainer7" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 178.0
margin_right = 786.0
margin_bottom = 146.0
margin_bottom = 192.0
rect_pivot_offset = Vector2( -141, -49 )
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer7"]
margin_right = 145.0
margin_bottom = 14.0
text = "Join Message Preview: "
[node name="lucy_servermsg_preview" type="RichTextLabel" parent="PanelContainer/VBoxContainer/HFlowContainer7"]
unique_name_in_owner = true
margin_left = 149.0
margin_right = 786.0
margin_bottom = 14.0
size_flags_horizontal = 3
bbcode_enabled = true
scroll_active = false
[node name="HSeparator5" type="HSeparator" parent="PanelContainer/VBoxContainer"]
margin_top = 196.0
margin_right = 786.0
margin_bottom = 200.0
[node name="HFlowContainer8" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 204.0
margin_right = 786.0
margin_bottom = 228.0
rect_pivot_offset = Vector2( -141, -49 )
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer8"]
margin_top = 5.0
margin_right = 107.0
margin_bottom = 19.0
text = "Chat Name Color"
[node name="lucy_chatcolor_bool" type="CheckBox" parent="PanelContainer/VBoxContainer/HFlowContainer8"]
unique_name_in_owner = true
margin_left = 111.0
margin_right = 181.0
margin_bottom = 24.0
text = "Enable"
[node name="lucy_chatcolor" type="ColorPickerButton" parent="PanelContainer/VBoxContainer/HFlowContainer8"]
unique_name_in_owner = true
margin_left = 185.0
margin_right = 227.0
margin_bottom = 24.0
rect_min_size = Vector2( 42, 0 )
edit_alpha = false
[node name="HFlowContainer2" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 232.0
margin_right = 786.0
margin_bottom = 252.0
[node name="lucy_clearchat" type="Button" parent="PanelContainer/VBoxContainer/HFlowContainer2"]
margin_right = 76.0
margin_bottom = 20.0
hint_tooltip = "Clears game chat (for you only)"
text = "Clear Chat"
[node name="lucy_raincloud" type="Button" parent="PanelContainer/VBoxContainer/HFlowContainer2"]
margin_right = 118.0
unique_name_in_owner = true
margin_left = 80.0
margin_right = 198.0
margin_bottom = 20.0
text = "Spawn Raincloud"
[node name="lucy_meteor" type="Button" parent="PanelContainer/VBoxContainer/HFlowContainer2"]
margin_left = 122.0
margin_right = 224.0
unique_name_in_owner = true
margin_left = 202.0
margin_right = 304.0
margin_bottom = 20.0
text = "Spawn Meteor"
[node name="lucy_freezerain" type="Button" parent="PanelContainer/VBoxContainer/HFlowContainer2"]
margin_left = 228.0
margin_right = 314.0
unique_name_in_owner = true
margin_left = 308.0
margin_right = 394.0
margin_bottom = 20.0
text = "Freeze Rain"
[node name="lucy_clearrain" type="Button" parent="PanelContainer/VBoxContainer/HFlowContainer2"]
margin_left = 318.0
margin_right = 393.0
unique_name_in_owner = true
margin_left = 398.0
margin_right = 473.0
margin_bottom = 20.0
text = "Clear Rain"
[node name="lucy_clearmeteor" type="Button" parent="PanelContainer/VBoxContainer/HFlowContainer2"]
unique_name_in_owner = true
margin_left = 477.0
margin_right = 571.0
margin_bottom = 20.0
text = "Clear Meteor"
[node name="HSeparator2" type="HSeparator" parent="PanelContainer/VBoxContainer"]
margin_top = 150.0
margin_top = 256.0
margin_right = 786.0
margin_bottom = 154.0
margin_bottom = 260.0
[node name="HSplitContainer" type="HSplitContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 158.0
margin_top = 264.0
margin_right = 786.0
margin_bottom = 182.0
margin_bottom = 288.0
split_offset = 100
[node name="HFlowContainer3" type="HFlowContainer" parent="PanelContainer/VBoxContainer/HSplitContainer"]
@@ -179,9 +302,9 @@ rounded = true
allow_greater = true
[node name="HSplitContainer2" type="HSplitContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 186.0
margin_top = 292.0
margin_right = 786.0
margin_bottom = 210.0
margin_bottom = 316.0
split_offset = 100
[node name="HFlowContainer3" type="HFlowContainer" parent="PanelContainer/VBoxContainer/HSplitContainer2"]
@@ -229,10 +352,14 @@ allow_greater = true
[connection signal="toggled" from="PanelContainer/VBoxContainer/HFlowContainer/lucy_punchback" to="." method="_on_lucy_punchback_toggled"]
[connection signal="text_changed" from="PanelContainer/VBoxContainer/HFlowContainer4/lucy_servername" to="." method="_on_lucy_servername_text_changed"]
[connection signal="text_changed" from="PanelContainer/VBoxContainer/HFlowContainer5/lucy_servermsg" to="." method="_on_lucy_servermsg_text_changed"]
[connection signal="toggled" from="PanelContainer/VBoxContainer/HFlowContainer8/lucy_chatcolor_bool" to="." method="_on_lucy_chatcolor_bool_toggled"]
[connection signal="color_changed" from="PanelContainer/VBoxContainer/HFlowContainer8/lucy_chatcolor" to="." method="_on_lucy_chatcolor_color_changed"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/HFlowContainer2/lucy_clearchat" to="." method="_on_lucy_clearchat_pressed"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/HFlowContainer2/lucy_raincloud" to="." method="_on_lucy_raincloud_pressed"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/HFlowContainer2/lucy_meteor" to="." method="_on_lucy_meteor_pressed"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/HFlowContainer2/lucy_freezerain" to="." method="_on_lucy_freezerain_pressed"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/HFlowContainer2/lucy_clearrain" to="." method="_on_lucy_clearrain_pressed"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/HFlowContainer2/lucy_clearmeteor" to="." method="_on_lucy_clearmeteor_pressed"]
[connection signal="value_changed" from="PanelContainer/VBoxContainer/HSplitContainer/HFlowContainer3/lucy_fpackets" to="." method="_on_lucy_fpackets_value_changed"]
[connection signal="value_changed" from="PanelContainer/VBoxContainer/HSplitContainer/HFlowContainer/lucy_bpackets" to="." method="_on_lucy_bpackets_value_changed"]
[connection signal="value_changed" from="PanelContainer/VBoxContainer/HSplitContainer2/HFlowContainer3/lucy_binterval" to="." method="_on_lucy_binterval_value_changed"]

View File

@@ -2,6 +2,8 @@ extends Node
const LUCYS_MENU_SCENE = preload("res://mods/Lucy.LucysTools/lucys_menu.tscn")
var host_required = true
var lucys_menu = null
onready var root = get_tree().root
@@ -14,6 +16,13 @@ var bulk_packets = 200 setget set_bulk_packets
var bulk_interval = 1 setget set_bulk_interval
var full_interval = 5 setget set_full_interval
var custom_color_enabled = false setget set_custom_color_enabled
var custom_color = Color("009cd0") setget set_custom_color
var srv_allow_bbcode = false setget set_srv_bbcode
var log_messages = false setget set_log_messages
# Patched Network vars
# var LUCY_PACKETS_READ = 0
# var LUCY_BULK_FULL_TIMER = 0
@@ -24,14 +33,27 @@ var full_interval = 5 setget set_full_interval
# var LUCY_CHAT_BBCODE
# var LUCY_SRV_NAME
# var LUCY_PUNCHED_ME
# var LUCY_INSTANCE_SENDER
# var LUCY_CUSTOM_COLOR_B
# var LUCY_CUSTOM_COLOR
# var LUCY_LOG_MESSAGES
var ingame = false
func set_log_messages(val):
log_messages = val
Network.LUCY_LOG_MESSAGES = val
func set_punchback(punchback):
do_punchback = punchback
func set_bbcode(bbcode):
allow_bbcode = bbcode
Network.LUCY_CHAT_BBCODE = bbcode
if Network.GAME_MASTER or not host_required: self.srv_allow_bbcode = bbcode
func set_srv_bbcode(bbcode):
if Network.GAME_MASTER and not Network.PLAYING_OFFLINE: send_server_sync_actor()
srv_allow_bbcode = bbcode
Network.LUCY_CHAT_BBCODE = bbcode if host_required else allow_bbcode
if lucys_menu != null: lucys_menu.update()
func set_server_name(name):
custom_server_name = name
Network.LUCY_SRV_NAME = name
@@ -51,6 +73,13 @@ func set_full_interval(val):
full_interval = val
Network.LUCY_BULK_FULL_INTERVAL = val
Network.LUCY_BULK_FULL_TIMER = 0
func set_custom_color_enabled(val):
custom_color_enabled = val
Network.LUCY_CUSTOM_COLOR_B = val
func set_custom_color(val):
custom_color = Color(val)
custom_color.a = 1
Network.LUCY_CUSTOM_COLOR = Color(custom_color) if Color(custom_color) != Color("d5aa73") else Color("739ed5")
func _ready():
print("[LUCY] Loaded LucysTools")
@@ -58,6 +87,23 @@ func _ready():
root.connect("child_entered_tree", self, "_on_enter")
Network.connect("_new_player_join", self, "new_player")
PlayerData.connect("_punched", self, "punched")
Network.connect("_instance_actor", self, "_instance_actor")
func send_server_sync_actor(to = "peers"):
if not Network.GAME_MASTER: return
var dict = {"actor_type": "lucy_fake_actor", "at": Vector3.ZERO, "zone": "", "actor_id": 0, "creator_id": Network.STEAM_ID, "data": {
"allow_bbcode": allow_bbcode
}}
Network._send_P2P_Packet({"type": "instance_actor", "params": dict}, to, 2)
func _instance_actor(dict):
if dict["actor_type"] != "lucy_fake_actor": return
var sender = Network.LUCY_INSTANCE_SENDER
Network.LUCY_INSTANCE_SENDER = 0
if sender != Network.KNOWN_GAME_MASTER or Network.GAME_MASTER: return
var data = dict["data"]
self.srv_allow_bbcode = data["allow_bbcode"]
func get_player() -> Actor:
for p in get_tree().get_nodes_in_group("player"):
@@ -84,6 +130,7 @@ func new_player(id):
if server_join_message.empty() or not Network.GAME_MASTER: return
print("[LUCY] sending join message")
Network._send_message(server_join_message)
send_server_sync_actor(str(id))
func _on_enter(node: Node):
if node.name == "main_menu":
@@ -95,8 +142,20 @@ func _on_enter(node: Node):
lucys_menu = LUCYS_MENU_SCENE.instance()
node.add_child(lucys_menu)
ingame = true
# retrigger setter
self.srv_allow_bbcode = false
self.allow_bbcode = allow_bbcode
lucys_menu.setup(self)
const save_keys = [
"do_punchback", "allow_bbcode",
"custom_server_name", "server_join_message",
"frame_packets", "bulk_packets",
"bulk_interval", "full_interval",
"custom_color_enabled", "custom_color",
"log_messages"
]
func load_settings():
print("[LUCY] Loading settings")
var file = File.new()
@@ -105,27 +164,18 @@ func load_settings():
file.close()
var result = parse.result
# trigger setters
self.do_punchback = result.do_punchback
self.allow_bbcode = result.allow_bbcode
self.custom_server_name = result.custom_server_name
self.server_join_message = result.server_join_message
self.frame_packets = result.frame_packets
self.bulk_packets = result.bulk_packets
self.bulk_interval = result.bulk_interval
self.full_interval = result.full_interval
for key in result.keys():
if key in save_keys: self[key] = result[key]
func save_settings():
print("[LUCY] Saving settings")
var settings = {
"do_punchback": do_punchback,
"allow_bbcode": allow_bbcode,
"custom_server_name": custom_server_name,
"server_join_message": server_join_message,
"frame_packets": frame_packets,
"bulk_packets": bulk_packets,
"bulk_interval": bulk_interval,
"full_interval": full_interval
}
custom_color = Color(custom_color).to_html()
var settings = {}
for key in save_keys:
settings[key] = self[key]
var file = File.new()
if file.open(OS.get_executable_path().get_base_dir().plus_file("GDWeave/configs/LucysTools.json"),File.WRITE) == OK:
file.store_string(JSON.print(settings))

View File

@@ -1,7 +0,0 @@
using System.Text.Json.Serialization;
namespace LucysTools;
public class Config {
[JsonInclude] public bool SomeSetting = true;
}

File diff suppressed because it is too large Load Diff

View File

@@ -2,13 +2,24 @@ LucysTools
----------
Uses GDWeave.
Client Features:
- Makes the client (tunably) read all packets. This fixes chat messages dropping.
- Optionally knocks people back when they punch you.
- Lets you clear gamechat
- Sends messages on P2P channel 2 (This should make your messages more reliable for users who don't have LucysTools)
- Only the game host can kick/ban you
- Allows changing your name's color in chat
Host Features:
- Lets you set a custom server name and message that will be sent when someone joins.
- Lets you spawn rainclouds & meteors.
- Lets you do 'raw' messages & BBCode in messages.
- Optionally knocks people back when they punch you.
- More coming soon!
- Probably certainly full of bugs.
- Lets you do 'raw' messages & BBCode in messages. If enabled, other players on the server can use BBCode too. (Not secure or anything, implemented client side)
Log Features:
- If you enable "log_messages" in the config file, messages, kicks, and bans will be logged to godot.log along with the user who sent the packet.
More coming soon!
Probably certainly full of bugs.
Packet options:
- 'Per Frame Packets' is the number of net packets your client will attempt to read per frame.