Skip to content

Commit

Permalink
Update annotation from @GodotMember to @member, fix supertype metadat…
Browse files Browse the repository at this point in the history
…a including interfaces and fix treating of signals as properties when a registration annotation is present
  • Loading branch information
chippmann committed Nov 2, 2024
1 parent fa83ff9 commit 76fe8ab
Show file tree
Hide file tree
Showing 46 changed files with 348 additions and 348 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package godot.tests.library.flattened

import godot.Node3D
import godot.annotation.Export
import godot.annotation.GodotMember
import godot.annotation.Member
import godot.annotation.GodotScript

@GodotScript
Expand All @@ -11,6 +11,6 @@ class Simple: Node3D() {
@Export
var testProperty = "Hello from flattened-library-test!"

@GodotMember
@Member
fun provideGreeting(): String = testProperty
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package godot.tests.library.fqname

import godot.Node3D
import godot.annotation.Export
import godot.annotation.GodotMember
import godot.annotation.Member
import godot.annotation.GodotScript

@GodotScript
Expand All @@ -11,6 +11,6 @@ open class Simple: Node3D() {
@Export
var testProperty = "Hello from fqname-library-test!"

@GodotMember
@Member
fun provideGreeting(): String = testProperty
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package godot.tests.library.hierarchical

import godot.Node3D
import godot.annotation.Export
import godot.annotation.GodotMember
import godot.annotation.Member
import godot.annotation.GodotScript

@GodotScript
Expand All @@ -11,6 +11,6 @@ class Simple: Node3D() {
@Export
var testProperty = "Hello from hierarchical-library-test!"

@GodotMember
@Member
fun provideGreeting(): String = testProperty
}
6 changes: 3 additions & 3 deletions harness/tests/otherSourceDir/CoreTypePropertyChecks.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import godot.Node
import godot.annotation.Export
import godot.annotation.GodotMember
import godot.annotation.Member
import godot.annotation.GodotScript
import godot.core.Vector3

Expand All @@ -18,10 +18,10 @@ class CoreTypePropertyChecks: Node() {
var exportedNormalCoreType: Vector3 = Vector3.ZERO

// not allowed
// @GodotMember
// @Member
// lateinit var lateinitCoreType: Vector3

// allowed
@GodotMember
@Member
var normalCoreType: Vector3 = Vector3.ZERO
}
4 changes: 2 additions & 2 deletions harness/tests/otherSourceDir/ScriptInOtherSourceDir.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import godot.Node
import godot.annotation.GodotMember
import godot.annotation.Member
import godot.annotation.GodotScript

@GodotScript
class ScriptInOtherSourceDir: Node() {

@GodotMember
@Member
fun greeting() = "HelloWorld"
}
14 changes: 7 additions & 7 deletions harness/tests/src/main/java/godot/tests/JavaTestClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import godot.RenderingServer;
import godot.annotation.EnumTypeHint;
import godot.annotation.Export;
import godot.annotation.GodotMember;
import godot.annotation.Member;
import godot.annotation.GodotScript;
import godot.core.*;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -47,18 +47,18 @@ public class JavaTestClass extends Node {
@Export
public Button exportedButton;

@GodotMember
@Member
public String greeting() {
return "Hello from java";
}

@GodotMember
@Member
public boolean signalEmitted = false;

@GodotMember
@Member
public VariantArray<Integer> variantArray = new VariantArray<>(Integer.class);

@GodotMember
@Member
public Dictionary<Float, String> dictionary = new Dictionary<>(Float.class, String.class);

public LambdaCallable<Void> lambdaCallable = LambdaCallable0.create(
Expand All @@ -79,7 +79,7 @@ public void _ready() {
RenderingServer.getDefaultClearColor();
}

@GodotMember
@Member
public void connectAndTriggerSignal() {
connect(
StringNames.asStringName("test_signal"),
Expand All @@ -100,7 +100,7 @@ public GodotNotification _notification() {
);
}

@GodotMember
@Member
public void signalCallback() {
signalEmitted = true;
}
Expand Down
42 changes: 21 additions & 21 deletions harness/tests/src/main/kotlin/godot/tests/CoreTypesIdentityTest.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package godot.tests

import godot.Node
import godot.annotation.GodotMember
import godot.annotation.Member
import godot.annotation.GodotScript
import godot.core.AABB
import godot.core.Basis
Expand All @@ -17,64 +17,64 @@ import godot.core.Vector3
@GodotScript
class CoreTypesIdentityTest : Node() {

@GodotMember
@Member
var aabb = AABB(Vector3(1, 1, 1), Vector3(2, 2, 2))

@GodotMember
@Member
var basis = Basis(Vector3(0, 1, 2), Vector3(3, 4, 5), Vector3(6, 7, 8))

@GodotMember
@Member
var color = Color(0.1, 0.2, 0.3, 0.4)

@GodotMember
@Member
var plane = Plane(1, 2, 3, 4)

@GodotMember
@Member
var quaternion = Quaternion(1, 2, 3, 4)

@GodotMember
@Member
var rect2 = Rect2(1.0, 2.0, 3.0, 4.0)

@GodotMember
@Member
var transform3D =
Transform3D(Vector3(0, 1, 2), Vector3(3, 4, 5), Vector3(6, 7, 8), Vector3(9, 10, 11))

@GodotMember
@Member
var transform2D = Transform2D(0, 1, 2, 3, 4, 5)

@GodotMember
@Member
var vector2 = Vector2(1, 2)

@GodotMember
@Member
var vector3 = Vector3(1, 2, 3)

@GodotMember
@Member
fun aabb(aabb: AABB) = aabb

@GodotMember
@Member
fun basis(basis: Basis) = basis

@GodotMember
@Member
fun color(color: Color) = color

@GodotMember
@Member
fun plane(plane: Plane) = plane

@GodotMember
@Member
fun quat(quaternion: Quaternion) = quaternion

@GodotMember
@Member
fun rect2(rect2: Rect2) = rect2

@GodotMember
@Member
fun transform(transform3D: Transform3D) = transform3D

@GodotMember
@Member
fun transform2D(transform2D: Transform2D) = transform2D

@GodotMember
@Member
fun vector2(vector2: Vector2) = vector2

@GodotMember
@Member
fun vector3(vector3: Vector3) = vector3
}
28 changes: 14 additions & 14 deletions harness/tests/src/main/kotlin/godot/tests/FuncRefTest.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package godot.tests

import godot.Node
import godot.annotation.GodotMember
import godot.annotation.Member
import godot.annotation.GodotScript
import godot.annotation.Rpc
import godot.core.signal0
Expand All @@ -13,60 +13,60 @@ class FuncRefTest : Node() {

val test by signal0()

@GodotMember
@Member
var blubb: Boolean = false

@GodotMember
@Member
var callFlag = false

@GodotMember
@Member
var callWithParamFlag = false

@GodotMember
@Member
var signalCallFlag = false

@GodotMember
@Member
override fun _ready() {
test.connect(this, FuncRefTest::testSignalCallback)
}

@Rpc
@GodotMember
@Member
fun testSignalCallback() {
signalCallFlag = true
}

@GodotMember
@Member
fun testSignalCall() {
test.emit()
}

@GodotMember
@Member
fun withoutParamCallback() {
callFlag = true
}

@GodotMember
@Member
fun testCallWithoutParam() {
call(this::withoutParamCallback)
}

@GodotMember
@Member
fun testCallDeferredWithoutParam() {
callDeferred(this::withoutParamCallback)
}

@GodotMember
@Member
fun withParamCallback(flag: Boolean) {
callWithParamFlag = flag
}

@GodotMember
@Member
fun testCallWithParam() {
call(this::withParamCallback, true)
}

@GodotMember
@Member
fun testCallDeferredWithParam() {
callDeferred(this::withParamCallback, true)
}
Expand Down
Loading

0 comments on commit 76fe8ab

Please sign in to comment.