From 527c3aa0ce58cd30ac68bb7c7a0d11e156c0b04e Mon Sep 17 00:00:00 2001 From: geemili Date: Thu, 29 Feb 2024 13:45:41 -0700 Subject: [PATCH] feat: make text gray if it has no command --- src/main.zig | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main.zig b/src/main.zig index 0a63850..489fcf2 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1009,7 +1009,9 @@ pub const TextElement = struct { const this: *@This() = @ptrCast(@alignCast(pointer)); _ = max; - const text_size = canvas.writeText(min, this.text, .{}); + const text_size = canvas.writeText(min, this.text, .{ + .color = if (this.command != null) .{ 0xFF, 0xFF, 0xFF, 0xFF } else .{ 0xAA, 0xAA, 0xAA, 0xFF }, + }); if (render_resources.hovered != null and this.command != null and std.mem.eql(u8, render_resources.hovered.?, this.command.?)) { canvas.rect( @@ -1195,13 +1197,7 @@ fn endOfTurnConfirmHandler(arena: std.mem.Allocator, request: Request) HandlerEr } } - var new_meld_text = try TextElement.create(arena, .{ - .text = "New Meld", - .command = null, - }); - var melds_hbox = try HBox.create(arena); - try melds_hbox.addElement(new_meld_text.element()); var draw_pile = try Pile.create(arena, request.game_state.draw_pile.items); draw_pile.hidden = true;