Skip to content

Commit 04ffc0a

Browse files
committed
Rename issue_notification -> notify
1 parent 59e4f75 commit 04ffc0a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

godot-codegen/src/class_generator.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,14 @@ fn make_notify_method(class_name: &TyName, ctx: &mut Context) -> TokenStream {
391391
/// If you call this method on a user-defined object while holding a `GdRef` or `GdMut` guard on the instance, you will encounter
392392
/// a panic. The reason is that the receiving virtual method `on_notification()` acquires a `GdMut` lock dynamically, which must
393393
/// be exclusive.
394-
pub fn issue_notification(&mut self, what: #enum_name) {
394+
pub fn notify(&mut self, what: #enum_name) {
395395
self.notification(i32::from(what) as i64, false);
396396
}
397397

398-
/// ⚠️ Like [`Self::issue_notification()`], but starts at the most-derived class and goes up the hierarchy.
398+
/// ⚠️ Like [`Self::notify()`], but starts at the most-derived class and goes up the hierarchy.
399399
///
400400
/// See docs of that method, including the panics.
401-
pub fn issue_notification_reversed(&mut self, what: #enum_name) {
401+
pub fn notify_reversed(&mut self, what: #enum_name) {
402402
self.notification(i32::from(what) as i64, true);
403403
}
404404
}
@@ -1299,7 +1299,7 @@ fn special_virtual_methods(notification_enum_name: &Ident) -> TokenStream {
12991299
/// to represent integers out of known constants (mistakes or future additions).
13001300
///
13011301
/// This method is named `_notification` in Godot, but `on_notification` in Rust. To _send_ notifications, use the
1302-
/// [`Object::issue_notification`][crate::engine::Object::issue_notification] method.
1302+
/// [`Object::notify`][crate::engine::Object::notify] method.
13031303
///
13041304
/// See also in Godot docs:
13051305
/// * [`Object::_notification`](https://docs.godotengine.org/en/stable/classes/class_object.html#class-object-method-notification).

itest/rust/src/virtual_methods_test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,10 @@ fn test_input_event(test_context: &TestContext) {
446446
fn test_notifications() {
447447
let obj = Gd::<NotificationTest>::new_default();
448448
let mut node = obj.share().upcast::<Node>();
449-
node.issue_notification(NodeNotification::Unpaused);
450-
node.issue_notification(NodeNotification::EditorPostSave);
451-
node.issue_notification(NodeNotification::Ready);
452-
node.issue_notification_reversed(NodeNotification::WmSizeChanged);
449+
node.notify(NodeNotification::Unpaused);
450+
node.notify(NodeNotification::EditorPostSave);
451+
node.notify(NodeNotification::Ready);
452+
node.notify_reversed(NodeNotification::WmSizeChanged);
453453

454454
assert_eq!(
455455
obj.bind().sequence,

0 commit comments

Comments
 (0)