Python: Know of a way to put an event in the pipeline?

Requies

Prince
Joined
Nov 15, 2005
Messages
381
Kind of hard to explain, but I'm trying to set up something where a button press puts an event in the event queue, but DOESN'T do it immediately (so a basic call to that event handler won't work).

Is there some sort of timed event possible here? Or some other solution?

Any help would be appreciated.

Thanks,
Req
 
eotinb said:
How long do you want to wait: A set amount of time? After some other event fires? A set number of turns?

After another event fires (specifically after the engine gets done updating the changes and all the data is correct).

Basically, this is for work on the Domestic Advisor.

I want to be able to:

1) make a change to a city in the Domestic Advisor,
2) have that change propagate to the engine, updating all the data, and
3) call the updateScreen or handleInput function in the Domestic Advisor.

Unfortunately, instead of 1, 2, 3, the engine currently goes 1, 3, 2. :(.

I've taken a look at the Main Interface, but so far, I haven't come up with the mechanism for why the City Interface can do what I want. If I could copy that mechanism, then, it would make my Domestic Advisor complete (well, as far as I can. It looks like the way to bring up Hints is actually within the C++ code, not the Python code :( ). So, hovering over specific areas won't help at all, right now.

Req
 
Requies said:
After another event fires (specifically after the engine gets done updating the changes and all the data is correct).

Basically, this is for work on the Domestic Advisor.

I want to be able to:

1) make a change to a city in the Domestic Advisor,
2) have that change propagate to the engine, updating all the data, and
3) call the updateScreen or handleInput function in the Domestic Advisor.

Unfortunately, instead of 1, 2, 3, the engine currently goes 1, 3, 2. :(.

I've taken a look at the Main Interface, but so far, I haven't come up with the mechanism for why the City Interface can do what I want. If I could copy that mechanism, then, it would make my Domestic Advisor complete (well, as far as I can. It looks like the way to bring up Hints is actually within the C++ code, not the Python code :( ). So, hovering over specific areas won't help at all, right now.

Req


Ok, I was able to find a work around, but unfortunately wasn't able to find a way to do what I was asking for in the first post.

BTW, my workaround was to modify the "update" function in CvScreensInterface.... It's rather klugish, but it gets the job done.

Hopefully, I can get my DomesticAdvisor out soon.

Req
 
Back
Top Bottom