[Kde-games-devel] Review Request: KPat: Add command line option to skip directly to a particular game
Parker Coates
parker.coates at gmail.com
Tue Feb 10 22:38:25 CET 2009
> On 2009-02-10 13:15:21, Albert Astals Cid wrote:
> > Actually i think the --gametype=string would make much more sense than an index, who in earth is going to remember an index? For i18n i would do that the user has the option to either use --gametype=granfather or --gametype=i18n(grandfather) to get the grandfather game
That simple enough for the game types with single word names, provided we convert to lower case before comparing, but what about "Simple Simon" or "Forty & Eight"?
Providing the list in the "--help" text seems like a good idea, but because all KCmdLineArgs business has to happen before the KApplication is created, it uses ki18n and KLocalizeStrings. KLocalizedStrings can't be concatenated, so I can't really see a way to generate a translated list. Of course, i18n isn't really my specialty.
The other tricky bit is that the different game types and their indices are detected at compile time, so we can't really cut corners and hardcode anything.
- Parker
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/50/#review58
-----------------------------------------------------------
On 2009-02-10 12:29:08, Parker Coates wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/50/
> -----------------------------------------------------------
>
> (Updated 2009-02-10 12:29:08)
>
>
> Review request for KDE Games.
>
>
> Summary
> -------
>
> Bug 182718 requests a way to skip the new starting screen that was added to KPat in 4.2. While I love the start screen, I think it makes sense allow the user the possibility to skip directly to a particular game if they so desire. One of the reporters suggestions was a command line switch. I liked this suggestion as it would allow one to create separate icons for launching different games.
>
> This patch adds a command line option "--gametype" to which one passes the index of the game type one would like to play. The welcome screen is skipped and the game loads immediately.
>
> The problem lies with the game indices. KPat internally keeps track of its different game types using integer indexes. Unfortunately, for backwards compatibility (I assume) the game indexes are not sequential and some game types have multiple indices. Seemingly random indices aren't a very userfriendly way of referencing the games either.
>
> This initial version of the patch adds a game to index mapping to the "--help" text, but it does so in a fairly hideous and non-i18n-friendly way. I had considered using string constants like "--gametype=simple_simon", but I'm not sure if that makes sense in a translated environment.
>
> So essentially, I'm looking for suggestions for a saner implementation that takes ease of use and ease of translation into account.
>
>
> This addresses bug 182718.
> https://bugs.kde.org/show_bug.cgi?id=182718
>
>
> Diffs
> -----
>
> trunk/KDE/kdegames/kpat/main.cpp 923927
> trunk/KDE/kdegames/kpat/pwidget.cpp 923927
>
> Diff: http://reviewboard.kde.org/r/50/diff
>
>
> Testing
> -------
>
> minimal
>
>
> Thanks,
>
> Parker
>
>
More information about the kde-games-devel
mailing list