mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
fix custom dialog boxes not being properly reset
This commit is contained in:
parent
5a9f4b10bd
commit
b8fe342c17
2 changed files with 14 additions and 5 deletions
|
|
@ -131,9 +131,10 @@ void smlua_text_utils_reset_all(void) {
|
||||||
|
|
||||||
for (s32 i = 0; i < DIALOG_COUNT; i++) {
|
for (s32 i = 0; i < DIALOG_COUNT; i++) {
|
||||||
if (!sReplacedDialog[i]) { continue; }
|
if (!sReplacedDialog[i]) { continue; }
|
||||||
|
const struct DialogEntry *dialogOrig = segmented_to_virtual(dialogTableOrg[i]);
|
||||||
struct DialogEntry *dialog = segmented_to_virtual(dialogTable[i]);
|
struct DialogEntry *dialog = segmented_to_virtual(dialogTable[i]);
|
||||||
free((u8*)dialog->str);
|
free((u8*)dialog->str);
|
||||||
dialog->str = dialogTableOrg[i];
|
memcpy(dialog, dialogOrig, sizeof(struct DialogEntry));
|
||||||
sReplacedDialog[i] = false;
|
sReplacedDialog[i] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,12 @@
|
||||||
#include "dialogs.h"
|
#include "dialogs.h"
|
||||||
|
|
||||||
#undef DEFINE_DIALOG
|
#undef DEFINE_DIALOG
|
||||||
#define DEFINE_DIALOG(id, _1, _2, _3, _4, _5) dialog_text_ ## id,
|
#define DEFINE_DIALOG(id, unused, linesPerBox, leftOffset, width, _) \
|
||||||
|
static const struct DialogEntry dialog_entry_orig_ ## id = { \
|
||||||
|
unused, linesPerBox, leftOffset, width, dialog_text_ ## id \
|
||||||
|
};
|
||||||
|
|
||||||
const u8* seg2_dialog_original[] = {
|
|
||||||
#include "dialogs.h"
|
#include "dialogs.h"
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
#undef DEFINE_DIALOG
|
#undef DEFINE_DIALOG
|
||||||
#define DEFINE_DIALOG(id, unused, linesPerBox, leftOffset, width, _) \
|
#define DEFINE_DIALOG(id, unused, linesPerBox, leftOffset, width, _) \
|
||||||
|
|
@ -22,6 +22,14 @@ const u8* seg2_dialog_original[] = {
|
||||||
|
|
||||||
#include "dialogs.h"
|
#include "dialogs.h"
|
||||||
|
|
||||||
|
#undef DEFINE_DIALOG
|
||||||
|
#define DEFINE_DIALOG(id, _1, _2, _3, _4, _5) &dialog_entry_orig_ ## id,
|
||||||
|
|
||||||
|
const struct DialogEntry *const seg2_dialog_original[] = {
|
||||||
|
#include "dialogs.h"
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
#undef DEFINE_DIALOG
|
#undef DEFINE_DIALOG
|
||||||
#define DEFINE_DIALOG(id, _1, _2, _3, _4, _5) &dialog_entry_ ## id,
|
#define DEFINE_DIALOG(id, _1, _2, _3, _4, _5) &dialog_entry_ ## id,
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue