Decompile 6 functions in Source/UI/Window/UIControl.cpp, Source/UI/Window/UIControl.h
Batch #11319 by cremane: 2 byte-identical, 4 confirmed by peer review. - fn_14504 CUIResizer::Slot25: logic confirmed by peer review - fn_14505 CUIResizer::Slot31: logic confirmed by peer review - fn_14506 CUIResizer::Slot27: logic confirmed by peer review - fn_14507 CUIResizer::ResetCursor: byte-identical - fn_14633 CUIButton::ResetCursor: logic confirmed by peer review - fn_14714 CUIThumb::ResetCursor: byte-identical Peer-reviewed-by: kyoshi, SapitoSucio, StrawberrysherbetIX, Yommy, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
74e5136dd9
commit
0a4a6892fd
1 changed files with 54 additions and 54 deletions
|
|
@ -537,7 +537,7 @@ void CUIHThumb::Slot27(int x, int) {
|
|||
// OFFSET: 0x009F24F0
|
||||
// FUNCTION: fn_14714
|
||||
void CUIThumb::ResetCursor(int, int) {
|
||||
static_cast<CMode*>(g_charViewMode)->SetCursorAction(2);
|
||||
g_modeMgr.gameMode->SetCursorAction(2);
|
||||
}
|
||||
|
||||
// OFFSET: 0x009F2450
|
||||
|
|
@ -859,7 +859,7 @@ void CUIButton::Slot48() {
|
|||
// OFFSET: 0x009EEAA0
|
||||
// FUNCTION: fn_14633
|
||||
void CUIButton::ResetCursor(int, int) {
|
||||
static_cast<CMode*>(g_charViewMode)->SetCursorAction(this->disabled ? 0 : 2);
|
||||
g_modeMgr.gameMode->SetCursorAction(this->disabled ? 0 : 2);
|
||||
}
|
||||
|
||||
// OFFSET: 0x009ECCD0
|
||||
|
|
@ -2513,79 +2513,79 @@ void CUIResizer::Paint() {
|
|||
// OFFSET: 0x009E9430
|
||||
// FUNCTION: fn_14504
|
||||
void CUIResizer::Slot25(int x, int y) {
|
||||
if (this->parent) {
|
||||
g_windowMgr.SetCapture(this);
|
||||
for (const UIWindow* node = this; node; node = node->parent) {
|
||||
x += node->geometry.x;
|
||||
y += node->geometry.y;
|
||||
}
|
||||
this->startX = x;
|
||||
this->startY = y;
|
||||
this->startWidth = this->parent->geometry.width;
|
||||
this->startHeight = this->parent->geometry.height;
|
||||
this->deltaX = 0;
|
||||
this->deltaY = 0;
|
||||
if (!this->parent) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_windowMgr.SetCapture(this);
|
||||
this->ToScreen(x, y);
|
||||
|
||||
this->startX = x;
|
||||
this->startY = y;
|
||||
this->startWidth = this->parent->geometry.width;
|
||||
this->startHeight = this->parent->geometry.height;
|
||||
this->deltaX = 0;
|
||||
this->deltaY = 0;
|
||||
}
|
||||
|
||||
// OFFSET: 0x009E94B0
|
||||
// FUNCTION: fn_14505
|
||||
void CUIResizer::Slot31(int x, int y) {
|
||||
if (this->parent && this == g_windowMgr.Capture()) {
|
||||
g_windowMgr.ReleaseCapture();
|
||||
this->parent->Slot36();
|
||||
for (const UIWindow* node = this; node; node = node->parent) {
|
||||
x += node->geometry.x;
|
||||
y += node->geometry.y;
|
||||
}
|
||||
this->startX = x;
|
||||
this->startY = y;
|
||||
this->startWidth = this->parent->geometry.width;
|
||||
this->startHeight = this->parent->geometry.height;
|
||||
this->deltaX = 0;
|
||||
this->deltaY = 0;
|
||||
if (!this->parent || this != g_windowMgr.Capture()) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_windowMgr.ReleaseCapture();
|
||||
this->parent->Slot36();
|
||||
this->ToScreen(x, y);
|
||||
|
||||
this->startX = x;
|
||||
this->startY = y;
|
||||
this->startWidth = this->parent->geometry.width;
|
||||
this->startHeight = this->parent->geometry.height;
|
||||
this->deltaX = 0;
|
||||
this->deltaY = 0;
|
||||
}
|
||||
|
||||
// OFFSET: 0x009E9540
|
||||
// FUNCTION: fn_14506
|
||||
void CUIResizer::Slot27(int x, int y) {
|
||||
if (this->parent && this == g_windowMgr.Capture()) {
|
||||
for (const UIWindow* node = this; node; node = node->parent) {
|
||||
x += node->geometry.x;
|
||||
y += node->geometry.y;
|
||||
}
|
||||
const int rows = static_cast<int>(std::roundf(static_cast<float>(y - this->startY) / static_cast<float>(this->stepY)) * static_cast<float>(this->stepY));
|
||||
int width = static_cast<int>(std::roundf(static_cast<float>(x - this->startX) / static_cast<float>(this->stepX)) * static_cast<float>(this->stepX)) + this->startWidth;
|
||||
if (width > this->maxWidth) {
|
||||
width = this->maxWidth;
|
||||
} else if (width < this->minWidth) {
|
||||
width = this->minWidth;
|
||||
}
|
||||
if (!this->parent || this != g_windowMgr.Capture()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int height = rows + this->startHeight;
|
||||
if (height > this->maxHeight) {
|
||||
height = this->maxHeight;
|
||||
} else if (height < this->minHeight) {
|
||||
height = this->minHeight;
|
||||
}
|
||||
this->ToScreen(x, y);
|
||||
|
||||
width -= this->startWidth;
|
||||
height -= this->startHeight;
|
||||
if (width != this->deltaX || height != this->deltaY) {
|
||||
if (this->onResize) {
|
||||
this->onResize(width - this->deltaX, height - this->deltaY);
|
||||
}
|
||||
this->deltaX = width;
|
||||
this->deltaY = height;
|
||||
const int rows = static_cast<int>(std::roundf(static_cast<float>(y - this->startY) / static_cast<float>(this->stepY)) * static_cast<float>(this->stepY));
|
||||
int width = static_cast<int>(std::roundf(static_cast<float>(x - this->startX) / static_cast<float>(this->stepX)) * static_cast<float>(this->stepX)) + this->startWidth;
|
||||
if (width > this->maxWidth) {
|
||||
width = this->maxWidth;
|
||||
} else if (width < this->minWidth) {
|
||||
width = this->minWidth;
|
||||
}
|
||||
|
||||
int height = rows + this->startHeight;
|
||||
if (height > this->maxHeight) {
|
||||
height = this->maxHeight;
|
||||
} else if (height < this->minHeight) {
|
||||
height = this->minHeight;
|
||||
}
|
||||
|
||||
width -= this->startWidth;
|
||||
height -= this->startHeight;
|
||||
if (width != this->deltaX || height != this->deltaY) {
|
||||
if (this->onResize) {
|
||||
this->onResize(width - this->deltaX, height - this->deltaY);
|
||||
}
|
||||
this->deltaX = width;
|
||||
this->deltaY = height;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x009E96B0
|
||||
// FUNCTION: fn_14507
|
||||
void CUIResizer::ResetCursor(int, int) {
|
||||
static_cast<CMode*>(g_charViewMode)->SetCursorAction(2);
|
||||
g_modeMgr.gameMode->SetCursorAction(2);
|
||||
}
|
||||
|
||||
// OFFSET: 0x009E96C0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue