Help Tag

Monaldinio

Prince
Joined
Jan 6, 2010
Messages
415
Location
Rostock
Maybe some of you knowe, the plantefall mod use in some Info.xml (Building, Promotion ect) a tag called <Help></Help>...wich allow add. text...via a text key...

I would like tu use this tag also in my BonusInfo.xml...
I have tried to edit, in my opinon, the necessary sdk files..., but it do not work...:undecide:

First of all, i do not realy know if this is the right way...
Second, i get a Error...
Can someone help?!?



CvGameTextMgr.cpp

Code:
void CvGameTextMgr::setBonusHelp(CvWStringBuffer &szBuffer, BonusTypes eBonus, bool bCivilopediaText, bool bStrategyText, bool bTechChooserText, CvCity* pCity)
{
	setBonusTradeHelp(szBuffer, eBonus, bCivilopediaText, NO_PLAYER);
}


CvGameTextMgr.h

Code:
DllExport void setBonusHelp(CvWStringBuffer &szBuffer, BonusTypes eBonus, bool bCivilopediaText = false, bool bStrategyText = false, bool bTechChooserText = false, CvCity* pCity = NULL);


CyGameTextMgr.cpp


Code:
std::wstring CyGameTextMgr::getBonusHelp(int iBonus, bool bCivilopediaText, bool bStrategyText, bool bTechChooserText, CyCity* pCity)
{
	CvWStringBuffer szBuffer;
	GAMETEXT.setBonusHelp(szBuffer, (BonusTypes)iBonus, bCivilopediaText, bStrategyText, bTechChooserText, ((pCity != NULL) ? pCity->getCity() : NULL));
	return szBuffer.getCString();


CyGameTextMgr.h


Code:
std::wstring getBonusHelp(int iBonus, bool bCivilopediaText, bool bStrategyText, bool bTechChooserText, CyCity* pCity);


Spoiler :
attachment.php
 
Isn't it already there by default? I can see a Help tag in the TerrainSchema BtS file:

Code:
	<ElementType name="BonusInfo" content="eltOnly">
		<element type="Type"/>
		<element type="Description"/>
		<element type="Civilopedia"/>
		<element type="Help" minOccurs="0"/>
		<element type="BonusClassType"/>

The minOccurs=0 means that you don't need to have a tag but you can add one if you want (exactly between tags Civilopedia & BonusClassType).
 
Aha, so i dont have to chance nothing in the sdk?!?

Thats what i have in my BonusInfo.xml...

Code:
<BonusInfo>
			<Type>BONUS_MONOLITH</Type>
			<Description>TXT_KEY_BONUS_MONOLITH</Description>
			<Civilopedia>TXT_KEY_BONUS_MONOLITH_PEDIA</Civilopedia>
			<Help>TXT_KEY_BONUS_MONOLITH_HELP</Help>

Thats what i have in my TerrainSchema...


Code:
<ElementType name="BonusInfo" content="eltOnly">
		<element type="Type"/>
		<element type="Description"/>
		<element type="Civilopedia"/>
		<element type="Help" minOccurs="0"/>


But the Text wich i add is not shown in the pedia...

Code:
<TEXT>
		<Tag>TXT_KEY_BONUS_MONOLITH_HELP</Tag>
		<English>[ICON_BULLET]BLa bla bla</English>
		<French>[ICON_BULLET]BLa bla bla</French>
		<German>[ICON_BULLET]BLa bla bla</German>
		<Italian>[ICON_BULLET]BLa bla bla</Italian>
		<Spanish>[ICON_BULLET]BLa bla bla</Spanish>		
	</TEXT>
 
I don't know, it should be displayed in Civilopedia via the CvPediaBonus.py:
Spoiler :
Code:
	def placeSpecial(self):
		
		screen = self.top.getScreen()
		
		panelName = self.top.getNextWidgetName()
		screen.addPanel( panelName, localText.getText("TXT_KEY_PEDIA_EFFECTS", ()), "", true, false,
				 self.X_EFFECTS_PANE, self.Y_EFFECTS_PANE, self.W_EFFECTS_PANE, self.H_EFFECTS_PANE, PanelStyles.PANEL_STYLE_BLUE50 )
						
		listName = self.top.getNextWidgetName()
		screen.attachListBoxGFC( panelName, listName, "", TableStyles.TABLE_STYLE_EMPTY )
		screen.enableSelect(listName, False)
		
		szSpecialText = CyGameTextMgr().getBonusHelp(self.iBonus, True)
		splitText = string.split( szSpecialText, "\n" )
		for special in splitText:
			if len( special ) != 0:
				screen.appendListBoxString( listName, special, WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY )

Is it Sevopedia that you are using or something else?
 
Hmmm... maybe it's useless but I would try the text tag <German>[ICON_BULLET]BLa bla bla</German>
without the [ICON_BULLET].
 
Tested: yes it works and the text is shown in civilopedia.
 
Effets (Effects).

Edit: just in case, it worked too with
Code:
<French>[ICON_BULLET]BLa bla bla</French>
: it shows correctly with the icon bullet in front.
 
Top Bottom