feat(client): add liquid presentation and clearer cellular HUD
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m32s
Foundation / postgres-tools (push) Successful in 26s
Foundation / server-image (push) Successful in 4m11s
Foundation / image (push) Successful in 4m36s

This commit is contained in:
dingo
2026-10-22 09:08:03 -04:00
parent c43a3b0837
commit 8ce609d344
12 changed files with 596 additions and 94 deletions
+94 -4
View File
@@ -405,6 +405,7 @@ void cellular_panels(const std::filesystem::path& review) {
EnvironmentLayer environment;
OrganismLayer organisms;
CellularPlay play;
CHECK(organisms.accept(*population));
play.initialize(100);
play.connected();
network::CellularLifeDiagnostics diagnostics;
@@ -449,13 +450,24 @@ void cellular_panels(const std::filesystem::path& review) {
view.remote->region = 4;
// 2026-10-16 microscope view: patches as granules and cells, drawn under the HUD.
CellularScene scene;
scene.camera_centre = camera->centre();
for (int y = 100; y < height; y += 50)
for (int x = 40; x < width; x += 55)
scene.flows.push_back({static_cast<float>(x), static_cast<float>(y), 22, -10, 0.7F,
static_cast<std::uint32_t>(x + y)});
scene.patches.push_back({200, 200, 60, {50000, 100, 20, 10, 40}, false, false, 1});
scene.patches.push_back({400, 260, 60, {0, 90, 0, 8, 0}, true, false, 2});
scene.cells.push_back({300, 300, 24, 2.5F, 2, 3, true, false, false, 901});
scene.cells.push_back({440, 350, 34, 2.5F, 2, 3, true, false, false, 901});
scene.cells.push_back({500, 220, 14, 4.0F, 0, 2, false, true, false, 77});
// ADR-0136: a pool, a draining bubble, a still one and a pop draw under the HUD.
scene.deposits.push_back(
{620, 320, 50, {90000, 4000, 900, 300, 1200}, true, false, false, 5});
scene.deposits.push_back({600,
350,
65,
{90000000, 40000000, 9000000, 3000000, 12000000},
true,
false,
false,
5});
scene.deposits.push_back({360, 330, 4, {0, 52000, 0, 0, 0}, false, true, false, 6});
scene.deposits.push_back({380, 360, 4, {2000000, 0, 0, 0, 0}, false, false, false, 7});
scene.pops.push_back({400, 300, 4, 0.4F, 3});
@@ -477,8 +489,84 @@ void cellular_panels(const std::filesystem::path& review) {
auto* dock = ImGui::FindWindowByName("Actions");
CHECK(fits(vitals) && fits(dock) && fits(ImGui::FindWindowByName("##mode")));
CHECK(fits(ImGui::FindWindowByName("##mutation"))); // The offer callout.
CHECK(fits(ImGui::FindWindowByName("Nearby")));
const auto disjoint = [](const ImGuiWindow* a, const ImGuiWindow* b) {
return a->Pos.x + a->Size.x <= b->Pos.x || b->Pos.x + b->Size.x <= a->Pos.x ||
a->Pos.y + a->Size.y <= b->Pos.y || b->Pos.y + b->Size.y <= a->Pos.y;
};
CHECK(disjoint(vitals, dock) && disjoint(ImGui::FindWindowByName("Nearby"), dock));
if (width >= 880)
CHECK(fits(ImGui::FindWindowByName("Field notes")));
CHECK(fits(ImGui::FindWindowByName("Field notes")) &&
disjoint(vitals, ImGui::FindWindowByName("Field notes")));
// Minimize/restore stays local to the panel, including a same-batch click.
const auto toggle = [&](const char* name, bool& minimized) {
const auto* panel = ImGui::FindWindowByName(name);
CHECK(panel);
const float expanded = panel->Size.y;
const auto click_heading = [&] {
const float x =
panel->Pos.x + panel->Size.x - ImGui::GetStyle().WindowPadding.x - 20;
const float y =
panel->Pos.y + ImGui::GetStyle().WindowPadding.y + ImGui::GetFrameHeight() / 2;
mouse(id, SDL_EVENT_MOUSE_MOTION, x, y);
mouse(id, SDL_EVENT_MOUSE_BUTTON_DOWN, x, y);
mouse(id, SDL_EVENT_MOUSE_BUTTON_UP, x, y);
CHECK(app->poll_events() && !app->take_navigation().click);
for (int i = 0; i < 3; ++i)
draw();
};
click_heading();
CHECK(minimized && panel->Size.y < expanded && fits(panel));
click_heading();
CHECK(!minimized && fits(panel));
};
toggle("Vitals", form.vitals_minimized);
toggle("Nearby", form.map_minimized);
if (width >= 880)
toggle("Field notes", form.notes_minimized);
mouse(id, SDL_EVENT_MOUSE_MOTION, 5, 5);
// A depleted channel vanishes independently. Stale observations retain the food
// silhouettes but never their fresh opacity. Inspect the world draw list, not HUD.
if (width == 960) {
const auto saved_scene = scene;
scene = {};
scene.deposits.push_back({450,
300,
70,
{10000000, 10000000, 10000000, 10000000, 10000000},
true,
false,
false,
5});
constexpr std::array colors{IM_COL32(255, 214, 107, 225), IM_COL32(201, 138, 91, 225),
IM_COL32(111, 183, 255, 225), IM_COL32(255, 127, 178, 225),
IM_COL32(184, 178, 196, 225)};
const auto has_color = [&](ImU32 color) {
const auto& vertices = ImGui::GetBackgroundDrawList()->VtxBuffer;
return std::any_of(vertices.begin(), vertices.end(),
[&](const ImDrawVert& vertex) { return vertex.col == color; });
};
draw();
for (auto color : colors)
CHECK(has_color(color));
for (std::size_t channel = 0; channel < colors.size(); ++channel) {
scene.deposits[0].stock[channel] = 0;
draw();
CHECK(!has_color(colors[channel]));
for (std::size_t remaining = channel + 1; remaining < colors.size(); ++remaining)
CHECK(has_color(colors[remaining]));
}
scene.deposits[0].stock.fill(10000000);
scene.deposits[0].stale = true;
scene.stale = true;
draw();
for (auto color : colors) {
CHECK(!has_color(color));
CHECK(has_color((color & ~IM_COL32_A_MASK) | (90U << IM_COL32_A_SHIFT)));
}
scene = saved_scene;
draw();
}
if (!review.empty()) {
std::filesystem::create_directories(review);
auto later = perception;
@@ -486,6 +574,8 @@ void cellular_panels(const std::filesystem::path& review) {
later.diagnostics->reserve_energy_pj -= 50;
play.observe(later);
view.cellular_feed_target = {{2000, 3000}};
for (int i = 0; i < 3; ++i)
draw();
CHECK(app->request_screenshot(
(review / ("cellular-" + std::to_string(width) + ".bmp")).string()));
draw();