summaryrefslogtreecommitdiff
path: root/src/msgbox.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-04-30 17:34:09 +0200
committerTreeki <treeki@gmail.com>2013-04-30 17:34:51 +0200
commit46f7334790a5cef5fb167698e2d11c8bb680b6e9 (patch)
treee2c7410ad9379ec9f6abc9214dc9172f1539157b /src/msgbox.cpp
parent7f8d7800a9e6636c72604e80e3b6258ca1f0830f (diff)
downloadkamek-46f7334790a5cef5fb167698e2d11c8bb680b6e9.tar.gz
kamek-46f7334790a5cef5fb167698e2d11c8bb680b6e9.zip
changes to palace dude and message box, and removal of cutscenes
Diffstat (limited to '')
-rw-r--r--src/msgbox.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/msgbox.cpp b/src/msgbox.cpp
index 30ee66e..ed75f83 100644
--- a/src/msgbox.cpp
+++ b/src/msgbox.cpp
@@ -101,7 +101,12 @@ void dMsgBoxManager_c::executeState_Wait() {
/*****************************************************************************/
// Show Box
-void dMsgBoxManager_c::showMessage(int id) {
+void dMsgBoxManager_c::showMessage(int id, bool canCancel, int delay) {
+ if (!this) {
+ OSReport("ADD A MESSAGE BOX MANAGER YOU MORON\n");
+ return;
+ }
+
// get the data file
header_s *data = (header_s*)msgDataLoader.buffer;
@@ -116,12 +121,17 @@ void dMsgBoxManager_c::showMessage(int id) {
}
if (title == 0) {
+ OSReport("Message Box: Message %08x not found\n", id);
return;
}
layout.findTextBoxByName("T_title")->SetString(title);
layout.findTextBoxByName("T_msg")->SetString(msg);
+ this->canCancel = canCancel;
+ this->delay = delay;
+ layout.findPictureByName("button")->SetVisible(canCancel);
+
state.setState(&StateID_BoxAppearWait);
}
@@ -151,10 +161,17 @@ CREATE_STATE(dMsgBoxManager_c, ShownWait);
void dMsgBoxManager_c::beginState_ShownWait() { }
void dMsgBoxManager_c::executeState_ShownWait() {
- int nowPressed = Remocon_GetPressed(GetActiveRemocon());
-
- if (nowPressed & WPAD_TWO) {
- state.setState(&StateID_BoxDisappearWait);
+ if (canCancel) {
+ int nowPressed = Remocon_GetPressed(GetActiveRemocon());
+
+ if (nowPressed & WPAD_TWO)
+ state.setState(&StateID_BoxDisappearWait);
+ }
+
+ if (delay > 0) {
+ delay--;
+ if (delay == 0)
+ state.setState(&StateID_BoxDisappearWait);
}
}
void dMsgBoxManager_c::endState_ShownWait() { }