//
// EditorUI::toggleViewOption from 0xbfe7e8 to 0xbfee0c (1572 bytes)
//
// 3 xrefs:
// > EditorUI::handleEditorAction @ 0xbd7b34
// > EditorUI::onViewButton @ 0xbfee40
// > ??> @ 0x5de68
//
// This function is hookable on this platform (idp: arm, 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 13:03:47 +0000
//
__int64 __fastcall EditorUI::toggleViewOption(EditorUI *this, int a2)
{
__int64 *v3; // x0
__int64 *v4; // x21
GameManager *v5; // x0
__int64 v6; // x1
GameManager *v7; // x0
GameManager *v8; // x0
const char *v10; // x1
size_t v11; // x0
__int64 v12; // x21
LevelEditorLayer *v13; // x21
GameManager *v14; // x0
char GameVariable; // w0
GameManager *v16; // x21
GameManager *v17; // x21
char *v18; // [xsp+40h] [xbp+40h]
int v19; // [xsp+4Ch] [xbp+4Ch] BYREF
float v20; // [xsp+50h] [xbp+50h] BYREF
float v21; // [xsp+58h] [xbp+58h] BYREF
__int64 v22; // [xsp+60h] [xbp+60h] BYREF
__int64 v23; // [xsp+68h] [xbp+68h]
void *v24; // [xsp+70h] [xbp+70h]
__int64 v25[2]; // [xsp+78h] [xbp+78h] BYREF
void *v26; // [xsp+88h] [xbp+88h]
__int64 v27; // [xsp+90h] [xbp+90h] BYREF
__int64 v28; // [xsp+98h] [xbp+98h]
void *v29; // [xsp+A0h] [xbp+A0h]
v19 = a2;
if ( a2 != 20 && a2 != 9 || !*(_DWORD *)(*((_QWORD *)this + 180) + 1972LL) )
{
v3 = std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::find(
(_QWORD *)this + 174,
&v19);
v4 = v3;
if ( v3 )
{
v5 = (GameManager *)*((unsigned __int8 *)v3 + 24);
v6 = (unsigned __int8)v5 >> 1;
if ( ((unsigned __int8)v5 & 1) != 0 )
v6 = v4[4];
if ( v6 )
{
v7 = (GameManager *)GameManager::sharedState(v5);
if ( (v4[3] & 1) != 0 )
GameManager::toggleGameVariable(v7, (char *)v4[5]);
else
GameManager::toggleGameVariable(v7, (char *)v4 + 25);
}
}
v8 = (GameManager *)(unsigned int)(v19 - 4);
switch ( v19 )
{
case 4:
EditorUI::toggleObjectInfoLabel(this);
break;
case 5:
v13 = *((LevelEditorLayer **)this + 180);
v14 = (GameManager *)GameManager::sharedState(v8);
GameVariable = GameManager::getGameVariable(v14, "0037");
LevelEditorLayer::toggleGround(v13, GameVariable);
break;
case 7:
LevelEditorLayer::updatePreviewParticles(*((cocos2d::CCArray ***)this + 180));
break;
case 8:
LevelEditorLayer::updatePreviewAnim(*((cocos2d::CCArray ***)this + 180));
break;
case 9:
LevelEditorLayer::updateEditorMode(*((LevelEditorLayer **)this + 180));
break;
case 14:
v16 = (GameManager *)GameManager::sharedState(v8);
*((_BYTE *)v16 + 921) = *(_BYTE *)(GameManager::sharedState(v16) + 921) ^ 1;
break;
case 15:
v17 = (GameManager *)GameManager::sharedState(v8);
*((_BYTE *)v17 + 922) = *(_BYTE *)(GameManager::sharedState(v17) + 922) ^ 1;
break;
case 17:
LevelEditorLayer::toggleLocalDeaths(*((LevelEditorLayer **)this + 180));
break;
case 18:
LevelEditorLayer::toggleGlobalDeaths(*((LevelEditorLayer **)this + 180));
break;
case 19:
LevelEditorLayer::toggleDeathLabels(*((LevelEditorLayer **)this + 180));
break;
case 20:
*(_BYTE *)(*((_QWORD *)this + 180) + 14938LL) = 1;
break;
case 21:
LevelEditorLayer::s_liveTraceIn ^= 1u;
break;
case 22:
LevelEditorLayer::s_liveTraceOut ^= 1u;
break;
default:
break;
}
LevelEditorLayer::updateOptions(*((EditorUI ***)this + 180));
EditorUI::updateViewButtons(this);
v22 = 0;
v23 = 0;
v24 = nullptr;
std::string::__init(&v22, &byte_11B8890, 0);
switch ( v19 )
{
case -16:
std::string::assign(&v22, "Keyframe Lines: ");
break;
case 1:
std::string::assign(&v22, "Ignore Damage: ");
break;
case 2:
std::string::assign(&v22, "Select Filter: ");
break;
case 3:
std::string::assign(&v22, "Show Grid: ");
break;
case 4:
std::string::assign(&v22, "Object Info: ");
break;
case 5:
std::string::assign(&v22, "Show Ground: ");
break;
case 6:
std::string::assign(&v22, "Preview Shaders: ");
break;
case 7:
std::string::assign(&v22, "Preview Particles: ");
break;
case 8:
std::string::assign(&v22, "Preview Anims: ");
break;
case 9:
std::string::assign(&v22, "Preview Mode: ");
break;
case 10:
std::string::assign(&v22, "Hide Invisible: ");
break;
case 11:
std::string::assign(&v22, "Show Hitboxes: ");
break;
case 12:
std::string::assign(&v22, "Effect Lines: ");
break;
case 13:
std::string::assign(&v22, "Duration Lines: ");
break;
case 14:
std::string::assign(&v22, "Song Guidelines: ");
break;
case 15:
std::string::assign(&v22, "BPM Lines: ");
break;
case 17:
std::string::assign(&v22, "Local Markers: ");
break;
case 18:
std::string::assign(&v22, "Global Markers: ");
break;
case 19:
std::string::assign(&v22, "Marker Labels: ");
break;
case 20:
std::string::assign(&v22, "LDM: ");
break;
case 21:
std::string::assign(&v22, "Live Trace In: ");
break;
case 22:
std::string::assign(&v22, "Live Trace Out: ");
break;
default:
break;
}
if ( (v22 & 1) != 0 )
{
if ( !v23 )
{
LABEL_19:
operator delete(v24);
return 1;
}
}
else if ( !((int)(unsigned __int8)v22 >> 1) )
{
return 1;
}
if ( (unsigned __int8)EditorUI::getViewButtonState(this, v19) )
std::string::append((__int64)&v22, "On", 2u);
else
std::string::append((__int64)&v22, "Off", 3u);
v10 = (char *)&v22 + 1;
if ( (v22 & 1) != 0 )
v10 = (const char *)v24;
v18 = (char *)v10;
v25[0] = 0;
v25[1] = 0;
v26 = nullptr;
v11 = strlen(v10);
std::string::__init(v25, v18, v11);
v27 = 0;
v28 = 0;
v29 = nullptr;
std::string::__init(&v27, "chatFont.fnt", 0xCu);
v12 = TextAlertPopup::create((char *)v25, 100, (char *)&v27, 0.6, 0.6);
if ( (v27 & 1) != 0 )
operator delete(v29);
if ( (v25[0] & 1) != 0 )
operator delete(v26);
TextAlertPopup::setLabelColor(v12, 65280);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, 0.0, 1.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v21, 20.0, -20.0);
TextAlertPopup::setAlertPosition(v12, &v20, &v21);
(*(void (__fastcall **)(EditorUI *, __int64, __int64))(*(_QWORD *)this + 464LL))(this, v12, 100);
if ( (v22 & 1) == 0 )
return 1;
goto LABEL_19;
}
v27 = 0;
v28 = 0;
v29 = nullptr;
std::string::__init(&v27, "Stop Playtest First.", 0x14u);
EditorUI::showTextAlert((__int64)this, (__int64)&v27, 0, 1, 0);
if ( (v27 & 1) != 0 )
operator delete(v29);
return 0;
}