Decompile 2 functions in Source/UI/Cooldowns/CooldownState.cpp, Source/UI/Cooldowns/CooldownState.h, ...

Batch #2159 by ntrl: 0 byte-identical, 2 confirmed by peer review.

- fn_20947 CooldownState::~CooldownState: logic confirmed by peer review
- fn_21826 ShortcutCooldowns::ApplyStart: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
This commit is contained in:
ragnarok-clanker 2026-10-29 14:45:03 +00:00
commit c1638c3896
3 changed files with 11 additions and 4 deletions

View file

@ -21,6 +21,12 @@ CooldownState::CooldownState(
std::memset(this->vertices, 0, sizeof(this->vertices));
}
// OFFSET: 0x00CA5120
// FUNCTION: fn_20947
CooldownState::~CooldownState() {
this->ClearEdges();
}
// OFFSET: 0x00CA59C0
// FUNCTION: fn_20951
void CooldownState::ClearEdges() {

View file

@ -36,6 +36,7 @@ struct CooldownState {
/* 0334 */ std::uint32_t color;
CooldownState(int slot, int x, int y, std::uint32_t duration, std::uint32_t start, std::uint32_t elapsed, int reverse);
~CooldownState();
void ClearEdges();
void AddEdge(unsigned segment, float origin, int radius, unsigned char increasing);
float Update(const CooldownClock& clock);

View file

@ -110,16 +110,16 @@ void ShortcutCooldowns::ApplyStart(
const auto entry = find();
if (entry == this->records.end()) {
value.main.emplace_back(icon.slot, icon.x, icon.y, duration, now, 0, 0);
value.main.push_back(CooldownState(icon.slot, icon.x, icon.y, duration, now, 0, 0));
this->records.push_back(value);
} else {
const auto slot = std::find_if(entry->main.begin(), entry->main.end(), [&](const CooldownState& state) { return state.slot == icon.slot; });
if (slot == entry->main.end()) {
entry->main.emplace_back(icon.slot, icon.x, icon.y, duration, now, 0, 0);
entry->main.push_back(CooldownState(icon.slot, icon.x, icon.y, duration, now, 0, 0));
} else {
this->records.erase(entry);
value.main.emplace_back(icon.slot, icon.x, icon.y, duration, now, 0, 0);
value.main.push_back(CooldownState(icon.slot, icon.x, icon.y, duration, now, 0, 0));
this->records.push_back(value);
}
}
@ -127,7 +127,7 @@ void ShortcutCooldowns::ApplyStart(
for (const ShortcutCooldownIcon& icon : alternateIcons) {
if (icon.id == id && find() == this->records.end()) {
value.alternate.emplace_back(icon.slot, icon.x, icon.y, duration, now, 0, 0);
value.alternate.push_back(CooldownState(icon.slot, icon.x, icon.y, duration, now, 0, 0));
this->records.push_back(value);
}
}