feat: make text gray if it has no command
parent
6d7c4d8b74
commit
527c3aa0ce
10
src/main.zig
10
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;
|
||||
|
|
Loading…
Reference in New Issue