CaptainMidnight
Warlord
- Joined
- Apr 16, 2006
- Messages
- 141
I recently merged the Vehem's floating integer for happiness from Xienwolf's Fall Further 0.51. This includes floating integers for feature happiness, military unit happiness (Civicinfos), and improvement happiness (improvementinfos). Everything is fine in the actual game itself and Improvement happiness displays correctly but I get a weird number in the civilopedia for Military unit happiness and feature Happiness:
I'm aware Fall Further has a different Civics screen layout but I'm not sure how this affects the code. I want to retain the original civic screen layout. In Gametextmgr this part of the code I have edited for feature happiness:
Gametextmgr confuses the hell out of me so any help would be godsend!
I'm aware Fall Further has a different Civics screen layout but I'm not sure how this affects the code. I want to retain the original civic screen layout. In Gametextmgr this part of the code I have edited for feature happiness:
Code:
// Feature Happiness
iLast = 0;
for (iI = 0; iI < GC.getNumFeatureInfos(); ++iI)
{
if (GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI) != 0)
{
[B]/************************************************************************************************/
/* UNOFFICIAL_PATCH 08/28/09 jdog5000 */
/* */
/* Bugfix */
/************************************************************************************************/[/B]
// original bts code
// szFirstBuffer.Format(L"%s%s", NEWLINE, gDLL->getText("TXT_KEY_CIVIC_FEATURE_HAPPINESS", GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI), ((GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI) > 0) ? gDLL->getSymbolID(HAPPY_CHAR) : gDLL->getSymbolID(UNHAPPY_CHAR))).c_str());
// Use absolute value with unhappy face
[B]// CMEDIT FLOATING INTEGERS (VEHEM & XIANWOLF)[/B]
CvWString szHappyString;
if (GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI) * 0.01f == int(GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI) * 0.01f))
{
szHappyString.Format(L"%.0f", 0.01f * GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI));
}
else
{
szHappyString.Format(L"%.2f", 0.01f * GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI));
}
//<Original COde> szFirstBuffer.Format(L"%s%s", NEWLINE, gDLL->getText("TXT_KEY_CIVIC_FEATURE_HAPPINESS", abs(GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI)), ((GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI) > 0) ? gDLL->getSymbolID(HAPPY_CHAR) : gDLL->getSymbolID(UNHAPPY_CHAR))).c_str());
szFirstBuffer.Format(L"%s%s", NEWLINE, gDLL->getText("TXT_KEY_CIVIC_FEATURE_HAPPINESS", szHappyString.GetCString(), (GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI) > 0 ? gDLL->getSymbolID(HAPPY_CHAR) : gDLL->getSymbolID(UNHAPPY_CHAR))).c_str());
[B]// CMEDIT End[/B]
[B]/************************************************************************************************/
/* UNOFFICIAL_PATCH END */
/************************************************************************************************/[/B]
CvWString szFeature;
szFeature.Format(L"<link=literal>%s</link>", GC.getFeatureInfo((FeatureTypes)iI).getDescription());
setListHelp(szHelpText, szFirstBuffer, szFeature, L", ", (GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI) != iLast));
iLast = GC.getCivicInfo(eCivic).getFeatureHappinessChanges(iI);
}
}
Gametextmgr confuses the hell out of me so any help would be godsend!