diff --git a/Gift.gd b/Gift.gd index c8271d2..ad3dab7 100644 --- a/Gift.gd +++ b/Gift.gd @@ -44,21 +44,21 @@ func _ready() -> void: whisper("TEST", "mennomax") # The cmd_data array contains [, , -func command_test(cmd_data): +func command_test(cmd_info : CommandInfo) -> void: print("A") # The cmd_data array contains [, , -func hello_world(cmd_data): +func hello_world(cmd_info : CommandInfo) -> void: chat("HELLO WORLD!") -func streamer_only(cmd_data): +func streamer_only(cmd_info : CommandInfo) -> void: chat("Streamer command executed") -func no_permission(cmd_data): +func no_permission(cmd_info : CommandInfo) -> void: chat("NO PERMISSION!") -func greet(cmd_data, arg_ary): +func greet(cmd_info : CommandInfo, arg_ary : PoolStringArray) -> void: chat("Greetings, " + arg_ary[0]) -func list(cmd_data, arg_ary): +func list(cmd_info : CommandInfo, arg_ary : PoolStringArray) -> void: chat(arg_ary.join(", ")) \ No newline at end of file diff --git a/addons/gift/gift_node.gd b/addons/gift/gift_node.gd index 06deea5..d1e1c3d 100644 --- a/addons/gift/gift_node.gd +++ b/addons/gift/gift_node.gd @@ -193,9 +193,9 @@ func handle_command(sender_data : SenderData, msg : PoolStringArray, whisper : b print_debug("No Permission for command!") return if(arg_ary.size() == 0): - cmd_data.func_ref.call_func([sender_data, command, whisper]) + cmd_data.func_ref.call_func(CommandInfo.new(sender_data, command, whisper)) else: - cmd_data.func_ref.call_func([sender_data, command, whisper], arg_ary) + cmd_data.func_ref.call_func(CommandInfo.new(sender_data, command, whisper), arg_ary) func get_perm_flag_from_tags(tags : Dictionary) -> int: var flag = 0 diff --git a/addons/gift/util/cmd_info.gd b/addons/gift/util/cmd_info.gd new file mode 100644 index 0000000..3134fd6 --- /dev/null +++ b/addons/gift/util/cmd_info.gd @@ -0,0 +1,12 @@ +extends Reference +class_name CommandInfo + +var sender_data : SenderData +var command : String +var whisper : bool + +func _init(sndr_dt, cmd, whspr): + sender_data = sndr_dt + command = cmd + whisper = whspr + \ No newline at end of file diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..7e85c2b --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,24 @@ +[preset.0] + +name="Linux/X11" +platform="Linux/X11" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="/home/mennomax/Documents/godot/GIFT.x86_64" +patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" + +[preset.0.options] + +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true +binary_format/64_bits=true +custom_template/release="" +custom_template/debug="" diff --git a/project.godot b/project.godot index 31a6572..cd5a892 100644 --- a/project.godot +++ b/project.godot @@ -14,6 +14,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/gift/util/cmd_data.gd" }, { +"base": "Reference", +"class": "CommandInfo", +"language": "GDScript", +"path": "res://addons/gift/util/cmd_info.gd" +}, { "base": "Node", "class": "Gift", "language": "GDScript", @@ -26,6 +31,7 @@ _global_script_classes=[ { } ] _global_script_class_icons={ "CommandData": "", +"CommandInfo": "", "Gift": "", "SenderData": "" }