Batch #17706 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_10856 UITextureButton::OnLBtnUp: logic confirmed by peer review Peer-reviewed-by: Yommy, cremane, bibinir Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
#include "Client/Mode/ModeMessage.h"
|
|
#include "UI/Window/UIEnums.h"
|
|
#include "Client/Replay/Replay.h"
|
|
#include "UI/Window/WindowPolicy.h"
|
|
#include "UI/Login/UINewSelectCharWnd.h"
|
|
#include "Contents/Tables/MessageTable.h"
|
|
#include "Client/Mode/CMode.h"
|
|
#include "Client/Mode/ModeMgr.h"
|
|
#include "Client/Mode/ModeEvents.h"
|
|
#include "UI/Buttons/UITextureButton.h"
|
|
#include "UI/Window/UIWindowMgr.h"
|
|
|
|
#include "Resource/MSGSTRINGID.h"
|
|
// OFFSET: 0x0085E070
|
|
// FUNCTION: fn_10822
|
|
void UITextureButton::Paint() {
|
|
}
|
|
|
|
// OFFSET: 0x0085F060
|
|
// FUNCTION: fn_10856
|
|
void UITextureButton::OnLBtnUp(int x, int y) {
|
|
if (this->m_disabled == 1) {
|
|
return;
|
|
}
|
|
|
|
if (this != g_windowMgr.Capture()) {
|
|
return;
|
|
}
|
|
|
|
if (x < 0 || x >= this->geometry.width || y < 0 || y >= this->geometry.height) {
|
|
this->geometry.state = 0;
|
|
} else {
|
|
if (this->toggleEnabled == 1) {
|
|
this->toggled = this->toggled == 0;
|
|
}
|
|
|
|
this->geometry.state = 1;
|
|
if (this->parent) {
|
|
if (g_windowMgr.WindowPolicy(3, this->parent->geometry.id) > 0) {
|
|
int id = this->geometry.id;
|
|
if (id == 185 && g_modeMgr.gameMode && g_modeMgr.gameMode->cursorType == 2) {
|
|
const char* text = LookupMessage(MSI_DO_YOU_REALLY_WANT_TO_QUIT);
|
|
if (g_windowMgr.Confirm(text, 2, true, false, 0, "Message", 280, 120, 0) == 187) {
|
|
g_modeMgr.gameMode->SendMsg(MM_QUIT, 0, 0, 0, 0);
|
|
}
|
|
} else {
|
|
if (id == 184 || id == 321) {
|
|
this->parent->RecordEditTexts();
|
|
id = this->geometry.id;
|
|
}
|
|
|
|
this->parent->SendMsg(this, UM_COMMAND, id, this->m_argument, 0, 0);
|
|
}
|
|
}
|
|
} else {
|
|
g_modeMgr.gameMode->SendMsg(MM_COMMAND, this->geometry.id, this->m_argument, 0, 0);
|
|
}
|
|
}
|
|
|
|
this->Invalidate();
|
|
g_windowMgr.ReleaseCapture();
|
|
}
|