PDA

View Full Version : Definition of UI Elements



LordEntrails
September 12th, 2015, 05:06
I imagine this is documented somewhere, but I couldn't find it in the wiki or on the forums.

Could someone point me to documentation on what file defines the various window elements and what elements there are?

Specifically, I'm looking to create an extension that will add a button next to the Options button (and below the Effects button).

Alternately, if someone knows of an extension that modifies these buttons, then I can look at that to reverse engineer it.

Thanks in advance :)

dulux-oz
September 12th, 2015, 06:38
Hi LE,

Apart from the Developer Guides on the Wiki there is no such doco - and believe me, we wish there was. Basically, the definitions are spread across several files and you have to go searching for them (ie reverse-engineering the code). For this I use Notepad++ and open up each and every XML and LUA file from the CoreRPG, then work out which object I'm looking at in the UI and find it in the code, then use Notepad++'s global search function to track things back, eventually reaching a "base" definition listed in the Guides on the Wiki. I know I'm getting close when I get to one of the XML files in the "common" directory.

Apart from that, I don't know what you're going to do - sorry :)

As a pointer, that area of the UI is defined by the desktop_manager.lua and other files.

Cheers

LordEntrails
September 12th, 2015, 07:13
I guess what I'm going to try and do is document it *UGH!*

That's kind of what I was doing. I found all the graphics in the folder called "sidebar", but no elements with that name in them. I've used "calendar" to track back and so far what seems most relevant is starting on line 22 of "desktop.lua" where the related button actions/nodes are set to public (so they show).

So, if you (or anyone else) has time to look and comment (and if not, that's ok too, as this will help document it for others and myself), what it looks like I need to do is:
- create two icons (one regular and one depressed) per supported theme
- update desktop.lua (or something, not yet clear how to handle this with an extension, but I'll get there)
- - Line 22+ add a declaration
- - Line 36+ add a set if this is to be visible to a client (non-host/gm)
- - Line 42+ add a set of... but I've yet to figure out what all the attribute/parameters that are being set are

Now I've got to go open more files to see where these "sidebar_tooltip" callouts go :)

I also noticed there appears to be 3 modes; local, host and player. Anyone able to explain the how local is different than the others?

damned
September 12th, 2015, 11:42
Have a look at some of the desktop themes over at FGCon.
https://www.fg-con.com/free-downloads/
These should give you some clues - although I generally dont use a "down" graphic - but as you have to define them - I have used the same graphic twice.

leozelig
September 12th, 2015, 12:19
I believe you are on the right track starting with desktop.lua. I haven't looked at the code, but some of those parameters at line 42+ will probably be setting the location on the desktop.

The sidebar images will be defined in one of the graphics files... graphics/graphics_icons.xml or something like that. If you are adding a button, make sure you define it there.

Local mode is what you see when you manage characters for a ruleset.