//
// ThreadViewPopup::onRefresh from 0x1400db590 to 0x1400db75f (463 bytes)
//
// 2 xrefs:
// > ThreadViewPopup::init @ 0x1400d9a49
// > ??> @ 0x1409148b8
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:26:28 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall ThreadViewPopup::onRefresh(__int64 a1)
{
__int64 v2; // rcx
__int64 v3; // rcx
__int64 *v4; // rdi
__int64 v5; // rbx
__int64 v6; // rdx
__int64 v7; // r8
__int64 v8; // rax
__int64 v9; // rcx
__int64 v10; // r8
__int128 v11; // [rsp+30h] [rbp-48h] BYREF
__int64 v12; // [rsp+40h] [rbp-38h]
__int64 v13; // [rsp+48h] [rbp-30h]
__int128 v14; // [rsp+50h] [rbp-28h] BYREF
__int64 v15; // [rsp+60h] [rbp-18h]
__int64 v16; // [rsp+68h] [rbp-10h]
void *v17; // [rsp+80h] [rbp+8h]
void *v18; // [rsp+80h] [rbp+8h]
if ( !*(_BYTE *)(a1 + 1104) )
{
v2 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v17 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v17);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v2 = *(_QWORD *)&qword_14090BFB0;
}
if ( (unsigned int)GameLevelManager::getTimeLeft(v2, "threadViewUpdate") - 1 > 4 )
{
v9 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v18 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v18);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v9 = *(_QWORD *)&qword_14090BFB0;
}
GameLevelManager::makeTimeStamp(v9, "threadViewUpdate");
if ( *(_BYTE *)(a1 + 781) )
v10 = *(_QWORD *)(a1 + 768);
else
v10 = 0;
if ( ThreadViewPopup::requestMessages(a1, 0, v10) )
ThreadViewPopup::showLoading(a1);
}
else
{
v4 = *(__int64 **)(cocos2d::CCDirector::sharedDirector(v3) + 272);
v14 = 0;
v15 = 0;
v16 = 15;
LOBYTE(v14) = 0;
v11 = 0;
*(_QWORD *)&v11 = sub_14003D460(0x20u);
v12 = 18;
v13 = 31;
strcpy((char *)v11, "Already up to date");
v5 = *v4;
v8 = TextAlertPopup::create(&v11, v6, v7, 150, &v14);
(*(void (__fastcall **)(__int64 *, __int64, __int64))(v5 + 456))(v4, v8, 1000);
}
}
}