Changed: Minor changes (spaces replaced by tabs)

This commit is contained in:
kervala 2016-03-14 23:58:58 +01:00
parent 49f62f7747
commit 9a4ef0501f
2 changed files with 427 additions and 422 deletions

View file

@ -20,90 +20,93 @@ end
-- Fyros -- Fyros
function outgame:getFyrosFirstName() function outgame:getFyrosFirstName()
local nbFyrosFirstNames = 0; local nbFyrosFirstNames = 0;
for _ in pairs(fyrosFirstNames) do nbFyrosFirstNames = nbFyrosFirstNames + 1 end for _ in pairs(fyrosFirstNames) do nbFyrosFirstNames = nbFyrosFirstNames + 1 end
return fyrosFirstNames[math.random(nbFyrosFirstNames)] return fyrosFirstNames[math.random(nbFyrosFirstNames)]
end end
function outgame:getFyrosLastName()
local nbFyrosLastNames = 0;
for _ in pairs(fyrosLastNames) do nbFyrosLastNames = nbFyrosLastNames + 1 end
return fyrosLastNames[math.random(nbFyrosLastNames)] function outgame:getFyrosLastName()
local nbFyrosLastNames = 0;
for _ in pairs(fyrosLastNames) do nbFyrosLastNames = nbFyrosLastNames + 1 end
return fyrosLastNames[math.random(nbFyrosLastNames)]
end end
-- Matis -- Matis
function outgame:getMatisFirstName(sex) function outgame:getMatisFirstName(sex)
local dbNameSex = getDbProp("UI:TEMP:NAME_SEX"); -- 1 = male, 2 = female
local dbNameSex = getDbProp("UI:TEMP:NAME_SEX");
if sex ~= nil then if sex ~= nil then
dbNameSex = sex; dbNameSex = sex;
end end
local FirstName = "" local FirstName = ""
if tonumber( dbNameSex )== 1 then if tonumber(dbNameSex) == 1 then
local nbMatisMaleFirstNames = 0; local nbMatisMaleFirstNames = 0;
for _ in pairs(matisMaleFirstNames) do nbMatisMaleFirstNames = nbMatisMaleFirstNames + 1 end for _ in pairs(matisMaleFirstNames) do nbMatisMaleFirstNames = nbMatisMaleFirstNames + 1 end
FirstName = matisMaleFirstNames[math.random(nbMatisMaleFirstNames)]; FirstName = matisMaleFirstNames[math.random(nbMatisMaleFirstNames)];
else else
local nbMatisFemaleFirstNames = 0; local nbMatisFemaleFirstNames = 0;
for _ in pairs(matisFemaleFirstNames) do nbMatisFemaleFirstNames = nbMatisFemaleFirstNames + 1 end for _ in pairs(matisFemaleFirstNames) do nbMatisFemaleFirstNames = nbMatisFemaleFirstNames + 1 end
FirstName = matisFemaleFirstNames[math.random(nbMatisFemaleFirstNames)]; FirstName = matisFemaleFirstNames[math.random(nbMatisFemaleFirstNames)];
end end
return FirstName; return FirstName;
end end
function outgame:getMatisLastName() function outgame:getMatisLastName()
local nbMatisLastNames = 0; local nbMatisLastNames = 0;
for _ in pairs(matisLastNames) do nbMatisLastNames = nbMatisLastNames + 1 end for _ in pairs(matisLastNames) do nbMatisLastNames = nbMatisLastNames + 1 end
return matisLastNames[math.random(nbMatisLastNames)] return matisLastNames[math.random(nbMatisLastNames)]
end end
-- Tryker -- Tryker
function outgame:getTrykerFirstName() function outgame:getTrykerFirstName()
local nbTrykerFirstNames = 0; local nbTrykerFirstNames = 0;
for _ in pairs(trykerFirstNames) do nbTrykerFirstNames = nbTrykerFirstNames + 1 end for _ in pairs(trykerFirstNames) do nbTrykerFirstNames = nbTrykerFirstNames + 1 end
return trykerFirstNames[math.random(nbTrykerFirstNames)] return trykerFirstNames[math.random(nbTrykerFirstNames)]
end end
function outgame:getTrykerLastName()
local nbTrykerLastNames = 0;
for _ in pairs(trykerLastNames) do nbTrykerLastNames = nbTrykerLastNames + 1 end
return trykerLastNames[math.random(nbTrykerLastNames)] function outgame:getTrykerLastName()
local nbTrykerLastNames = 0;
for _ in pairs(trykerLastNames) do nbTrykerLastNames = nbTrykerLastNames + 1 end
return trykerLastNames[math.random(nbTrykerLastNames)]
end end
-- Zoraï -- Zoraï
function outgame:getZoraiFirstName() function outgame:getZoraiFirstName()
local nbFirstNamesOne = 0; local nbFirstNamesOne = 0;
for _ in pairs(zoraiFirstNamesOne) do nbFirstNamesOne = nbFirstNamesOne + 1 end for _ in pairs(zoraiFirstNamesOne) do nbFirstNamesOne = nbFirstNamesOne + 1 end
local FirstNameOne = zoraiFirstNamesOne[math.random(nbFirstNamesOne)]; local FirstNameOne = zoraiFirstNamesOne[math.random(nbFirstNamesOne)];
local nbFirstNamesTwo = 0; local nbFirstNamesTwo = 0;
for _ in pairs(zoraiFirstNamesTwo) do nbFirstNamesTwo = nbFirstNamesTwo + 1 end for _ in pairs(zoraiFirstNamesTwo) do nbFirstNamesTwo = nbFirstNamesTwo + 1 end
local FirstNameTwo = zoraiFirstNamesTwo[math.random(nbFirstNamesTwo)]; local FirstNameTwo = zoraiFirstNamesTwo[math.random(nbFirstNamesTwo)];
return FirstNameOne .. "-" .. FirstNameTwo return FirstNameOne .. "-" .. FirstNameTwo
end end
function outgame:getZoraiLastName() function outgame:getZoraiLastName()
local nbLastNames = 0; local nbLastNames = 0;
for _ in pairs(zoraiLastNames) do nbLastNames = nbLastNames + 1 end for _ in pairs(zoraiLastNames) do nbLastNames = nbLastNames + 1 end
return zoraiLastNames[math.random(nbLastNames)] return zoraiLastNames[math.random(nbLastNames)]
end end
function outgame:procGenerateName() function outgame:procGenerateName()
local uiNameFull = getUI("ui:outgame:appear_name:name_full"); local uiNameFull = getUI("ui:outgame:appear_name:name_full");
local uiGenText = getUI("ui:outgame:appear_name:eb"); local uiGenText = getUI("ui:outgame:appear_name:eb");
local dbNameRace = getDbProp("UI:TEMP:NAME_RACE"); local dbNameRace = getDbProp("UI:TEMP:NAME_RACE");
local dbNameSubRace = getDbProp("UI:TEMP:NAME_SUB_RACE"); local dbNameSubRace = getDbProp("UI:TEMP:NAME_SUB_RACE");
local dbNameSubRace2 = getDbProp("UI:TEMP:NAME_SUB_RACE2"); local dbNameSubRace2 = getDbProp("UI:TEMP:NAME_SUB_RACE2");
local nameResult = ""; local nameResult = "";
local fullnameResult = ""; local fullnameResult = "";
-- Look at outgame:procUpdateNameRaceLabel() for the "race" list. -- Look at outgame:procUpdateNameRaceLabel() for the "race" list.
-- fy ma try zo --> -- fy ma try zo -->
@ -175,31 +178,35 @@ function outgame:procGenerateName()
uiNameFull.hardtext = fullnameResult; uiNameFull.hardtext = fullnameResult;
nameResult = string.gsub(nameResult, "'", ""); uiNameFull.hardtext = fullnameResult;
nameResult = string.gsub(nameResult, " ", "");
nameResult = string.gsub(nameResult, "-", ""); nameResult = string.gsub(nameResult, "'", "");
nameResult = string.lower( nameResult ); nameResult = string.gsub(nameResult, " ", "");
nameResult = nameResult:gsub("^%l", string.upper); nameResult = string.gsub(nameResult, "-", "");
uiGenText.input_string = nameResult; nameResult = string.lower( nameResult );
nameResult = nameResult:gsub("^%l", string.upper);
uiGenText.input_string = nameResult;
end end
-- Name sex slider update. -- Name sex slider update.
function outgame:procUpdateNameSexLabel() function outgame:procUpdateNameSexLabel()
local nameSexType = { "uiCP_Sex_Male", "uiCP_Sex_Female" } local nameSexType = { "uiCP_Sex_Male", "uiCP_Sex_Female" }
local uiNameSexText = getUI("ui:outgame:appear_name:name_sex_slider:name_sex"); local uiNameSexText = getUI("ui:outgame:appear_name:name_sex_slider:name_sex");
local uiNameSex = getDbProp("UI:TEMP:NAME_SEX"); local uiNameSex = getDbProp("UI:TEMP:NAME_SEX");
tempstr = tostring(i18n.get(nameSexType[tonumber(uiNameSex)])); tempstr = tostring(i18n.get(nameSexType[tonumber(uiNameSex)]));
tempstr = string.lower( tempstr ); tempstr = string.lower(tempstr);
tempstr = (tempstr:gsub("^%l", string.upper)); tempstr = (tempstr:gsub("^%l", string.upper));
uiNameSexText.hardtext= tempstr; uiNameSexText.hardtext = tempstr;
end end
-- Name race slider update. -- Name race slider update.
function outgame:procUpdateNameRaceLabel() function outgame:procUpdateNameRaceLabel()
local nameRaceType = { "Fyros", "Matis", "Tryker", "Zoraï", "uiCP_Maraudeur" } local nameRaceType = { "Fyros", "Matis", "Tryker", "Zoraï", "uiCP_Maraudeur" }
local uiNameRaceText = getUI("ui:outgame:appear_name:name_race_slider:name_race"); local uiNameRaceText = getUI("ui:outgame:appear_name:name_race_slider:name_race");
local dbNameRace = getDbProp("UI:TEMP:NAME_RACE"); local dbNameRace = getDbProp("UI:TEMP:NAME_RACE");
local uiNameSexSlider = getUI("ui:outgame:appear_name:name_sex_slider"); local uiNameSexSlider = getUI("ui:outgame:appear_name:name_sex_slider");
@ -207,15 +214,15 @@ function outgame:procUpdateNameRaceLabel()
local uiNameSubRace2Slider = getUI("ui:outgame:appear_name:name_sub_race2_slider"); local uiNameSubRace2Slider = getUI("ui:outgame:appear_name:name_sub_race2_slider");
local uiNameGenerate = getUI("ui:outgame:appear_name:generate"); local uiNameGenerate = getUI("ui:outgame:appear_name:generate");
-- Show/Hide sex slider -- Show/Hide sex slider
uiNameGenerate.y = "-50" uiNameGenerate.y = "-50"
if tonumber(dbNameRace) == 2 then if tonumber(dbNameRace) == 2 then
uiNameSexSlider.active = true; uiNameSexSlider.active = true;
uiNameGenerate.y = "-65" uiNameGenerate.y = "-65"
else else
uiNameSexSlider.active = false; uiNameSexSlider.active = false;
end end
-- Show/Hide sub race slider -- Show/Hide sub race slider
if tonumber(dbNameRace) == 5 then if tonumber(dbNameRace) == 5 then
@ -227,8 +234,7 @@ function outgame:procUpdateNameRaceLabel()
uiNameSubRace2Slider.active = false; uiNameSubRace2Slider.active = false;
end end
uiNameRaceText.hardtext = tostring(nameRaceType[tonumber(dbNameRace)]);
uiNameRaceText.hardtext= tostring(nameRaceType[tonumber(dbNameRace)]);
end end