Locale.Compare (Civ5 API)

From Civilization Modding Wiki
Revision as of 20:39, 19 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of Locale.

This is a static method, invoke it with a dot.


Usage

int Locale.Compare(string a, string b)


Returned Value

No description available.

Parameters

a: No description available.
b: No description available.


Source code samples

Redundant occurences have been removed.

AdvancedSetup.lua

UI/FrontEnd/GameSetup/AdvancedSetup.lua
0411
table.sort(civs, function(a,b) return Locale.Compare(a.LeaderDescription, b.LeaderDescription) == -1; end);


ChoosePantheonPopup.lua (G&K)

DLC/Expansion/UI/InGame/Popups/ChoosePantheonPopup.lua
0097
table.sort(availablePantheonBeliefs, function(a,b) return Locale.Compare(a.Name, b.Name) < 0; end);


ChooseReligionPopup.lua (G&K)

DLC/Expansion/UI/InGame/Popups/ChooseReligionPopup.lua
0124
table.sort(availableFounderBeliefs, function(a,b) return Locale.Compare(a.Name, b.Name) < 0; end);
0153
table.sort(availableFollowerBeliefs, function(a,b) return Locale.Compare(a.Name, b.Name) < 0; end);
0209
table.sort(availableEnhancerBeliefs, function(a,b) return Locale.Compare(a.Name, b.Name) < 0; end);
0237
table.sort(availableBonusBeliefs, function(a,b) return Locale.Compare(a.Name, b.Name) < 0; end);


CivilopediaScreen.lua

UI/Civilopedia/CivilopediaScreen.lua
0008
return Locale.Compare(a.entryName, b.entryName) == -1;


DiploCorner.lua

UI/InGame/WorldView/DiploCorner.lua
0081
return (Locale.Compare(a.text, b.text) == -1);


EspionageOverview.lua (G&K)

DLC/Expansion/UI/InGame/Popups/EspionageOverview.lua
1509
return Locale.Compare(a[field], b[field]) == -1;
1513
return Locale.Compare(a[field], b[field]) == 1;


GameMenu.lua

UI/InGame/Menus/GameMenu.lua
0450
table.sort(sortedActivatedMods, function(a,b) return Locale.Compare(a.Title, b.Title) == -1 end);


InstalledPanel.lua

UI/FrontEnd/Modding/InstalledPanel.lua
0038
return (Locale.Compare(a.DisplayName, b.DisplayName) == -1);
0048
return (Locale.Compare(a.DisplayName, b.DisplayName) == 1);


LoadMenu.lua

UI/FrontEnd/LoadMenu.lua
0635
return Locale.Compare(oa.Title, ob.Title) == -1;
0648
return Locale.Compare(ob.Title, oa.Title) == -1;


Lobby.lua

UI/FrontEnd/Multiplayer/Lobby.lua
0472
compareResult = Locale.Compare(aRowData[v.Column], bRowData[v.Column]);
0475
compareResult = Locale.Compare(bRowData[v.Column], aRowData[v.Column]);


PremiumContentMenu.lua

UI/FrontEnd/PremiumContentMenu.lua
0077
return Locale.Compare(a.Description, b.Description) == -1;


ReligionOverview.lua (G&K)

DLC/Expansion/UI/InGame/Popups/ReligionOverview.lua
0313
table.sort(sortedGreatPeople, function(a,b) return Locale.Compare(a,b) == -1 end);


ReplayViewer.lua

UI/InGame/Popups/ReplayViewer.lua
1223
table.sort(graphEntries, function(a,b) return Locale.Compare(a[1], b[1]) == -1; end);


ScenariosMenu.lua

UI/FrontEnd/ScenariosMenu.lua
0162
table.sort(g_ScenarioList, function(a,b) return Locale.Compare(a.DisplayName, b.DisplayName) == -1 end);


SelectCivilization.lua

UI/FrontEnd/GameSetup/SelectCivilization.lua
0194
table.sort(civEntries, function(a, b) return Locale.Compare(a[1], b[1]) == -1 end);


StagingRoom.lua

UI/FrontEnd/Multiplayer/StagingRoom.lua
1036
table.sort(civEntries, function(a,b) return Locale.Compare(a.Title, b.Title) == -1; end);


TechButtonInclude.lua (G&K)

DLC/Expansion/UI/InGame/TechTree/TechButtonInclude.lua
0207
table.sort(sortedYieldChanges, function(a,b) return Locale.Compare(a[1], b[1]) == -1 end);
0213
table.sort(v[2], function(a,b) return Locale.Compare(a,b) == -1 end);



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.