johnny_cash
Chieftain
Hi,
I can't seem to find many resources on the forum (tutorials, etc.) on how widgets work in general.
I'd like to create a widget (setOutput) that would be appended to appropriate buildings in the building list table in CvMainInterface.py.
This widget would basically just be a clone of the + - buttons of the commerce controls, that would allow one to set the output of a building.
In cvinfos i already have getMaxBonusOutput and then And and Or Bonus Inputs that are entered per output.
So a factory has a max output of 4 steel. each steel takes 2 coal and 2 iron. but using the widget setoutput i can set it to produce 0 to 4 steel. so instead of having to always use 8 coal and 8 iron, i can set it to produce less and thus use less.
I've looked through CvDLLWidgetData and am pretty confused.
i guess my main question is, what are the steps i take to put a widget like this into play? first i add the widget in CvDLLWidgetData, then i add it to CyCityInterface? then to CvMainInterface.py? how do i get the information set in python back into CvCity for the actual calculations that i want to take place?
Thanks in advance for any help!
I can't seem to find many resources on the forum (tutorials, etc.) on how widgets work in general.
I'd like to create a widget (setOutput) that would be appended to appropriate buildings in the building list table in CvMainInterface.py.
This widget would basically just be a clone of the + - buttons of the commerce controls, that would allow one to set the output of a building.
In cvinfos i already have getMaxBonusOutput and then And and Or Bonus Inputs that are entered per output.
So a factory has a max output of 4 steel. each steel takes 2 coal and 2 iron. but using the widget setoutput i can set it to produce 0 to 4 steel. so instead of having to always use 8 coal and 8 iron, i can set it to produce less and thus use less.
I've looked through CvDLLWidgetData and am pretty confused.
i guess my main question is, what are the steps i take to put a widget like this into play? first i add the widget in CvDLLWidgetData, then i add it to CyCityInterface? then to CvMainInterface.py? how do i get the information set in python back into CvCity for the actual calculations that i want to take place?
Thanks in advance for any help!