Skip to content

Commit

Permalink
Aligned handicap and rules
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed Feb 5, 2024
1 parent 641ae0a commit 764699c
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/views/Game/PlayerCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,6 @@ function komiString(komi: number) {
return komi > 0 ? `+ ${abs_komi}` : `- ${abs_komi}`;
}

function rulesParens(rules: string | null | undefined) {
const code = rulesCode(rules);
if (!code || !rules || code === rulesText(rules)) {
return "";
}
return " (" + code + ")";
}

function rulesAndHandicap(rules: string | null | undefined, handicap_stones: number | undefined) {
const stones = handicap_stones ? stonesString(handicap_stones) : "";
return (
Expand Down Expand Up @@ -528,17 +520,16 @@ function ScorePopup({ show, goban, color }: ScorePopupProps) {
<div className="score_breakdown">
{color === "black" && goban.engine.config.rules && (
<>
<div className="summary">
<div>
<span>
{_("Rules")}: {rulesText(goban.engine.config.rules)}
{rulesParens(goban.engine.config.rules)}
</span>
<div>{rulesCode(goban.engine.config.rules)}</div>
</div>
{!!goban.engine.handicap && (
<div className="summary">
<span>
{_("Handicap")}: {goban.engine.handicap}
</span>
<div>
<span>{_("Handicap")}</span>
<div>{goban.engine.handicap}</div>
</div>
)}
<hr />
Expand Down

0 comments on commit 764699c

Please sign in to comment.