summaryrefslogtreecommitdiff
path: root/anim/src/words.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/words.zig')
-rw-r--r--anim/src/words.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/anim/src/words.zig b/anim/src/words.zig
index bec5116..134b42f 100644
--- a/anim/src/words.zig
+++ b/anim/src/words.zig
@@ -22,6 +22,8 @@ const t = theme.color.text;
pub const Clock = struct {
cursor: Cursor,
box: Rect = .{ .x = theme.canvas.stage.x, .y = theme.canvas.clock_y - 12, .w = theme.canvas.stage.w, .h = 24 },
+ /// The map, drawn small under the clock's right end: the minimap.
+ map: ?*const @import("map.zig").Map = null,
pub fn draw(k: *const Clock, f: *sk.Frame, at: anim.Placed) void {
const u = fixed(f, at, 0);
@@ -58,13 +60,15 @@ pub const Clock = struct {
const size = theme.size.mono.context;
const base = c.clock_y + 28;
const count = u.print("moment {d} of {d}", .{ counted -| now.way[0], now.way[1] -| now.way[0] });
- const count_x = stage.x + stage.w - u.width(.mono, size, count);
+ // Ranged right left of the minimap.
+ const count_x = (if (k.map != null) theme.minimap.count_end else stage.x + stage.w) - u.width(.mono, size, count);
u.text(.mono, size, count_x, base, count, t.faint);
// Secondary action: the pace, said quietly. It only fades.
if (now.hurried > 0) {
const steps = if (now.of > 0) u.print("step {d} of {d}", .{ now.count, now.of }) else u.print("step {d}", .{now.count});
u.faded(now.hurried).text(.mono, size, count_x - u.width(.mono, size, steps) - 3 * ui.advance(size), base, steps, t.dim);
}
+ if (k.map) |m| if (m.settled(at)) @import("map.zig").minimap(m, f, at);
}
};
@@ -195,7 +199,7 @@ pub const Legend = struct {
u.label(.mono_bold, size, r, .center, "rip", theme.mark(.current).on_solid);
},
.written, .changed => for ([_]Rect{ half, other }, [_][]const u8{ "2a", "00" }) |cell, digits| {
- const ink = u.cellWritten(cell, if (entry == .written) .{ .level = 1, .solid = 1 } else .ember, theme.color.raised);
+ const ink = u.cellWritten(cell, if (entry == .written) .struck else .ember, theme.color.raised);
u.label(ink.face, size, cell, .center, digits, ink.ink);
},
.read => for ([_]Rect{ half, other }, [_][]const u8{ "2a", "00" }) |cell, digits| {