diff --git a/Source/Client/Mode/CGameMode.h b/Source/Client/Mode/CGameMode.h index 0270e621..fdfd704f 100644 --- a/Source/Client/Mode/CGameMode.h +++ b/Source/Client/Mode/CGameMode.h @@ -150,6 +150,7 @@ public: void WorldCell(float x, float z, int& column, int& row) const; void SubcellPosition(int column, int row, int subColumn, int subRow, float& x, float& z) const; void PlayerCell(int* column, int* row) const; + void RefreshActorJobEffects(bool playerOnly); int GetSkillAttackRange(int id, int level); int TerrainHeight() const; int TerrainWidth() const; diff --git a/Source/Client/Mode/GameModeActorEffects.cpp b/Source/Client/Mode/GameModeActorEffects.cpp new file mode 100644 index 00000000..ead2ea2b --- /dev/null +++ b/Source/Client/Mode/GameModeActorEffects.cpp @@ -0,0 +1,19 @@ +#include "Client/Mode/CGameMode.h" +#include "Contents/Actors/Pc.h" +#include "Contents/World/World.h" + +// OFFSET: 0x00CD6DD0 +// FUNCTION: fn_21289 +void CGameMode::RefreshActorJobEffects(bool playerOnly) { + this->scene->player->ResetJobEffects(); + this->scene->player->sub_CAA4D0(); + if (!playerOnly) { + for (std::list::iterator it = this->scene->actors.begin(); it != this->scene->actors.end(); ++it) { + CGameActor* actor = static_cast(*it); + if (actor->unknown_02B4 != 0) { + actor->ResetJobEffects(); + actor->sub_CAA4D0(); + } + } + } +} diff --git a/Source/Contents/UserData/NormalItemSlots.cpp b/Source/Contents/UserData/NormalItemSlots.cpp index 5b7748fc..e692e98d 100644 --- a/Source/Contents/UserData/NormalItemSlots.cpp +++ b/Source/Contents/UserData/NormalItemSlots.cpp @@ -3,7 +3,7 @@ #include "Contents/MapSkyMgr.h" #include "Render/Renderer.h" #include "UI/Navigation/UINavigationV4Wnd.h" - +#include "UI/Window/UIWindowMgr.h" #include // GLOBAL: gl_24700 @@ -1039,6 +1039,114 @@ void PreviewEquipWndInfo::Reset() { this->y = static_cast(static_cast(g_renderer->viewport.height - 260) * g_depthAverageHalf); } +// OFFSET: 0x009A6E90 +// FUNCTION: fn_13737 +void UIWindowMgr::ResetUIRectInfo() { + // GLOBAL: gl_25071 + static bool s_resetPending = true; + if (!s_resetPending) { + return; + } + s_resetPending = false; + + unsigned char* const base = reinterpret_cast(this); + reinterpret_cast(base + 0x514)->Reset(); + reinterpret_cast(base + 0x528)->Reset(); + + int* const questWnd = reinterpret_cast(base + 0x550); + questWnd[0] = 0; + questWnd[1] = 120; + questWnd[2] = 280; + questWnd[3] = 200; + questWnd[4] = 200; + questWnd[5] = 0; + questWnd[6] = 0; + + reinterpret_cast(base + 0x574)->Reset(); + reinterpret_cast(base + 0x590)->Reset(); + reinterpret_cast(base + 0x5A8)->Reset(); + reinterpret_cast(base + 0x5C0)->Reset(); + reinterpret_cast(base + 0x5D4)->Reset(); + reinterpret_cast(base + 0x5E4)->Reset(); + reinterpret_cast(base + 0x5F4)->Reset(); + reinterpret_cast(base + 0x604)->Reset(); + reinterpret_cast(base + 0x614)->Reset(); + + ItemStoreFindSlotInfo* const storeSlots = reinterpret_cast(base + 0x62C); + for (int index = 0; index < 8; ++index) { + storeSlots[index].Reset(index); + } + this->unknown_0058 = 8; + + reinterpret_cast(base + 0x6AC)->Reset(); + reinterpret_cast(base + 0x6BC)->Reset(); + reinterpret_cast(base + 0x6CC)->Reset(); + reinterpret_cast(base + 0x6DC)->Reset(); + reinterpret_cast(base + 0x6EC)->Reset(); + reinterpret_cast(base + 0x6FC)->Reset(); + reinterpret_cast(base + 0x70C)->Reset(); + reinterpret_cast(base + 0x71C)->Reset(); + reinterpret_cast(base + 0x72C)->Reset(); + reinterpret_cast(base + 0x748)->Reset(); + reinterpret_cast(base + 0x75C)->Reset(); + reinterpret_cast(base + 0x76C)->Reset(); + reinterpret_cast(base + 0x780)->Reset(); + reinterpret_cast(base + 0x794)->Reset(); + reinterpret_cast(base + 0x7A4)->Reset(); + reinterpret_cast(base + 0x7B4)->Reset(false); + reinterpret_cast(base + 0x7C4)->Reset(); + reinterpret_cast(base + 0x7D4)->Reset(); + reinterpret_cast(base + 0x7E4)->Reset(); + reinterpret_cast(base + 0x7F4)->Reset(); + reinterpret_cast(base + 0x804)->Reset(); + reinterpret_cast(base + 0x814)->Reset(); + reinterpret_cast(base + 0x824)->Reset(); + reinterpret_cast(base + 0x834)->Reset(); + reinterpret_cast(base + 0x848)->Reset(); + reinterpret_cast(base + 0x87C)->Reset(); + reinterpret_cast(base + 0x88C)->Reset(); + reinterpret_cast(base + 0x89C)->Reset(); + reinterpret_cast(base + 0x8AC)->Reset(); + reinterpret_cast(base + 0x8BC)->Reset(); + reinterpret_cast(base + 0x8CC)->Reset(); + reinterpret_cast(base + 0x8F0)->Reset(); + reinterpret_cast(base + 0x914)->Reset(0); + reinterpret_cast(base + 0x924)->Reset(1); + reinterpret_cast(base + 0x934)->Reset(); + reinterpret_cast(base + 0x944)->Reset(); + reinterpret_cast(base + 0x954)->Reset(); + reinterpret_cast(base + 0x964)->Reset(); + reinterpret_cast(base + 0x974)->Reset(); + reinterpret_cast(base + 0x984)->Reset(true); + reinterpret_cast(base + 0x994)->Reset(); + reinterpret_cast(base + 0x9A4)->Reset(); + reinterpret_cast(base + 0x9B4)->Reset(); + reinterpret_cast(base + 0x4F154)->Reset(); + + NavigationWindowInfo* const navigation = reinterpret_cast(base + 0x4F178); + navigation->x = static_cast(g_renderer->viewport.width * 0.5 - 136.0); + navigation->y = static_cast(g_renderer->viewport.height * 0.5 - 169.0); + navigation->width = 272; + navigation->height = 338; + navigation->expanded = 1; + + reinterpret_cast(base + 0x4F1A8)->Reset(); + reinterpret_cast(base + 0x4F1D8)->Reset(); + reinterpret_cast(base + 0x4F200)->Reset(); + reinterpret_cast(base + 0x4F220)->Reset(); + + int* const swapEquipment = reinterpret_cast(base + 0x4F228); + swapEquipment[0] = (g_renderer->viewport.width - 280) / 2; + swapEquipment[1] = (g_renderer->viewport.height - 177) / 2; + swapEquipment[2] = 280; + swapEquipment[3] = 167; + + reinterpret_cast(base + 0x570)->Reset(); + reinterpret_cast(base + 0xA00)->Reset(); + reinterpret_cast(base + 0xA10)->Reset(); + reinterpret_cast(base + 0xA20)->Reset(); +} + // OFFSET: 0x009A7CA0 // FUNCTION: fn_13738 void NavigationWindowInfo::Clamp() { diff --git a/Source/UI/Lists/UIItemStoreComboBox.cpp b/Source/UI/Lists/UIItemStoreComboBox.cpp new file mode 100644 index 00000000..0cb278ff --- /dev/null +++ b/Source/UI/Lists/UIItemStoreComboBox.cpp @@ -0,0 +1,41 @@ +#include "UI/Buttons/UIBitmapButton.h" +#include "UI/Lists/UIItemStoreComboBox.h" +#include "UI/Text/UIStaticText.h" + +#include +#include + +// OFFSET: 0x00886200 +// FUNCTION: fn_11325 +void UIItemStoreComboBoxWnd::Slot15(int, int) { + std::string path = "유저인터페이스\\basic_interface\\"; + const char* pressed = this->pink == 1 ? "combo_btn_pink_b" : "combo_btn_b"; + const char* disabled = this->pink == 1 ? "combo_btn_pink_c" : "combo_btn_c"; + + auto& controls = this->m_controls->buttons; + this->button = new UIBitmapButton(*this->m_context, controls); + this->button->SetBitmap((path + "combo_btn_a" + ".bmp").c_str(), 0, 0); + this->button->SetBitmap((path + pressed + ".bmp").c_str(), 1, 0); + this->button->SetBitmap((path + disabled + ".bmp").c_str(), 2, 0); + this->button->SetSize(this->button->BitmapWidth(), this->button->BitmapHeight()); + this->button->Move(this->geometry.width - this->button->BitmapWidth(), this->geometry.height - this->button->BitmapHeight()); + this->button->SetId(273); + this->AddChild(this->button); + + UIItemStoreComboBox* items = new UIItemStoreComboBox(*this->m_context, this->m_controls->combo); + this->list = items; + items->pink = this->pink != 0; + this->list->SetSize(62, 45); + this->list->Move(0, 0); + this->list->Show(0); + this->AddChild(this->list); + + char text[12] = {}; + std::sprintf(text, "(NO SELECT)"); + this->label = new UIStaticText(*this->m_context, controls); + this->label->SetSize(this->geometry.width - this->button->BitmapWidth(), this->button->BitmapHeight()); + this->label->SetText(text, 0); + this->label->Move(2, 3); + this->label->shadow = 1; + this->AddChild(this->label); +} diff --git a/Source/UI/Lists/UIItemStoreComboBox.h b/Source/UI/Lists/UIItemStoreComboBox.h index d4d24800..1eeaa51b 100644 --- a/Source/UI/Lists/UIItemStoreComboBox.h +++ b/Source/UI/Lists/UIItemStoreComboBox.h @@ -6,15 +6,21 @@ class UIItemStoreComboBox : public UIComboBoxEx { public: + UIItemStoreComboBox(UIWindowContext& windows, UIComboBoxContext& combo) : UIComboBoxEx(windows, combo), pink(false) {} void Slot15(int width, int height) override; void Slot27(int x, int y) override; void Slot31(int x, int y) override; + + /* 00C4 */ bool pink; }; class UIItemStoreComboBoxWnd : public UIComboBoxDefWnd { public: + void Slot15(int width, int height) override; void Paint() override; int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; + + /* 00A8 */ unsigned char pink; }; #endif diff --git a/Source/UI/Window/UIWindowMgr.h b/Source/UI/Window/UIWindowMgr.h index 6de4db20..fe4eaf25 100644 --- a/Source/UI/Window/UIWindowMgr.h +++ b/Source/UI/Window/UIWindowMgr.h @@ -458,6 +458,7 @@ public: void LoadShortcutItems(); void SaveShortcutItems(); void SaveUIRectInfo(); + void ResetUIRectInfo(); UIWindow* LookupWindow(int id); void sub_AAB070(int option); void sub_AAB090(); diff --git a/data/compile.json b/data/compile.json index 28c94a58..ee24ccb9 100644 --- a/data/compile.json +++ b/data/compile.json @@ -259,6 +259,7 @@ "Source/Client/Input/Mouse.cpp": 0, "Source/Client/Input/VietnameseInput.cpp": 0, "Source/Client/Mode/GameMode.cpp": 0, + "Source/Client/Mode/GameModeActorEffects.cpp": 0, "Source/Client/Mode/GameModeEquipWindow.cpp": 0, "Source/Client/Mode/GameModeHandlers.cpp": 0, "Source/Client/Mode/GameModeItemLists.cpp": 0, @@ -891,6 +892,7 @@ "Source/UI/Lists/UIComboBoxDefWnd.cpp": 2, "Source/UI/Lists/UIComboBoxEx.cpp": 2, "Source/UI/Lists/UIDropDownBox.cpp": 2, + "Source/UI/Lists/UIItemStoreComboBox.cpp": 2, "Source/UI/Lists/UIListBox.cpp": 2, "Source/UI/Lists/UIListBoxEx.cpp": 2, "Source/UI/Lists/UIListBoxID.cpp": 2,