-
Notifications
You must be signed in to change notification settings - Fork 45
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
Mapvote GSC helpers #215
base: develop
Are you sure you want to change the base?
Mapvote GSC helpers #215
Conversation
Co-authored-by: William Roy <[email protected]>
Co-authored-by: William Roy <[email protected]>
9cd6d51
to
6d6b027
Compare
Wait I think the function I call by raw address should probably be registered in Game.hpp instead or functions.hpp maybe This code/feature comes from my fork, where I have much less of a standard for cleanliness so, I did not realize this |
{ | ||
if (Game::Scr_GetNumParam() != 2) | ||
{ | ||
Game::Scr_Error("GetMapArenaInfo: Needs az map name and a field name!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"az" - typo?
const char* str = Game::Scr_GetString(0); | ||
|
||
const auto result = Game::UI_SafeTranslateString(str); | ||
|
||
Game::Scr_AddString(result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if Scr_GetString fails to retrieve a string? Can it fail to begin with, or is it safe to assume that it will always succeed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate of https://github.com/iw4x/iw4x-client/blob/develop/src/Components/Modules/GSC/String.cpp#L148
istring can cast and localize strings that are preached by gsc. check that you are not accidentally making a dupe (code may be different but could be functionally the same)
What does this PR do?
Adds various GSC functions very useful to make a map voting menu, among other things
How does this PR change IW4x's behaviour?
Adds scripting functions
Anything else we should know?
Not sure if LocalizeText isn't already a thing, I think it isn't, pretty sure it isn't, but maybe someone will correct me on this
Did you check all the boxes?
closes #XXXX
in comment to auto-close issue when PR is merged)