[Kde-games-devel] Theming suport

Mauricio Piacentini mauricio at tabuleiro.com
Thu Mar 15 04:36:08 CET 2007


Ian Wadham wrote:
> On Thu, 15 Mar 2007 09:27 am, Parker Coates wrote:
>> Including this in the UI seems like overkill to me. While it might be
>> "neat" to mix and match sprites, the majority of the time, the results
>> won't be very aesthetically pleasing.
>>
> I agree.  This is very dependent on the game, IMO.  In KMahjongg,
> for example, you could probably mix and match tilesets and backgrounds
> quite freely,...

I agree with both of you, we should not make things too complex, 
specially since we barely have the manpower necessary to complete even 
the basic stuff...
On a related note, I just committed the KMahjonggBackgroundSelector 
class to libkmahjongg. Now the Configure KMahjongg dialog has three 
pages: general, tiles and background. The code will look for .desktop 
files in the appropriate places, kmahjongglib/backgrounds/ for bgs, and 
kmahjongglib/tilesets for the tiles. These are directories registered 
with KStandardDirs.

> 
> I think we should leave the original mixes to the artists and await
> the "re-mixes" to appear, as Parker has suggested will happen.

I also agree, we should make it easy for artist to ship new themes. 
Currently in KMahjongg creating a new tileset or background (it could be 
a whole theme as well) involves:

a) Editing a .desktop file that includes meta information about the 
theme, including the svg filename (or svgz), author information, and 
description
b) Including one svg file with the elements properly identified.
c) Optionally, include a .copyright file that details license for the 
theme. This might not be necessary for user-distributed stuff, but I am 
including it for all the stuff we will be uploading to SVN.

A sample of the above can be found in the tilesets and backgrounds 
subdirectories of kdegames/libkmahjongg.

If you look at KMahjongg, provided that KConfig support is already 
hooked in your game, you will see that the additions to the existing 
config dialog are simple. Where we previously had

KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs:self());
dialog->addPage(new Settings(0), i18n("General", "iconname");

we now have:

KMahjonggConfigDialog *dialog = new KMahjonggConfigDialog(this, 
"settings", Prefs:self());
dialog->addPage(new Settings(0), i18n("General", "iconname");
dialog->addTilesetPage();
dialog->addBackgroundPage();

I will see if I can implement the theme switch in KMines using a shared 
dialog page, in the same manner, but available in libkdegames. If it 
proves to be useful for at least one more game we can keep it there, 
otherwise I simply move it to be part of KMines itself. I see that other 
games have more complex needs maybe, and KWin4 already have a theme 
selector. Maybe Martin can talk about it a bit, it might even be more 
appropriate for sharing/moving to libkdegames?

Also, if Dave Corrie is here, is it OK if I add tileset/background 
selection using these shared classes to KShisen?

Regards,
Mauricio Piacentini


More information about the kde-games-devel mailing list