Tuesday, December 18, 2012

Have It Your Way

I've just finished adding a new feature to Solitaire Till Dawn, one I've wanted since forever ago. I have a compulsive nature, and when I play cards to the foundations (the goal piles), I like to assign the suits to piles in this order: Hearts, Spades, Diamonds, Clubs. If it's a two-deck game then I like to double them, two by two: Hearts, Hearts, Spades, Spades, and so on. I want this enough that if an Ace is auto-played to the "wrong" pile, I will undo and then drag the offending card to the "right" pile before continuing. Of course it's easy enough to just do the dragging; but it would be even easier to just click the card and see it go straight to the right place!

I could have just hard-coded this behavior, but I never did that because I am sure that some of you have your own preferences in this, and they may differ from mine. I don't want to force my own baseless prejudices on any of you. Over the years I occasionally considered inventing a set of options for the Preference panel to give you some control over suit placement, but this always seemed like huge and confusing overkill, so I never did anything about it.

But I think I've finally got it sussed out, and my solution will be included in the new release. It is simply this: for each kind of solitaire that you play, Solitaire Till Dawn will remember which suit you put in each goal pile. After that, any automatically-moved cards of each suit will go to the same piles where you put them in prior games.

If you later decide you don't like that placement, all you have to do is place the cards by hand in whatever other piles you like, and Solitaire Till Dawn will remember your new choices from then on.

Very simple, and no need for any new controls or options in the Preferences window or anywhere else.  There's nothing you need to learn; it will just happen automagically. (And of course, if you just don't care where the Aces fall, you can ignore the whole business.)

I got this working today. Yay!

Thursday, December 13, 2012

Winner, Winner, Chicken Dinner

Just finished up the "you win" alert. This was not so complex as the All Statistics window, but it had its own little collection of picky details to get right: show on early win or not, according to your preferences; several relevant prefs checkboxes right there in the alert, for convenient access; and it will start a new game when you dismiss it, if you've selected that option.

Per ardua ad astra!

Sunday, December 9, 2012

The Clock is Ticking

Last time, I wrote that the "All Statistics" window was nearly complete, and that I was working on the clock. Like the All Stats window, the clock is more complex than you'd expect. It needs to pause when Solitaire Till Dawn is not the frontmost application, resume when you come back to the game, and stop when the game is won. It needs to save the current time when you quit, and restore it when you open Solitaire Till Dawn again. It needs to know whether you want the clock to be running at all; and when you change your mind and turn it on, it needs to wait until you start a new game before it begins keeping time: no fair starting the clock from zero in the middle of your current game!

And of course, it needs to display and update correctly; and statistics for the times of won games need to be harvested and saved and shown in the All Stats window.

I was originally going to punt the clock for a later release, but I realized that I'd have to rearrange a lot of the user interface so that the missing clock wouldn't leave either ugly blank spaces or useless non-working displays; and then put it all back when I later got around to adding the clock back in. So rather than that, I just bit the bullet and made it work. And it's done now, and so is the All Statistics window. Yay!