//
// EditorUI::keyDown from 0x1000503a0 to 0x100051251 (3761 bytes)
//
// 2 xrefs:
// > sub_100051600 @ 0x10005160c
// > ??> @ 0x1008b0560
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// local variable allocation has failed, the output may be wrong!
void __fastcall EditorUI::keyDown(EditorUI *a1, cocos2d::enumKeyCodes a2, double a3)
{
cocos2d::enumKeyCodes v3; // r14d
double v4; // xmm0_8
LevelEditorLayer *m_editorLayer; // rax
LevelEditorLayer **p_m_editorLayer; // r13
char v7; // cl
cocos2d::CCDirector *v8; // rax
cocos2d::CCDirector *v9; // rax
cocos2d::CCDirector *v10; // rax
cocos2d::CCDirector *v11; // rax
EditCommand v12; // esi
cocos2d::CCDirector *v13; // rax
cocos2d::CCDirector *v14; // rax
cocos2d::CCDirector *v15; // rax
cocos2d::CCArray *SelectedObjects; // rax
UndoObject *v17; // rax
cocos2d::CCDirector *v18; // rax
cocos2d::CCDirector *v19; // rax
cocos2d::CCDirector *v20; // rax
cocos2d::CCDirector *v21; // rax
cocos2d::CCDirector *v22; // rsi
cocos2d::CCDirector *v23; // rax
double v24; // xmm0_8
cocos2d::CCString *v25; // rax
const char *CString; // rax
cocos2d::CCDirector *v27; // rax
CCMenuItemSpriteExtra *m_buildModeBtn; // rsi
GameManager *v29; // rax
GameManager *v30; // rax
bool GameVariable; // r15
cocos2d::CCDirector *v32; // rax
__int64 v33; // rax
cocos2d::CCLayer *m_objectLayer; // r15
cocos2d::CCDirector *v35; // rax
cocos2d::CCDirector *v36; // rax
cocos2d::CCDirector *v37; // rax
float v38; // xmm1_4
GameManager *v39; // rax
GameManager *v40; // rax
GameManager *v41; // rax
bool v42; // r15
GameManager *v43; // rax
GameManager *v44; // rax
GameManager *v45; // rax
GameManager *v46; // rax
GameManager *v47; // rax
GameManager *v48; // rax
const std::string::value_type *v49; // rsi
LevelEditorLayer *v50; // rax
GameObject *m_selectedObject; // rdx
GameObject *v52; // rcx
bool v53; // r15
char v54; // r12
LevelEditorLayer *v55; // rax
__int16 m_currentLayer; // dx
cocos2d::CCDirector *v57; // rax
cocos2d::CCDirector *v58; // rax
__int64 v59; // rax
cocos2d::CCDirector *v60; // rax
cocos2d::CCDirector *v61; // rax
double v62; // xmm0_8
__int64 v63; // rax
cocos2d::CCDirector *v64; // rsi
double v65; // xmm0_8
__int64 v66; // rax
cocos2d::CCDirector *v67; // rax
__int64 v68; // rax
LevelEditorLayer *v69; // rax
GameObject *v70; // rdx
GameObject *v71; // rcx
const char *data; // rsi
TextAlertPopup *v73; // r15
cocos2d::CCPoint v74; // [rsp+0h] [rbp-130h] BYREF
void *v75[3]; // [rsp+8h] [rbp-128h] BYREF
void *v76[3]; // [rsp+20h] [rbp-110h] BYREF
void *v77[3]; // [rsp+38h] [rbp-F8h] BYREF
void *v78[3]; // [rsp+50h] [rbp-E0h] BYREF
void *v79[3]; // [rsp+68h] [rbp-C8h] BYREF
void *v80[3]; // [rsp+80h] [rbp-B0h] BYREF
void *v81[3]; // [rsp+98h] [rbp-98h] BYREF
__int128 v82; // [rsp+B0h] [rbp-80h] BYREF
void *v83; // [rsp+C0h] [rbp-70h]
float v84[2]; // [rsp+D0h] [rbp-60h] BYREF
double v85; // [rsp+D8h] [rbp-58h]
float v86; // [rsp+E0h] [rbp-50h] BYREF
float v87; // [rsp+E4h] [rbp-4Ch]
float v88; // [rsp+E8h] [rbp-48h]
float v89; // [rsp+ECh] [rbp-44h]
std::string v90[2]; // [rsp+F0h] [rbp-40h] BYREF
v85 = a3;
v3 = a2;
ftime((timeb *)v90);
v4 = (double)(LOWORD(v90[0].__r_.__value_.__r.__words[1]) + 1000 * (*(_DWORD *)&v90[0].__r_.__value_.__l.0 & 0xFFFFF))
/ 1000.0;
a1->m_keyTime = v4;
if ( a2 == KEY_Space )
{
if ( a1->m_pressedSpace )
return;
a1->m_pressedSpace = 1;
m_editorLayer = a1->m_editorLayer;
if ( m_editorLayer->m_playbackMode != Playing )
{
p_m_editorLayer = &a1->m_editorLayer;
LABEL_5:
v7 = 0;
LABEL_6:
switch ( a2 )
{
case KEY_A:
v11 = cocos2d::CCDirector::sharedDirector();
v12 = 4
* (*(unsigned __int8 *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v11->getKeyboardDispatcher)(v11)
+ 88)
^ 1)
+ 1;
LABEL_27:
EditorUI::moveObjectCall_1(a1, v12);
return;
case KEY_E:
v10 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v10->getKeyboardDispatcher)(v10) + 90) == 1 )
EditorUI::transformObjectCall_1(a1, FlipY);
else
EditorUI::transformObjectCall_1(a1, RotateCW);
return;
case KEY_Q:
v8 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v8->getKeyboardDispatcher)(v8) + 90) == 1 )
EditorUI::transformObjectCall_1(a1, FlipX);
else
EditorUI::transformObjectCall_1(a1, RotateCCW);
return;
}
if ( !v7 )
{
switch ( a2 )
{
case KEY_Enter:
v57 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v57->getKeyboardDispatcher)(v57) + 89) != 1 )
goto LABEL_118;
if ( a1->m_touchID == -1 )
EditorUI::onPlayback(a1, *(cocos2d::CCObject **)&a2);
goto LABEL_113;
case KEY_Left:
v55 = a1->m_editorLayer;
m_currentLayer = 0;
if ( v55->m_currentLayer > 0 )
m_currentLayer = v55->m_currentLayer;
v55->m_currentLayer = m_currentLayer - 1;
goto LABEL_122;
case KEY_Right:
++a1->m_editorLayer->m_currentLayer;
LABEL_122:
EditorUI::updateGroupIDLabel(a1);
return;
case KEY_F:
EditorUI::toggleFreeMove(a1, *(cocos2d::CCObject **)&a2);
return;
case KEY_G:
EditorUI::toggleSnap(a1, *(cocos2d::CCObject **)&a2);
return;
case KEY_R:
EditorUI::toggleEnableRotate(a1, *(cocos2d::CCObject **)&a2);
return;
case KEY_S:
v60 = cocos2d::CCDirector::sharedDirector();
v12 = 4
* (*(unsigned __int8 *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v60->getKeyboardDispatcher)(v60)
+ 88)
^ 1)
+ 4;
goto LABEL_27;
case KEY_W:
v61 = cocos2d::CCDirector::sharedDirector();
v12 = 4
* (*(unsigned __int8 *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v61->getKeyboardDispatcher)(v61)
+ 88)
^ 1)
+ 3;
goto LABEL_27;
case KEY_F1:
LODWORD(v85) = ((float (__fastcall *)(cocos2d::CCLayer *))a1->m_editorLayer->m_objectLayer->getScale)(a1->m_editorLayer->m_objectLayer);
v64 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v90);
v88 = *(float *)&v90[0].__r_.__value_.__l.0 * 0.5;
v89 = (float)(0.5 * a1->m_toolbarHeight) + (float)(*((float *)v90[0].__r_.__value_.__r.__words + 1) * 0.5);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCDirector *))a1->m_editorLayer->m_objectLayer->getPosition)(
a1->m_editorLayer->m_objectLayer,
v64);
sub_10028CC60(&v86);
sub_10028CBE0(v84, (float)(v88 - v86) / *(float *)&v85, (float)(v89 - v87) / *(float *)&v85);
v65 = sub_10028CC90();
sub_100030790(v76, "Preview Locked", v65);
sub_100030790(v77, "", v65);
v66 = TextAlertPopup::create(v76, 150, v77, 0.5, 0.60000002);
((void (__fastcall *)(EditorUI *, __int64, __int64))a1->addChild_0)(a1, v66, 100);
if ( ((__int64)v77[0] & 1) != 0 )
operator delete(v77[2]);
if ( ((__int64)v76[0] & 1) != 0 )
operator delete(v76[2]);
return;
case KEY_F2:
v62 = sub_10028CC90();
sub_100030790(v78, "Preview Unlocked", v62);
sub_100030790(v79, "", v62);
v63 = TextAlertPopup::create(v78, 150, v79, 0.5, 0.60000002);
((void (__fastcall *)(EditorUI *, __int64, __int64))a1->addChild_0)(a1, v63, 100);
if ( ((__int64)v79[0] & 1) != 0 )
operator delete(v79[2]);
if ( ((__int64)v78[0] & 1) != 0 )
operator delete(v78[2]);
return;
case KEY_F3:
case KEY_F4:
case KEY_F5:
case KEY_F6:
case KEY_F7:
case KEY_F8:
case KEY_F9:
*(_QWORD *)&a2 = "";
sub_100030790(v90, "", v4);
switch ( v3 )
{
case KEY_F3:
v29 = GameManager::sharedState();
GameManager::toggleGameVariable(v29, "0036");
LevelEditorLayer::updateEditorMode(*p_m_editorLayer);
v30 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v30, "0036");
std::string::assign(v90, "Preview Mode: ");
goto LABEL_95;
case KEY_F4:
v47 = GameManager::sharedState();
GameManager::toggleGameVariable(v47, "0137");
LevelEditorLayer::updatePreviewParticles(*p_m_editorLayer);
v48 = GameManager::sharedState();
v42 = GameManager::getGameVariable(v48, "0137");
std::string::assign(v90, "Particle Icons: ");
goto LABEL_94;
case KEY_F5:
v43 = GameManager::sharedState();
GameManager::toggleGameVariable(v43, "0045");
LevelEditorLayer::updateOptions(*p_m_editorLayer);
v44 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v44, "0045");
std::string::assign(v90, "Show Hitboxes: ");
goto LABEL_95;
case KEY_F6:
v45 = GameManager::sharedState();
GameManager::toggleGameVariable(v45, "0121");
v46 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v46, "0121");
std::string::assign(v90, "Hide Invisible: ");
goto LABEL_95;
case KEY_F7:
v39 = GameManager::sharedState();
*(_QWORD *)&a2 = "0097";
if ( !GameManager::getGameVariable(v39, "0097") )
goto LABEL_103;
v40 = GameManager::sharedState();
GameManager::toggleGameVariable(v40, "0180");
v41 = GameManager::sharedState();
v42 = GameManager::getGameVariable(v41, "0180");
a1->m_linkControlsDisabled = v42;
EditorUI::updateButtons(a1);
std::string::assign(v90, "Link Mode: ");
LABEL_94:
GameVariable = !v42;
LABEL_95:
if ( GameVariable )
goto LABEL_96;
goto LABEL_146;
case KEY_F8:
if ( (unsigned int)sub_100720070(a1->m_selectedObjects) )
goto LABEL_103;
v50 = a1->m_editorLayer;
m_selectedObject = a1->m_selectedObject;
v52 = nullptr;
if ( m_selectedObject )
{
v53 = v50->m_traceInObject == m_selectedObject;
if ( v50->m_traceInObject != m_selectedObject )
v52 = a1->m_selectedObject;
}
else
{
v53 = 1;
}
v50->m_traceInObject = (EffectGameObject *)v52;
std::string::assign(v90, "Trace In: ");
goto LABEL_145;
case KEY_F9:
if ( (unsigned int)sub_100720070(a1->m_selectedObjects) )
{
LABEL_103:
v54 = 0;
}
else
{
v69 = a1->m_editorLayer;
v70 = a1->m_selectedObject;
v53 = 1;
if ( !v70 || v69->m_traceOutObject == v70 )
{
v71 = nullptr;
}
else
{
v71 = nullptr;
v53 = v70->m_classType != Effect;
if ( v70->m_classType == Effect )
v71 = a1->m_selectedObject;
}
v69->m_traceOutObject = (EffectGameObject *)v71;
std::string::assign(v90, "Trace Out: ");
LABEL_145:
(*p_m_editorLayer)->m_unk3b22 = 1;
if ( v53 )
LABEL_146:
v49 = "Off";
else
LABEL_96:
v49 = "On";
std::string::append(v90, v49);
if ( (*(_BYTE *)&v90[0].__r_.__value_.__s.0 & 1) != 0 )
data = v90[0].__r_.__value_.__l.__data_;
else
data = v90[0].__r_.__value_.__s.__data_;
sub_100030790(v80, data, v4);
sub_100030790(v81, "chatFont.fnt", v4);
v73 = (TextAlertPopup *)TextAlertPopup::create(v80, 100, v81, 0.60000002, 0.60000002);
if ( ((__int64)v81[0] & 1) != 0 )
operator delete(v81[2]);
if ( ((__int64)v80[0] & 1) != 0 )
operator delete(v80[2]);
TextAlertPopup::setLabelColor(v73, (cocos2d::ccColor3B)65280);
sub_10028CBE0(&v86, 0.0, 1.0);
sub_10028CBE0(v84, 20.0, -20.0);
TextAlertPopup::setAlertPosition(v73, (cocos2d::CCPoint)1101004800LL, (cocos2d::CCPoint)3248488448LL);
v54 = 1;
*(_QWORD *)&a2 = v73;
((void (__fastcall *)(EditorUI *, TextAlertPopup *, __int64))a1->addChild_0)(a1, v73, 100);
}
if ( (*(_BYTE *)&v90[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(v90[0].__r_.__value_.__l.__data_);
if ( !v54 )
return;
goto LABEL_13;
}
default:
LABEL_118:
v58 = cocos2d::CCDirector::sharedDirector();
v59 = ((__int64 (__fastcall *)(cocos2d::CCDirector *))v58->getKeyboardDispatcher)(v58);
if ( a2 == KEY_Up && *(_BYTE *)(v59 + 90) )
{
EditorUI::onTargetIDChange(a1, 1);
return;
}
v67 = cocos2d::CCDirector::sharedDirector();
v68 = ((__int64 (__fastcall *)(cocos2d::CCDirector *))v67->getKeyboardDispatcher)(v67);
if ( a2 != KEY_Down || !*(_BYTE *)(v68 + 90) )
goto LABEL_13;
EditorUI::onTargetIDChange(a1, -1);
break;
}
return;
}
v13 = cocos2d::CCDirector::sharedDirector();
*(_QWORD *)&a2 = 4
* (*(unsigned __int8 *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v13->getKeyboardDispatcher)(v13)
+ 88)
^ 1u)
+ 2;
EditorUI::moveObjectCall_1(a1, (EditCommand)a2);
goto LABEL_13;
}
goto LABEL_12;
}
m_editorLayer = a1->m_editorLayer;
if ( m_editorLayer->m_playbackMode != Playing )
{
p_m_editorLayer = &a1->m_editorLayer;
switch ( a2 )
{
case KEY_C:
v9 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v9->getKeyboardDispatcher)(v9) + 89) != 1 )
goto LABEL_5;
EditorUI::doCopyObjects(a1, 0);
return;
case KEY_D:
v15 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v15->getKeyboardDispatcher)(v15) + 90) == 1 )
{
if ( a1->m_selectedObject || (unsigned int)sub_100720070(a1->m_selectedObjects) )
{
SelectedObjects = EditorUI::getSelectedObjects(a1);
v17 = UndoObject::createWithArray(SelectedObjects, Select);
v17->m_redo = 0;
LevelEditorLayer::addToUndoList(a1->m_editorLayer, v17, 0);
}
EditorUI::deselectAll(a1);
}
else
{
v32 = cocos2d::CCDirector::sharedDirector();
v33 = ((__int64 (__fastcall *)(cocos2d::CCDirector *))v32->getKeyboardDispatcher)(v32);
v7 = 1;
if ( *(_BYTE *)(v33 + 89) != 1 )
goto LABEL_6;
EditorUI::onDuplicate(a1, *(cocos2d::CCObject **)&a2);
}
return;
case KEY_V:
v14 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v14->getKeyboardDispatcher)(v14) + 89) != 1 )
goto LABEL_5;
EditorUI::doPasteObjects(a1, 0);
return;
case KEY_Z:
v18 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v18->getKeyboardDispatcher)(v18) + 89) == 1
&& (v19 = cocos2d::CCDirector::sharedDirector(),
*(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v19->getKeyboardDispatcher)(v19) + 88) == 1) )
{
LevelEditorLayer::redoLastAction(a1->m_editorLayer);
}
else
{
v27 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v27->getKeyboardDispatcher)(v27) + 89) != 1 )
goto LABEL_5;
LevelEditorLayer::undoLastAction(a1->m_editorLayer);
}
EditorUI::updateButtons(a1);
if ( ((unsigned __int8 (__fastcall *)(GJRotationControl *))a1->m_rotationControl->isVisible)(a1->m_rotationControl) )
{
a1->m_canActivateControls = 1;
EditorUI::activateRotationControl(a1, *(cocos2d::CCObject **)&a2);
}
EditorUI::updateObjectInfoLabel(a1);
((void (__fastcall *)(EditorUI *))a1->updateScaleControl)(a1);
return;
default:
if ( (unsigned int)(a2 - 48) > 9
|| (v20 = cocos2d::CCDirector::sharedDirector(),
!*(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v20->getKeyboardDispatcher)(v20) + 89))
&& (v21 = cocos2d::CCDirector::sharedDirector(),
*(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v21->getKeyboardDispatcher)(v21) + 90) != 1) )
{
v7 = 0;
if ( a2 <= KEY_LaunchApp2 )
{
switch ( a2 )
{
case '.':
goto LABEL_77;
case '/':
case '0':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '<':
case '=':
case '>':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
goto LABEL_6;
case '1':
m_buildModeBtn = a1->m_buildModeBtn;
goto LABEL_80;
case '2':
m_buildModeBtn = a1->m_editModeBtn;
goto LABEL_80;
case '3':
m_buildModeBtn = a1->m_deleteModeBtn;
LABEL_80:
EditorUI::toggleMode(a1, m_buildModeBtn);
return;
case 'T':
v36 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v36->getKeyboardDispatcher)(v36) + 89) == 1 )
EditorUI::activateTransformControl(a1, *(cocos2d::CCObject **)&a2);
else
EditorUI::toggleSwipe(a1, *(cocos2d::CCObject **)&a2);
return;
default:
if ( a2 != KEY_Backspace )
goto LABEL_6;
LABEL_77:
EditorUI::onDeleteSelected(a1, *(cocos2d::CCObject **)&a2);
goto LABEL_13;
}
}
if ( a2 == KEY_OEMPlus )
{
v37 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v37->getKeyboardDispatcher)(v37) + 88) == 1 )
{
EditorUI::zoomIn(a1, *(cocos2d::CCObject **)&a2);
return;
}
v38 = -10.0;
}
else
{
if ( a2 != KEY_OEMMinus )
goto LABEL_6;
v35 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v35->getKeyboardDispatcher)(v35) + 88) == 1 )
{
EditorUI::zoomOut(a1, *(cocos2d::CCObject **)&a2);
return;
}
v38 = 10.0;
}
sub_10028CBE0(v90, 0.0, v38);
EditorUI::moveGamelayer(a1, 0);
return;
}
v88 = ((float (__fastcall *)(cocos2d::CCLayer *))a1->m_editorLayer->m_objectLayer->getScale)(a1->m_editorLayer->m_objectLayer);
v22 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v86);
v89 = v86 * 0.5;
*(float *)&v85 = (float)(0.5 * a1->m_toolbarHeight) + (float)(v87 * 0.5);
v23 = cocos2d::CCDirector::sharedDirector();
if ( *(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *, cocos2d::CCDirector *))v23->getKeyboardDispatcher)(
v23,
v22)
+ 89) != 1 )
{
*(_QWORD *)&a2 = *p_m_editorLayer;
LevelEditorLayer::getSavedEditorPosition((LevelEditorLayer *)v90, (int)*p_m_editorLayer);
if ( *(float *)&v90[0].__r_.__value_.__l.0 != 0.0 || *((float *)v90[0].__r_.__value_.__r.__words + 1) != 0.0 )
{
m_objectLayer = (*p_m_editorLayer)->m_objectLayer;
sub_10028CBE0(
v84,
v89 - (float)(*(float *)&v90[0].__r_.__value_.__l.0 * v88),
*(float *)&v85 - (float)(*((float *)v90[0].__r_.__value_.__r.__words + 1) * v88));
*(_QWORD *)&a2 = v84;
((void (__fastcall *)(cocos2d::CCLayer *, float *))m_objectLayer->setPosition)(m_objectLayer, v84);
}
goto LABEL_13;
}
((void (__fastcall *)(cocos2d::CCLayer *))(*p_m_editorLayer)->m_objectLayer->getPosition)((*p_m_editorLayer)->m_objectLayer);
sub_10028CC60(v84);
*(_QWORD *)&v24 = LODWORD(v89);
*(float *)&v24 = (float)(v89 - v84[0]) / v88;
sub_10028CBE0(&v74, *(float *)&v24, (float)(*(float *)&v85 - v84[1]) / v88);
LevelEditorLayer::saveEditorPosition(*p_m_editorLayer, &v74, v3 - 48);
v25 = (cocos2d::CCString *)sub_1007AB580("Position %i saved.", SLOBYTE(v74.x));
CString = cocos2d::CCString::getCString(v25);
sub_100030790(v90, CString, v24);
if ( (*(_BYTE *)&v90[0].__r_.__value_.__s.0 & 1) != 0 )
{
sub_100006B70(&v82, v90[0].__r_.__value_.__l.__data_, v90[0].__r_.__value_.__l.__size_, v24);
}
else
{
v83 = v90[0].__r_.__value_.__l.__data_;
v24 = *(double *)v90[0].__r_.__value_.__r.__words;
v82 = *(_OWORD *)&v90[0].__r_.__value_.__l.0;
}
sub_100030790(v75, "", v24);
*(_QWORD *)&a2 = TextAlertPopup::create(&v82, 150, v75, 0.5, 0.60000002);
((void (__fastcall *)(EditorUI *, _QWORD, __int64))a1->addChild_0)(a1, *(_QWORD *)&a2, 100);
if ( ((__int64)v75[0] & 1) != 0 )
{
operator delete(v75[2]);
if ( (v82 & 1) == 0 )
{
LABEL_71:
if ( (*(_BYTE *)&v90[0].__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_13;
LABEL_75:
operator delete(v90[0].__r_.__value_.__l.__data_);
goto LABEL_13;
}
}
else if ( (v82 & 1) == 0 )
{
goto LABEL_71;
}
operator delete(v83);
if ( (*(_BYTE *)&v90[0].__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_13;
goto LABEL_75;
}
}
LABEL_12:
*(_QWORD *)&a2 = (unsigned int)a2;
((void (__fastcall *)(UILayer *, _QWORD, double))m_editorLayer->m_uiLayer->keyDown)(
m_editorLayer->m_uiLayer,
(unsigned int)a2,
v85);
LABEL_13:
if ( v3 > (KEY_OEM3|KEY_Zero|0x300) )
{
if ( v3 != CONTROLLER_Start )
{
if ( v3 != CONTROLLER_Back )
{
LABEL_16:
if ( v3 == KEY_Space )
a1->m_spaceSwiping = 1;
return;
}
LABEL_23:
EditorUI::onPause(a1, *(cocos2d::CCObject **)&a2);
return;
}
}
else if ( v3 != KEY_Enter )
{
if ( v3 != KEY_Escape )
goto LABEL_16;
goto LABEL_23;
}
LABEL_113:
if ( ((unsigned __int8 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_playtestStopBtn->isVisible)(a1->m_playtestStopBtn) )
{
EditorUI::onStopPlaytest(a1, *(cocos2d::CCObject **)&a2);
}
else if ( a1->m_touchID == -1 )
{
EditorUI::onPlaytest(a1, nullptr);
}
}