Skip to content

Add ConVar.GetDescription() method#1449

Merged
peace-maker merged 4 commits intoalliedmodders:masterfrom
Wend4r:patch-4
Mar 21, 2021
Merged

Add ConVar.GetDescription() method#1449
peace-maker merged 4 commits intoalliedmodders:masterfrom
Wend4r:patch-4

Conversation

@Wend4r
Copy link
Contributor

@Wend4r Wend4r commented Mar 18, 2021

Issue #1432

@Wend4r
Copy link
Contributor Author

Wend4r commented Mar 18, 2021

Works
image

* @param maxlength Maximum length of string buffer.
* @error Invalid or corrupt Handle.
*/
native void GetConVarDescription(Handle convar, char[] buffer, int maxlength);
Copy link
Member

Choose a reason for hiding this comment

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

I understand adding this for the sake of completion, but we don't add old style functions for new features. Rest looks good to me, though! 😄

@peace-maker
Copy link
Member

We need to figure out how to handle changes to translation phrases before merging this!

@Wend4r
Copy link
Contributor Author

Wend4r commented Mar 19, 2021

We need to figure out how to handle changes to translation phrases before merging this!

I followed the standards set by basecommands

LoadTranslations("common.phrases");
LoadTranslations("plugin.basecommands");

Phrases from ConVars are found in these 2 files.
I think this already needs to be speak with a solution, outside of this pull request.

@peace-maker
Copy link
Member

Yes, sorry, this is nothing wrong with your changes. Just like #597 changes to the translation files have to be reflected in the translator tool used to gather all the different languages. That update isn't automated yet and the process of translation hasn't been revisited since SourceMod switched to a rolling release cycle afaik.

@asherkin
Copy link
Member

I think it would be best to remove the basecommands changes so we can get the new API merged.

Copy link
Member

@peace-maker peace-maker left a comment

Choose a reason for hiding this comment

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

The non-methodmap native needs to go, but otherwise this looks great!

@Wend4r
Copy link
Contributor Author

Wend4r commented Mar 21, 2021

When there was an active change with basecommands, it returns an empty string aka NULL_STRING from ConVar.GetDescription() from ConVars without a description.

@peace-maker
Copy link
Member

NULL_STRING and an empty string aren't the same, but I guess you're talking about an empty string, so this is fine.

@peace-maker peace-maker merged commit 5a72644 into alliedmodders:master Mar 21, 2021
@peace-maker peace-maker linked an issue Mar 21, 2021 that may be closed by this pull request
@Wend4r Wend4r deleted the patch-4 branch March 21, 2021 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce ConVar.GetDescription() method

4 participants