aiannacc / Goko-Salvager

Enhance your Dominion Online experience!
13 stars 9 forks source link

Enter in Kingdom Generator reloads page #154

Closed yed closed 10 years ago

yed commented 10 years ago

Hitting enter instead of clicking to Ok in Kingdom Generator reloads page to http://play.goko.com/Dominion/gameClient.html?selval=All

yed commented 10 years ago

onclick => onsubmit javascript event change will probably solve this.

aiannacc commented 10 years ago

Someone should just rewrite the whole Kingdom Generator form. Something with dropdowns and radioboxes.

yed commented 10 years ago

Yes, that would be better. But I lack time and also motivation for this. I almost never use kingdom generator.

aiannacc commented 10 years ago

Same. Nor do I care about avatars.

michaeljb commented 10 years ago

I actually have some time to work on this again. First I'll worry about just fixing the pressing enter issue, then I'll worry about rewriting it. (unless some of this is covered by the "Create Game II" in replace-game-dialog?)

michaeljb commented 10 years ago

I think this fixes the enter issue, but also causes it to exit on error (like if they type "Oasis" instead of "Oasis, All") again. I have an idea why, I'll take a look again soon.

a6b8ea6e9b

michaeljb commented 10 years ago

e79afa5903 fixes exiting on error for Chrome.

The kingdom generator doesn't work for Firefox at all on this branch now, I'm not sure why. Maybe it's not happy with using jQuery to bind to the submit event?

aiannacc commented 10 years ago

Yes, I plan for the "Create Game II" in replace-game-dialog to include a UI for the kingdom generator. It might be a while before I release that, though, so don't let me stop you.

On the other hand, you should definitely check out kingdomGenerator2.js in that branch, a massively simplified and commented version of the original kingdom generating logic. It's currently usable from the command line right now, like

GS.generateKingdom("Moat, Attack, 3 * Seaside + Prosperity");

What it's still missing is knowledge of which sets you own. That used to be accomplished by overriding one of the deck generating functions and caching the "cachedCards" object, which includes that information. But that override is getting in my way elsewhere, so I want to do the lookup directly instead (as automatch.js does).