Decompile fn_12449 (UISecondPasswordInputWnd::ShuffleKeypad)

Batch #9742 by dori: 0 byte-identical, 1 confirmed by peer review.

- fn_12449 UISecondPasswordInputWnd::ShuffleKeypad: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, KWDev, Romain, Toshiro
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-01 21:15:33 +00:00
commit 22db5ecae3
2 changed files with 20 additions and 0 deletions

View file

@ -122,6 +122,7 @@
#include "Utility/Text/GroupedInteger.h"
#include "Client/Mode/ModeTooltip.h"
#include <algorithm>
#include <random>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
@ -7033,3 +7034,21 @@ void UIStorePasswordInputWnd::Paint() {
}
}
}
// OFFSET: 0x0090C5A0
// FUNCTION: fn_12449
void UISecondPasswordInputWnd::ShuffleKeypad()
{
unsigned char digits[10];
for (int index = 0; index < 10; ++index)
digits[index] = static_cast<unsigned char>(index);
std::mt19937 engine(std::random_device{}());
std::shuffle(digits, digits + 10, engine);
const int positions[11][2] = {
{219, 78}, {279, 78}, {339, 78}, {219, 138}, {279, 138}, {339, 138},
{219, 198}, {279, 198}, {339, 198}, {219, 258}, {279, 258}
};
for (int index = 0; index < 10; ++index)
unknown_0124[index]->Move(positions[digits[index]][0], positions[digits[index]][1]);
Invalidate();
}

View file

@ -81,6 +81,7 @@ class UISecondPasswordInputWnd : public UIStorePasswordInputWnd {
public:
UISecondPasswordInputWnd(UIWindowContext& windows, UIFrameContext& frames);
void Paint() override;
void ShuffleKeypad();
/* 010C */ int unknown_010C;
/* 0110 */ unsigned char unknown_0110[0xC];