Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ API: Add methods for deprecation + API Folder #156

Merged

Conversation

ithinkandicode
Copy link
Collaborator

@ithinkandicode ithinkandicode commented Mar 2, 2023

Adds 3 new methods for deprecation, as outlined and discussed in #154, which this PR closes.

Deviates slightly from #154, in that the deprecation messages are generic, rather than specific to ModLoader. This means that mods can use these methods too, not just ModLoader.

Additionally, this PR introduces the api directory, as discussed in #153. Classes in this folder are considered to be available for public use.

Methods

# A method has changed its name/class
static func deprecated_changed(old_method: String, new_method: String, since_version: String, show_removal_note: bool = true)

# A method has been entirely removed, with no replacement
# (should never be needed but good to have just in case)
static func deprecated_removed(old_method: String, since_version: String, show_removal_note: bool = true)

# Freeform deprecation message.
# Allows you to add a deprecation comment without specifying the old/new method
static func deprecated_message(msg: String, since_version: String = "")

Examples

Code:

ModLoaderDeprecated.deprecated_changed("Hello.World", "Hello.Globe", "6.5.0")
ModLoaderDeprecated.deprecated_removed("Hello.World", "6.5.0")
ModLoaderDeprecated.deprecated_message("Generic deprecation message with version", "6.5.0")
ModLoaderDeprecated.deprecated_message("Generic deprecation message, no version")

Results:

deprecated_changed

deprecated_changed

deprecated_removed

deprecated_removed

deprecated_message (wi. version)

deprecated_message1

deprecated_message (no version)

deprecated_message2

Related

@ithinkandicode ithinkandicode added the enhancement New feature or request label Mar 2, 2023
@ithinkandicode ithinkandicode linked an issue Mar 2, 2023 that may be closed by this pull request
Copy link
Collaborator

@Qubus0 Qubus0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thank you

addons/mod_loader/api/deprecated.gd Outdated Show resolved Hide resolved
@ithinkandicode ithinkandicode added this pull request to the merge queue Mar 2, 2023
Merged via the queue into GodotModding:development with commit 61132dd Mar 2, 2023
@ithinkandicode ithinkandicode deleted the api-deprecated branch March 2, 2023 13:58
@ithinkandicode ithinkandicode changed the title API: Add methods for deprecation + API Folder feat: ✨ API: Add methods for deprecation + API Folder Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: Deprecation
2 participants