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
Missing whitespace for skill point(s) #43
Comments
gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/Story/Text.d Lines 534 to 535 in e66b303
changed to const string NAME_LearnPostfixS = " skill point)";
const string NAME_LearnPostfixP = " skill points)"; |
This fix will be possible. However, it will only work if we know the exact wording for each language we want to support. If the wording is off by a little, or the values have been corrected, the fix would not take effect (which seems like a good option), |
This bug seems to be present for the English language version of the game only. If the fix doesn't take effect when a mod fixes these strings, that's fine. |
#43: Fix whitespace of learning print (EN)
This fix should be updated to use the G1CP string manipulation functions. In order to stick to only updating either both or none of the two string, the functions gothic-1-community-patch/src/Ninja/G1CP/Content/Fixes/Session/fix043_EN_SkillMissingWhitespace.d Lines 5 to 24 in 5abd54e
changed to (something like): var int symb1Id; symb1Id = G1CP_GetStringConstId("NAME_LearnPostfixS", 0);
var int symb2Id; symb2Id = G1CP_GetStringConstId("NAME_LearnPostfixP", 0);
// Check if the strings are as expected
if (Hlp_StrCmp(G1CP_GetStringConstI(symb1Id, 0, "G1CP invalid string"), "skill point)"))
&& (Hlp_StrCmp(G1CP_GetStringConstI(symb2Id, 0, "G1CP invalid string"), "skill points)")) {
// Only then, fix them
G1CP_SetStringConstI(symb1Id, 0, " skill point)");
G1CP_SetStringConstI(symb2Id, 0, " skill points)");
return TRUE;
};
return FALSE; |
I suggest splitting this fix into separate Fixes and refactor them like this: G1CP_ReplaceStringConst("NAME_LearnPostfixS", "skill point)", " skill point)");
/*
* Find a constant string (case-sensitive) and replace it if found. Returns true on success.
*/
func int G1CP_ReplaceStringConst(var string name, var string needle, var string replace) {
if (STR_Compare(G1CP_GetStringConst(name, 0, "G1CP invalid string"), needle) != STR_EQUAL) {
return FALSE;
};
G1CP_SetStringConst(name, 0, replace);
return TRUE;
}; Alternatively, we could refactor this and leave both into one fix: G1CP_ReplaceStringConst("NAME_LearnPostfixS", "skill point)", " skill point)");
G1CP_ReplaceStringConst("NAME_LearnPostfixP", "skill points)", " skill points)"); |
When learning from teachers, there is a whitespace missing before "skill point" and "skill points" respectively.
The text was updated successfully, but these errors were encountered: