Upgrade cellular client to v10 with readable play and assisted steering

This commit is contained in:
dingo
2026-10-14 19:53:28 -04:00
parent 75b8bbb333
commit 68958a9e54
21 changed files with 1603 additions and 93 deletions
+8 -6
View File
@@ -286,13 +286,15 @@ void toolkit_capture() {
int presses = 0;
bool text_focus = false;
std::array<char, 32> text{}, field{};
ImVec2 field_min{}, field_max{};
ImVec2 field_min{}, field_max{}, button_centre{};
app->set_overlay([&] {
ImGui::SetNextWindowPos({0, 0}, ImGuiCond_Always);
ImGui::SetNextWindowSize({150, 150}, ImGuiCond_Always);
ImGui::SetNextWindowSize({180, 190}, ImGuiCond_Always);
ImGui::Begin("panel", nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize);
if (ImGui::Button("Press", {130, 40}))
++presses;
const auto button_min = ImGui::GetItemRectMin(), button_max = ImGui::GetItemRectMax();
button_centre = {(button_min.x + button_max.x) / 2, (button_min.y + button_max.y) / 2};
ImGui::InputText("field", field.data(), field.size());
field_min = ImGui::GetItemRectMin();
field_max = ImGui::GetItemRectMax();
@@ -331,7 +333,7 @@ void toolkit_capture() {
// Over the widget: the button activates once, the world sees no click.
// The panel exists before the user clicks (as every application panel does).
CHECK(app->present(frame) == Step::rendered && app->present(frame) == Step::rendered);
CHECK(!click(60, 30) && presses == 1 && app->ui_wants_pointer());
CHECK(!click(button_centre.x, button_centre.y) && presses == 1 && app->ui_wants_pointer());
// Open world: a click is delivered once, then consumed.
const auto world = click(260, 200);
CHECK(world && world->x == 260 && world->y == 200 && presses == 1);
@@ -347,9 +349,9 @@ void toolkit_capture() {
// nothing and the widget still activates on the toolkit's next frames.
mouse(SDL_EVENT_MOUSE_MOTION, 260, 200);
CHECK(app->poll_events() && app->present(frame) == Step::rendered && !app->ui_wants_pointer());
mouse(SDL_EVENT_MOUSE_MOTION, 60, 30);
mouse(SDL_EVENT_MOUSE_BUTTON_DOWN, 60, 30);
mouse(SDL_EVENT_MOUSE_BUTTON_UP, 60, 30);
mouse(SDL_EVENT_MOUSE_MOTION, button_centre.x, button_centre.y);
mouse(SDL_EVENT_MOUSE_BUTTON_DOWN, button_centre.x, button_centre.y);
mouse(SDL_EVENT_MOUSE_BUTTON_UP, button_centre.x, button_centre.y);
CHECK(app->poll_events() && !app->take_navigation().click);
for (int i = 0; i < 5 && presses == 1; ++i)
CHECK(app->present(frame) == Step::rendered && app->poll_events());