Decompile 6 functions in Source/UI/Window/UIBattleMsgOptionWnd.cpp, Source/UI/Window/UIBattleMsgOptionWnd.h, ...
Batch #4473 by youko: 0 byte-identical, 6 confirmed by peer review. - fn_12606 UIBattleMsgOptionWnd::RowAt: logic confirmed by peer review - fn_12614 UIQuickSlotWnd::SlotX: logic confirmed by peer review - fn_12615 UIQuickSlotWnd::SlotAt: logic confirmed by peer review - fn_12619 UISubChatHisWnd::Slot42: logic confirmed by peer review - fn_12611 SetRoMapMarker: logic confirmed by peer review - fn_12622 UIRoMapWnd::ClearRecords: logic confirmed by peer review Peer-reviewed-by: eAthena, willerthal, KWDev 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
71cb93087a
commit
674b54cbce
8 changed files with 138 additions and 1 deletions
|
|
@ -10,3 +10,10 @@
|
|||
// OFFSET: 0x009309B0
|
||||
|
||||
// OFFSET: 0x00931710
|
||||
|
||||
// OFFSET: 0x0091C9E0
|
||||
// FUNCTION: fn_12619
|
||||
bool UISubChatHisWnd::Slot42(void* output) {
|
||||
*static_cast<SubChatHistoryState*>(output) = this->m_state;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,27 @@
|
|||
|
||||
class UIEditCtrl;
|
||||
|
||||
struct SubChatHistoryState {
|
||||
/* 0000 */ int unknown_0000;
|
||||
/* 0004 */ int unknown_0004;
|
||||
/* 0008 */ int unknown_0008;
|
||||
/* 000C */ int unknown_000C;
|
||||
/* 0010 */ int unknown_0010;
|
||||
/* 0014 */ int unknown_0014;
|
||||
/* 0018 */ int unknown_0018;
|
||||
};
|
||||
|
||||
class UISubChatHisWnd : public UIFrameWnd {
|
||||
public:
|
||||
void Slot25(int x, int y) override;
|
||||
void Slot26(int x, int y) override;
|
||||
void Slot31(int x, int y) override;
|
||||
bool Slot42(void* output) override;
|
||||
|
||||
private:
|
||||
/* 00B4 */ unsigned char unknown_00B4[0x34];
|
||||
/* 00B4 */ unsigned char unknown_00B4[0xC];
|
||||
/* 00C0 */ SubChatHistoryState m_state;
|
||||
/* 00DC */ unsigned char unknown_00DC[0xC];
|
||||
/* 00E8 */ int m_inputHeight;
|
||||
/* 00EC */ int m_inputWidth;
|
||||
/* 00F0 */ int unknown_00F0;
|
||||
|
|
@ -21,4 +34,8 @@ private:
|
|||
/* 012C */ UIEditCtrl* m_edit;
|
||||
};
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(SubChatHistoryState) == 0x1C);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -343,6 +343,33 @@ void UIQuickSlotWnd::Slot19() {
|
|||
this->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x0091C4D0
|
||||
// FUNCTION: fn_12614
|
||||
int UIQuickSlotWnd::SlotX(int slot) {
|
||||
for (int index = 0; index < 2; ++index) {
|
||||
if (index == slot) {
|
||||
return index * 29 + 5;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// OFFSET: 0x0091C500
|
||||
// FUNCTION: fn_12615
|
||||
int UIQuickSlotWnd::SlotAt(int x, int y) {
|
||||
if (y < 0 || y >= 24 || (x > 58 && x < this->geometry.width)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
const int index = (x - 4) / 29;
|
||||
if (x > index * 29 + 30) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00932E90
|
||||
// FUNCTION: fn_12719
|
||||
void UISeekPartyWnd::Slot19() {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ class UIQuickSlotWnd : public UIFrameWnd {
|
|||
public:
|
||||
void Slot19() override;
|
||||
void Paint() override;
|
||||
int SlotX(int slot);
|
||||
int SlotAt(int x, int y);
|
||||
|
||||
protected:
|
||||
/* 00B4 */ int m_selected;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
#include "Contents/MessageTable.h"
|
||||
#include "UI/Lists/UIScrollBar.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
// OFFSET: 0x009335E0
|
||||
// FUNCTION: fn_12726
|
||||
void UIBattleMsgOptionWnd::Slot35(int delta) {
|
||||
|
|
@ -56,4 +58,24 @@ UIBattleMsgOptionWnd::UIBattleMsgOptionWnd(UIWindowContext& windows, UIFrameCont
|
|||
this->text = LookupMessage(0x509);
|
||||
}
|
||||
|
||||
// OFFSET: 0x0091BA20
|
||||
// FUNCTION: fn_12606
|
||||
int UIBattleMsgOptionWnd::RowAt(int x, int y) {
|
||||
if (x >= 0 && y >= 17 && y < this->m_visibleRows * 20 + 17) {
|
||||
const int column = x / this->geometry.width;
|
||||
int row = 0;
|
||||
int index = 0;
|
||||
for (std::vector<const char*>::iterator it = this->messages.begin(); it != this->messages.end(); ++it, ++index) {
|
||||
if (std::strcmp(LookupMessage(0x60D), *it) != 0 && index >= this->unknown_00C4) {
|
||||
if (row == (y - 17) / 20 + column) {
|
||||
return index;
|
||||
}
|
||||
++row;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// OFFSET: 0x009305F0
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ public:
|
|||
UIBattleMsgOptionWnd(UIWindowContext& windows, UIFrameContext& frames);
|
||||
void Slot26(int x, int y) override;
|
||||
void Slot35(int delta) override;
|
||||
int RowAt(int x, int y);
|
||||
|
||||
/* 00B4 */ UIScrollBar* m_scrollBar;
|
||||
/* 00B8 */ int unknown_00B8;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,36 @@
|
|||
#include "UI/Window/UIRoMapWnd.h"
|
||||
|
||||
#include "Contents/MapSkyMgr.h"
|
||||
|
||||
// OFFSET: 0x00931080
|
||||
// FUNCTION: fn_12697
|
||||
void UIRoMapWnd::Slot25(int, int) {
|
||||
}
|
||||
|
||||
// OFFSET: 0x0091BE80
|
||||
// FUNCTION: fn_12611
|
||||
void SetRoMapMarker(std::string name, const WorldViewArea& area, RoMapMarker& marker) {
|
||||
const int width = area.right - area.left;
|
||||
const int height = area.bottom - area.top;
|
||||
const float centerX = static_cast<float>(width) * g_depthAverageHalf + static_cast<float>(area.left);
|
||||
const float centerY = static_cast<float>(height) * g_depthAverageHalf + static_cast<float>(area.top);
|
||||
|
||||
marker.name = name;
|
||||
marker.area = area;
|
||||
marker.centerX = centerX;
|
||||
marker.centerY = centerY;
|
||||
marker.width = static_cast<float>(width);
|
||||
marker.height = static_cast<float>(height);
|
||||
}
|
||||
|
||||
// OFFSET: 0x0091CF40
|
||||
// FUNCTION: fn_12622
|
||||
void UIRoMapWnd::ClearRecords() {
|
||||
this->m_records.clear();
|
||||
this->unknown_00D0 = 0;
|
||||
this->unknown_00C4 = 0;
|
||||
this->unknown_00C8 = 0;
|
||||
this->unknown_00C0 = 0;
|
||||
this->unknown_00BC = 0;
|
||||
this->unknown_00CC = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,42 @@
|
|||
#ifndef RAGNAROK_SOURCE_UI_WINDOW_UIROMAPWND_H
|
||||
#define RAGNAROK_SOURCE_UI_WINDOW_UIROMAPWND_H
|
||||
|
||||
#include "Contents/WorldView/WorldViewData.h"
|
||||
#include "UI/Window/UIFrameWnd.h"
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
||||
struct RoMapMarker {
|
||||
/* 0000 */ std::string name;
|
||||
/* 0018 */ WorldViewArea area;
|
||||
/* 002C */ float centerX;
|
||||
/* 0030 */ float centerY;
|
||||
/* 0034 */ float width;
|
||||
/* 0038 */ float height;
|
||||
};
|
||||
|
||||
void SetRoMapMarker(std::string name, const WorldViewArea& area, RoMapMarker& marker);
|
||||
|
||||
class UIRoMapWnd : public UIFrameWnd {
|
||||
public:
|
||||
void Slot25(int x, int y) override;
|
||||
void ClearRecords();
|
||||
|
||||
private:
|
||||
/* 00B4 */ std::list<WorldViewRecord> m_records;
|
||||
/* 00BC */ int unknown_00BC;
|
||||
/* 00C0 */ int unknown_00C0;
|
||||
/* 00C4 */ int unknown_00C4;
|
||||
/* 00C8 */ int unknown_00C8;
|
||||
/* 00CC */ unsigned char unknown_00CC;
|
||||
/* 00D0 */ int unknown_00D0;
|
||||
};
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(RoMapMarker) == 0x3C);
|
||||
static_assert(offsetof(RoMapMarker, area) == 0x18);
|
||||
static_assert(offsetof(RoMapMarker, centerX) == 0x2C);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue