renamed addon

This commit is contained in:
2023-03-11 18:01:42 +01:00
parent 22fd456059
commit a80244b4db
16 changed files with 25 additions and 77 deletions

4
project/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Godot
.godot/
#Visual Studio
.vs/

View File

@@ -0,0 +1,22 @@
[configuration]
entry_symbol = "discordrpcgd_library_init"
[libraries]
macos.debug = "bin/libgd-discordrpc.macos.template_debug.framework"
macos.release = "bin/libgd-discordrpc.macos.template_release.framework"
windows.debug.x86_32 = "bin/libgd-discordrpc.windows.template_debug.x86_32.dll"
windows.release.x86_32 = "bin/libgdexample.windows.template_release.x86_32.dll"
windows.debug.x86_64 = "bin/libgd-discordrpc.windows.template_debug.x86_64.dll"
windows.release.x86_64 = "bin/libgd-discordrpc.windows.template_release.x86_64.dll"
linux.debug.x86_64 = "bin/libgd-discordrpc.linux.template_debug.x86_64.so"
linux.release.x86_64 = "bin/libgd-discordrpc.linux.template_release.x86_64.so"
linux.debug.arm64 = "bin/libgd-discordrpc.linux.template_debug.arm64.so"
linux.release.arm64 = "bin/libgd-discordrpc.linux.template_release.arm64.so"
linux.debug.rv64 = "bin/libgd-discordrpc.linux.template_debug.rv64.so"
linux.release.rv64 = "bin/libgd-discordrpc.linux.template_release.rv64.so"
android.debug.x86_64 = "bin/libgd-discordrpc.android.template_debug.x86_64.so"
android.release.x86_64 = "bin/libgd-discordrpc.android.template_release.x86_64.so"
android.debug.arm64 = "bin/libgd-discordrpc.android.template_debug.arm64.so"
android.release.arm64 = "bin/libgd-discordrpc.android.template_release.arm64.so"

7
project/default_env.tres Normal file
View File

@@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=3 uid="uid://dtd3q2x2ulcsi"]
[sub_resource type="Sky" id="1"]
[resource]
background_mode = 2
sky = SubResource("1")

BIN
project/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

34
project/icon.png.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cswr8vy4lt7dt"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

80
project/main.gd Normal file
View File

@@ -0,0 +1,80 @@
extends Node
func _ready():
# Bind signals
prints("Signal bind")
$Button.button_up.connect($Example.emit_custom_signal.bind("Button", 42))
prints("")
# To string.
prints("To string")
prints(" Example --> ", $Example.to_string())
prints(" ExampleMin --> ", $Example/ExampleMin.to_string())
# Call static methods.
prints("Static method calls")
prints(" static (109)", Example.test_static(9, 100));
Example.test_static2();
# Property list.
prints("Property list")
$Example.property_from_list = Vector3(100, 200, 300)
prints(" property value ", $Example.property_from_list)
# Call methods.
prints("Instance method calls")
$Example.simple_func()
($Example as Example).simple_const_func() # Force use of ptrcall
prints(" returned", $Example.return_something("some string"))
prints(" returned const", $Example.return_something_const())
var null_ref = $Example.return_empty_ref()
prints(" returned empty ref", null_ref)
var ret_ref = $Example.return_extended_ref()
prints(" returned ref", ret_ref.get_instance_id(), ", id:", ret_ref.get_id())
prints(" returned ", $Example.get_v4())
prints(" test node argument", $Example.test_node_argument($Example))
prints("VarArg method calls")
var ref = ExampleRef.new()
prints(" sending ref: ", ref.get_instance_id(), "returned ref: ", $Example.extended_ref_checks(ref).get_instance_id())
prints(" vararg args", $Example.varargs_func("some", "arguments", "to", "test"))
prints(" vararg_nv ret", $Example.varargs_func_nv("some", "arguments", "to", "test"))
$Example.varargs_func_void("some", "arguments", "to", "test")
prints("Method calls with default values")
prints(" defval (300)", $Example.def_args())
prints(" defval (250)", $Example.def_args(50))
prints(" defval (150)", $Example.def_args(50, 100))
prints("Array and Dictionary")
prints(" test array", $Example.test_array())
prints(" test tarray", $Example.test_tarray())
prints(" test dictionary", $Example.test_dictionary())
var array: Array[int] = [1, 2, 3]
$Example.test_tarray_arg(array)
prints("String += operator")
prints(" test string +=", $Example.test_string_ops())
prints("PackedArray iterators")
prints(" test packed array iterators", $Example.test_vector_ops())
prints("Properties")
prints(" custom position is", $Example.group_subgroup_custom_position)
$Example.group_subgroup_custom_position = Vector2(50, 50)
prints(" custom position now is", $Example.group_subgroup_custom_position)
prints("Constants")
prints(" FIRST", $Example.FIRST)
prints(" ANSWER_TO_EVERYTHING", $Example.ANSWER_TO_EVERYTHING)
prints(" CONSTANT_WITHOUT_ENUM", $Example.CONSTANT_WITHOUT_ENUM)
prints("BitFields")
prints(" FLAG_ONE", Example.FLAG_ONE)
prints(" FLAG_TWO", Example.FLAG_TWO)
prints(" returned BitField", $Example.test_bitfield(0))
prints(" returned BitField", $Example.test_bitfield(Example.FLAG_ONE | Example.FLAG_TWO))
func _on_Example_custom_signal(signal_name, value):
prints("Example emitted:", signal_name, value)

25
project/main.tscn Normal file
View File

@@ -0,0 +1,25 @@
[gd_scene load_steps=2 format=3 uid="uid://dmx2xuigcpvt4"]
[ext_resource type="Script" path="res://main.gd" id="1_c326s"]
[node name="Node" type="Node"]
script = ExtResource("1_c326s")
[node name="Example" type="Example" parent="."]
[node name="ExampleMin" type="ExampleMin" parent="Example"]
layout_mode = 0
[node name="Label" type="Label" parent="Example"]
layout_mode = 0
offset_left = 194.0
offset_top = -2.0
offset_right = 234.0
offset_bottom = 21.0
[node name="Button" type="Button" parent="."]
offset_right = 79.0
offset_bottom = 29.0
text = "Click me!"
[connection signal="custom_signal" from="Example" to="." method="_on_Example_custom_signal"]

28
project/project.godot Normal file
View File

@@ -0,0 +1,28 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="GDExtension Test Project"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.0")
config/icon="res://icon.png"
[dotnet]
project/assembly_name="GDExtension Test Project"
[native_extensions]
paths=["res://example.gdextension"]
[rendering]
environment/defaults/default_environment="res://default_env.tres"