diff --git a/Source/UI/Buttons/UIBmpRadioBtn.h b/Source/UI/Buttons/UIBmpRadioBtn.h index 8e41f075..9bdeef4e 100644 --- a/Source/UI/Buttons/UIBmpRadioBtn.h +++ b/Source/UI/Buttons/UIBmpRadioBtn.h @@ -21,7 +21,7 @@ struct UIBmpRadioBtnText { }; class UIBmpRadioBtn : public UIWindow { - friend class UICashShopWnd; + friend class UICashShopWnd; friend class UINewMakeCharWnd; public: UIBmpRadioBtn(UIWindowContext& windows, UIButtonContext& controls); diff --git a/Source/UI/Buttons/UIButton.h b/Source/UI/Buttons/UIButton.h index 709a727f..90cefa63 100644 --- a/Source/UI/Buttons/UIButton.h +++ b/Source/UI/Buttons/UIButton.h @@ -38,7 +38,7 @@ class UIButton : public UIWindow { friend class UIAchListWnd; friend class UIStylingshopTabParentWnd; friend class UIDisplayCharacter; - friend class UIPrivateAirplaneWnd; + friend class UIPrivateAirplaneWnd; friend class UINewMakeCharWnd; public: UIButton(UIWindowContext& windowContext, UIButtonContext& buttonContext); diff --git a/Source/UI/Window/UINewMakeCharWnd.cpp b/Source/UI/Window/UINewMakeCharWnd.cpp index 1733c4b2..999d35d3 100644 --- a/Source/UI/Window/UINewMakeCharWnd.cpp +++ b/Source/UI/Window/UINewMakeCharWnd.cpp @@ -336,3 +336,177 @@ void UINewMakeCharWnd::sub_7DBFD0() { this->m_raceOffsets = GetBodyImfName(this->m_job, this->m_sex, this->m_head, this->m_costumeJob); } + +// OFFSET: 0x007DA340 +// FUNCTION: fn_09614 +void UINewMakeCharWnd::Slot15(int width, int height) { + UIBitmapButton* closeButton = new UIBitmapButton(*this->m_context, *this->m_controls); + closeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_close_normal.bmp", 0, 0); + closeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_close_over.bmp", 1, 0); + closeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_close_press.bmp", 2, 0); + closeButton->SetSize(closeButton->BitmapWidth(), closeButton->BitmapHeight()); + closeButton->Move(0x300, 9); + closeButton->SetId(0xB9); + this->AddChild(closeButton); + + UIBmpTextButton* makeButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + makeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_normal.bmp", 0, 0); + makeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_over.bmp", 1, 0); + makeButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_press.bmp", 2, 0); + makeButton->SetSize(makeButton->BitmapWidth(), makeButton->BitmapHeight()); + makeButton->Move(0x268, 0x17B); + makeButton->SetText(LookupMessage(0xD11)); + makeButton->AddTextStyle(0, 0xE, 0x313131, 1, 1, -1000, -1000); + makeButton->AddTextStyle(1, 0xE, 0x313131, 1, 1, -1000, -1000); + makeButton->AddTextStyle(2, 0xE, 0x313131, 1, 1, -1000, -1000); + makeButton->SetId(0xB8); + this->AddChild(makeButton); + + UIBmpTextButton* cancelButton = new UIBmpTextButton(*this->m_context, *this->m_controls); + cancelButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_normal.bmp", 0, 0); + cancelButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_over.bmp", 1, 0); + cancelButton->SetBitmap("유저인터페이스\\make_character_ver2\\bt_make_press.bmp", 2, 0); + cancelButton->SetSize(cancelButton->BitmapWidth(), cancelButton->BitmapHeight()); + cancelButton->Move(0x19, 0x17B); + cancelButton->SetText(LookupMessage(0xD17)); + cancelButton->AddTextStyle(0, 0xE, 0x313131, 1, 1, -1000, -1000); + cancelButton->AddTextStyle(1, 0xE, 0x313131, 1, 1, -1000, -1000); + cancelButton->AddTextStyle(2, 0xE, 0x313131, 1, 1, -1000, -1000); + cancelButton->SetId(0xB9); + this->AddChild(cancelButton); + + this->m_nameEdit = new UIEditCtrl2(*this->m_context, *this->m_editContext); + this->m_nameEdit->SetSize(0x82, 0x14); + this->m_nameEdit->Move(0x1B3, 0x10C); + this->m_nameEdit->maximum = 0x17; + this->AddChild(this->m_nameEdit); + + UIDescriptRace* human = new UIDescriptRace(0); + human->SetBitmap("유저인터페이스\\make_character_ver2\\img_human_off.bmp", 0, 0); + human->SetBitmap("유저인터페이스\\make_character_ver2\\img_human_on.bmp", 1, 0); + human->SetBitmap("유저인터페이스\\make_character_ver2\\img_human_on.bmp", 2, 0); + human->SetSize(human->BitmapWidth(), human->BitmapHeight()); + human->Move(0x15, 0x24); + this->m_raceViews[0] = human; + this->AddChild(human); + + UIDescriptRace* doram = new UIDescriptRace(1); + const char* doramNormal; + const char* doramActive; + if (!g_doramCreationEnabled) { + doramActive = "유저인터페이스\\make_character_ver2\\img_doram_comingSoon.bmp"; + doramNormal = doramActive; + } else { + doramActive = "유저인터페이스\\make_character_ver2\\img_doram_on.bmp"; + doramNormal = "유저인터페이스\\make_character_ver2\\img_doram_off.bmp"; + } + doram->SetBitmap(doramNormal, 0, 0); + doram->SetBitmap(doramActive, 1, 0); + doram->SetBitmap(doramActive, 2, 0); + doram->SetSize(doram->BitmapWidth(), doram->BitmapHeight()); + doram->Move(0x15, 0xCA); + this->m_raceViews[1] = doram; + this->AddChild(doram); + + this->m_genderButtons[1] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_genderButtons[1]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_male_off.bmp", 0, 0); + this->m_genderButtons[1]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_male_over.bmp", 1, 0); + this->m_genderButtons[1]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_male_press.bmp", 2, 0); + this->m_genderButtons[1]->SetSize(this->m_genderButtons[1]->BitmapWidth(), this->m_genderButtons[1]->BitmapHeight()); + this->m_genderButtons[1]->Move(0x1B5, 0x3B); + this->m_genderButtons[1]->SetId(0x20D); + this->AddChild(this->m_genderButtons[1]); + + this->m_genderButtons[0] = new UIBitmapButton(*this->m_context, *this->m_controls); + this->m_genderButtons[0]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_female_off.bmp", 0, 0); + this->m_genderButtons[0]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_female_over.bmp", 1, 0); + this->m_genderButtons[0]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_female_press.bmp", 2, 0); + this->m_genderButtons[0]->SetSize(this->m_genderButtons[0]->BitmapWidth(), this->m_genderButtons[0]->BitmapHeight()); + this->m_genderButtons[0]->Move(500, 0x3B); + this->m_genderButtons[0]->SetId(0x20D); + this->AddChild(this->m_genderButtons[0]); + + if (this->m_sex == 1) { + this->m_genderButtons[1]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_male_on.bmp", 0, 0); + } else if (this->m_sex == 0) { + this->m_genderButtons[0]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_female_on.bmp", 0, 0); + } + + UIBitmapButton* leftTurn = new UIBitmapButton(*this->m_context, *this->m_controls); + leftTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_leftTurn_normal.bmp", 0, 0); + leftTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_leftTurn_over.bmp", 1, 0); + leftTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_leftTurn_press.bmp", 2, 0); + leftTurn->SetSize(leftTurn->BitmapWidth(), leftTurn->BitmapHeight()); + leftTurn->Move(0x1AA, 0xB3); + leftTurn->SetId(0xE3); + leftTurn->m_argument = 0; + leftTurn->SetTooltip(LookupMessage(0x87E)); + this->AddChild(leftTurn); + + UIBitmapButton* rightTurn = new UIBitmapButton(*this->m_context, *this->m_controls); + rightTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_rightTurn_normal.bmp", 0, 0); + rightTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_rightTurn_over.bmp", 1, 0); + rightTurn->SetBitmap("유저인터페이스\\make_character_ver2\\bt_rightTurn_press.bmp", 2, 0); + rightTurn->SetSize(rightTurn->BitmapWidth(), rightTurn->BitmapHeight()); + rightTurn->Move(0x227, 0xB3); + rightTurn->SetId(0xE2); + rightTurn->m_argument = 0; + rightTurn->SetTooltip(LookupMessage(0x87F)); + this->AddChild(rightTurn); + + UIStaticText* hairStyleTitle = new UIStaticText(*this->m_context, *this->m_controls); + hairStyleTitle->SetSize(100, 0xF); + hairStyleTitle->SetText(LookupMessage(0xD12), 0); + hairStyleTitle->SetColor(0x40, 0x40, 0x40); + hairStyleTitle->SetFont(0, 0xB, 1, 0); + hairStyleTitle->Move(0x261, 0x2E); + this->AddChild(hairStyleTitle); + + for (int index = 0; index < 24; ++index) { + this->m_hairStyleButtons[index] = new UIHairStyleButton(*this->m_context, *this->m_controls, index, this->m_sex); + this->m_hairStyleButtons[index]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_hairStyle_normal.bmp", 0, 0); + this->m_hairStyleButtons[index]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_hairStyle_over.bmp", 1, 0); + this->m_hairStyleButtons[index]->SetBitmap("유저인터페이스\\make_character_ver2\\bt_hairStyle_select.bmp", 2, 0); + this->m_hairStyleButtons[index]->SetSize(0x24, 0x25); + this->m_hairStyleButtons[index]->SetId(0x20C); + this->m_hairStyleButtons[index]->Move((index % 4) * 0x26 + 0x25E, (index / 4) * 0x25 + 0x3B); + this->AddChild(this->m_hairStyleButtons[index]); + if (index == 0) { + this->m_hairStyleButtons[0]->SendMsg(this, 13, 1, 0, 0, 0); + } + } + + UIStaticText* hairColorTitle = new UIStaticText(*this->m_context, *this->m_controls); + hairColorTitle->SetSize(100, 0xF); + hairColorTitle->SetText(LookupMessage(0xD13), 0); + hairColorTitle->SetColor(0x40, 0x40, 0x40); + hairColorTitle->SetFont(0, 0xB, 1, 0); + hairColorTitle->Move(0x261, 0x11F); + this->AddChild(hairColorTitle); + + char name[128]; + memset(name, 0, sizeof(name)); + for (int index = 0; index < 9; ++index) { + UIBmpRadioBtn* button = new UIBmpRadioBtn(*this->m_context, *this->m_controls); + memset(name, 0, 0x40); + sprintf(name, "유저인터페이스\\make_character_ver2\\color%02d_off.bmp", index + 1); + button->SetBitmap(name, 0); + memset(name, 0, 0x40); + sprintf(name, "유저인터페이스\\make_character_ver2\\color%02d_over.bmp", index + 1); + button->SetBitmap(name, 1); + memset(name, 0, 0x40); + sprintf(name, "유저인터페이스\\make_character_ver2\\color%02d_on.bmp", index + 1); + button->SetBitmap(name, 2); + if (index == 0) { + button->SendMsg(this, 13, 1, 0, 0, 0); + } + button->m_value = 0x1EF; + button->Move((index % 5) * 0x1B + 0x26B, (index / 5) * 0x18 + 0x132); + this->m_hairColorButtons[index] = button; + this->AddChild(button); + } + + InputFocus focus{g_windowMgr.hoverWindow}; + focus.Set(this->m_nameEdit); + this->m_message0 = 0xB8; +} diff --git a/Source/UI/Window/UINewMakeCharWnd.h b/Source/UI/Window/UINewMakeCharWnd.h index e53177eb..65f0ec46 100644 --- a/Source/UI/Window/UINewMakeCharWnd.h +++ b/Source/UI/Window/UINewMakeCharWnd.h @@ -2,7 +2,14 @@ #define RAGNAROK_SOURCE_UI_WINDOW_UINEWMAKECHARWND_H #include "UI/Buttons/UIBitmapButton.h" +#include "UI/Buttons/UIBmpRadioBtn.h" +#include "UI/Buttons/UIBmpTextButton.h" +#include "UI/Buttons/UIDescriptRace.h" +#include "UI/Edit/UIEditCtrl.h" +#include "UI/Text/UIStaticText.h" +#include "UI/Window/InputFocus.h" #include "UI/Window/UIFrameWnd.h" +#include "UI/Window/UIWindowMgr.h" #include @@ -21,6 +28,10 @@ public: class UIHairStyleButton : public UIBitmapButton { public: + // INLINED + UIHairStyleButton(UIWindowContext& windows, UIButtonContext& controls, int style, int sex) + : UIBitmapButton(windows, controls), m_style(style), m_sex(sex), m_race(0), m_preview(nullptr), m_selected(false) { + } void Slot15(int width, int height) override; int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override; @@ -52,6 +63,7 @@ static_assert(sizeof(MakeCharacterStatus) == 0x50); class UINewMakeCharWnd : public UIFrameWnd { public: UINewMakeCharWnd(); + void Slot15(int width, int height) override; void Paint() override; void Slot19() override; void sub_7DBFD0(); @@ -86,20 +98,33 @@ public: /* 029B */ unsigned char unknown_029B[0x23]; /* 02BE */ unsigned char m_sex; /* 02BF */ unsigned char unknown_02BF; - /* 02C0 */ int unknown_02C0; + union { + /* 02C0 */ int unknown_02C0; + UIEditCtrl2* m_nameEdit; + }; /* 02C4 */ int m_race; /* 02C8 */ UIWindow* m_raceViews[2]; - /* 02D0 */ int unknown_02D0[6]; - /* 02E8 */ unsigned char unknown_02E8[0x48]; - /* 0330 */ int unknown_0330[2]; - /* 0338 */ unsigned char unknown_0338; - /* 0339 */ unsigned char unknown_0339[0x1B]; - /* 0354 */ short unknown_0354; - /* 0356 */ unsigned char unknown_0356[0x06]; + union { + /* 02D0 */ int unknown_02D0[6]; + UIHairStyleButton* m_hairStyleButtons[24]; + }; + union { + struct { + /* 0330 */ int unknown_0330[2]; + /* 0338 */ unsigned char unknown_0338; + }; + UIBmpRadioBtn* m_hairColorButtons[9]; + }; + union { + /* 0354 */ short unknown_0354; + UIBitmapButton* m_genderButtons[2]; + }; /* 035C */ int unknown_035C; /* 0360 */ unsigned long m_startTime; /* 0364 */ int unknown_0364; /* 0368 */ int unknown_0368; + UIButtonContext* m_controls; + UIEditContext* m_editContext; }; #if defined(_WIN32) && !defined(_WIN64) @@ -113,6 +138,9 @@ static_assert(offsetof(UINewMakeCharWnd, m_race) == 0x2C4); static_assert(offsetof(UINewMakeCharWnd, m_status) == 0x214); static_assert(offsetof(UINewMakeCharWnd, m_slot) == 0x29A); static_assert(offsetof(UINewMakeCharWnd, m_startTime) == 0x360); +static_assert(offsetof(UINewMakeCharWnd, m_hairStyleButtons) == 0x2D0); +static_assert(offsetof(UINewMakeCharWnd, m_hairColorButtons) == 0x330); +static_assert(offsetof(UINewMakeCharWnd, m_genderButtons) == 0x354); #endif #endif