games: the sit button that never looked twice, and the phrase that ran off the phone
UNO synced its sit panel once, at boot, before the chip bar had said what you have. Land on the table with nothing, buy chips right there on the page, and Sit down stayed greyed out until you reloaded — the money came in and nothing looked at the button again. Getting up had the same shape: the panel came back last synced while the leave request was still in flight, so it came back dead. Every fresh view of the money now re-syncs the panel while you're off a table, and controls() re-syncs it whenever a request finishes — which is the moment getting up hands your stack back. Hangman's phrase was laid out at a fixed tile width and never broke inside a word, so a twelve-letter one was 475px of tiles in a 306px felt and took the whole page sideways with it. Tiles scale with the screen now, and a word breaks inside itself when it has to, with the gap between words kept several times the gap inside one so a break still reads as a break in the word. The keyboard was over the edge too — P, M and 9 were off the right of a phone and unclickable — so a key lays out at a width the narrowest screen can afford and grows into whatever room there is. Desktop is unchanged: same tile, same key, same felt. Claude-Session: https://claude.ai/code/session_01R7MuRkXEEGS564aFo5Rtjs
This commit is contained in:
@@ -390,6 +390,10 @@
|
||||
if (deckEl) deckEl.disabled = busy || !yours || drawn || stack;
|
||||
if (dealBtn) dealBtn.disabled = busy;
|
||||
if (leaveBtn) leaveBtn.disabled = busy;
|
||||
// With no table under you the sit panel is what's on screen, and Sit down is
|
||||
// the button that has to come back out of busy. Getting up hands your stack
|
||||
// back, so it is also affordable again the moment the request lands.
|
||||
if (!game) syncSit();
|
||||
}
|
||||
|
||||
function setPhase(v) {
|
||||
@@ -1045,13 +1049,19 @@
|
||||
|
||||
pickRules("normal");
|
||||
|
||||
// Every fresh view of the money re-syncs the sit panel, not just the first one.
|
||||
// Buying chips from the chip bar happens on this page, and a Sit down button
|
||||
// that was greyed out when you had nothing has to notice that you now have
|
||||
// something — otherwise the only way to sit down is to reload.
|
||||
G.onUpdate(function () { if (!game) syncSit(); });
|
||||
|
||||
var resumed = false;
|
||||
G.onUpdate(function () {
|
||||
if (resumed) return;
|
||||
resumed = true;
|
||||
G.refresh().then(function (v) {
|
||||
if (v && v.uno) { paint(v.uno); seated(); }
|
||||
else { paint(null); loadLobby(); syncSit(); }
|
||||
else { paint(null); loadLobby(); }
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user