Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b3a7dc09d |
@@ -2140,11 +2140,10 @@ body.hasActionBar #toastHost {
|
|||||||
whole phone width to work with, so everything grows to thumb size — and
|
whole phone width to work with, so everything grows to thumb size — and
|
||||||
every field goes to 16px, below which iOS zooms the page on focus and the
|
every field goes to 16px, below which iOS zooms the page on focus and the
|
||||||
dealer has to pinch back out mid-hand. */
|
dealer has to pinch back out mid-hand. */
|
||||||
.seatEditorForm .seatNameInput,
|
/* Every text or number field in the form, rather than a list of the ones that
|
||||||
.seatEditorForm .amountOverrideInput,
|
existed when this was written. The stack field was added later and sat at 28px
|
||||||
.seatEditorForm .chipCountInput,
|
next to its 44px neighbours precisely because it wasn't on that list. */
|
||||||
.seatEditorForm .customFieldLabel,
|
.seatEditorForm input:not([type="checkbox"]):not([type="color"]) {
|
||||||
.seatEditorForm .customFieldValue {
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
min-height: 44px;
|
min-height: 44px;
|
||||||
padding: 0.4rem 0.6rem;
|
padding: 0.4rem 0.6rem;
|
||||||
@@ -2208,6 +2207,77 @@ body.hasActionBar #toastHost {
|
|||||||
margin-top: 0.4rem;
|
margin-top: 0.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The sidebar's own controls never got the touch pass the seat form did — these
|
||||||
|
are settings a dealer changes at the table, on the same phone. Written against
|
||||||
|
the panel rather than each field, so a setting added later inherits it. */
|
||||||
|
.panelBody input:not([type="checkbox"]):not([type="color"]),
|
||||||
|
.subPanelBody input:not([type="checkbox"]):not([type="color"]),
|
||||||
|
.panelBody select {
|
||||||
|
font-size: 16px;
|
||||||
|
min-height: 44px;
|
||||||
|
padding: 0.4rem 0.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panelBody .holdemBtnSmall,
|
||||||
|
.handHistoryActions .holdemBtn {
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Destructive and tiny is the worst combination: these delete a chip colour or a
|
||||||
|
custom field, and were 28px wide. */
|
||||||
|
.removeChipColorBtn,
|
||||||
|
.removeFieldBtn {
|
||||||
|
min-width: 44px;
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* flex-shrink would take a stated width straight back off again in a row this
|
||||||
|
narrow, which is why it stayed 32px wide with the height applied. */
|
||||||
|
.chipColorInput {
|
||||||
|
flex: none;
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A bare checkbox can't grow into a target, but the row it sits in can — the
|
||||||
|
label is what a tap actually lands on. */
|
||||||
|
.panelBody .fieldRow {
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A bare checkbox with no label box around it to grow. */
|
||||||
|
#dedicatedDealerToggle {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* An underlined word is a 14px-tall target; give it room without making it look
|
||||||
|
like a button. */
|
||||||
|
.linkBtn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 44px;
|
||||||
|
padding: 0 0.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The dealer button has to stay a 22px disc — it's a chip sitting on a seat, and
|
||||||
|
drawing it thumb-sized would swallow the puck. So the disc keeps its size and
|
||||||
|
an invisible pad around it takes the tap. It reaches outward, away from the
|
||||||
|
puck's own tap target, so pressing the seat still opens the seat. */
|
||||||
|
.dealerChip::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dealerChip {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
.toastAction {
|
.toastAction {
|
||||||
min-height: 44px;
|
min-height: 44px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,19 +184,9 @@ const Betting = {
|
|||||||
|
|
||||||
const nextStreetIndex = this.STREETS.indexOf(state.street || "preflop") + 1;
|
const nextStreetIndex = this.STREETS.indexOf(state.street || "preflop") + 1;
|
||||||
state.street = this.STREETS[nextStreetIndex] || "river";
|
state.street = this.STREETS[nextStreetIndex] || "river";
|
||||||
|
state.actingSeatIndex = this.liveSeats(state).length > 1
|
||||||
if (this.liveSeats(state).length <= 1) {
|
? this.nextLiveIndex(state, state.dealerSeatIndex)
|
||||||
state.actingSeatIndex = null;
|
: null;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// After the flop the first live player left of the button acts — which heads-up
|
|
||||||
// is the big blind, since the button is the small blind. Naming the big blind
|
|
||||||
// directly also covers a button parked on a seat nobody is sitting in.
|
|
||||||
const { bbIndex, headsUp } = HoldemState.getBlindSeats(state);
|
|
||||||
state.actingSeatIndex = headsUp && bbIndex !== null && !state.seats[bbIndex].folded
|
|
||||||
? bbIndex
|
|
||||||
: this.nextLiveIndex(state, state.dealerSeatIndex);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
isHandOver(state) {
|
isHandOver(state) {
|
||||||
@@ -217,23 +207,15 @@ const Betting = {
|
|||||||
|
|
||||||
const sb = Number(state.smallBlind) || 0;
|
const sb = Number(state.smallBlind) || 0;
|
||||||
const bb = Number(state.bigBlind) || 0;
|
const bb = Number(state.bigBlind) || 0;
|
||||||
const { sbIndex, bbIndex, headsUp } = HoldemState.getBlindSeats(state);
|
const sbIndex = this.seatAt(state, state.dealerSeatIndex, 1);
|
||||||
|
const bbIndex = this.seatAt(state, state.dealerSeatIndex, 2);
|
||||||
|
|
||||||
if (sbIndex === null || bbIndex === null) {
|
if (sb > 0 && state.seats[sbIndex].inHand) this.putIn(state, sbIndex, sb);
|
||||||
state.currentBet = 0;
|
if (bb > 0 && state.seats[bbIndex].inHand) this.putIn(state, bbIndex, bb);
|
||||||
state.actingSeatIndex = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sb > 0) this.putIn(state, sbIndex, sb);
|
|
||||||
if (bb > 0) this.putIn(state, bbIndex, bb);
|
|
||||||
|
|
||||||
state.currentBet = this.round(Math.max(this.committed(state.seats[sbIndex]), this.committed(state.seats[bbIndex])));
|
state.currentBet = this.round(Math.max(this.committed(state.seats[sbIndex]), this.committed(state.seats[bbIndex])));
|
||||||
state.lastRaiseSize = bb || 0;
|
state.lastRaiseSize = bb || 0;
|
||||||
|
state.actingSeatIndex = this.nextLiveIndex(state, bbIndex);
|
||||||
// Heads-up the button is the small blind and acts first before the flop; with
|
|
||||||
// three or more it's the seat after the big blind.
|
|
||||||
state.actingSeatIndex = headsUp ? sbIndex : this.nextLiveIndex(state, bbIndex);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Winners get their share put back in front of them.
|
// Winners get their share put back in front of them.
|
||||||
|
|||||||
@@ -163,36 +163,10 @@ const HoldemState = {
|
|||||||
state.dealerSeatIndex = this.nextSeatIndex(state, state.dealerSeatIndex, 1);
|
state.dealerSeatIndex = this.nextSeatIndex(state, state.dealerSeatIndex, 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Seats dealt into this hand, in blind order starting from the seat after the
|
|
||||||
// button. Blinds follow the players, not the chairs — the seats immediately left
|
|
||||||
// of the button are empty often enough that counting chairs posts them to nobody.
|
|
||||||
liveOrderFromButton(state) {
|
|
||||||
const order = [];
|
|
||||||
for (let step = 1; step <= state.seatCount; step++) {
|
|
||||||
const index = this.nextSeatIndex(state, state.dealerSeatIndex, step);
|
|
||||||
if (state.seats[index].inHand) order.push(index);
|
|
||||||
}
|
|
||||||
return order;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Who posts what. Heads-up is its own rule: with two players the button posts the
|
|
||||||
// small blind, which is the opposite of the usual order.
|
|
||||||
getBlindSeats(state) {
|
getBlindSeats(state) {
|
||||||
const live = this.liveOrderFromButton(state);
|
const sbIndex = this.nextSeatIndex(state, state.dealerSeatIndex, 1);
|
||||||
const dealerIndex = state.dealerSeatIndex;
|
const bbIndex = this.nextSeatIndex(state, state.dealerSeatIndex, 2);
|
||||||
|
return { dealerIndex: state.dealerSeatIndex, sbIndex, bbIndex };
|
||||||
if (live.length < 2) {
|
|
||||||
return { dealerIndex, sbIndex: null, bbIndex: null, headsUp: false };
|
|
||||||
}
|
|
||||||
|
|
||||||
if (live.length === 2) {
|
|
||||||
const buttonIsPlaying = state.seats[dealerIndex].inHand;
|
|
||||||
const sbIndex = buttonIsPlaying ? dealerIndex : live[0];
|
|
||||||
const bbIndex = live.find(i => i !== sbIndex);
|
|
||||||
return { dealerIndex, sbIndex, bbIndex, headsUp: true };
|
|
||||||
}
|
|
||||||
|
|
||||||
return { dealerIndex, sbIndex: live[0], bbIndex: live[1], headsUp: false };
|
|
||||||
},
|
},
|
||||||
|
|
||||||
startNextHand(state) {
|
startNextHand(state) {
|
||||||
|
|||||||
Reference in New Issue
Block a user