SDK - civilopedia help for lightbulbing

Joined
Feb 6, 2006
Messages
796
I've noticed that civilopedia, and tooltip text, only shows lightbulbing help (eg, "this tech can be researched by a Great Prophet") when you are able to research it.
I'd like to show this text for every tech you haven't discovered yet.
I've found the method CvGameTextMgr.setTechHelp, and tried to modify the section which manages the TXT_KEY_TECH_GREAT_PERSON_DISCOVER.
I've tried in several ways, but I don't know how to do.
Have I to use the "bCivilopediaText" variable?
 
I haven't tested this, but the change is fairly minor. You just want to ignore the check of whether or not the player can research the tech on line 5218.

To keep the "Advances to the X era" text from displaying if you cannot research the tech, I've moved lines 5218-9 down to just before the original line 5234.

Code:
[s]if (GET_PLAYER(GC.getGameINLINE().getActivePlayer()).canResearch(eTech))
{[/s]
	for (iI = 0; iI < GC.getNumUnitInfos(); ++iI)
	{
		CvUnitInfo& kUnit = GC.getUnitInfo((UnitTypes)iI);

		if (kUnit.getBaseDiscover() > 0 || kUnit.getDiscoverMultiplier() > 0)
		{
			if (::getDiscoveryTech((UnitTypes)iI, GC.getGameINLINE().getActivePlayer()) == eTech)
			{
				szBuffer.append(NEWLINE);
				szBuffer.append(gDLL->getText("TXT_KEY_TECH_GREAT_PERSON_DISCOVER", kUnit.getTextKeyWide()));
			}
		}
	}

[B]if (GET_PLAYER(GC.getGameINLINE().getActivePlayer()).canResearch(eTech))
{[/B]
	if (GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCurrentEra() < GC.getTechInfo(eTech).getEra())
	{
		szBuffer.append(NEWLINE);
		szBuffer.append(gDLL->getText("TXT_KEY_TECH_ERA_ADVANCE", GC.getEraInfo((EraTypes)GC.getTechInfo(eTech).getEra()).getTextKeyWide()));
	}
}
If you want that to show up as well, instead just delete or comment out line 5218.

Code:
[B]//[/B]if (GET_PLAYER(GC.getGameINLINE().getActivePlayer()).canResearch(eTech))
{
	for (iI = 0; iI < GC.getNumUnitInfos(); ++iI)
	...
}
 
Oh sorry, I didn't check that. Yes, you'll have to modify the above code to not call getDiscoveryTech() and instead check the CvTechInfo if it can be discovered by the great person.
 
Back
Top Bottom