Skip to content

Commit

Permalink
Revert occurrences of *Virtual -> GodotExt
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Mar 19, 2023
1 parent b15b5d4 commit be2cb28
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/dodge-the-creeps/rust/src/hud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Hud {
}

#[godot_api]
impl CanvasLayerVirtual for Hud {
impl GodotExt for Hud {
fn init(base: Base<Self::Base>) -> Self {
Self { base }
}
Expand Down
2 changes: 1 addition & 1 deletion examples/dodge-the-creeps/rust/src/main_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl Main {
}

#[godot_api]
impl NodeVirtual for Main {
impl GodotExt for Main {
fn init(base: Base<Node>) -> Self {
Main {
mob_scene: PackedScene::new(),
Expand Down
2 changes: 1 addition & 1 deletion examples/dodge-the-creeps/rust/src/mob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Mob {
}

#[godot_api]
impl RigidBody2DVirtual for Mob {
impl GodotExt for Mob {
fn init(base: Base<RigidBody2D>) -> Self {
Mob {
min_speed: 150.0,
Expand Down
2 changes: 1 addition & 1 deletion examples/dodge-the-creeps/rust/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Player {
}

#[godot_api]
impl Area2DVirtual for Player {
impl GodotExt for Player {
fn init(base: Base<Area2D>) -> Self {
Player {
speed: 400.0,
Expand Down
5 changes: 4 additions & 1 deletion godot-core/src/obj/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ pub trait Share {
fn share(&self) -> Self;
}

// Marker trait that exists only for documentation purposes.
// pub trait GodotExt : private::Sealed {}

/// Non-strict inheritance relationship in the Godot class hierarchy.
///
/// `Derived: Inherits<Base>` means that either `Derived` is a subclass of `Base`, or the class `Base` itself (hence "non-strict").
Expand Down Expand Up @@ -164,7 +167,7 @@ pub mod cap {
fn __register_exports();
}

/// Auto-implemented for `#[godot_api] impl ***Virtual for MyClass` blocks
/// Auto-implemented for `#[godot_api] impl GodotExt for MyClass` blocks
pub trait ImplementsGodotVirtual: GodotClass {
#[doc(hidden)]
fn __virtual_call(_name: &str) -> sys::GDExtensionClassCallVirtual;
Expand Down
2 changes: 2 additions & 0 deletions godot-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub fn derive_native_class(input: TokenStream) -> TokenStream {
translate(input, derive_godot_class::transform)
}

/// Attribute to annotate `impl` blocks.
#[doc(alias="GodotExt")]
#[proc_macro_attribute]
pub fn godot_api(_meta: TokenStream, input: TokenStream) -> TokenStream {
translate(input, godot_api::transform)
Expand Down
2 changes: 1 addition & 1 deletion itest/rust/src/codegen_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub struct TestBaseRenamed {
}

#[godot_api]
impl HttpRequestVirtual for TestBaseRenamed {
impl GodotExt for TestBaseRenamed {
fn init(base: Base<HttpRequest>) -> Self {
TestBaseRenamed { base }
}
Expand Down
2 changes: 1 addition & 1 deletion itest/rust/src/export_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl HasProperty {
}

#[godot_api]
impl NodeVirtual for HasProperty {
impl GodotExt for HasProperty {
fn init(base: Base<Node>) -> Self {
HasProperty {
int_val: 0,
Expand Down
2 changes: 1 addition & 1 deletion itest/rust/src/object_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ pub struct ObjPayload {
}

#[godot_api]
impl RefCountedVirtual for ObjPayload {
impl GodotExt for ObjPayload {
fn init(_base: Base<Self::Base>) -> Self {
Self { value: 111 }
}
Expand Down
6 changes: 3 additions & 3 deletions itest/rust/src/virtual_methods_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct VirtualMethodTest {
impl VirtualMethodTest {}

#[godot_api]
impl RefCountedVirtual for VirtualMethodTest {
impl GodotExt for VirtualMethodTest {
fn to_string(&self) -> GodotString {
format!("VirtualMethodTest[integer={}]", self.integer).into()
}
Expand All @@ -50,7 +50,7 @@ struct ReadyVirtualTest {
}

#[godot_api]
impl Node2DVirtual for ReadyVirtualTest {
impl GodotExt for ReadyVirtualTest {
fn init(base: Base<Node2D>) -> Self {
ReadyVirtualTest {
some_base: base,
Expand All @@ -73,7 +73,7 @@ struct TreeVirtualTest {
}

#[godot_api]
impl Node2DVirtual for TreeVirtualTest {
impl GodotExt for TreeVirtualTest {
fn init(base: Base<Node2D>) -> Self {
TreeVirtualTest {
some_base: base,
Expand Down

0 comments on commit be2cb28

Please sign in to comment.