Page 1 of 1

Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 2:39 pm
by WiskeyDonkey
Hi There!

I am a part of a team of programmers who are working a open source reimplementation of C&C: Tiberian Sun in C++, and one of the issues we have at the moment, is replicating the in-game dialog system.

The original game is Windows only, and we aim to make our project cross platform, so we are looking at a fully skinable UI subsystem to implement and then skin with the assets from the original game, and so far wxWidgets gives us the best interface we require.

From what I can tell, it uses OwnerDraw (drawn with GDI) and index PCX files, but the dialogs also animate like a horizontal scroll on creation/open. The dialogs are designed and stored as RC scripts in a external DLL.

Is this something wxWidgets can do, any amount of work involved is not a issue, as I guess we might have to write another layer on top of wxWidgets to draw the edges, background and inner glow of the dialog? (these need to be separate assets due to the way the animation works).

Hopefully someone can answer my questions,

Thanks!

PS. For those of you that might have not played Tiberian Sun, here is a few screenshots of the in-game dialogs.

Image

Image

Image

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 3:16 pm
by doublemax
wxWidgets' key feature is that it uses native controls where ever possible. As you can't override the look of most native controls, i'd say wxWidgets might not the best tool for you. Basically you'd have to rewrite almost every control you need. If it would be just simple controls like buttons, static texts, etc. the effort would be still pretty low. When you need listboxes and choice controls like in your screenshot, the effort gets higher.

Everything is possible though, it's just a matter of how much effort you're willing to put into this. Especially if you're new to wxWidgets.

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 3:42 pm
by WiskeyDonkey
doublemax wrote:wxWidgets' key feature is that it uses native controls where ever possible. As you can't override the look of most native controls, i'd say wxWidgets might not the best tool for you. Basically you'd have to rewrite almost every control you need. If it would be just simple controls like buttons, static texts, etc. the effort would be still pretty low. When you need listboxes and choice controls like in your screenshot, the effort gets higher.

Everything is possible though, it's just a matter of how much effort you're willing to put into this. Especially if you're new to wxWidgets.
Thanks for the reply, do you happen to have any links/examples of projects that have achieved similar UI's? Also, is there any other cross platform GUI kits that you recommend for our requirements?

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 3:46 pm
by doublemax
do you happen to have any links/examples of projects that have achieved similar UI's?
Sorry, no.
Also, is there any other cross platform GUI kits that you recommend for our requirements?
Qt is really the only reasonable alternative. All others reach their limits very quickly.

BTW: After reading your post again, i'm not 100% sure that i understood you correctly. Do you want to keep the dialog logic of the old code and just replace the drawing functions? That would be easier. I was talking about rebuilding the whole gui and event system with wxWidgets methods (panels, sizers, custom controls. etc) and then changing the look of it.

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 4:06 pm
by WiskeyDonkey
doublemax wrote:
do you happen to have any links/examples of projects that have achieved similar UI's?
Sorry, no.
Also, is there any other cross platform GUI kits that you recommend for our requirements?
Qt is really the only reasonable alternative. All others reach their limits very quickly.

BTW: After reading your post again, i'm not 100% sure that i understood you correctly. Do you want to keep the dialog logic of the old code and just replace the drawing functions? That would be easier. I was talking about rebuilding the whole gui and event system with wxWidgets methods (panels, sizers, custom controls. etc) and then changing the look of it.
We did look at Qt, but using the library bloats the output binary immensely, and we fell this is a huge negative, unless there is a way to link to a DLL (I think it requires a commercial licence?).

For this project, we are actually reverse engineering the original game, and wish to make the code fully cross platform. So as long as the visual aspect of the dialog is the same, so the core mechanics are not a issue (from what I understand, we can create high level interfaces on top of wxWidgets for the rest of the game to interact?).

EDIT: We are totally open to coding a complete UI system on top of wxWidgets.

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 4:15 pm
by doublemax
So, you're actually rewriting the whole game and not re-using any code?

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 4:34 pm
by catalin
WiskeyDonkey wrote:We did look at Qt, but using the library bloats the output binary immensely, and we fell this is a huge negative, unless there is a way to link to a DLL (I think it requires a commercial licence?).
There is, and actually without a commercial license you are allowed to keep closed sources only if you link dynamically against Qt.

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 4:39 pm
by WiskeyDonkey
doublemax wrote:So, you're actually rewriting the whole game and not re-using any code?
Correct, so we are not bound to old Windows code, so we have a complete fresh platter to start from, no restrictions.
catalin wrote:
WiskeyDonkey wrote:We did look at Qt, but using the library bloats the output binary immensely, and we fell this is a huge negative, unless there is a way to link to a DLL (I think it requires a commercial licence?).
There is, and actually without a commercial license you are allowed to keep closed sources only if you link dynamically against Qt.
So we can still be open source (GPLV2) and link to a precompiled DLL?

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 4:45 pm
by catalin
WiskeyDonkey wrote:So we can still be open source (GPLV2) and link to a precompiled DLL?
When using Qt in open source code you don't have any restrictions. So the answer is yes.

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Fri Dec 16, 2016 9:23 pm
by Manolo
I have never done it but, if I recall well, you can draw your UI using wxHTML http://docs.wxwidgets.org/trunk/overview_html.html and http://docs.wxwidgets.org/trunk/classwx_web_view.html

A screenshot of an app showing custom sliders http://wxwidgets.org/about/screenshots/ ... on-msw.png

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Posted: Thu Dec 29, 2016 1:49 pm
by coderrc
wouldnt you be better served doing this with the UI skinning utility of your game engine? eg UE4, box2d, irrlicht, cocos, etc. Especially given that they will likely already have better graphics hardware support and animation routines. not to mention HID interfaces.

GUI toolkits like wxWiddgets and Qt seem like the wrong approach for this sort of thing.