Hi. I'm looking at the tooltip files in the game and I found something strange, so I'm asking a question.
In the ToolTipHelper.lua file in the civ6 game, The tooltip for the project looks like this:
-------------------------------------------------------------------------------
ToolTipHelper.GetProjectToolTip = function(projectType)
-- ToolTip Format
-- <Name>
-- <Static Description>
-- <Amenities While Active>
-- <Yield Conversions>
-- <Great Person Points>
local projectReference = GameInfo.Projects[projectType];
local name = projectReference.Name;
local description = projectReference.Description;
local amenitiesWhileActive = projectReference.AmenitiesWhileActive;
-- Build ze tip!
-- Build the tool tip line by line.
local toolTipLines = {};
table.insert(toolTipLines, Locale.ToUpper(name));
table.insert(toolTipLines, Locale.Lookup("LOC_PROJECT_NAME"));
AddProjectStrategicResourceTooltip(projectReference, toolTipLines);
if(not Locale.IsNilOrWhitespace(description)) then
table.insert(toolTipLines, "[NEWLINE]" .. Locale.Lookup(description));
end
AddReactorProjectData(projectReference, toolTipLines);
if (amenitiesWhileActive ~= nil and amenitiesWhileActive > 0) then
table.insert(toolTipLines, Locale.Lookup("LOC_PROJECT_AMENITIES_WHILE_ACTIVE", amenitiesWhileActive));
end
for row in GameInfo.Project_YieldConversions() do
if(row.ProjectType == projectType) then
local yield = GameInfo.Yields[row.YieldType];
if(yield) then
local yieldIcon = yield.IconString;
local yieldName = yield.Name;
local percent = row.PercentOfProductionRate; --TODO: Include player bonuses, like those from government
table.insert(toolTipLines, Locale.Lookup("LOC_PROJECT_YIELD_CONVERSIONS", yieldIcon, yieldName, percent));
end
end
end
for row in GameInfo.Project_GreatPersonPoints() do
if(row.ProjectType == projectType) then
local greatPersonClass = GameInfo.GreatPersonClasses[row.GreatPersonClassType];
if(greatPersonClass) then
local greatPersonClassName = greatPersonClass.Name;
local greatPersonClassIconString = greatPersonClass.IconString;
table.insert(toolTipLines, Locale.Lookup("LOC_PROJECT_GREAT_PERSON_POINTS", greatPersonClassIconString, greatPersonClassName));
end
end
end
-- Return the composite tooltip!
return table.concat(toolTipLines, "[NEWLINE]");
end
-------------------------------------------------------------------------------
As it says, there should be a text that says <Yield Conversions> and <Great Person Points> in the project's tooltip.
However, this code does not work in the game.
I want to make a mod that fixes this code to work, but I can't find what the problem is. I think there's no problem with the GameInfo.Yields or GameInfo.Project_GreatPersonPoints tables.
Could anyone help me?
In the ToolTipHelper.lua file in the civ6 game, The tooltip for the project looks like this:
-------------------------------------------------------------------------------
ToolTipHelper.GetProjectToolTip = function(projectType)
-- ToolTip Format
-- <Name>
-- <Static Description>
-- <Amenities While Active>
-- <Yield Conversions>
-- <Great Person Points>
local projectReference = GameInfo.Projects[projectType];
local name = projectReference.Name;
local description = projectReference.Description;
local amenitiesWhileActive = projectReference.AmenitiesWhileActive;
-- Build ze tip!
-- Build the tool tip line by line.
local toolTipLines = {};
table.insert(toolTipLines, Locale.ToUpper(name));
table.insert(toolTipLines, Locale.Lookup("LOC_PROJECT_NAME"));
AddProjectStrategicResourceTooltip(projectReference, toolTipLines);
if(not Locale.IsNilOrWhitespace(description)) then
table.insert(toolTipLines, "[NEWLINE]" .. Locale.Lookup(description));
end
AddReactorProjectData(projectReference, toolTipLines);
if (amenitiesWhileActive ~= nil and amenitiesWhileActive > 0) then
table.insert(toolTipLines, Locale.Lookup("LOC_PROJECT_AMENITIES_WHILE_ACTIVE", amenitiesWhileActive));
end
for row in GameInfo.Project_YieldConversions() do
if(row.ProjectType == projectType) then
local yield = GameInfo.Yields[row.YieldType];
if(yield) then
local yieldIcon = yield.IconString;
local yieldName = yield.Name;
local percent = row.PercentOfProductionRate; --TODO: Include player bonuses, like those from government
table.insert(toolTipLines, Locale.Lookup("LOC_PROJECT_YIELD_CONVERSIONS", yieldIcon, yieldName, percent));
end
end
end
for row in GameInfo.Project_GreatPersonPoints() do
if(row.ProjectType == projectType) then
local greatPersonClass = GameInfo.GreatPersonClasses[row.GreatPersonClassType];
if(greatPersonClass) then
local greatPersonClassName = greatPersonClass.Name;
local greatPersonClassIconString = greatPersonClass.IconString;
table.insert(toolTipLines, Locale.Lookup("LOC_PROJECT_GREAT_PERSON_POINTS", greatPersonClassIconString, greatPersonClassName));
end
end
end
-- Return the composite tooltip!
return table.concat(toolTipLines, "[NEWLINE]");
end
-------------------------------------------------------------------------------
As it says, there should be a text that says <Yield Conversions> and <Great Person Points> in the project's tooltip.
However, this code does not work in the game.
I want to make a mod that fixes this code to work, but I can't find what the problem is. I think there's no problem with the GameInfo.Yields or GameInfo.Project_GreatPersonPoints tables.
Could anyone help me?