My mod represents Christianity as three religions: Orthodox Christianity, Catholicism and Protestantism. The way it is supposed to go is: Orthodoxy is founded with Theology as normal, and later in the game the other two denominations branch off following special events (great schism and reformation).
The awkward thing about this is that when Christianity is still united (before Catholicism enters the picture) it is still displayed as Orthodoxy in the game, and the same applies to its buildings and units. I would prefer if Orthodoxy would simply be displayed as Christianity before other Christian religions exist, with the same applying to its associated units and buildings, while keeping the art and effects the same.
I wonder if there is a convenient way to make the text (description, help ...) conditional on some aspect of the game state (in this case, which religions have already been founded). I have looked into the corresponding methods in the CvInfoBase class that are inherited by the other Info classes.
In principle I am willing to do some dirty hacks in those methods (i.e. check if religion exists and then do text key substitution with simple hardcoded if clauses), but I think editing CvInfoBase is excessive. Unfortunately, overriding the methods in the correct subclasses (CvReligionInfos, CvBuildingInfos, CvUnitInfos) does not seem to work (as in, overriding methods do not seem to be called). It appears that this is because of object slicing, but I am not fluent enough in C++ to be sure of that.
I'm hesitant to edit CvInfoBase itself because then those additional checks would affect all Info classes, which seems excessive.
Is there any other way that allows me to make e.g. religion names conditional (or change them over the course of the game) without having to edit the game code in too many places (i.e. everywhere those strings are displayed)?
I am aware that I could create a fourth religion to represent unified Christianity, but that would mean extra buildings and units and a lot of extra work to handle the resulting special cases and making this workaround opaque to the player.
All ideas welcome, I hope I have made my problem sufficiently clear.
The awkward thing about this is that when Christianity is still united (before Catholicism enters the picture) it is still displayed as Orthodoxy in the game, and the same applies to its buildings and units. I would prefer if Orthodoxy would simply be displayed as Christianity before other Christian religions exist, with the same applying to its associated units and buildings, while keeping the art and effects the same.
I wonder if there is a convenient way to make the text (description, help ...) conditional on some aspect of the game state (in this case, which religions have already been founded). I have looked into the corresponding methods in the CvInfoBase class that are inherited by the other Info classes.
In principle I am willing to do some dirty hacks in those methods (i.e. check if religion exists and then do text key substitution with simple hardcoded if clauses), but I think editing CvInfoBase is excessive. Unfortunately, overriding the methods in the correct subclasses (CvReligionInfos, CvBuildingInfos, CvUnitInfos) does not seem to work (as in, overriding methods do not seem to be called). It appears that this is because of object slicing, but I am not fluent enough in C++ to be sure of that.
I'm hesitant to edit CvInfoBase itself because then those additional checks would affect all Info classes, which seems excessive.
Is there any other way that allows me to make e.g. religion names conditional (or change them over the course of the game) without having to edit the game code in too many places (i.e. everywhere those strings are displayed)?
I am aware that I could create a fourth religion to represent unified Christianity, but that would mean extra buildings and units and a lot of extra work to handle the resulting special cases and making this workaround opaque to the player.
All ideas welcome, I hope I have made my problem sufficiently clear.