Editing the Interface

mikeejimbo

Chieftain
Joined
Jan 16, 2010
Messages
65
I would like to learn how to edit the interface, mostly to add things, however, after playing with it for a bit I found that I wasn't having any effect. I don't know exactly what specific questions I would ask, though, so I thought it'd be nice if I looked for a tutorial for the interface. I searched and searched, though, and couldn't find one. Does such a thing exist? And if so, where would it be?

Thanks once again, o helpful Civ Fanatics!
 
I'm not sure of exactly what you want, but the main game screen is displayed using the Python/Screens/CvMainInterface.py file. It can be changed by editing a copy of that file.
 
I do know that much. The trouble I have is that I don't know what all the functions in the API for it do, I guess.
 
Well I mean, for something simple like displaying text on the screen, I have to create a label, set the label, and then call "show", don't I? But that doesn't seem to be working. And take, for example, this function:

Code:
VOID setLabel (STRING szName, STRING szAtttachTo, STRING szText, INT uiFlags, FLOAT fX, FLOAT fY, FLOAT fZ, FontType eFont, WidgetType eType, INT iData1, INT iData2)

The first few strings I understand, but what's that uiFlags? The floats I get, but what is a widget, anyway? And where in CyMainInterface would I want to put this? OnScreenUpdate?
 
uiFlags controls left/center/right justification I believe. Look at an example and you should see CvUtil.CENTER_FONT or something like that.

The WidgetType, iData1, and iData2 control what shows when you hover over the label and again when you click it. These are handled in the DLL (CvDLLWidgetData.cpp or something like that), but you can create your own widget types for adding hover text and taking actions in handleEvent--something that I didn't realize until recently (would have saved me a lot of work in BUG/BULL :().
 
That is interesting. What exactly do iData1 and iData2 do then? Or should I look in the SDK for that?
 
Each WidgetType determines what those data values do. For a unit button, for example, I think iData1 is the UnitType and iData2 is ignored, but that's just off the top of my head. The SDK is the ultimate source of truth. ;)
 
Top Bottom