Decompile 3 functions in Source/UI/FrameSkin.cpp, Source/UI/FrameSkin.h
Batch #1440 by Yommy: 0 byte-identical, 3 confirmed by peer review. - fn_14470 CUIFrameWnd::RefreshSkinColors: logic confirmed by peer review - fn_14471 CUIFrameWnd::Paint: logic confirmed by peer review - fn_14472 CUIFrameWnd::SetSkinColors: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker Reviewed-by: ragnarok-clanker Adds to the build: Source/UI/FrameSkin.cpp
This commit is contained in:
parent
7fd8a3bd08
commit
f93746f1b1
3 changed files with 78 additions and 0 deletions
48
Source/UI/FrameSkin.cpp
Normal file
48
Source/UI/FrameSkin.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
#include "UI/FrameSkin.h"
|
||||||
|
#include "Resource/ResourceMgr.h"
|
||||||
|
#include "Resource/TextureNames.h"
|
||||||
|
#include "UI/Window/WindowBorder.h"
|
||||||
|
|
||||||
|
// OFFSET: 0x009E6C70
|
||||||
|
// FUNCTION: fn_14470
|
||||||
|
void CUIFrameWnd::RefreshSkinColors() {
|
||||||
|
if (!this->m_resolveSkin) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->m_hasSkinColors) {
|
||||||
|
this->m_backgroundColor = SkinPaletteColor(ResourceMgr::Instance(), *this->m_textureNames, this->m_backgroundCell, this->m_resolveSkin);
|
||||||
|
this->m_borderColor = SkinPaletteColor(ResourceMgr::Instance(), *this->m_textureNames, this->m_borderCell, this->m_resolveSkin);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (UIWindow* child : this->m_children) {
|
||||||
|
child->Slot52(this->m_resolveSkin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: 0x009E6CF0
|
||||||
|
// FUNCTION: fn_14471
|
||||||
|
void CUIFrameWnd::Paint() {
|
||||||
|
if (this->m_hasSkinColors) {
|
||||||
|
this->ClearSurface(0xFFFF00FF);
|
||||||
|
this->FillRegion(1, 1, this->geometry.width - 2, this->geometry.height - 2, this->m_backgroundColor);
|
||||||
|
DrawRoundedBorder(*this, 0, 0, this->geometry.width, this->geometry.height, this->m_borderColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->m_buttonBarStyle > 0) {
|
||||||
|
this->DrawButtonBar(*this->m_textureNames, this->m_buttonBarStyle - 1, 0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// OFFSET: 0x009E6D60
|
||||||
|
// FUNCTION: fn_14472
|
||||||
|
void CUIFrameWnd::SetSkinColors(int backgroundColumn, int backgroundRow, int borderColumn, int borderRow) {
|
||||||
|
this->m_backgroundCell.column = backgroundColumn;
|
||||||
|
this->m_backgroundCell.row = backgroundRow;
|
||||||
|
this->m_borderCell.column = borderColumn;
|
||||||
|
this->m_borderCell.row = borderRow;
|
||||||
|
this->m_hasSkinColors = true;
|
||||||
|
|
||||||
|
this->m_backgroundColor = SkinPaletteColor(ResourceMgr::Instance(), *this->m_textureNames, this->m_backgroundCell, this->m_resolveSkin);
|
||||||
|
this->m_borderColor = SkinPaletteColor(ResourceMgr::Instance(), *this->m_textureNames, this->m_borderCell, this->m_resolveSkin);
|
||||||
|
}
|
||||||
29
Source/UI/FrameSkin.h
Normal file
29
Source/UI/FrameSkin.h
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef RAGNAROK_SOURCE_UI_FRAMESKIN_H
|
||||||
|
#define RAGNAROK_SOURCE_UI_FRAMESKIN_H
|
||||||
|
|
||||||
|
#include "Resource/SkinPalette.h"
|
||||||
|
#include "UI/Window/UIFrameWnd.h"
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
struct TextureNames;
|
||||||
|
|
||||||
|
class CUIFrameWnd : public UIFrameWnd {
|
||||||
|
public:
|
||||||
|
void Paint() override;
|
||||||
|
void RefreshSkinColors();
|
||||||
|
void SetSkinColors(int backgroundColumn, int backgroundRow, int borderColumn, int borderRow);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/* 00B4 */ std::uint16_t unknown_00B4;
|
||||||
|
/* 00B6 */ bool m_hasSkinColors;
|
||||||
|
/* 00B8 */ std::uint32_t m_backgroundColor;
|
||||||
|
/* 00BC */ std::uint32_t m_borderColor;
|
||||||
|
/* 00C0 */ SkinPaletteCell m_backgroundCell;
|
||||||
|
/* 00C8 */ SkinPaletteCell m_borderCell;
|
||||||
|
/* 00D0 */ int m_buttonBarStyle;
|
||||||
|
/* 00D4 */ bool m_resolveSkin;
|
||||||
|
TextureNames* m_textureNames;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -571,6 +571,7 @@
|
||||||
"Source/UI/Edit/UIEditCtrl.cpp": 2,
|
"Source/UI/Edit/UIEditCtrl.cpp": 2,
|
||||||
"Source/UI/Edit/UIEditLinks.cpp": 2,
|
"Source/UI/Edit/UIEditLinks.cpp": 2,
|
||||||
"Source/UI/Edit/UIEditVariants.cpp": 2,
|
"Source/UI/Edit/UIEditVariants.cpp": 2,
|
||||||
|
"Source/UI/FrameSkin.cpp": 2,
|
||||||
"Source/UI/Layout/SnapMgr.cpp": 2,
|
"Source/UI/Layout/SnapMgr.cpp": 2,
|
||||||
"Source/UI/Layout/SnapObject.cpp": 2,
|
"Source/UI/Layout/SnapObject.cpp": 2,
|
||||||
"Source/UI/Layout/SnapRectangle.cpp": 2,
|
"Source/UI/Layout/SnapRectangle.cpp": 2,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue