diff options
author | Treeki <treeki@gmail.com> | 2013-11-17 20:42:06 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2013-11-17 20:42:06 +0100 |
commit | c220e400436703c71adf2b49a04a863b72c41d29 (patch) | |
tree | 5d615b6834ee24233549a5ee4860f363c6e50185 /src/msgbox.cpp | |
parent | d55debf80b417793ce924ec977ed3a16413fd5d6 (diff) | |
download | kamek-c220e400436703c71adf2b49a04a863b72c41d29.tar.gz kamek-c220e400436703c71adf2b49a04a863b72c41d29.zip |
broken translations and shit, possibly final commit before public releaselevel-select
Diffstat (limited to '')
-rw-r--r-- | src/msgbox.cpp | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/src/msgbox.cpp b/src/msgbox.cpp index 829fcb3..4f8a958 100644 --- a/src/msgbox.cpp +++ b/src/msgbox.cpp @@ -78,23 +78,11 @@ int dMsgBoxManager_c::onDelete() { MessageBoxIsShowing = false; if (canCancel && StageC4::instance) StageC4::instance->_1D = 0; // disable no-pause - msgDataLoader.unload(); return layout.free(); } /*****************************************************************************/ -// Load Resources -CREATE_STATE_E(dMsgBoxManager_c, LoadRes); - -void dMsgBoxManager_c::executeState_LoadRes() { - if (msgDataLoader.load("/NewerRes/Messages.bin")) { - state.setState(&StateID_Wait); - } else { - } -} - -/*****************************************************************************/ // Waiting CREATE_STATE_E(dMsgBoxManager_c, Wait); @@ -111,25 +99,14 @@ void dMsgBoxManager_c::showMessage(int id, bool canCancel, int delay) { } // get the data file - header_s *data = (header_s*)msgDataLoader.buffer; + dScript::Res_c *bmg = GetBMG(); - const wchar_t *title = 0, *msg = 0; - - for (int i = 0; i < data->count; i++) { - if (data->entry[i].id == id) { - title = (const wchar_t*)((u32)data + data->entry[i].titleOffset); - msg = (const wchar_t*)((u32)data + data->entry[i].msgOffset); - break; - } - } - - if (title == 0) { - OSReport("Message Box: Message %08x not found\n", id); - return; - } + nw4r::lyt::TextBox *tb = layout.findTextBoxByName("T_title"); + nw4r::lyt::TextBox *mb = layout.findTextBoxByName("T_msg"); + mb->alignment = (2*3) + 3; - layout.findTextBoxByName("T_title")->SetString(title); - layout.findTextBoxByName("T_msg")->SetString(msg); + Newer_WriteBMGToTextBox(tb, bmg, 110000 + (id >> 8), id & 0xFF, 0); + Newer_WriteBMGToTextBox(mb, bmg, 100000 + (id >> 8), id & 0xFF, 0); this->canCancel = canCancel; this->delay = delay; |