ctm / mb2-doc

Mb2, poker software
https://devctm.com
7 stars 2 forks source link

Double Board placement on textual interface isn't usable #1284

Closed ctm closed 6 months ago

ctm commented 6 months ago

Make it so the double-board does not start out in the upper left hand corner in the textual interface

Even though the board is draggable, not everyone knows that.

ctm commented 6 months ago

The problem wasn't starting out in the upper-left. The problem is that "chowaha mode" was getting invoked and that causes the middle two rows (which are the rows that we use for Double Board Omaha) to be shifted upward.

"Chowaha mode" is a hack, but it works fine for what it does. It's just that I used to detect it by looking for more than three rows, but it wasn't actually counting the distinct number of rows, it was just looking at the maximum row used and that caused the Double Board to improperly invoke chowaha mode:

[double-board-text-1284]% git diff front-ends/web/src/action_tracker.rs
diff --git a/front-ends/web/src/action_tracker.rs b/front-ends/web/src/action_tracker.rs
index 33dcf974..a5785a50 100644
--- a/front-ends/web/src/action_tracker.rs
+++ b/front-ends/web/src/action_tracker.rs
@@ -1123,7 +1123,12 @@ impl ActionTracker {
             .map(|n| n + 1)
             .unwrap_or(0);

-        let chowaha_mode = n_rows > 3;
+        // chowaha_mode is a hack that is used to squash five rows
+        // into three by offsetting the middle two rows via the
+        // "selected" CSS attribute.  Currently, the only game where
+        // we have five rows is Chowaha and it needs chowaha_mode to
+        // work, so comparing n_rows to five is sufficient.
+        let chowaha_mode = n_rows == 5;

Deploying now.