AnotherDole / wrongest

The Wrongest Words
3 stars 0 forks source link

Start Screen improvements #7

Closed AhoyLemon closed 9 years ago

AhoyLemon commented 9 years ago
  1. "Start Game" should be disabled until you have three players in the room. Underneath the button...

    You need at least 3 players. Bug your friends!

  2. There needs to be a visible feedback div, (maybe a sibling of #roomDiv) that will display any problems with what you just did in trying to start a game, such as...

player names must be alphanumeric (don't ask why!)

etc.

I'm thinking right now about implementing this as a sort of toast message, so it will flash on screen, pause for a while, and then flash off. HTML syntax:

<ul id="SetupToasts">
  <li class="alert">Something terrible happened!</li>
  <li class="info">I'm not Dave.</li>
  <li class="success">I can't imagine why you'd have something terrific happen that would show up here but fuck I'm gonna build the CSS for it anyway.</li>
</ul>

I'm gonna set up the structure and see if I can build a hook for the extended ascii name thing, then we can use it as needed.

AhoyLemon commented 9 years ago

Okay, I've got a system for these toast messages that works out pretty well. I could't figure out where the logic that rejects certain player names was coming from, so I built a for-test-only function. If you name contains "bad", you'll get the alert message. "good" will get the success message, and "indif" will get the info message.

One caveat to note: When the toasts leave, they still take up space, because I wanted to be able to have multiple toasts display at the same time. So any time you fire a toast, you'll also need to add..

clearToast();

...which will tell it to wait until the animation is over, and then yank the HTML for the first li in the div.

AnotherDole commented 9 years ago

Just pushed 2 commits that should close this.

AhoyLemon commented 9 years ago

I agree, looks great.