diff --git a/config/implemented.csv b/config/implemented.csv index 7373f793..3965a492 100644 --- a/config/implemented.csv +++ b/config/implemented.csv @@ -135,6 +135,7 @@ th06::Gui::OnUpdate th06::Gui::OnDraw th06::Gui::DrawGameScene th06::Gui::DrawStageElements +th06::GuiImpl::MsgRead th06::GameWindow::WindowProc th06::GameWindow::CreateGameWindow WinMain diff --git a/config/stubbed.csv b/config/stubbed.csv index 252cf234..8e108295 100644 --- a/config/stubbed.csv +++ b/config/stubbed.csv @@ -45,7 +45,6 @@ th06::Gui::ShowSpellcard th06::Gui::ShowSpellcardBonus th06::Gui::Vm6SetInterruptTo1 th06::GuiImpl::RunMsg -th06::GuiImpl::MsgRead th06::GuiImpl::DrawDialogue th06::Enemy::MathSub th06::Enemy::MathMul diff --git a/src/GuiImpl.cpp b/src/GuiImpl.cpp index ac9ac2ed..499a104c 100644 --- a/src/GuiImpl.cpp +++ b/src/GuiImpl.cpp @@ -1,5 +1,42 @@ #include "GuiImpl.hpp" +#include "AnmManager.hpp" +#include "ZunColor.hpp" + namespace th06 { -}; +#pragma optimize("s", on) +void GuiImpl::MsgRead(i32 msgIdx) +{ + MsgRawHeader *msgFile; + + if (this->msg.msgFile->numEntries <= msgIdx) + { + return; + } + msgFile = this->msg.msgFile; + memset(&this->msg, 0, sizeof(GuiMsgVm)); + this->msg.currentMsgIdx = msgIdx; + this->msg.msgFile = msgFile; + this->msg.currentInstr = this->msg.msgFile->entries[msgIdx]; + this->msg.dialogueLines[0].anmFileIndex = -1; + this->msg.dialogueLines[1].anmFileIndex = -1; + this->msg.fontSize = 15; + this->msg.textColorsA[0] = COLOR_RGB(COLOR_GUI_1); + this->msg.textColorsA[1] = COLOR_RGB(COLOR_GUI_2); + this->msg.textColorsB[0] = 0; + this->msg.textColorsB[1] = 0; + this->msg.dialogueSkippable = 1; + if (g_GameManager.currentStage == 6 && (msgIdx == 0 || msgIdx == 10)) + { + g_AnmManager->LoadAnm(ANM_FILE_EFFECTS, "data/eff06.anm", ANM_OFFSET_EFFECTS); + } + else if (g_GameManager.currentStage == 7 && (msgIdx == 0 || msgIdx == 10)) + { + g_AnmManager->LoadAnm(ANM_FILE_EFFECTS, "data/eff07.anm", ANM_OFFSET_EFFECTS); + g_AnmManager->LoadAnm(ANM_FILE_FACE_STAGE_A, "data/face12c.anm", ANM_OFFSET_FACE_STAGE_A); + } + return; +} +#pragma optimize("", on) +}; // namespace th06 diff --git a/src/GuiImpl.hpp b/src/GuiImpl.hpp index edb51e48..40ae292d 100644 --- a/src/GuiImpl.hpp +++ b/src/GuiImpl.hpp @@ -26,7 +26,7 @@ struct GuiMsgVm ZunTimer timer; i32 framesElapsedDuringPause; AnmVm portraits[2]; - AnmVm dialogue_lines[2]; + AnmVm dialogueLines[2]; AnmVm introLines[2]; D3DCOLOR textColorsA[4]; D3DCOLOR textColorsB[4]; diff --git a/src/ZunColor.hpp b/src/ZunColor.hpp index 235f0e66..d6f0bd4a 100644 --- a/src/ZunColor.hpp +++ b/src/ZunColor.hpp @@ -16,6 +16,8 @@ #define COLOR_LIGHTYELLOW 0xffffff80 #define COLOR_PALEBLUE 0xffc0b0ff #define COLOR_NEONBLUE 0xff4040ff +#define COLOR_GUI_1 0xffe8f0ff +#define COLOR_GUI_2 0xffffe8f0 #define COLOR_RGB_MASK 0x00FFFFFF #define COLOR_ALPHA_MASK 0xFF000000