diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index 382ae566..38c08d3a 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -22,6 +22,39 @@ #include #include +namespace { + +template +class EncryptedName { +public: + explicit EncryptedName(const std::uint8_t (&source)[Length]) : m_encrypted(true) { + for (std::uint64_t index = 0; index < Length; ++index) { + this->m_text[index] = source[index]; + } + } + + ~EncryptedName() { + for (std::uint64_t index = 0; index < Length; ++index) { + this->m_text[index] = 0; + } + } + + const char* Text() { + if (this->m_encrypted) { + utility::XorBytes(this->m_text, Length, Key); + this->m_encrypted = false; + } + + return reinterpret_cast(this->m_text); + } + +private: + std::uint8_t m_text[Length]; + bool m_encrypted; +}; + +} + template void CUIListBoxEx::UpdateScrollBar(); template void CUIListBox::UpdateScrollBar(); template void CUIListBox::UpdateScrollBar(); @@ -120,6 +153,270 @@ void CUIListBoxEx::ClearItems this->selected = static_cast(-1); } +// OFFSET: 0x009C2D90 +// FUNCTION: fn_13999 +void CUIAdventureGuide::Slot15(int width, int height) { + this->background = new CUIStaticImage(*this->m_context); + this->background->SetSize(750, 468); + this->background->Move(0, 0); + { + CUIStaticImage* background = this->background; + const std::uint8_t backgroundImageSource[] = { + 0x49, 0x74, 0xA3, 0x83, 0x2B, 0x55, 0x0A, 0x7E, 0x4F, 0x3F, 0xA3, 0xB5, 0x56, 0x21, 0x93, 0xF2, 0xED, 0xAD, 0x06, 0x17, 0x9F, 0xEE, 0xBD, 0xD6, + 0xCE, 0xAE, 0x0A, 0x1D, 0x8E, 0xC7, 0xAD, 0xD4, 0xD6, 0xBC, 0x16, 0x10, 0x8F, 0xFE, 0xE1, 0xD1, 0xE4, 0xAB, 0x63}; + thread_local EncryptedName backgroundImageName(backgroundImageSource); + const std::string backgroundImage(backgroundImageName.Text()); + background->SetImage(backgroundImage); + } + this->AddChild(this->background); + + this->titleBar = new CUITitleBar(*this->m_context); + this->titleBar->SetSize(750, 17); + this->titleBar->Move(0, 0); + { + CUITitleBar* titleBar = this->titleBar; + const std::uint8_t titleRightSource[] = { + 0x5F, 0x56, 0x81, 0x37, 0x39, 0xA5, 0x62, 0x7A, 0x59, 0x1D, 0x81, 0x01, 0x44, 0xD1, 0xFB, 0xD5, 0xFE, 0x8A, 0x28, 0xAE, 0xA6, 0x02, 0xC9, 0xC3, + 0xFA, 0x8B, 0x27, 0xAC, 0x9A, 0x0E, 0xFB, 0xC3, 0xF6, 0x8D, 0x2D, 0xA8, 0x9B, 0x0A, 0xD5, 0xE8, 0xED, 0x90, 0x26, 0xA5, 0x8D, 0x45, 0xC5, 0xDA, + 0xEF, 0xF9}; + thread_local EncryptedName titleRightName(titleRightSource); + const std::string titleRight(titleRightName.Text()); + const std::uint8_t titleMiddleSource[] = { + 0x7F, 0x2A, 0xE7, 0x87, 0x93, 0xED, 0x3E, 0x2E, 0x79, 0x61, 0xE7, 0xB1, 0xEE, 0x99, 0xA7, 0x81, 0xDE, 0xF6, 0x4E, 0x1E, 0x0C, 0x4A, 0x95, 0x97, + 0xDA, 0xF7, 0x41, 0x1C, 0x30, 0x46, 0xA7, 0x97, 0xD6, 0xF1, 0x4B, 0x18, 0x31, 0x42, 0x89, 0xBC, 0xD2, 0xEC, 0x43, 0x53, 0x31, 0x4E, 0x8B, 0xE3}; + thread_local EncryptedName titleMiddleName(titleMiddleSource); + const std::string titleMiddle(titleMiddleName.Text()); + const std::uint8_t titleLeftSource[] = { + 0x23, 0xF8, 0xD5, 0xA7, 0xD7, 0x4F, 0x1E, 0xD2, 0x25, 0xB3, 0xD5, 0x91, 0xAA, 0x3B, 0x87, 0x7D, 0x82, 0x24, 0x7C, 0x3E, 0x48, 0xE8, 0xB5, 0x6B, + 0x86, 0x25, 0x73, 0x3C, 0x74, 0xE4, 0x87, 0x6B, 0x8A, 0x23, 0x79, 0x38, 0x75, 0xE0, 0xA9, 0x40, 0x8F, 0x32, 0x73, 0x29, 0x39, 0xE3, 0xB6, 0x6F, + 0xE3}; + thread_local EncryptedName titleLeftName(titleLeftSource); + const std::string titleLeft(titleLeftName.Text()); + titleBar->SetImages(titleLeft, titleMiddle, titleRight); + } + this->AddChild(this->titleBar); + + CUIStaticText* title = new CUIStaticText(*this->m_context); + title->SetSize(100, 17); + title->Move(18, 0); + title->SetText("", 0); + title->SetFitText(0); + title->SetAlign(0, 6); + { + const std::uint8_t titleFontSource[] = { + 0x90, 0x32, 0x91, 0x0A, 0x60, 0x39}; + thread_local EncryptedName titleFontName(titleFontSource); + const std::string titleFont(titleFontName.Text()); + title->SetFont(titleFont); + } + title->SetFontHeight(12); + title->SetBold(0); + title->SetColor(0); + title->SetShadow(1, 0xFFFFFF); + title->SetOutline(0, 0xFFFFFF); + this->titleBar->titleText = title; + this->titleBar->AddChild(title); + + CUIImageButton* menuButton = new CUIImageButton(*this->m_context); + menuButton->SetSize(11, 11); + menuButton->Move(3, 3); + menuButton->SetOnClick([this]() { this->OnButtonClick(); }); + menuButton->disabled = 0; + menuButton->Invalidate(); + { + const std::uint8_t menuDisabledSource[] = { + 0x49, 0xC4, 0x29, 0x65, 0x8B, 0x91, 0x5C, 0x08, 0x4F, 0x8F, 0x29, 0x53, 0xF6, 0xE5, 0xC5, 0xA7, 0xE8, 0x18, 0x80, 0xFC, 0x14, 0x36, 0xF7, 0xB1, + 0xEC, 0x19, 0x8F, 0xFE, 0x28, 0x3A, 0xC5, 0xB6, 0xF0, 0x18, 0xB6, 0xFD, 0x2A, 0x2C, 0xFC, 0x9A, 0xE6, 0x0D, 0x8F, 0xB1, 0x29, 0x32, 0xE9, 0xC5}; + thread_local EncryptedName menuDisabledName(menuDisabledSource); + const std::string menuDisabled(menuDisabledName.Text()); + const std::uint8_t menuPressedSource[] = { + 0xDB, 0x66, 0x01, 0x15, 0x11, 0xB3, 0xCA, 0xAC, 0xDD, 0x2D, 0x01, 0x23, 0x6C, 0xC7, 0x53, 0x03, 0x7A, 0xBA, 0xA8, 0x8C, 0x8E, 0x14, 0x61, 0x15, + 0x7E, 0xBB, 0xA7, 0x8E, 0xB2, 0x18, 0x53, 0x12, 0x62, 0xBA, 0x9E, 0x8D, 0xB0, 0x0E, 0x6A, 0x3E, 0x74, 0xA7, 0xEF, 0x8D, 0xBC, 0x0D, 0x0F}; + thread_local EncryptedName menuPressedName(menuPressedSource); + const std::string menuPressed(menuPressedName.Text()); + const std::uint8_t menuHoverSource[] = { + 0xF7, 0xDA, 0x6D, 0x5D, 0x03, 0x6F, 0x56, 0x92, 0xF1, 0x91, 0x6D, 0x6B, 0x7E, 0x1B, 0xCF, 0x3D, 0x56, 0x06, 0xC4, 0xC4, 0x9C, 0xC8, 0xFD, 0x2B, + 0x52, 0x07, 0xCB, 0xC6, 0xA0, 0xC4, 0xCF, 0x2C, 0x4E, 0x06, 0xF2, 0xC5, 0xA2, 0xD2, 0xF6, 0x00, 0x58, 0x1B, 0x83, 0xC5, 0xAE, 0xD1, 0x93}; + thread_local EncryptedName menuHoverName(menuHoverSource); + const std::string menuHover(menuHoverName.Text()); + const std::uint8_t menuNormalSource[] = { + 0x47, 0x08, 0x85, 0x89, 0xD5, 0x47, 0xB6, 0xC4, 0x41, 0x43, 0x85, 0xBF, 0xA8, 0x33, 0x2F, 0x6B, 0xE6, 0xD4, 0x2C, 0x10, 0x4A, 0xE0, 0x1D, 0x7D, + 0xE2, 0xD5, 0x23, 0x12, 0x76, 0xEC, 0x2F, 0x7A, 0xFE, 0xD4, 0x1A, 0x11, 0x74, 0xFA, 0x16, 0x56, 0xE8, 0xC1, 0x23, 0x5D, 0x77, 0xE4, 0x03, 0x09}; + thread_local EncryptedName menuNormalName(menuNormalSource); + const std::string menuNormal(menuNormalName.Text()); + menuButton->SetImages(menuNormal, menuHover, menuPressed, menuDisabled); + } + this->titleBar->AddChild(menuButton); + + CUIImageButton* closeButton = new CUIImageButton(*this->m_context); + closeButton->SetSize(11, 11); + closeButton->Move(736, 3); + closeButton->SetOnClick([this]() { this->OnClose(); }); + closeButton->disabled = 0; + closeButton->Invalidate(); + { + const std::uint8_t closeDisabledSource[] = { + 0x53, 0x34, 0xE5, 0x23, 0xE5, 0xE3, 0x68, 0x90, 0x55, 0x7F, 0xE5, 0x15, 0x98, 0x97, 0xF1, 0x3F, 0xF2, 0xE8, 0x4C, 0xBA, 0x7A, 0x44, 0xC3, 0x29, + 0xF6, 0xE9, 0x43, 0xB8, 0x46, 0x48, 0xF1, 0x2E, 0xEA, 0xE8, 0x7A, 0xBA, 0x49, 0x42, 0xDE, 0x38, 0xCC, 0xF4, 0x43, 0xBF, 0x0B, 0x4F, 0xC0, 0x2D, + 0x93}; + thread_local EncryptedName closeDisabledName(closeDisabledSource); + const std::string closeDisabled(closeDisabledName.Text()); + const std::uint8_t closePressedSource[] = { + 0x3D, 0x6E, 0xB3, 0xB9, 0xE7, 0x9F, 0xD8, 0xD2, 0x3B, 0x25, 0xB3, 0x8F, 0x9A, 0xEB, 0x41, 0x7D, 0x9C, 0xB2, 0x1A, 0x20, 0x78, 0x38, 0x73, 0x6B, + 0x98, 0xB3, 0x15, 0x22, 0x44, 0x34, 0x41, 0x6C, 0x84, 0xB2, 0x2C, 0x20, 0x4B, 0x3E, 0x6E, 0x7A, 0xA2, 0xAE, 0x1D, 0x6D, 0x45, 0x3C, 0x6D, 0x1F}; + thread_local EncryptedName closePressedName(closePressedSource); + const std::string closePressed(closePressedName.Text()); + const std::uint8_t closeHoverSource[] = { + 0xE7, 0x3C, 0xBF, 0xF5, 0x9B, 0xD1, 0xF2, 0xF0, 0xE1, 0x77, 0xBF, 0xC3, 0xE6, 0xA5, 0x6B, 0x5F, 0x46, 0xE0, 0x16, 0x6C, 0x04, 0x76, 0x59, 0x49, + 0x42, 0xE1, 0x19, 0x6E, 0x38, 0x7A, 0x6B, 0x4E, 0x5E, 0xE0, 0x20, 0x6C, 0x37, 0x70, 0x44, 0x58, 0x78, 0xFC, 0x11, 0x21, 0x39, 0x72, 0x47, 0x3D}; + thread_local EncryptedName closeHoverName(closeHoverSource); + const std::string closeHover(closeHoverName.Text()); + const std::uint8_t closeNormalSource[] = { + 0xE9, 0x60, 0xE9, 0xFD, 0x23, 0xE7, 0x32, 0xA6, 0xEF, 0x2B, 0xE9, 0xCB, 0x5E, 0x93, 0xAB, 0x09, 0x48, 0xBC, 0x40, 0x64, 0xBC, 0x40, 0x99, 0x1F, + 0x4C, 0xBD, 0x4F, 0x66, 0x80, 0x4C, 0xAB, 0x18, 0x50, 0xBC, 0x76, 0x64, 0x8F, 0x46, 0x84, 0x0E, 0x76, 0xA0, 0x4F, 0x61, 0xCD, 0x4B, 0x9A, 0x1B, + 0x29}; + thread_local EncryptedName closeNormalName(closeNormalSource); + const std::string closeNormal(closeNormalName.Text()); + closeButton->SetImages(closeNormal, closeHover, closePressed, closeDisabled); + } + this->titleBar->SetSecondButton(closeButton); + + this->characterInfo = new AdventureGuide::CUICharacterInfo(*this->m_context); + this->characterInfo->SetSize(161, 41); + this->characterInfo->Move(1, 19); + this->AddChild(this->characterInfo); + + this->titleText = new CUIStaticText(*this->m_context); + this->titleText->SetSize(104, 20); + this->titleText->Move(362, 28); + this->titleText->SetText("", 0); + this->titleText->SetFitText(0); + this->titleText->SetAlign(6, 6); + { + CUIStaticText* titleText = this->titleText; + const std::uint8_t stageFontSource[] = { + 0xF0, 0x14, 0x91, 0xD6, 0x5A, 0x2D}; + thread_local EncryptedName stageFontName(stageFontSource); + const std::string stageFont(stageFontName.Text()); + titleText->SetFont(stageFont); + } + this->titleText->SetFontHeight(14); + this->titleText->SetBold(1); + this->titleText->SetColor(0x89261B); + this->titleText->SetShadow(0, 0xFFFFFF); + this->titleText->SetOutline(0, 0xFFFFFF); + this->AddChild(this->titleText); + + this->intro = new AdventureGuide::CUIIntro(*this->m_context); + this->intro->SetSize(637, 373); + this->intro->Move(112, 63); + this->AddChild(this->intro); + + this->quest = new AdventureGuide::CUIQuest(*this->m_context); + this->quest->SetSize(627, 387); + this->quest->Move(122, 81); + this->AddChild(this->quest); + + this->monster = new AdventureGuide::CUIMonster(*this->m_context); + this->monster->SetSize(627, 387); + this->monster->Move(122, 81); + this->AddChild(this->monster); + + this->item = new AdventureGuide::CUIItem(*this->m_context); + this->item->SetSize(627, 387); + this->item->Move(122, 81); + this->AddChild(this->item); + + this->tabs = new CUIListBox(*this->m_context); + this->tabs->SetSize(106, 372); + this->tabs->Move(1, 63); + this->tabs->SetOnSelect([this](AdventureGuide::CUITab* tab) { this->OnSelectTab(tab); }); + { + CUIListBox* tabs = this->tabs; + const std::uint8_t tabDisabledSource[] = { + 0xB9, 0x02, 0x47, 0x89, 0xB3, 0x21, 0x26, 0x56, 0xBF, 0x49, 0x47, 0xBF, 0xCE, 0x55, 0xBF, 0xDA, 0x1D, 0xDB, 0xE2, 0x1D, 0x07, 0x9A, 0x91, 0xFE, + 0x3E, 0xD8, 0xEE, 0x17, 0x16, 0xB3, 0x97, 0xFA, 0x1B, 0xF2, 0xE5, 0x07, 0x1D, 0xB0, 0x8D, 0xF4, 0x0B, 0xC0, 0xE6, 0x1F, 0x5D, 0x8D, 0x8E, 0xEB, + 0x79}; + thread_local EncryptedName tabDisabledName(tabDisabledSource); + const std::string tabDisabled(tabDisabledName.Text()); + const std::uint8_t tabPressedSource[] = { + 0xF7, 0x52, 0xB5, 0xAF, 0xF5, 0x0F, 0x90, 0x8A, 0xF1, 0x19, 0xB5, 0x99, 0x88, 0x7B, 0x09, 0x06, 0x53, 0x8B, 0x10, 0x3B, 0x41, 0xB4, 0x27, 0x22, + 0x70, 0x88, 0x1C, 0x31, 0x50, 0x9D, 0x21, 0x26, 0x55, 0xA2, 0x17, 0x21, 0x5B, 0x9E, 0x3A, 0x31, 0x52, 0x8F, 0x5B, 0x37, 0x58, 0xB1, 0x55}; + thread_local EncryptedName tabPressedName(tabPressedSource); + const std::string tabPressed(tabPressedName.Text()); + const std::uint8_t tabHoverSource[] = { + 0xC7, 0x72, 0xB7, 0x99, 0xA3, 0xFB, 0x0E, 0xDC, 0xC1, 0x39, 0xB7, 0xAF, 0xDE, 0x8F, 0x97, 0x50, 0x63, 0xAB, 0x12, 0x0D, 0x17, 0x40, 0xB9, 0x74, + 0x40, 0xA8, 0x1E, 0x07, 0x06, 0x69, 0xBF, 0x70, 0x65, 0x82, 0x15, 0x17, 0x0D, 0x6A, 0xBB, 0x63, 0x62, 0xAE, 0x04, 0x4D, 0x01, 0x58, 0xBB, 0x11}; + thread_local EncryptedName tabHoverName(tabHoverSource); + const std::string tabHover(tabHoverName.Text()); + const std::uint8_t tabNormalSource[] = { + 0xB5, 0xCA, 0xA1, 0x23, 0x8D, 0xC7, 0x1A, 0xB4, 0xB3, 0x81, 0xA1, 0x15, 0xF0, 0xB3, 0x83, 0x38, 0x11, 0x13, 0x04, 0xB7, 0x39, 0x7C, 0xAD, 0x1C, + 0x32, 0x10, 0x08, 0xBD, 0x28, 0x55, 0xAB, 0x18, 0x17, 0x3A, 0x03, 0xAD, 0x23, 0x56, 0xB1, 0x16, 0x07, 0x08, 0x00, 0xB5, 0x63, 0x6B, 0xB2, 0x09, + 0x75}; + thread_local EncryptedName tabNormalName(tabNormalSource); + const std::string tabNormal(tabNormalName.Text()); + tabs->SetImages(tabNormal, tabHover, tabPressed, tabDisabled); + } + + this->tabs->itemWidth = 98; + this->tabs->rowHeight = 40; + this->tabs->itemX = 8; + this->tabs->itemY = 0; + this->tabs->scrollBar->SetSize(8, 372); + this->tabs->scrollBar->Move(0, 0); + this->tabs->scrollBar->step = 20; + { + CUIListBox* tabs = this->tabs; + const std::uint8_t downImageSource[] = { + 0x9F, 0xD6, 0x61, 0x1D, 0x31, 0x03, 0x9A, 0x4A, 0x99, 0x9D, 0x61, 0x2B, 0x4C, 0x77, 0x03, 0xC6, 0x3B, 0x0F, 0xC4, 0x89, 0x85, 0xB8, 0x2D, 0xE2, + 0x18, 0x0C, 0xC8, 0x83, 0x94, 0x91, 0x2C, 0xE4, 0x2D, 0x16, 0xCD, 0x8B, 0xAE, 0xAC, 0x2D, 0xF5, 0x30, 0x0E, 0xFE, 0x83, 0x9E, 0xBA, 0x31, 0xA9, + 0x3D, 0x14, 0xD1, 0xE7}; + thread_local EncryptedName downImageName(downImageSource); + const std::string downImage(downImageName.Text()); + const std::uint8_t upImageSource[] = { + 0xA9, 0x2A, 0x9F, 0xDF, 0x77, 0xB9, 0xAE, 0x74, 0xAF, 0x61, 0x9F, 0xE9, 0x0A, 0xCD, 0x37, 0xF8, 0x0D, 0xF3, 0x3A, 0x4B, 0xC3, 0x02, 0x19, 0xDC, + 0x2E, 0xF0, 0x36, 0x41, 0xD2, 0x2B, 0x18, 0xDA, 0x1B, 0xEA, 0x33, 0x49, 0xE8, 0x16, 0x19, 0xCB, 0x06, 0xF2, 0x00, 0x50, 0xC7, 0x59, 0x09, 0xD4, + 0x19, 0x85}; + thread_local EncryptedName upImageName(upImageSource); + const std::string upImage(upImageName.Text()); + tabs->scrollBar->SetButtonImages(upImage, downImage); + } + { + CUIListBox* tabs = this->tabs; + const std::uint8_t scrollBackgroundSource[] = { + 0x9B, 0x32, 0xE5, 0xD7, 0x47, 0xE3, 0xE8, 0xCA, 0x9D, 0x79, 0xE5, 0xE1, 0x3A, 0x97, 0x71, 0x46, 0x3F, 0xEB, 0x40, 0x43, 0xF3, 0x58, 0x5F, 0x62, + 0x1C, 0xE8, 0x4C, 0x49, 0xE2, 0x71, 0x5E, 0x64, 0x29, 0xF2, 0x49, 0x41, 0xD8, 0x4F, 0x4A, 0x58, 0x36, 0xF4, 0x41, 0x03, 0xE5, 0x40, 0x5D, 0x07}; + thread_local EncryptedName scrollBackgroundName(scrollBackgroundSource); + const std::string scrollBackground(scrollBackgroundName.Text()); + tabs->scrollBar->SetBackground(scrollBackground); + } + { + CUIListBox* tabs = this->tabs; + const std::uint8_t thumbBottomSource[] = { + 0x97, 0x40, 0x11, 0x4F, 0x6B, 0xB1, 0x38, 0x92, 0x91, 0x0B, 0x11, 0x79, 0x16, 0xC5, 0xA1, 0x1E, 0x33, 0x99, 0xB4, 0xDB, 0xDF, 0x0A, 0x8F, 0x3A, + 0x10, 0x9A, 0xB8, 0xD1, 0xCE, 0x23, 0x8E, 0x3C, 0x25, 0x80, 0xBD, 0xD9, 0xF4, 0x0B, 0x95, 0x2A, 0x3A, 0x8D, 0x8E, 0xD1, 0xC4, 0x08, 0x93, 0x71, + 0x35, 0x82, 0xA1, 0xB5}; + thread_local EncryptedName thumbBottomName(thumbBottomSource); + const std::string thumbBottom(thumbBottomName.Text()); + const std::uint8_t thumbMiddleSource[] = { + 0x11, 0xCE, 0x31, 0x73, 0xAF, 0x9F, 0x20, 0x1E, 0x17, 0x85, 0x31, 0x45, 0xD2, 0xEB, 0xB9, 0x92, 0xB5, 0x17, 0x94, 0xE7, 0x1B, 0x24, 0x97, 0xB6, + 0x96, 0x14, 0x98, 0xED, 0x0A, 0x0D, 0x96, 0xB0, 0xA3, 0x0E, 0x9D, 0xE5, 0x30, 0x25, 0x8D, 0xA6, 0xBC, 0x03, 0xAE, 0xE4, 0x06, 0x35, 0xCB, 0xB1, + 0xBC, 0x11, 0xF1}; + thread_local EncryptedName thumbMiddleName(thumbMiddleSource); + const std::string thumbMiddle(thumbMiddleName.Text()); + const std::uint8_t thumbTopSource[] = { + 0x4D, 0xBC, 0xBF, 0xE9, 0xA1, 0x2B, 0xF0, 0x38, 0x4B, 0xF7, 0xBF, 0xDF, 0xDC, 0x5F, 0x69, 0xB4, 0xE9, 0x65, 0x1A, 0x7D, 0x15, 0x90, 0x47, 0x90, + 0xCA, 0x66, 0x16, 0x77, 0x04, 0xB9, 0x46, 0x96, 0xFF, 0x7C, 0x13, 0x7F, 0x3E, 0x91, 0x5D, 0x80, 0xE0, 0x71, 0x20, 0x66, 0x11, 0xCB, 0x57, 0x98, + 0xFD, 0x13}; + thread_local EncryptedName thumbTopName(thumbTopSource); + const std::string thumbTop(thumbTopName.Text()); + tabs->scrollBar->SetThumbImages(thumbTop, thumbMiddle, thumbBottom); + } + this->AddChild(this->tabs); +} + +// OFFSET: 0x009DBF20 + // OFFSET: 0x009C14F0 // FUNCTION: fn_13991 void CUIAdventureGuide::Slot53() { @@ -406,7 +703,6 @@ void CUIQuest::Slot54(int type, int id) { this->unknown_0088->Show(0); } - // OFFSET: 0x009DE410 // FUNCTION: fn_14353 void CUITab::SetSelected(bool selected) { @@ -539,39 +835,6 @@ void CUIAdventureGuide::OnSelectTab(AdventureGuide::CUITab* tab) { } } -namespace { - -template -class EncryptedName { -public: - explicit EncryptedName(const std::uint8_t (&source)[Length]) : m_encrypted(true) { - for (std::uint64_t index = 0; index < Length; ++index) { - this->m_text[index] = source[index]; - } - } - - ~EncryptedName() { - for (std::uint64_t index = 0; index < Length; ++index) { - this->m_text[index] = 0; - } - } - - const char* Text() { - if (this->m_encrypted) { - utility::XorBytes(this->m_text, Length, Key); - this->m_encrypted = false; - } - - return reinterpret_cast(this->m_text); - } - -private: - std::uint8_t m_text[Length]; - bool m_encrypted; -}; - -} - namespace AdventureGuide { // OFFSET: 0x009C5400 diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.h b/Source/UI/AdventureGuide/UIAdventureGuide.h index 8593a380..2039b8c0 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.h +++ b/Source/UI/AdventureGuide/UIAdventureGuide.h @@ -7,17 +7,32 @@ #include +namespace AdventureGuide { +class CUICharacterInfo; +class CUIIntro; +class CUIItem; +class CUIMonster; +class CUIQuest; +} + class CUIAdventureGuide : public CUIFrameWnd { public: + void Slot15(int width, int height) override; virtual void Slot53(); void OnButtonClick(); + void OnClose(); void OnSelectTab(AdventureGuide::CUITab* tab); void MarkQuest(int questId); - /* 00D8 */ unsigned char unknown_00D8[0x0C]; + /* 00D8 */ CUIStaticImage* background; + /* 00DC */ CUITitleBar* titleBar; + /* 00E0 */ AdventureGuide::CUICharacterInfo* characterInfo; /* 00E4 */ CUIStaticText* titleText; - /* 00E8 */ unsigned char unknown_00E8[0x10]; + /* 00E8 */ AdventureGuide::CUIIntro* intro; + /* 00EC */ AdventureGuide::CUIQuest* quest; + /* 00F0 */ AdventureGuide::CUIMonster* monster; + /* 00F4 */ AdventureGuide::CUIItem* item; /* 00F8 */ CUIListBox* tabs; }; @@ -25,11 +40,17 @@ namespace AdventureGuide { class CUIPage : public CUIControl { public: + explicit CUIPage(UIWindowContext& context) : CUIControl(context) { + } + virtual void Slot54(int first, int second) = 0; }; class CUICharacterInfo : public CUIControl { public: + explicit CUICharacterInfo(UIWindowContext& context) : CUIControl(context), level(nullptr), jobLevel(nullptr), name(nullptr), jobIcon(nullptr) { + } + void Slot15(int width, int height) override; void Slot16() override; @@ -41,6 +62,9 @@ public: class CUIIntro : public CUIPage { public: + explicit CUIIntro(UIWindowContext& context) : CUIPage(context), image(nullptr), contents(nullptr) { + } + void Slot16() override; void Paint() override; void Slot54(int first, int second) override; @@ -54,6 +78,10 @@ public: class CUIItem : public CUIPage { public: + explicit CUIItem(UIWindowContext& context) + : CUIPage(context), unknown_0084(nullptr), unknown_0088(nullptr), unknown_008C(), location(-1), itemList(nullptr) { + } + void Slot16() override; void Paint() override; void Slot54(int type, int id) override; @@ -69,6 +97,9 @@ public: class CUIMonster : public CUIPage { public: + explicit CUIMonster(UIWindowContext& context) : CUIPage(context), unknown_0084(nullptr), unknown_0088(), monsterList(nullptr) { + } + void Slot16() override; void Paint() override; void Slot54(int first, int second) override; @@ -83,6 +114,9 @@ public: class CUIQuest : public CUIPage { public: + explicit CUIQuest(UIWindowContext& context) : CUIPage(context), unknown_0084(nullptr), unknown_0088(nullptr), unknown_008C(), questList(nullptr) { + } + void Slot16() override; void Paint() override; void Slot54(int type, int id) override; diff --git a/Source/UI/Window/UIControl.h b/Source/UI/Window/UIControl.h index f2afdb22..e1ed7b3b 100644 --- a/Source/UI/Window/UIControl.h +++ b/Source/UI/Window/UIControl.h @@ -258,6 +258,12 @@ public: class CUITitleBar : public CUIControl { public: + // INLINED + explicit CUITitleBar(UIWindowContext& context) + : CUIControl(context), resizable(1), left(), middle(), right(), leftName(), middleName(), rightName(), unknown_00D8(), titleText(nullptr), + firstButton(nullptr), secondButton(nullptr) { + } + void Resize(int width, int height) override; void Paint() override; void Slot53(int resolveSkin) override;