bustiiing / blazingstars

Automatically exported from code.google.com/p/blazingstars
0 stars 0 forks source link

Make BlazingStars auto-detect the current PokerStars theme. #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It's possible to auto-detect the theme PokerStars is using, by reading the 
PokerStars prefs. I've already implemented this in Poker Copilot, so I'd like 
to 
take on this task for BlazingStars.

Steven, if that's cool, let me know by changing the status of this issue to 
"Accepted".

Original issue reported on code.google.com by steve.mc...@gmail.com on 23 Dec 2009 at 2:28

GoogleCodeExporter commented 8 years ago
Sounds great, Steve!  That would simplify the setup for initial users greatly.  
The
one caveat is that BlazingStars will have to warn people if they change the 
theme to
one that is not currently supported, or else the experience is going to go 
sideways
in a real hurry.  

Original comment by steven.h...@gmail.com on 23 Dec 2009 at 6:16

GoogleCodeExporter commented 8 years ago
I've now added some code to automatically detect the current PokerStars theme, 
but I 
haven't committed it yet. The API is accessed as follows:

PokerStarsTheme *selectedTheme = [PokerStarsInfo determineTheme];

The PokerStarsTheme contains both the theme's name and whether it is supported 
by 
BS.

I propose that I remove the ability for the user to manually set the theme. 
Instead we 
can display the theme where it currently shown in the preferences, and add a 
"Redetect" button, which the user can click if they change the theme while BS 
is 
running.

Additionally, I propose that BS show the user the detected theme at startup, if 
it is 
not supported, instructing the user the change the theme. This would be an 
alert 
with "Quit", "Help", and "Redetect" as the options.

All sound good?

Original comment by steve.mc...@gmail.com on 28 Dec 2009 at 3:54

GoogleCodeExporter commented 8 years ago
Sounds great!  Go ahead and commit that, I'm eager to see it. 

Original comment by steven.h...@gmail.com on 28 Dec 2009 at 5:13

GoogleCodeExporter commented 8 years ago
I've now committed this, including changes to the preferences to accommodate 
auto-
detection of PS themes.

My Objective-C is rusty so I'd be grateful if you took a close look at the code 
I added, 
in case there are any glaring memory leaks or clumsy code.

Original comment by steve.mc...@gmail.com on 28 Dec 2009 at 8:47

GoogleCodeExporter commented 8 years ago
Looks good from where I am, but I'm stuck on my iPhone right now - I'm having 
trouble getting home to 
my laptop. I'll give it a solid look through as soon as I can. 

Original comment by steven.h...@gmail.com on 28 Dec 2009 at 11:31

GoogleCodeExporter commented 8 years ago
I've looked through the code, and I like it!  I've moved the theme logic into 
the
PokerStarsTheme class to centralize that in one place.  

I'm waiting on a fix for one issue from Steve before I close the issue.

Original comment by steven.h...@gmail.com on 29 Dec 2009 at 5:43

GoogleCodeExporter commented 8 years ago
The timing issue is now fixed. AFAIK my code now fully works and this issue can 
be 
heavily tested.

Original comment by steve.mc...@gmail.com on 29 Dec 2009 at 9:47

GoogleCodeExporter commented 8 years ago
I've been using it, and it seems to work well.  One small issue:  when the user 
has
both the PokerStars and PokerStars.IT clients installed, the given code will 
default
to the theme for the Italian client even if the vanilla PokerStars is running.  
I've
modified the code to use the extern NSString *appName that I'm using throughout 
the
rest of the code so that the preferences will be read for the currently open
application.  This obviates the need for the applicationInstalled method in
PokerStarsInfo;  if you have no objections, Steve, I'll remove it in the next 
commit.

Original comment by steven.h...@gmail.com on 30 Dec 2009 at 8:21

GoogleCodeExporter commented 8 years ago
Issue 19 has been merged into this issue.

Original comment by steven.h...@gmail.com on 30 Dec 2009 at 8:22

GoogleCodeExporter commented 8 years ago
Luca, can you tell me which theme you're trying to choose?  Three are currently
supported:  Hyper-Simple, Black, and Slick.  I've noticed that there's a problem
selecting the Black theme on the PokerStars.IT client;  the name is reported as
"xBlack" for some reason and I'll take a look when I have a minute.  

Original comment by steven.h...@gmail.com on 30 Dec 2009 at 8:24

GoogleCodeExporter commented 8 years ago
I've committed a change to work around a PokerStars IT bug regarding the Black 
theme.

Original comment by steven.h...@gmail.com on 30 Dec 2009 at 8:51

GoogleCodeExporter commented 8 years ago
No worries, go ahead and make what I did fit in more with what's already in 
BlazingStars. Makes sense to me.

And Luca, thanks for testing it out. 

Original comment by steve.mc...@gmail.com on 30 Dec 2009 at 9:11

GoogleCodeExporter commented 8 years ago
I tested all supported themes, and detection works properly for all of them. 
Thanks for 
fixing this, steve. 

So far the theme that seems to work better with pot OCR is the black one, which 
is now 
correctly detected.

Original comment by luca.hel...@gmail.com on 30 Dec 2009 at 9:22

GoogleCodeExporter commented 8 years ago

Original comment by steven.h...@gmail.com on 31 Dec 2009 at 5:38