From 2a3c4bdba7c09ba1485429bcf825f1053ec4b2af Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 22:37:03 +0000 Subject: [PATCH] Decompile fn_12453 (UISecondPasswordInputWnd::CreateKeypad) Batch #10683 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_12453 UISecondPasswordInputWnd::CreateKeypad: logic confirmed by peer review Peer-reviewed-by: Yommy, dori, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Dialogs/UIPasswordWnd.cpp | 74 ++++++++++++++--------------- Source/UI/Dialogs/UIPasswordWnd.h | 6 +-- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Source/UI/Dialogs/UIPasswordWnd.cpp b/Source/UI/Dialogs/UIPasswordWnd.cpp index 246224fbe..5b16cbc10 100644 --- a/Source/UI/Dialogs/UIPasswordWnd.cpp +++ b/Source/UI/Dialogs/UIPasswordWnd.cpp @@ -53,16 +53,15 @@ void UISecondPasswordInputWnd::CreateKeypad(unsigned int seed) { const int commandPositions[5][2] = {{414, 192}, {414, 220}, {414, 248}, {414, 192}, {414, 276}}; for (int i = 0; i < 5; ++i) { - UIBitmapButton* button = new UIBitmapButton(); - this->unknown_0150[i] = button; - button->SetBitmap((prefix + commandNames[i][0] + ".bmp").c_str(), 0, 0); - button->SetBitmap((prefix + commandNames[i][1] + ".bmp").c_str(), 1, 0); - button->SetBitmap((prefix + commandNames[i][2] + ".bmp").c_str(), 2, 0); - button->SetBitmap((prefix + commandNames[i][3] + ".bmp").c_str(), 3, 0); - button->SetSize(button->BitmapWidth(), button->BitmapHeight()); - button->Move(commandPositions[i][0], commandPositions[i][1]); - button->SetId(commandIds[i]); - this->AddChild(button); + this->unknown_0150[i] = new UIBitmapButton(); + this->unknown_0150[i]->SetBitmap((prefix + commandNames[i][0] + ".bmp").c_str(), 0, 0); + this->unknown_0150[i]->SetBitmap((prefix + commandNames[i][1] + ".bmp").c_str(), 1, 0); + this->unknown_0150[i]->SetBitmap((prefix + commandNames[i][2] + ".bmp").c_str(), 2, 0); + this->unknown_0150[i]->SetBitmap((prefix + commandNames[i][3] + ".bmp").c_str(), 3, 0); + this->unknown_0150[i]->SetSize(this->unknown_0150[i]->BitmapWidth(), this->unknown_0150[i]->BitmapHeight()); + this->unknown_0150[i]->Move(commandPositions[i][0], commandPositions[i][1]); + this->unknown_0150[i]->SetId(commandIds[i]); + this->AddChild(this->unknown_0150[i]); } prefix = "유저인터페이스\\basic_interface\\"; @@ -78,38 +77,39 @@ void UISecondPasswordInputWnd::CreateKeypad(unsigned int seed) { for (int i = 0; i < 10; ++i) { const int digit = this->m_digits[i]; - UIBitmapButton* button = new UIBitmapButton(); - this->unknown_0124[i] = button; - button->SetBitmap((prefix + keyNames[digit][0] + ".bmp").c_str(), 0, 0); - button->SetBitmap((prefix + keyNames[digit][1] + ".bmp").c_str(), 1, 0); - button->SetBitmap((prefix + keyNames[digit][2] + ".bmp").c_str(), 2, 0); - button->SetSize(button->BitmapWidth(), button->BitmapHeight()); - button->Move(keyPositions[i][0], keyPositions[i][1]); - button->SetId(keyIds[digit]); - this->AddChild(button); + this->unknown_0124[i] = new UIBitmapButton(); + this->unknown_0124[i]->SetBitmap((prefix + keyNames[digit][0] + ".bmp").c_str(), 0, 0); + this->unknown_0124[i]->SetBitmap((prefix + keyNames[digit][1] + ".bmp").c_str(), 1, 0); + this->unknown_0124[i]->SetBitmap((prefix + keyNames[digit][2] + ".bmp").c_str(), 2, 0); + this->unknown_0124[i]->SetSize(this->unknown_0124[i]->BitmapWidth(), this->unknown_0124[i]->BitmapHeight()); + this->unknown_0124[i]->Move(keyPositions[i][0], keyPositions[i][1]); + this->unknown_0124[i]->SetId(keyIds[digit]); + this->AddChild(this->unknown_0124[i]); } - UIBitmapButton* reset = new UIBitmapButton(); - this->unknown_0124[10] = reset; - reset->SetBitmap((prefix + keyNames[10][0] + ".bmp").c_str(), 0, 0); - reset->SetBitmap((prefix + keyNames[10][1] + ".bmp").c_str(), 1, 0); - reset->SetBitmap((prefix + keyNames[10][2] + ".bmp").c_str(), 2, 0); - reset->SetSize(reset->BitmapWidth(), reset->BitmapHeight()); - reset->Move(keyPositions[10][0], keyPositions[10][1]); - reset->SetId(keyIds[10]); - this->AddChild(reset); + this->unknown_0124[10] = new UIBitmapButton(); + this->unknown_0124[10]->SetBitmap((prefix + keyNames[10][0] + ".bmp").c_str(), 0, 0); + this->unknown_0124[10]->SetBitmap((prefix + keyNames[10][1] + ".bmp").c_str(), 1, 0); + this->unknown_0124[10]->SetBitmap((prefix + keyNames[10][2] + ".bmp").c_str(), 2, 0); + this->unknown_0124[10]->SetSize(this->unknown_0124[10]->BitmapWidth(), this->unknown_0124[10]->BitmapHeight()); + this->unknown_0124[10]->Move(keyPositions[10][0], keyPositions[10][1]); + this->unknown_0124[10]->SetId(keyIds[10]); + this->AddChild(this->unknown_0124[10]); this->unknown_0150[0]->Enable(0); - if (g_session.m_passwordWndMode == 2) { + + switch (g_session.m_passwordWndMode) { + case 2: this->unknown_0150[0]->Enable(1); this->unknown_0150[3]->Enable(0); - } else if (g_session.m_passwordWndMode == 4 || g_session.m_passwordWndMode == 5) { - UIButton* button = this->unknown_0150[1]; - button->SetDisabled(1); - button->Invalidate(); - button = this->unknown_0150[2]; - button->SetDisabled(1); - button->Invalidate(); + break; + case 4: + case 5: + this->unknown_0150[1]->SetDisabled(1); + this->unknown_0150[1]->Invalidate(); + this->unknown_0150[2]->SetDisabled(1); + this->unknown_0150[2]->Invalidate(); + break; } this->unknown_0150[2]->Enable(0); @@ -129,7 +129,7 @@ void UISecondPasswordInputWnd::CreateKeypad(unsigned int seed) { // OFFSET: 0x0090DE10 // FUNCTION: fn_12454 void UISecondPasswordInputWnd::sub_90DE10() { - UIButton** slot = this->unknown_0124; + UIBitmapButton** slot = this->unknown_0124; for (int remaining = 11; remaining != 0; --remaining) { UIButton* button = *slot; button->SetDisabled(0); diff --git a/Source/UI/Dialogs/UIPasswordWnd.h b/Source/UI/Dialogs/UIPasswordWnd.h index a0e614335..714a964aa 100644 --- a/Source/UI/Dialogs/UIPasswordWnd.h +++ b/Source/UI/Dialogs/UIPasswordWnd.h @@ -3,7 +3,7 @@ #include "UI/Window/UIFrameWnd.h" -class UIButton; +class UIBitmapButton; class UIEditCtrl; class UIStaticText; @@ -72,8 +72,8 @@ public: /* 0110 */ unsigned char m_digits[10]; /* 011C */ int unknown_011C; /* 0120 */ int unknown_0120; - /* 0124 */ UIButton* unknown_0124[11]; - /* 0150 */ UIButton* unknown_0150[5]; + /* 0124 */ UIBitmapButton* unknown_0124[11]; + /* 0150 */ UIBitmapButton* unknown_0150[5]; /* 0164 */ UIStaticText* unknown_0164; };