Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
7fdbf170f1 | |||
0d7a3fb0f1 | |||
e6f1a0ee3e | |||
8bac7851c7 | |||
1ac84a76c5 | |||
f9777340af | |||
24883547ac |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ Godot/export_presets.cfg
|
||||
Godot/icon.png
|
||||
Godot/icon.png.import
|
||||
build/LucysTools.pck
|
||||
build
|
||||
|
26
CHANGELOG.md
Normal file
26
CHANGELOG.md
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
|
||||
0.4
|
||||
----
|
||||
- bbcode filtering added
|
||||
- bbcode enabled globally
|
||||
- intrusive bbcode separated
|
||||
- custom name bbcode
|
@@ -1,20 +1,59 @@
|
||||
extends Control
|
||||
|
||||
var MANAGER = null
|
||||
var MANAGER
|
||||
|
||||
func setup(manager):
|
||||
MANAGER = 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_servermsg").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
|
||||
func setup():
|
||||
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_intbbcode").pressed = MANAGER.allow_intrusive_bbcode
|
||||
|
||||
get_node("%lucy_chatcolor_bool").pressed = MANAGER.custom_color_enabled
|
||||
get_node("%lucy_chatcolor").color = Color(MANAGER.custom_color)
|
||||
|
||||
get_node("%lucy_name").text = MANAGER.custom_name
|
||||
|
||||
update()
|
||||
|
||||
|
||||
func update():
|
||||
get_node("%lucy_srv_allow_bbcode").text = "Yes" if MANAGER.srv_allow_bbcode else "No"
|
||||
_on_lucy_name_text_changed(MANAGER.custom_name)
|
||||
|
||||
|
||||
func _on_lucy_name_text_changed(new_text):
|
||||
var result = MANAGER.bbcode_process(new_text)
|
||||
#print("[fin] ", result.fin)
|
||||
#print("[tags] ", result.tags)
|
||||
#print("[stripped] ", result.stripped)
|
||||
|
||||
var lol_steam_username = Network.STEAM_USERNAME.replace("[", "").replace("]", "")
|
||||
var good = result.stripped == lol_steam_username
|
||||
get_node("%lucy_name_preview").bbcode_text = result.fin
|
||||
get_node("%lucy_namegood").bbcode_text = "[color=green]Good[/color]" if good else "[color=red]Bad[/color]"
|
||||
|
||||
MANAGER.custom_name_enabled = good
|
||||
MANAGER.custom_name = result.fin
|
||||
|
||||
func _ready():
|
||||
print("[LUCY] Menu Ready")
|
||||
|
||||
MANAGER = $"/root/LucyLucysTools"
|
||||
|
||||
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:
|
||||
@@ -34,8 +73,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 +86,12 @@ 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_intbbcode_toggled(button_pressed):
|
||||
MANAGER.allow_intrusive_bbcode = button_pressed
|
||||
|
||||
func _on_lucy_raincloud_pressed():
|
||||
if not MANAGER.ingame: return
|
||||
@@ -56,6 +103,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 +131,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)
|
||||
|
||||
|
@@ -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
|
||||
@@ -35,33 +36,69 @@ rect_pivot_offset = Vector2( -141, -49 )
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer"]
|
||||
margin_top = 13.0
|
||||
margin_right = 286.0
|
||||
margin_right = 138.0
|
||||
margin_bottom = 27.0
|
||||
text = "Allow BBCode in Chat (start message with %)"
|
||||
text = "Allow BBCode (Client)"
|
||||
|
||||
[node name="lucy_bbcode" type="CheckButton" parent="PanelContainer/VBoxContainer/HFlowContainer"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 290.0
|
||||
margin_right = 366.0
|
||||
margin_left = 142.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 40.0
|
||||
|
||||
[node name="Label3" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer"]
|
||||
margin_left = 222.0
|
||||
margin_top = 13.0
|
||||
margin_right = 471.0
|
||||
margin_bottom = 27.0
|
||||
text = "Allow Intrusive BBCode (requires Host)"
|
||||
|
||||
[node name="lucy_intbbcode" type="CheckButton" parent="PanelContainer/VBoxContainer/HFlowContainer"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 475.0
|
||||
margin_right = 551.0
|
||||
margin_bottom = 40.0
|
||||
|
||||
[node name="Label2" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer"]
|
||||
margin_left = 370.0
|
||||
margin_left = 555.0
|
||||
margin_top = 13.0
|
||||
margin_right = 505.0
|
||||
margin_right = 690.0
|
||||
margin_bottom = 27.0
|
||||
text = "Punch back on Punch"
|
||||
|
||||
[node name="lucy_punchback" type="CheckButton" parent="PanelContainer/VBoxContainer/HFlowContainer"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 509.0
|
||||
margin_right = 585.0
|
||||
margin_left = 694.0
|
||||
margin_right = 770.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 = 199.0
|
||||
margin_bottom = 14.0
|
||||
text = "Host Allows Intrusive BBCode: "
|
||||
|
||||
[node name="lucy_srv_allow_bbcode" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer3"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 203.0
|
||||
margin_right = 221.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 +110,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 +158,160 @@ 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="HFlowContainer9" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
|
||||
margin_top = 232.0
|
||||
margin_right = 786.0
|
||||
margin_bottom = 256.0
|
||||
rect_pivot_offset = Vector2( -141, -49 )
|
||||
hint_tooltip = "Must match Steam username"
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HFlowContainer9"]
|
||||
margin_top = 5.0
|
||||
margin_right = 91.0
|
||||
margin_bottom = 19.0
|
||||
text = "Custom Name"
|
||||
|
||||
[node name="lucy_namegood" type="RichTextLabel" parent="PanelContainer/VBoxContainer/HFlowContainer9"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 95.0
|
||||
margin_right = 145.0
|
||||
margin_bottom = 24.0
|
||||
rect_min_size = Vector2( 50, 0 )
|
||||
bbcode_enabled = true
|
||||
bbcode_text = "[color=green]Good[/color]"
|
||||
text = "Good"
|
||||
scroll_active = false
|
||||
|
||||
[node name="lucy_name" type="LineEdit" parent="PanelContainer/VBoxContainer/HFlowContainer9"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 149.0
|
||||
margin_right = 207.0
|
||||
margin_bottom = 24.0
|
||||
expand_to_text_length = true
|
||||
placeholder_text = "Name"
|
||||
|
||||
[node name="lucy_name_preview" type="RichTextLabel" parent="PanelContainer/VBoxContainer/HFlowContainer9"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 211.0
|
||||
margin_right = 786.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
bbcode_enabled = true
|
||||
scroll_active = false
|
||||
|
||||
[node name="HFlowContainer2" type="HFlowContainer" parent="PanelContainer/VBoxContainer"]
|
||||
margin_top = 260.0
|
||||
margin_right = 786.0
|
||||
margin_bottom = 280.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 = 284.0
|
||||
margin_right = 786.0
|
||||
margin_bottom = 154.0
|
||||
margin_bottom = 288.0
|
||||
|
||||
[node name="HSplitContainer" type="HSplitContainer" parent="PanelContainer/VBoxContainer"]
|
||||
margin_top = 158.0
|
||||
margin_top = 292.0
|
||||
margin_right = 786.0
|
||||
margin_bottom = 182.0
|
||||
margin_bottom = 316.0
|
||||
split_offset = 100
|
||||
|
||||
[node name="HFlowContainer3" type="HFlowContainer" parent="PanelContainer/VBoxContainer/HSplitContainer"]
|
||||
@@ -179,9 +356,9 @@ rounded = true
|
||||
allow_greater = true
|
||||
|
||||
[node name="HSplitContainer2" type="HSplitContainer" parent="PanelContainer/VBoxContainer"]
|
||||
margin_top = 186.0
|
||||
margin_top = 320.0
|
||||
margin_right = 786.0
|
||||
margin_bottom = 210.0
|
||||
margin_bottom = 344.0
|
||||
split_offset = 100
|
||||
|
||||
[node name="HFlowContainer3" type="HFlowContainer" parent="PanelContainer/VBoxContainer/HSplitContainer2"]
|
||||
@@ -226,13 +403,19 @@ value = 6.4
|
||||
allow_greater = true
|
||||
|
||||
[connection signal="toggled" from="PanelContainer/VBoxContainer/HFlowContainer/lucy_bbcode" to="." method="_on_lucy_bbcode_toggled"]
|
||||
[connection signal="toggled" from="PanelContainer/VBoxContainer/HFlowContainer/lucy_intbbcode" to="." method="_on_lucy_intbbcode_toggled"]
|
||||
[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="text_changed" from="PanelContainer/VBoxContainer/HFlowContainer9/lucy_name" to="." method="_on_lucy_name_text_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"]
|
||||
|
@@ -5,8 +5,8 @@ const LUCYS_MENU_SCENE = preload("res://mods/Lucy.LucysTools/lucys_menu.tscn")
|
||||
var lucys_menu = null
|
||||
onready var root = get_tree().root
|
||||
|
||||
var do_punchback = false setget set_punchback
|
||||
var allow_bbcode = false setget set_bbcode
|
||||
var do_punchback = false
|
||||
var allow_bbcode = false
|
||||
var custom_server_name = "" setget set_server_name
|
||||
var server_join_message = "[color=#5BCEFA]TRAN[/color][color=#F5A9B8]S RIG[/color][color=#ffffff]HTS![/color]" setget set_join_message
|
||||
var frame_packets = 50 setget set_frame_packets
|
||||
@@ -14,6 +14,59 @@ 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
|
||||
var custom_color = Color("009cd0") setget set_custom_color
|
||||
|
||||
var custom_name_enabled = false
|
||||
var custom_name = ""
|
||||
|
||||
var allow_intrusive_bbcode = false setget set_allow_intrusive_bbcode
|
||||
var srv_allow_bbcode = false setget set_srv_bbcode
|
||||
|
||||
var log_messages = false setget set_log_messages
|
||||
|
||||
|
||||
var allowed_tags = ["b", "i", "u", "s", "color"]
|
||||
var escape_invalid = true
|
||||
var bbcode_matcher = null
|
||||
|
||||
# i know this sucks
|
||||
# but i have things to do
|
||||
func bbcode_recurse(text, data):
|
||||
var m = bbcode_matcher.search(text)
|
||||
if m == null:
|
||||
var escaped = text.replace('[lb]','[').replace('[','[lb]') if escape_invalid else text
|
||||
data.fin += escaped
|
||||
data.stripped += escaped
|
||||
else:
|
||||
#print("Found ", m.strings, " in '", text, "'")
|
||||
bbcode_recurse(m.get_string(1), data)
|
||||
var tag = m.get_string(2)
|
||||
var junk = m.get_string(3)
|
||||
var allowed = tag in allowed_tags
|
||||
if allowed:
|
||||
data.fin += "[" + tag + junk + "]"
|
||||
else:
|
||||
data.fin += "[lb]" + tag + junk + "]"
|
||||
data.stripped += "[lb]" + tag + junk + "]"
|
||||
#print("TAG ", m.get_string(2), " JUNK ", m.get_string(3))
|
||||
data.tags.append([tag, junk])
|
||||
bbcode_recurse(m.get_string(4), data)
|
||||
if allowed:
|
||||
data.fin += "[/" + tag + "]"
|
||||
else:
|
||||
data.fin += "[lb]/" + tag + "]"
|
||||
data.stripped += "[lb]/" + tag + "]"
|
||||
bbcode_recurse(m.get_string(5), data)
|
||||
|
||||
func bbcode_process(text):
|
||||
bbcode_matcher = RegEx.new()
|
||||
bbcode_matcher.compile("^(.*?)\\[(\\w+?)([^\\]]*)\\](.+?)\\[/\\2\\](.*?)$")
|
||||
#print("processing '", text, "'")
|
||||
var data = {"fin": "", "tags": [], "stripped": ""}
|
||||
bbcode_recurse(text, data)
|
||||
return data
|
||||
|
||||
# Patched Network vars
|
||||
# var LUCY_PACKETS_READ = 0
|
||||
# var LUCY_BULK_FULL_TIMER = 0
|
||||
@@ -21,17 +74,62 @@ var full_interval = 5 setget set_full_interval
|
||||
# var LUCY_BULK_PACKETS = 128
|
||||
# var LUCY_BULK_INTERVAL = 0.8
|
||||
# var LUCY_BULK_FULL_INTERVAL = 6.4
|
||||
# var LUCY_CHAT_BBCODE
|
||||
# var LUCY_SRV_NAME
|
||||
# var LUCY_PUNCHED_ME
|
||||
# var LUCY_INSTANCE_SENDER
|
||||
# var LUCY_LOG_MESSAGES
|
||||
|
||||
var ingame = false
|
||||
|
||||
func set_punchback(punchback):
|
||||
do_punchback = punchback
|
||||
func set_bbcode(bbcode):
|
||||
allow_bbcode = bbcode
|
||||
Network.LUCY_CHAT_BBCODE = bbcode
|
||||
func process_message(lit_text, final_text, prefix, suffix, endcap, username, final_color, spoken_text):
|
||||
var thing = {
|
||||
"lit_text": lit_text, "final_text": final_text, "prefix": prefix, "suffix": suffix,
|
||||
"endcap": endcap, "username": username, "final_color": final_color,
|
||||
"srv_allow_bbcode": srv_allow_bbcode, "custom_color_enabled": custom_color_enabled,
|
||||
"custom_name_enabled": custom_name_enabled, "allow_bbcode": allow_bbcode,
|
||||
"allowed_tags": allowed_tags
|
||||
}
|
||||
#print("FUCK ", thing)
|
||||
if srv_allow_bbcode and lit_text.begins_with("%"):
|
||||
return [lit_text.trim_prefix('%'), spoken_text]
|
||||
|
||||
var name = custom_name if custom_name_enabled else username
|
||||
var color = custom_color if custom_color_enabled else final_color
|
||||
var msg = final_text
|
||||
var speak = spoken_text
|
||||
if allow_bbcode:
|
||||
var p = bbcode_process(lit_text)
|
||||
if not p.tags.empty():
|
||||
msg = p.fin
|
||||
speak = p.stripped
|
||||
return [
|
||||
prefix + "[color=#" + str(color.to_html()) + "]" + name + endcap + msg + suffix,
|
||||
speak
|
||||
]
|
||||
|
||||
func bbcode_changes():
|
||||
if srv_allow_bbcode and allow_intrusive_bbcode:
|
||||
allowed_tags = [
|
||||
"b", "i", "u", "s", "color",
|
||||
"wave", "rainbow", "shake", "tornado", "font"]
|
||||
else:
|
||||
allowed_tags = [
|
||||
"b", "i", "u", "s", "color"]
|
||||
if lucys_menu != null: lucys_menu.update()
|
||||
|
||||
func set_log_messages(val):
|
||||
log_messages = val
|
||||
Network.LUCY_LOG_MESSAGES = val
|
||||
|
||||
func set_allow_intrusive_bbcode(bbcode):
|
||||
allow_intrusive_bbcode = bbcode
|
||||
if Network.GAME_MASTER or not ingame:
|
||||
self.srv_allow_bbcode = bbcode
|
||||
else: bbcode_changes()
|
||||
func set_srv_bbcode(bbcode):
|
||||
if Network.GAME_MASTER and not Network.PLAYING_OFFLINE: send_server_sync_actor()
|
||||
srv_allow_bbcode = bbcode
|
||||
bbcode_changes()
|
||||
func set_server_name(name):
|
||||
custom_server_name = name
|
||||
Network.LUCY_SRV_NAME = name
|
||||
@@ -51,6 +149,9 @@ func set_full_interval(val):
|
||||
full_interval = val
|
||||
Network.LUCY_BULK_FULL_INTERVAL = val
|
||||
Network.LUCY_BULK_FULL_TIMER = 0
|
||||
func set_custom_color(val):
|
||||
custom_color = Color(val) if Color(val) != Color("d5aa73") else Color("739ed5")
|
||||
custom_color.a = 1
|
||||
|
||||
func _ready():
|
||||
print("[LUCY] Loaded LucysTools")
|
||||
@@ -58,6 +159,22 @@ 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,18 +201,34 @@ 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":
|
||||
lucys_menu = LUCYS_MENU_SCENE.instance()
|
||||
lucys_menu.MANAGER = self
|
||||
node.add_child(lucys_menu)
|
||||
ingame = false
|
||||
lucys_menu.setup(self)
|
||||
lucys_menu.setup()
|
||||
if node.name == "playerhud":
|
||||
lucys_menu = LUCYS_MENU_SCENE.instance()
|
||||
lucys_menu.MANAGER = self
|
||||
node.add_child(lucys_menu)
|
||||
ingame = true
|
||||
lucys_menu.setup(self)
|
||||
# retrigger setter
|
||||
self.srv_allow_bbcode = false
|
||||
self.allow_intrusive_bbcode = allow_intrusive_bbcode
|
||||
lucys_menu.setup()
|
||||
|
||||
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", "custom_name",
|
||||
"allow_intrusive_bbcode"
|
||||
]
|
||||
|
||||
func load_settings():
|
||||
print("[LUCY] Loading settings")
|
||||
@@ -105,27 +238,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))
|
||||
|
@@ -1,7 +0,0 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace LucysTools;
|
||||
|
||||
public class Config {
|
||||
[JsonInclude] public bool SomeSetting = true;
|
||||
}
|
1443
LucysTools/Mod.cs
1443
LucysTools/Mod.cs
File diff suppressed because it is too large
Load Diff
21
README.md
21
README.md
@@ -2,13 +2,26 @@ 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 custom name bbcode (and/or custom color)
|
||||
- Allows some BBCode in chat: [b], [i], [u], [s], [color] Make sure to close your tags!
|
||||
|
||||
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 enable intrusive BBCode ([rainbow], [tornado], [shake], [wave], [font]) in messages. If enabled, other players on the server can use these too. (Not secure or anything, implemented client side)
|
||||
- If intrusive BBCode is enabled, 'raw' messages can be sent with a % prefix
|
||||
|
||||
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.
|
||||
|
Reference in New Issue
Block a user