Batch #1727 by ragnarok-clanker: 0 byte-identical, 4 confirmed by peer review. - fn_04205 UILapineUpgradeBoxWnd::Slot25: logic confirmed by peer review - fn_04206 UILapineUpgradeBox_IngredientInfoWnd::Slot25: logic confirmed by peer review - fn_04211 UILapineUpgradeBoxWnd::Slot32: logic confirmed by peer review - fn_04212 UILapineUpgradeBox_IngredientInfoWnd::Slot32: logic confirmed by peer review Reviewed-by: ragnarok-clanker
120 lines
3.8 KiB
C++
120 lines
3.8 KiB
C++
#include "UI/UILapineUpgradeBoxWnd.h"
|
|
|
|
#include "Client/Mode/ActiveGameMode.h"
|
|
#include "Client/Mode/CGameMode.h"
|
|
#include "Client/Mode/ModeDragState.h"
|
|
#include "Client/Mode/ModeEvents.h"
|
|
#include "Contents/Items/ItemDescription.h"
|
|
#include "UI/Buttons/UIBitmapButton.h"
|
|
#include "UI/Window/WindowManagerWindows.h"
|
|
|
|
// OFFSET: 0x006035E0
|
|
// FUNCTION: fn_04194
|
|
void UILapineUpgradeBoxWnd::Slot10(int x, int y, std::intptr_t value) {
|
|
ModeEvents* mode = this->m_context->mode;
|
|
if (this->item.unknown_0000[1] > 0) {
|
|
mode->SendModeMessage(18, 0, 0, 0, 0);
|
|
return;
|
|
}
|
|
const ModeDragState* drag = reinterpret_cast<const ModeDragState*>(value);
|
|
if (drag->source == 27) {
|
|
this->SendMsg(this, 31, drag->id, 0, 0, 0);
|
|
}
|
|
mode->SendModeMessage(18, 0, 0, 0, 0);
|
|
}
|
|
|
|
// OFFSET: 0x00603650
|
|
// FUNCTION: fn_04195
|
|
void UILapineUpgradeBox_IngredientInfoWnd::Slot10(int x, int y, std::intptr_t value) {
|
|
if (this->parent) {
|
|
this->parent->Slot10(x + this->geometry.x, y + this->geometry.y, value);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x006036D0
|
|
// FUNCTION: fn_04197
|
|
void UILapineUpgradeBox_IngredientInfoWnd::Move(int x, int y) {
|
|
UIWindow::Move(x, y);
|
|
}
|
|
|
|
// OFFSET: 0x00603DB0
|
|
// FUNCTION: fn_04203
|
|
void UILapineUpgradeBoxWnd::Slot26(int x, int y) {
|
|
if (static_cast<unsigned>(x - 101) <= 24 && static_cast<unsigned>(y - 165) <= 24 && this->item.unknown_0000[1] != 0) {
|
|
this->SendMsg(this, 104, this->item.unknown_0000[1], 0, 0, 0);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00603DF0
|
|
// FUNCTION: fn_04204
|
|
void UILapineUpgradeBox_IngredientInfoWnd::Slot26(int x, int y) {
|
|
if (this->item.unknown_0000[1] > 0) {
|
|
this->parent->SendMsg(this, 104, this->item.unknown_0000[1], 0, 0, 0);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00603E20
|
|
// FUNCTION: fn_04205
|
|
void UILapineUpgradeBoxWnd::Slot25(int x, int y) {
|
|
if (y < 17) {
|
|
UIFrameWnd::Slot25(x, y);
|
|
}
|
|
if (static_cast<unsigned>(x - 101) <= 24 && static_cast<unsigned>(y - 165) <= 24 && this->item.unknown_0000[1] != 0) {
|
|
ItemDescriptions descriptions{g_itemDescriptions};
|
|
static_cast<CGameMode*>(g_world.ActiveGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 26, this->item, 1, -1);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00603E80
|
|
// FUNCTION: fn_04206
|
|
void UILapineUpgradeBox_IngredientInfoWnd::Slot25(int x, int y) {
|
|
if (this->item.unknown_0000[1] != 0) {
|
|
ItemDescriptions descriptions{g_itemDescriptions};
|
|
static_cast<CGameMode*>(g_world.ActiveGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 27, this->item, this->quantity, -1);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00603EC0
|
|
// FUNCTION: fn_04207
|
|
void UILapineUpgradeBox_IngredientInfoWnd::Slot31(int x, int y) {
|
|
this->selected = 1;
|
|
this->Invalidate();
|
|
if (this->parent) {
|
|
this->parent->SendMsg(this, 6, 0, 0, 0, 0);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00604180
|
|
// FUNCTION: fn_04213
|
|
void UILapineUpgradeBox_IngredientInfoWnd::Slot35(int argument) {
|
|
if (this->parent) {
|
|
this->parent->Slot35(argument);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x006040E0
|
|
// FUNCTION: fn_04211
|
|
void UILapineUpgradeBoxWnd::Slot32(int x, int y) {
|
|
if (static_cast<unsigned>(x - 101) <= 24 && static_cast<unsigned>(y - 165) <= 24 && this->item.unknown_0000[1] != 0) {
|
|
UIWindow* window = this->m_frameContext->windows.EnsureWindow(12);
|
|
window->SendMsg(nullptr, 24, reinterpret_cast<std::intptr_t>(&this->item), 0, 0, 0);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00604140
|
|
// FUNCTION: fn_04212
|
|
void UILapineUpgradeBox_IngredientInfoWnd::Slot32(int x, int y) {
|
|
if (this->item.unknown_0000[1] != 0) {
|
|
UIWindow* window = this->m_frameContext->windows.EnsureWindow(12);
|
|
window->SendMsg(this, 24, reinterpret_cast<std::intptr_t>(&this->item), 0, 0, 0);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00605BB0
|
|
// FUNCTION: fn_04225
|
|
void UILapineUpgradeBoxWnd::SetWaiting(unsigned char value) {
|
|
this->waiting = value;
|
|
this->upgradeButton->SetDisabled(value);
|
|
this->upgradeButton->Invalidate();
|
|
this->Invalidate();
|
|
}
|