I wrote a little patch, only problem seems to be the localization. Sorry i'm new to lua.
Code: Select all
--- CensusPlus.lua.org 2007-01-27 18:45:15.000000000 +0100
+++ CensusPlus.lua 2007-01-27 18:51:02.000000000 +0100
@@ -2454,6 +2454,7 @@ function CensusPlus_UpdateView()
levelSearch = levelSearch..level..")";
end
+ local maxChars = 0;
local totalCharactersText = nil;
if (levelSearch ~= nil) then
totalCharactersText = format(CENSUSPlus_TOTALCHAR, g_TotalCount)..levelSearch;
@@ -2462,6 +2463,7 @@ function CensusPlus_UpdateView()
end
CensusPlusTotalCharacters:SetText(totalCharactersText);
CensusPlusTotalCharacterXP:SetText(format(CENSUSPlus_TOTALCHARXP, g_TotalCharacterXP));
+ maxChars = g_TotalCount;
CensusPlus_UpdateGuildButtons();
if( CensusPlus_EnableProfiling ) then
@@ -2575,19 +2577,30 @@ function CensusPlus_UpdateView()
-- Accumulate totals for each level
--
local maxCount = 0;
+ local levelSum = 0;
for i = 1, MAX_CHARACTER_LEVEL, 1 do
- if ((levelKey == nil) or (levelKey == i) or (levelKey < 0 and levelKey + i ~= 0)) then
+ if ((levelKey == nil) or (levelKey == i) or (levelKey <0> maxCount) then
maxCount = g_AccumulatorCount;
end
g_LevelCount[i] = g_AccumulatorCount;
+ levelSum = levelSum + g_AccumulatorCount * i;
else
g_LevelCount[i] = 0;
end
end
+ -- Process level data and calculate deviation
+ local mean = floor(levelSum / maxChars);
+ local deviation = 0;
+ for i = 1, MAX_CHARACTER_LEVEL, 1 do
+ deviation = deviation + (i-mean)*(i-mean)*g_LevelCount[i];
+ end
+ deviation = math.sqrt (deviation / maxChars);
+ CensusPlusMeanCharacterLvl:SetText(format(CENSUSPlus_MEANCHARLVL, mean, deviation ));
+
--
-- Update level bars
--
--- localization.de.lua.org 2007-01-27 18:45:15.000000000 +0100
+++ localization.de.lua 2007-01-27 18:52:05.000000000 +0100
@@ -64,6 +64,8 @@ if ( GetLocale() == "deDE" ) then
CENSUSPlus_TOTALCHAR_0 = "Charaktere Gesamte : 0";
CENSUSPlus_TOTALCHARXP = "Charakter-XP Gesamte : %d";
CENSUSPlus_TOTALCHARXP_0 = "Charakter-XP Gesamte : 0";
+ CENSUSPlus_MEANCHARLVL = "Level Durschnitt : %d (s=%d)";
+ CENSUSPlus_MEANCHARLVL_0 = "Level Durschnitt : n/a";
CENSUSPlus_AUTOCLOSEWHO = "Who automatisch beenden";
CENSUSPlus_SHOWMINI = "Mini-Button beim Start";
CENSUSPlus_UNGUILDED = "(ohne Gilde)";
@@ -104,4 +106,4 @@ if ( GetLocale() == "deDE" ) then
CENSUSPLUS_EU_LOCALE = "Bitte gib an, ob du auf einem EURO-Server spielst.";
CENSUSPLUS_LOCALE_SELECT = "Bitte gib an, ob du auf einem US- oder EURO-Server spielst.";
-end
\ No newline at end of file
+end
--- localization.lua.org 2007-01-27 18:45:15.000000000 +0100
+++ localization.lua 2007-01-27 18:52:15.000000000 +0100
@@ -63,6 +63,8 @@ CENSUSPlus_TOTALCHAR = "Total Cha
CENSUSPlus_TOTALCHAR_0 = "Total Characters: 0";
CENSUSPlus_TOTALCHARXP = "Total Character XP: %d";
CENSUSPlus_TOTALCHARXP_0 = "Total Character XP: 0";
+CENSUSPlus_MEANCHARLVL = "Mean Level: %d (s=%d)";
+CENSUSPlus_MEANCHARLVL_0 = "Mean Level: n/a";
CENSUSPlus_AUTOCLOSEWHO = "Automatically Close Who";
CENSUSPlus_SHOWMINI = "Show Mini On Start";
CENSUSPlus_UNGUILDED = "(Unguilded)";
--- localization.fr.lua.org 2007-01-27 18:45:15.000000000 +0100
+++ localization.fr.lua 2007-01-27 18:45:31.000000000 +0100
@@ -64,6 +64,8 @@ if ( GetLocale() == "frFR" ) then
CENSUSPlus_TOTALCHAR_0 = "Nombre de personnages : 0";
CENSUSPlus_TOTALCHARXP = "Nombre d'xp total : %d";
CENSUSPlus_TOTALCHARXP_0 = "Nombre d'xp total : 0";
+ CENSUSPlus_MEANCHARLVL = "Mean Level: %d (s=%d)";
+ CENSUSPlus_MEANCHARLVL_0 = "Mean Level: n/a";
CENSUSPlus_AUTOCLOSEWHO = "Fermeture auto du /Who";
CENSUSPlus_SHOWMINI = "Montrer Mini au d?marrage";
CENSUSPlus_UNGUILDED = "(Sans Guilde)";
@@ -104,4 +106,4 @@ if ( GetLocale() == "frFR" ) then
CENSUSPLUS_EU_LOCALE = "Choisissez si vous jouez sur un serveur EURO";
CENSUSPLUS_LOCALE_SELECT = "Choisissez la localit? de votre serveur";
-end
\ No newline at end of file
+end
--- CensusPlus.xml.org 2007-01-27 18:45:15.000000000 +0100
+++ CensusPlus.xml 2007-01-27 18:45:31.000000000 +0100
@@ -329,6 +329,15 @@
</Anchor>
</Anchors>
</FontString>
+ <FontString>
+ <Anchors>
+ <Anchor>
+ <Offset>
+ <AbsDimension>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ </FontString>
<FontString>
<Anchors>
<Anchor>