slightlycynical
Chieftain
- Joined
- Jan 11, 2017
- Messages
- 6
The score panel is not ordered by score but by id (inconvenient and stupid).
INB4 the are never going to fix this, the fix works like this:
Fixed version of the function "ViewScore()" in "Sid Meier's Civilization VI\Base\Assets\UI\PartialScreens\WorldRankings.lua" (line 788)
edit: code-tags eingebaut
INB4 the are never going to fix this, the fix works like this:
Fixed version of the function "ViewScore()" in "Sid Meier's Civilization VI\Base\Assets\UI\PartialScreens\WorldRankings.lua" (line 788)
Code:
function ViewScore()
ResetState(ViewScore);
Controls.ScoreView:SetHide(false);
ChangeActiveHeader("VICTORY_SCORE", m_GenericHeaderIM, Controls.ScoreViewHeader);
local subTitle:string = Locale.Lookup("LOC_WORLD_RANKINGS_SCORE_CONDITION", Game.GetMaxGameTurns());
PopulateGenericHeader(RealizeScoreStackSize, SCORE_TITLE, subTitle, SCORE_DETAILS, ICON_GENERIC);
m_ScoreIM:ResetInstances();
local playersScore = {};
for i = 0, PlayerManager.GetWasEverAliveCount() - 1 do
local pPlayer = Players;
if (pPlayer:IsAlive() == true and pPlayer:IsMajor() == true) then
table.insert(playersScore, pPlayer);
end
end
-- Sort players by Score, including tiebreaker
table.sort(playersScore, function(a, b)
local aScore = a:GetScore();
local bScore = b:GetScore();
if aScore == bScore then
return a:GetID() < b:GetID(); -- lower id first
end
return aScore > bScore; -- higher score first
end);
for _, scoringPlayer in pairs(playersScore) do
PopulateScoreInstance(m_ScoreIM:GetInstance(), scoringPlayer);
end
RealizeScoreStackSize();
end
edit: code-tags eingebaut
Last edited: