Need help with scrolling civics screen.

johny smith

Deity
Joined
Mar 10, 2007
Messages
2,273
Ok I am attempting to make a working scrolling civics screen, but I am not very experienced in coding. My problem is I get a symbol like this "[]" in front of the yield and commerce changes when I try to add some lines to the SDK to parse the civic info text for the help panel.

Here is what it looks like on a screenshot.
civicsscreen.jpg


Now here is an example of the code changes in the SDK in the CvGameTextMgr.cpp that shows the text.

Code:
void CvGameTextMgr::parseCivicInfoYieldChangeHelpAllCities(CvWStringBuffer &szHelpText, CivicTypes eCivic, bool bCivilopediaText, bool bPlayerContext, bool bSkipName)
{
	CvWStringBuffer szFirstBuffer;

	//	Yield Modifiers
	setYieldChangeHelp(szHelpText, L"", L"", gDLL->getText("TXT_KEY_CIVIC_IN_ALL_CITIES").GetCString(), GC.getCivicInfo(eCivic).getYieldModifierArray(), true);
}

Now I can leave it alone in the SDK if I knew a function that would hide it in the python. And here is the code in the CvCivicsScreen.py that effects the same area as the example above.

Code:
if (CyGameTextMgr().parseCivicInfoYieldChangeHelpAllCities(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoYieldChangeHelpAllCities(iCivic, False, True, True)
			screen.setTextAt( szPaneIDYieldChangeHelpAllCities, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

Anyway the rest of the text works besides the yield and commerce changes text.

And here are the files if anyone can help me.

http://forums.civfanatics.com/uploads/112213/Civics_Screen.rar

I will appreciate it very much if anyone can help me figure what to do for this symbol. And I thank you ahead of time for reading this.
 
If you need to remove a single or several chars from the begining or end of a string use somthing like:
Code:
sText = "[]a test"
sText = sText.strip("[]")

I haven't looked at your uploaded file, but from the screen shot it seems you are adding an extra symbol before the bullet symbol.

I'm downloading the file and will take a look at it while I'm watching the newest resident evil movie. :)
 
Well thanks for the help first of all. But there is no character is the other problem now to hide. It is some sort of tab or new line I think, and it comes from the L"", L"" from the SDK which represent something from the gamefont files.
 
Got a chance to look at the civics python file and didn't see anything that jumped out at me. You might be right about the one of the L"", it looks like it is calling some kind of symbol, but I can't see where it would need to be fixed. From my previous experience with screens you have to manually add the bullet character so anything before that would also be manually put there, but if the sdk function is returning the entire string.. Well, good luck, if I think of anything I'll let ya know. :)
 
Back
Top Bottom