Decompile fn_10395 (UISwapBitmapButton::Paint)

Batch #4255 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_10395 UISwapBitmapButton::Paint: logic confirmed by peer review

Peer-reviewed-by: willerthal, superintelligence, OrangeCat
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-10-30 01:54:53 +00:00
commit c13ee20ca1
2 changed files with 38 additions and 1 deletions

View file

@ -5,9 +5,19 @@
#include "Client/Mode/ModeMgr.h"
#include "Client/Session.h"
#include "Contents/Items/ItemInfo.h"
#include "Contents/MessageTable.h"
#include "UI/Buttons/UIBasicButton.h"
#include "UI/Window/UIWindowMgr.h"
#include <windows.h>
#include <timeapi.h>
#include <cstdint>
#include <new>
#include <string>
// GLOBAL: gl_24874
unsigned long g_swapEquipmentTick;
// OFFSET: 0x0082F990
// FUNCTION: fn_10390
@ -74,3 +84,17 @@ void UISwapEquipmentWnd::SetSlotValue(int index, int value) {
break;
}
}
// OFFSET: 0x00830760
// OFFSET: 0x00830970
// FUNCTION: fn_10395
void UISwapBitmapButton::Paint() {
UIBitmapButton::Paint();
const unsigned long elapsed = timeGetTime() - g_swapEquipmentTick;
this->SetBitmap(elapsed < 10000 ? "유저인터페이스\\swap_equipment\\btn_change2_disable.bmp" : "유저인터페이스\\swap_equipment\\btn_change2_normal.bmp", 0, 0);
this->SetBitmap(elapsed < 10000 ? "유저인터페이스\\swap_equipment\\btn_change2_disable.bmp" : "유저인터페이스\\swap_equipment\\btn_change2_over.bmp", 1, 0);
this->SetBitmap(elapsed < 10000 ? "유저인터페이스\\swap_equipment\\btn_change2_disable.bmp" : "유저인터페이스\\swap_equipment\\btn_change2_press.bmp", 2, 0);
this->m_textColor = elapsed < 10000 ? 0x969696 : 0x172842;
this->DrawCenteredText(this->geometry.width / 2, this->geometry.height / 2 - 5, this->label.c_str(), this->label.size(), 0, 12, this->m_textColor, 0);
}

View file

@ -1,15 +1,27 @@
#ifndef RAGNAROK_SOURCE_UI_ITEMS_UISWAPEQUIPMENTWND_H
#define RAGNAROK_SOURCE_UI_ITEMS_UISWAPEQUIPMENTWND_H
#include "UI/Buttons/UIBitmapButton.h"
#include "UI/Window/UIFrameWnd.h"
#include <cstdint>
class UISwapBitmapButton;
struct UIButtonContext;
extern unsigned long g_swapEquipmentTick;
class UISwapBitmapButton : public UIBitmapButton {
public:
using UIBitmapButton::UIBitmapButton;
void Paint() override;
/* 0120 */ std::uint32_t m_textColor;
};
class UISwapEquipmentWnd : public UIFrameWnd {
public:
void Slot10(int x, int y, std::intptr_t value) override;
void Slot15(int width, int height) override;
void SetSlotValue(int index, int value);
protected:
@ -24,6 +36,7 @@ protected:
/* 00D4 */ int unknown_00D4;
/* 00D8 */ int unknown_00D8;
/* 00DC */ int unknown_00DC;
UIButtonContext* m_controls;
};
#endif