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

Refactor change dialog line speaker fixes #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
* #142 Dialog lines with ambient templar interchanged pt. 1
*/
func int G1CP_142_TemplarVIPDialog() {
var int funcId; funcId = G1CP_GetFuncId("Info_Tpl_8_WichtigePersonen_Info", "void|none");
return (G1CP_ReplaceOuInst(funcId, 0, "Info_Tpl_8_WichtigePersonen_15_02", self, other, other, self) > 0);
return G1CP_OuSwitchSpeaker("Info_Tpl_8_WichtigePersonen_Info", "Info_Tpl_8_WichtigePersonen_15_02", self, other);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
* #197 Dialog lines with ambient templar interchanged pt. 2
*/
func int G1CP_197_TemplarCampDialog() {
var int funcId; funcId = G1CP_GetFuncId("Info_Tpl_8_DasLager_Info", "void|none");
return (G1CP_ReplaceOuInst(funcId, 0, "Info_Tpl_8_DasLager_08_02", other, self, self, other) > 0);
return G1CP_OuSwitchSpeaker("Info_Tpl_8_DasLager_Info", "Info_Tpl_8_DasLager_08_02", other, self);
};
17 changes: 17 additions & 0 deletions src/Ninja/G1CP/Content/Misc/ou.d
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,20 @@ func int G1CP_ReplaceOuFilenameP(var int ouPtr, var string needle, var string re
func int G1CP_ReplaceOuFilename(var string ouName, var string needle, var string replace) {
return G1CP_ReplaceOuFilenameP(G1CP_GetOu(ouName), needle, replace);
};


/*
* Switch the speaker of a dialog line. Returns true on success.
*/
func int G1CP_OuSwitchSpeaker(var string infoName, var string ouName, var int needle, var int replace) {
var int funcId; funcId = G1CP_GetFuncId(infoName, "void|none");

if ((needle == self) && (replace == other)) {
return (G1CP_ReplaceOuInst(funcId, 0, infoName, self, other, other, self) > 0);
}
if ((needle == other) && (replace == self)) {
return (G1CP_ReplaceOuInst(funcId, 0, infoName, other, self, self, other) > 0);
}

return FALSE;
};