From c220e400436703c71adf2b49a04a863b72c41d29 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 17 Nov 2013 20:42:06 +0100 Subject: broken translations and shit, possibly final commit before public release --- src/msgbox.cpp | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'src/msgbox.cpp') diff --git a/src/msgbox.cpp b/src/msgbox.cpp index 829fcb3..4f8a958 100644 --- a/src/msgbox.cpp +++ b/src/msgbox.cpp @@ -78,22 +78,10 @@ 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; -- cgit v1.2.3