// Copyright (c) 2008-2023 the Urho3D project // License: MIT #include "AppState_MainScreen.h" #include "AppStateManager.h" #include #include #include #include #include #include #include #include using namespace Urho3D; static const String MAIN_SCREEN_WINDOW_STR = "Main Screen Window"; static const String BENCHMARK_01_STR = "Benchmark 01"; static const String BENCHMARK_02_STR = "Benchmark 02"; static const String BENCHMARK_03_STR = "Benchmark 03"; static const String BENCHMARK_04_STR = "Benchmark 04"; void AppState_MainScreen::HandleButtonPressed(StringHash eventType, VariantMap& eventData) { Button* pressedButton = static_cast(eventData["Element"].GetPtr()); AppStateManager* appStateManager = GetSubsystem(); if (pressedButton->GetName() == BENCHMARK_01_STR) appStateManager->SetRequiredAppStateId(APPSTATEID_BENCHMARK01); else if (pressedButton->GetName() == BENCHMARK_02_STR) appStateManager->SetRequiredAppStateId(APPSTATEID_BENCHMARK02); else if (pressedButton->GetName() == BENCHMARK_03_STR) appStateManager->SetRequiredAppStateId(APPSTATEID_BENCHMARK03); else if (pressedButton->GetName() == BENCHMARK_04_STR) appStateManager->SetRequiredAppStateId(APPSTATEID_BENCHMARK04); } void AppState_MainScreen::CreateButton(const String& name, const String& text, Window& parent) { Button* button = parent.CreateChild