Batch #1675 by ragnarok-clanker: 2 byte-identical, 45 confirmed by peer review. - fn_10839 UIButton::Slot25: logic confirmed by peer review - fn_10852 UIButton::Slot31: logic confirmed by peer review - fn_10868 UIButton::Slot27: logic confirmed by peer review - fn_10930 UIStaticBitmap::SetBitmap: logic confirmed by peer review - fn_10931 UIBitmapButton::SetBitmap: logic confirmed by peer review - fn_11320 UIComboBoxEx2::Slot15: logic confirmed by peer review - fn_11326 UIListBox::Slot15: logic confirmed by peer review - fn_11327 UIListBoxEx::Slot15: logic confirmed by peer review - fn_11381 UIScrollBar::Paint: logic confirmed by peer review - fn_11383 UIScrollBar_Navi::Paint: logic confirmed by peer review - fn_11425 UIScrollBar::Slot25: logic confirmed by peer review - fn_11440 UIScrollBar::Slot31: logic confirmed by peer review - fn_11445 UITextButton::Slot31: logic confirmed by peer review - fn_11468 UIScrollBar::Slot27: logic confirmed by peer review - fn_11471 UITextButton::Slot27: logic confirmed by peer review - fn_11494 UITextButton::Slot33: logic confirmed by peer review - fn_11779 UIFrameWnd::Slot25: logic confirmed by peer review - fn_11781 UIFrameWnd::Slot31: logic confirmed by peer review - fn_11786 UIFrameWnd::Slot27: logic confirmed by peer review - fn_12610 CSession::GetOption: logic confirmed by peer review - fn_12689 ActivateShortcut: logic confirmed by peer review - fn_12711 ShortcutTooltip::Hover: logic confirmed by peer review - fn_12724 ShortcutDetails::Open: logic confirmed by peer review (already on main) - fn_12760 UIShortCutWnd::SendMsg: logic confirmed by peer review - fn_17144 UIWindowMgr::RemoveOrder: logic confirmed by peer review - fn_17158 UIWindowMgr::Capture: byte-identical - fn_17180 UIWindowMgr::BringToFront: logic confirmed by peer review - fn_17192 UIWindowMgr::IsOrderFixed: logic confirmed by peer review - fn_17232 UIWindowMgr::ReleaseCapture: byte-identical - fn_17255 UIWindowMgr::SetCapture: logic confirmed by peer review - fn_20382 CConnection::CConnection: logic confirmed by peer review - fn_20383 CRagConnection::CRagConnection: logic confirmed by peer review - fn_20384 CConnection::~CConnection: logic confirmed by peer review (already on main) - fn_20389 CConnection::Connect: logic confirmed by peer review - fn_20390 CConnection::Close: logic confirmed by peer review - fn_20409 GetRagConnection: logic confirmed by peer review - fn_21406 AutomaticSkills::Complete: logic confirmed by peer review - fn_03927 CCharacterLinkedUserDataMgr::CompleteLoad: logic confirmed by peer review - fn_03933 CCharacterLinkedUserDataMgr::Save: logic confirmed by peer review - fn_03937 CSession::SetOption: logic confirmed by peer review - fn_11073 UIScrollBar::UIScrollBar: logic confirmed by peer review - fn_11102 UIComboBoxEx2::~UIComboBoxEx2: logic confirmed by peer review (already on main) - fn_09150 AutomaticSkills::DisableAll: logic confirmed by peer review - fn_09153 AutomaticSkills::Use: logic confirmed by peer review - fn_10689 UIBitmapButton::~UIBitmapButton: logic confirmed by peer review (already on main) - fn_10795 UIBitmapButton::Paint: logic confirmed by peer review - fn_10817 UIStaticBitmap::Paint: logic confirmed by peer review Reviewed-by: ragnarok-clanker
106 lines
3 KiB
C++
106 lines
3 KiB
C++
#include "Render/DeviceContext/DeviceContext.h"
|
|
#include "Resource/Bitmap/BitmapResource.h"
|
|
#include "Resource/ResourceMgr.h"
|
|
#include "UI/Buttons/UIButton.h"
|
|
#include "UI/UIStaticBitmap.h"
|
|
|
|
// OFFSET: 0x00850430
|
|
// FUNCTION: fn_10676
|
|
UIStaticBitmap::UIStaticBitmap(UIWindowContext& windows, UIButtonContext& controls)
|
|
: UIWindow(windows, 0), tooltipX(0), tooltipY(-20), forwardHover(0), m_controls(&controls) {
|
|
}
|
|
|
|
// OFFSET: 0x00852F20
|
|
UIStaticBitmap::~UIStaticBitmap() = default;
|
|
|
|
// OFFSET: 0x00865740
|
|
// FUNCTION: fn_10930
|
|
void UIStaticBitmap::SetBitmap(const char* name) {
|
|
this->bitmap = name;
|
|
const auto* resource = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(this->bitmap.c_str()));
|
|
this->geometry.width = resource->image.width;
|
|
this->geometry.height = resource->image.height;
|
|
}
|
|
|
|
// OFFSET: 0x0085DA90
|
|
// FUNCTION: fn_10817
|
|
void UIStaticBitmap::Paint() {
|
|
if (this->bitmap.empty()) {
|
|
return;
|
|
}
|
|
|
|
if (this->geometry.unknown_0030 == 0) {
|
|
const auto* resource = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(this->bitmap.c_str()));
|
|
this->DrawBitmap(0, 0, resource ? &resource->image : nullptr, false);
|
|
} else if (this->geometry.unknown_0030 == 1 && this->geometry.surface) {
|
|
this->geometry.surface->Fill(nullptr, 0xFFFF00FFu);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x0085EE10
|
|
// FUNCTION: fn_10849
|
|
void UIStaticBitmap::Slot25(int x, int y) {
|
|
this->parent->Slot25((x + this->geometry.x), (y + this->geometry.y));
|
|
}
|
|
|
|
// OFFSET: 0x0085EA30
|
|
// FUNCTION: fn_10836
|
|
void UIStaticBitmap::Slot26(int x, int y) {
|
|
this->parent->Slot26((x + this->geometry.x), (y + this->geometry.y));
|
|
}
|
|
|
|
// OFFSET: 0x0085F8A0
|
|
// FUNCTION: fn_10872
|
|
void UIStaticBitmap::Slot27(int x, int y) {
|
|
this->parent->Slot27((x + this->geometry.x), (y + this->geometry.y));
|
|
}
|
|
|
|
// OFFSET: 0x0085F500
|
|
// FUNCTION: fn_10865
|
|
void UIStaticBitmap::Slot28(int x, int y) {
|
|
if (this->forwardHover != 0) {
|
|
this->parent->Slot28(x, y);
|
|
}
|
|
|
|
if (!this->tooltip.empty()) {
|
|
int screenX = this->tooltipX;
|
|
int screenY = this->tooltipY;
|
|
|
|
for (const UIWindow* window = this; window; window = window->parent) {
|
|
screenX = (screenX + window->geometry.x);
|
|
screenY = (screenY + window->geometry.y);
|
|
}
|
|
|
|
this->m_controls->services.Tooltip(this->tooltip.c_str(), screenX, screenY, -1, false, true);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x0085FA80
|
|
// FUNCTION: fn_10880
|
|
void UIStaticBitmap::ResetCursor(int x, int y) {
|
|
this->parent->ResetCursor((x + this->geometry.x), (y + this->geometry.y));
|
|
}
|
|
|
|
// OFFSET: 0x0085F000
|
|
// FUNCTION: fn_10854
|
|
void UIStaticBitmap::Slot31(int x, int y) {
|
|
this->parent->Slot31((x + this->geometry.x), (y + this->geometry.y));
|
|
}
|
|
|
|
// OFFSET: 0x0085FEA0
|
|
// FUNCTION: fn_10888
|
|
void UIStaticBitmap::Slot32(int x, int y) {
|
|
this->parent->Slot32((x + this->geometry.x), (y + this->geometry.y));
|
|
}
|
|
|
|
// OFFSET: 0x0085FF00
|
|
// FUNCTION: fn_10890
|
|
void UIStaticBitmap::Slot33(int x, int y) {
|
|
this->parent->Slot33((x + this->geometry.x), (y + this->geometry.y));
|
|
}
|
|
|
|
// OFFSET: 0x00860010
|
|
// FUNCTION: fn_10896
|
|
void UIStaticBitmap::Slot35(int value) {
|
|
this->parent->Slot35(value);
|
|
}
|