EmperorFool
Deity
Check out setYieldHelp(). This is called near the top of setCommerceHelp() and is responsible for the Base Commerce and 50% Bureaucracy modifier lines. Here you will want to add your code for shrines and eventually techs.
One trick: the function uses
to get the value to show for Base X, but doesn't that already include your shrine yields? You'll need to calculate the shrine and tech yields and subtract them from the above value. Then you can show the base, shrine, and techs as separate lines with a Total line after them.
You need to decide how nice you want it to look, and that involves more code. If there's only one source (no shrine or techs), do you want Base and Total lines? Or just a Base? What about if there are no modifiers? Obviously the easiest is to always show a Base and Total. But do you want a separate Subtotal and Total if there are modifiers?
Here are all the possible sources shown.
Do you want to make the hover this long? Maybe you want to omit the subtotal line.
One trick: the function uses
Code:
int iBaseProduction = city.getBaseYieldRate(eYieldType);
to get the value to show for Base X, but doesn't that already include your shrine yields? You'll need to calculate the shrine and tech yields and subtract them from the above value. Then you can show the base, shrine, and techs as separate lines with a Total line after them.
You need to decide how nice you want it to look, and that involves more code. If there's only one source (no shrine or techs), do you want Base and Total lines? Or just a Base? What about if there are no modifiers? Obviously the easiest is to always show a Base and Total. But do you want a separate Subtotal and Total if there are modifiers?
Here are all the possible sources shown.
Code:
Base Commerce: 12C
Shrines: 5C
Techs: 2C
------------------------
Subtotal Commerce: 19C
* +50% for Capital
------------------------
Total Commerce: 28C
Do you want to make the hover this long? Maybe you want to omit the subtotal line.