Custom CvScreenUtil question.

Gerikes

User of Run-on Sentences.
Joined
Jul 26, 2005
Messages
1,753
Location
Massachusetts
So I've decided to actually use some python in Civcraft (it was just so much easier when it was all c++ :p) but I'm running into this problem.

I've created a new CvScreenUtil class that inherits from the base class (just like the CvScrenUtils.py file says), and for now just put some debug statements into it just to see if I got it working. Well, some functions work, some don't. For example, the update function will get called like it should, same with the forceScreenUpdate. However, I'm not getting anything from leftMousePressed, rightMousePressed, mouseOverPlot, or handleInput. (The few others I didn't test).

Strangely, while trying to figure this out, I went into the WorldBuilder and all of the functions were working while I was in WorldBuilder mode. Once I exited, they stopped working. From that, I assumed that the functions would only be called if a screen other than the main screen was up, but when I opened another screen (many of the advisor screens) I still couldn't get them to work.

So, what am I missing here? If these functions aren't called every time the event they represent happen, what do I need to make sure of to make sure of to see that they are called when I need them to be?
 
I've had trouble getting those function to work with the main interface. Didn't really try to hard, and haven't really played with that file, so I can't really offer any suggestions.
 
:bump:

Well, I guess for now, if no one knows anything, I'll be sure just to use the update function to call my other functions that might need updating. BTW, sorry to go OT, but is anyone else checking out that "Only X days left 'til release" and starting to cower in fear?
 
Actualy I am feeling a bit more confident latley, I read resently that the game code already support Custom Civ Building Architectures as we have all see in the preview screenies. Custom Civ Buildings (Forums for Rome and Malls for America) are also already their but un-used. It dosn't seem to me like their is a lot of coding actualy needed in Warlords, their just adding that GreatWall effect (probly adds some data to Plot similar to how a river is stored and some logic to how barbarians move), a few leader Traits (I already 4 new Tags and 10 new Traits) and the GreatWarlord mechanic (probably just a day worth of coding their). That sounds to be less real work thenr whats already in the CCP. Unless they did a whole lot of "silent" coding to make the game smother/faster/stabler/smarter the SDK merging isn't going to be very hard. Basicaly warlords will be little more then XML files and art.
 
They sell a mod with a quite code more than these from the forums for lots of money. That's real capitalism :D
 
Ok, I think I figured it out.

Aparently, the functions will only get called if there are screens open, and of those at least one has set their screen to handle inputs using the showScreen function.. Why the MainInterface screen doesn't count I'm not sure. The reason why they worked when the WorldBuilder was up was because the worldbuilder opened up a screen that recieved inputs.

My first mistake was that I wasn't opening a screen. I thought that was the problem, so I decided to make my new "invisible" screen (like worldbuilder is) and open it. However, that didn't work. So I thought that wasn't the problem.

Finally, while looking through the other screens, I noticed that I had forgotten the important screen.showScreen(ePopupState, bHandleInput) function in interfaceScreen. Because of this, the screen probably wasn't registering, and thus there was no screens registered that take inputs. Thus, no calls to handleInput or the other functions.
 
Top Bottom