rodecomp/Source/Contents/Schedule/EmotionSchedule.cpp
ragnarok-clanker f8d3e8622d Maintenance: Rename placeholder sub_XXXXXX functions to evidence-based names (Lua registration strings, log/error strings, packet ids
Batch #13412 by ragnarok-clanker: no function's compiled code changes; checked with 592 compiled unit(s), including every includer of Source/Client/Mode/CGameMode.h, Source/Client/Session.h, Source/Contents/Actors/GameActor.h, Source/Contents/CashEmotionMgr.h, Source/Contents/ClientItemLists.h, Source/Contents/ClientState.h, Source/Contents/Configuration/GameSettingsMgr.h, Source/Contents/Items/ItemInfo.h, Source/Contents/NavigationManager.h, Source/Contents/RenewQuestMgr.h, Source/Contents/ReputeMgr.h, Source/Contents/Schedule/TimeScheduler.h, Source/Contents/WorldView/WorldViewData.h, Source/UI/Buttons/UIDescriptRace.h, Source/UI/CashEmotion/UICashEmotionListWnd.h, Source/UI/Dialogs/UIPasswordWnd.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Edit/UIItemTagCtrl.h, Source/UI/GameSettings/GameSettingsUI.h, Source/UI/Item/UIItemStoreSubWnd.h, Source/UI/Items/UISwapEquipmentWnd.h, Source/UI/Lists/UIChatHisBox.h, Source/UI/Lists/UITagListBox.h, Source/UI/Quest/UIOngoingQuestInfo.h, Source/UI/Quest/UIRenewQuestUI.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/Text/UIAchWnd.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/UIIngredientInfoWnd.h, Source/UI/UIMacroUserInfoWnd.h, Source/UI/Window/UINewSkillListWnd.h, Source/UI/Window/UIRegisterMgr.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/Utility/JsonCppLoader.h.
2026-11-06 16:30:12 +00:00

81 lines
2.6 KiB
C++

#include "Contents/Schedule/EmotionSchedule.h"
#include "Contents/CashEmotionMgr.h"
#include "Contents/ShowRankingScheduler.h"
class UICashEmotionListWnd {
public:
void RefreshPackLists();
void RefreshSelection();
};
// GLOBAL: gl_24915
UICashEmotionListWnd* g_cashEmotionListWnd;
// OFFSET: 0x00636B60
// FUNCTION: fn_04715
CEmotionPurchaseExpireSchedule::CEmotionPurchaseExpireSchedule(const std::uint64_t& timestamp, const std::int64_t& interval, int scheduleType)
: CSchedule(timestamp, interval, scheduleType, ++g_schedulerSerial, 5) {
}
// OFFSET: 0x00636C90
// FUNCTION: fn_04717
void CEmotionPurchaseExpireSchedule::Process(const std::uint64_t& now) {
CSchedule::Process(now);
if (g_cashEmotionMgr->RemoveExpiredPacks()) {
if (g_cashEmotionListWnd) {
g_cashEmotionListWnd->RefreshPackLists();
}
}
int earliest = g_cashEmotionMgr->GetEarliestExpiry();
if (earliest != 0x7FFFFFFF) {
int current = g_cashEmotionMgr->GetServerTime();
if (current < earliest) {
this->interval = (static_cast<std::int64_t>(earliest) * 10000000i64 - static_cast<std::int64_t>(current) * 10000000i64) / 10000i64;
return;
}
}
this->active = false;
}
// OFFSET: 0x00636D20
// FUNCTION: fn_04718
CEmotionPurchaseUseableTimeUISchedule::CEmotionPurchaseUseableTimeUISchedule(
const std::uint64_t& timestamp, const std::int64_t& interval, int scheduleType
)
: CSchedule(timestamp, interval, scheduleType, ++g_schedulerSerial, 7) {
}
// OFFSET: 0x00636E50
// FUNCTION: fn_04720
void CEmotionPurchaseUseableTimeUISchedule::Process(const std::uint64_t& now) {
CSchedule::Process(now);
if (!g_cashEmotionMgr->UpdatePurchasedPackExpiry()) {
this->active = false;
}
}
// OFFSET: 0x00636E80
// FUNCTION: fn_04721
CEmotionSaleExpireSchedule::CEmotionSaleExpireSchedule(const std::uint64_t& timestamp, const std::int64_t& interval, int scheduleType)
: CSchedule(timestamp, interval, scheduleType, ++g_schedulerSerial, 6) {
}
// OFFSET: 0x00636FB0
// FUNCTION: fn_04723
void CEmotionSaleExpireSchedule::Process(const std::uint64_t& now) {
CSchedule::Process(now);
CashEmotionPackRefresh refresh = g_cashEmotionMgr->RefreshUnownedPacks();
if (refresh.changed && g_cashEmotionListWnd) {
g_cashEmotionListWnd->RefreshPackLists();
g_cashEmotionListWnd->RefreshSelection();
}
if (refresh.nextTime != 0x7FFFFFFF) {
int current = g_cashEmotionMgr->GetServerTime();
if (current < refresh.nextTime) {
this->interval = (static_cast<std::int64_t>(refresh.nextTime) * 10000000i64 - static_cast<std::int64_t>(current) * 10000000i64) / 10000i64;
return;
}
}
this->active = false;
}