Theme Creation

Talk about general things concerning Forged Alliance Forever.

Theme Creation

Postby thygrrr » 13 Feb 2012, 12:21

Theming in FAFLobby 0.5+ works as follows:
Everything you see in folder _res can be themed. Simply create a folder _themes/MyTheme and put only the files you wish changed in there. You can then choose the theme from the Settings menu in the Lobby.

Yes, you can even change the entire UI layout, as long as all the types and names remain the same.

In the early stages of 0.5.x, ui files will change a bit now and then, and sometimes even a lot. So themes will need frequent small and sometimes big adjustments - sorry.

There will be an opportunity to mod the colors and formatting of the chat as well in one of the next updates.

Everyone is welcome to make themes for themselves or share them with others. The only requirement is to make the theme yourself, not just post a mockup and hope it will be created for you.

Additional resources will also be added frequently (mostly banners, watermarks and icons) and they won't break your mod, but you may want to put in modded versions of such new files as needed.

If your theme is particularly awesome, it might even get packaged with the lobby installer if you agree. (ZePilot decides what the default theme will be, obviously, and he said he wanted to make a concept for one in Photoshop once he has some time to catch a breath)

Resources for Theming:
Supported HTML subset by Qt
How to Customize Qt Widgets
Last edited by thygrrr on 20 Feb 2012, 00:21, edited 4 times in total.
I waited ten years for Supreme Commander (1997-2007)
and have not a single day felt disappointed with it!

Image
User avatar
thygrrr
Contributor
 
Posts: 783
Joined: 18 Nov 2011, 17:08
Location: Germany
Has liked: 2 times
Been liked: 3 times

Re: Theme Creation

Postby ozonex » 17 Feb 2012, 10:05

i will try make some theme as default skin, I start work on it tomorrow and hopefully I manage to do something cool

this is for example veeery old concept
http://i386.photobucket.com/albums/oo30 ... cecopy.png
FAF Map Editor Alpha v0.515 > Get it now!
User avatar
ozonex
Avatar-of-War
 
Posts: 275
Joined: 16 Feb 2012, 20:11
Location: Poland
Has liked: 121 times
Been liked: 182 times
FAF User Name: ozonex

Re: Theme Creation

Postby ToejamS » 17 Feb 2012, 10:53

ozonex, that looks simply amazing. Great job.

Is it finished yet?
what about now?
Gotta be finished now... surely... what taking so long... :P

Man, fa is a pool of hidden talents alright.
ToejamS
Avatar-of-War
 
Posts: 296
Joined: 26 Aug 2011, 18:03
Has liked: 0 time
Been liked: 1 time
FAF User Name: ToejamS

Re: Theme Creation

Postby thygrrr » 17 Feb 2012, 11:12

I like it too, actually. I went for a clean slate simple theme first to allow people to express their ideas.

The theme code will change considerably over the next couple of versions, but never in a way that would invalidate everything you guys worked on. Rather in the scope of small name changes, etc.

First up: Since I've been having problems with Chat performance vs. layout quality, in one of the upcoming themes chat might be a different Qt widget type (maybe a table... lol). Not sure yet where it will lead.
I waited ten years for Supreme Commander (1997-2007)
and have not a single day felt disappointed with it!

Image
User avatar
thygrrr
Contributor
 
Posts: 783
Joined: 18 Nov 2011, 17:08
Location: Germany
Has liked: 2 times
Been liked: 3 times

Re: Theme Creation

Postby Ze_PilOt » 17 Feb 2012, 11:16

Be careful of the scrolling bug with tables :)
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: Theme Creation

Postby thygrrr » 17 Feb 2012, 11:18

Ze_PilOt wrote:Be careful of the scrolling bug with tables :)


Yeah that's why I went for a TextBrowser, but the problem is if you appendHtml() to it, it makes a new paragraph, meaning you can't keep all the usernames adjusted unless reserving a huge bit of space for the first one, and if you setHtml() on it, it takes longer and longer to parse the entire document. (that's the main reason for the high CPU load I think, but I'm also performing a more and more complex string concatenation each time someone writes a line, so maybe I can get some performance gains there instead)

As another approach, I will be trying something fancy with a document style sheet where the <td> class for the username is extended by some kind of heuristic for all such cells when long-named users write something, or something slightly less fancy permanently extending the reserved space each time a longer-named user writes something.

The performance issue is already mitigated one way or another.
I waited ten years for Supreme Commander (1997-2007)
and have not a single day felt disappointed with it!

Image
User avatar
thygrrr
Contributor
 
Posts: 783
Joined: 18 Nov 2011, 17:08
Location: Germany
Has liked: 2 times
Been liked: 3 times

Re: Theme Creation

Postby Ze_PilOt » 17 Feb 2012, 11:28

There is a font metric function (on QFont if I remember correctly), that return the width of any text depending of the font and size of it.
Maybe you can compute the fontMetric every time someone is typing something, keep the wider in memory, and only redo the whole QTextBrowser if the new metric > the current wider one.

Another optimisation should be to only retain a certain amount of text and erase the old one (but then maybe it will suffer from a scrolling bug too).
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: Theme Creation

Postby ozonex » 18 Feb 2012, 13:30

ok, first simple skins for UEF, Cybran, Aeon and Seraphim are complieted

Download:
http://ozonex.pl/pliki/themes.rar

also needed to change some files in _res folder, they dont change when in themes folder:
http://ozonex.pl/pliki/_res.rar

INSTALATION:
themes move to _themes folder, and res files to _res folder (replace existing files)


to make better skins i need to change some positions etc. but dont know how yet

screens:
http://i386.photobucket.com/albums/oo30 ... o3/uef.png
http://i386.photobucket.com/albums/oo30 ... cybran.png
http://i386.photobucket.com/albums/oo30 ... 3/aeon.png
http://i386.photobucket.com/albums/oo30 ... 3/sera.png
FAF Map Editor Alpha v0.515 > Get it now!
User avatar
ozonex
Avatar-of-War
 
Posts: 275
Joined: 16 Feb 2012, 20:11
Location: Poland
Has liked: 121 times
Been liked: 182 times
FAF User Name: ozonex

Re: Theme Creation

Postby Raging_Squirrel » 18 Feb 2012, 13:35

dashed tabs ain't looking good for me, but the rest is great!
Never argue with an idiot. He will bring you down to his level and beat with experience.
User avatar
Raging_Squirrel
Priest
 
Posts: 494
Joined: 26 Aug 2011, 16:53
Location: Russia
Has liked: 1 time
Been liked: 4 times
FAF User Name: Raging_Squirrel

Re: Theme Creation

Postby thygrrr » 18 Feb 2012, 15:17

Raging_Squirrel wrote:dashed tabs ain't looking good for me, but the rest is great!


Yes. Pretty awesome, and thanks for doing my job (i.e. the four basic themes) - now I can focus more on the lobby code. Looking forward to further developments. 8-)
I waited ten years for Supreme Commander (1997-2007)
and have not a single day felt disappointed with it!

Image
User avatar
thygrrr
Contributor
 
Posts: 783
Joined: 18 Nov 2011, 17:08
Location: Germany
Has liked: 2 times
Been liked: 3 times

Next

Return to General Discussions

Who is online

Users browsing this forum: Armaster, Bing [Bot], MayorDamage and 11 guests