1
+ # API methods for deprecating funcs. Can be used by mods with public APIs.
1
2
class_name ModLoaderDeprecated
2
3
extends Node
3
4
4
- # API methods for deprecating funcs. Can be used by mods with public APIs.
5
5
6
6
const LOG_NAME := "ModLoader:Deprecated"
7
7
8
8
9
- # A method has changed its name/class
9
+ # Marks a method that has changed its name or class.
10
+ #
11
+ # Parameters:
12
+ # - old_method (String): The name of the deprecated method.
13
+ # - new_method (String): The name of the new method to use.
14
+ # - since_version (String): The version number from which the method has been deprecated.
15
+ # - show_removal_note (bool): (optional) If true, includes a note about future removal of the old method. Default is true.
16
+ #
17
+ # Returns: void
10
18
static func deprecated_changed (old_method : String , new_method : String , since_version : String , show_removal_note : bool = true ) -> void :
11
19
_deprecated_log (str (
12
20
"DEPRECATED: " ,
@@ -16,8 +24,15 @@ static func deprecated_changed(old_method: String, new_method: String, since_ver
16
24
))
17
25
18
26
19
- # A method has been entirely removed, with no replacement
20
- # (should never be needed but good to have just in case)
27
+ # Marks a method that has been entirely removed, with no replacement.
28
+ # Note: This should rarely be needed but is included for completeness.
29
+ #
30
+ # Parameters:
31
+ # - old_method (String): The name of the removed method.
32
+ # - since_version (String): The version number from which the method has been deprecated.
33
+ # - show_removal_note (bool): (optional) If true, includes a note about future removal of the old method. Default is true.
34
+ #
35
+ # Returns: void
21
36
static func deprecated_removed (old_method : String , since_version : String , show_removal_note : bool = true ) -> void :
22
37
_deprecated_log (str (
23
38
"DEPRECATED: " ,
@@ -27,15 +42,24 @@ static func deprecated_removed(old_method: String, since_version: String, show_r
27
42
))
28
43
29
44
30
- # Freeform deprecation message.
31
- # Allows you to add a deprecation comment without specifying the old/new method
45
+ # Marks a method with a freeform deprecation message.
46
+ #
47
+ # Parameters:
48
+ # - msg (String): The deprecation message.
49
+ # - since_version (String): (optional) The version number from which the deprecation applies.
50
+ #
51
+ # Returns: void
32
52
static func deprecated_message (msg : String , since_version : String = "" ) -> void :
33
53
var since_text := " (since version %s )" % since_version if since_version else ""
34
54
_deprecated_log (str ("DEPRECATED: " , msg , since_text ))
35
55
36
56
37
- # Internal func for logging with support to trigger warnings instead of fatal
38
- # errors
57
+ # Internal function for logging deprecation messages with support to trigger warnings instead of fatal errors.
58
+ #
59
+ # Parameters:
60
+ # - msg (String): The deprecation message.
61
+ #
62
+ # Returns: void
39
63
static func _deprecated_log (msg : String ) -> void :
40
64
if ModLoaderStore .ml_options .ignore_deprecated_errors or OS .has_feature ("standalone" ):
41
65
ModLoaderLog .warning (msg , LOG_NAME )
0 commit comments