void KeyPressed_FusionImageBox(FusionEngine::Control *control, const FusionEngine::IEventData &eventData) { if (GetWorld().GetCurrentLayout()->HasActiveTextBox() || GetWorld().GetCurrentLayout()->GetType() != FE_LAYOUT_GAME) { return; } char key = static_cast<const OnKeyPressedEvent&>(eventData).key; std::string objId = static_cast<const OnKeyPressedEvent&>(eventData).objectId; if (objId == control->GetName()) { size_t imageIdx = 0; const std::string validInputButtons = GetWorld().GetFusionInputValidButtons(); if (key == validInputButtons[0]) { imageIdx = 1; } else if (key == validInputButtons[1]) { imageIdx = 2; } else if (key == validInputButtons[2]) { imageIdx = 3; } else if (key == GetWorld().GetFusionInputSequenceEndButton()) { objId = "all"; } control->ChangeBackgroundImage(imageIdx); } if (objId == "all") { Layout *currentLayout = GetWorld().GetCurrentLayout(); currentLayout->GetControl("fusionOne")->ChangeBackgroundImage(0); currentLayout->GetControl("fusionTwo")->ChangeBackgroundImage(0); currentLayout->GetControl("fusionThree")->ChangeBackgroundImage(0); } }