this.svg.append(this.call_control);
const call_control_label = document.createElementNS(svgns, "text");
- const call_control_text = document.createTextNode("Call");
- call_control_label.append(call_control_text);
+ this.call_control_text = document.createTextNode("Call");
+ call_control_label.append(this.call_control_text);
call_control_label.setAttribute("x", "385");
call_control_label.setAttribute("y", "470");
call_control_label.classList.add("call-control-label");
}
redraw_players() {
- this.fold_control.classList.toggle("active", this.active === this.username);
+ this.fold_control.classList.toggle("active", this.active === this.username && this.chips_to_call() > 0);
this.call_control.classList.toggle("active", this.active === this.username);
+ this.call_control_text.textContent = this.active === this.username && this.chips_to_call() == 0 ? "Check" : "Call";
this.bet_control.classList.toggle("active", this.active === this.username);
for (const [username, [user, stack, active, bet]] of this.user_icons) {
if (!this.seats.has(username)) {