Changed: Removed extraenous spaces at the end of lines

This commit is contained in:
kervala 2016-02-20 20:41:34 +01:00
parent 9dff74badf
commit 08c30dc32b

View file

@ -8,6 +8,7 @@ if (outgame==nil) then
end end
------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------
-- Name generator. -- Name generator.
@ -17,88 +18,88 @@ end
-- zorai: given name one 318, given name two 644, surname 1287 -- zorai: given name one 318, given name two 644, surname 1287
-- tryker: given name 4500, surname 4335 -- tryker: given name 4500, surname 4335
function outgame:getFyrosName() function outgame:getFyrosName()
local nameResult = ""; local nameResult = "";
local fullnameResult = ""; local fullnameResult = "";
local nbFyrosGivenNames = 0; local nbFyrosGivenNames = 0;
for _ in pairs(fyrosGivenNames) do nbFyrosGivenNames = nbFyrosGivenNames + 1 end for _ in pairs(fyrosGivenNames) do nbFyrosGivenNames = nbFyrosGivenNames + 1 end
local givenName = fyrosGivenNames[math.random(nbFyrosGivenNames)]; local givenName = fyrosGivenNames[math.random(nbFyrosGivenNames)];
local nbFyrosSurnames = 0; local nbFyrosSurnames = 0;
for _ in pairs(fyrosSurnames) do nbFyrosSurnames = nbFyrosSurnames + 1 end for _ in pairs(fyrosSurnames) do nbFyrosSurnames = nbFyrosSurnames + 1 end
local surname = fyrosSurnames[math.random(nbFyrosSurnames)]; local surname = fyrosSurnames[math.random(nbFyrosSurnames)];
fullnameResult = givenName .. " " .. surname; fullnameResult = givenName .. " " .. surname;
nameResult = surname; nameResult = surname;
return fullnameResult, nameResult return fullnameResult, nameResult
end end
function outgame:getMatisName(sex) function outgame:getMatisName(sex)
local nameResult = ""; local nameResult = "";
local fullnameResult = ""; local fullnameResult = "";
local dbNameSex = getDbProp("UI:TEMP:NAME_SEX"); local dbNameSex = getDbProp("UI:TEMP:NAME_SEX");
if sex ~= nil then if sex ~= nil then
dbNameSex = sex dbNameSex = sex
end end
if tonumber( dbNameSex )== 1 then if tonumber( dbNameSex )== 1 then
local nbMatisMaleNames = 0; local nbMatisMaleNames = 0;
for _ in pairs(matisMaleNames) do nbMatisMaleNames = nbMatisMaleNames + 1 end for _ in pairs(matisMaleNames) do nbMatisMaleNames = nbMatisMaleNames + 1 end
givenName = matisMaleNames[math.random(nbMatisMaleNames)]; givenName = matisMaleNames[math.random(nbMatisMaleNames)];
else else
local nbMatisFemaleNames = 0; local nbMatisFemaleNames = 0;
for _ in pairs(matisFemaleNames) do nbMatisFemaleNames = nbMatisFemaleNames + 1 end for _ in pairs(matisFemaleNames) do nbMatisFemaleNames = nbMatisFemaleNames + 1 end
givenName = matisFemaleNames[math.random(nbMatisFemaleNames)]; givenName = matisFemaleNames[math.random(nbMatisFemaleNames)];
end end
local nbMatisSurnames = 0; local nbMatisSurnames = 0;
for _ in pairs(matisSurnames) do nbMatisSurnames = nbMatisSurnames + 1 end for _ in pairs(matisSurnames) do nbMatisSurnames = nbMatisSurnames + 1 end
local surname = matisSurnames[math.random(nbMatisSurnames)]; local surname = matisSurnames[math.random(nbMatisSurnames)];
fullnameResult = givenName .. " " .. surname; fullnameResult = givenName .. " " .. surname;
nameResult = givenName; nameResult = givenName;
return fullnameResult, nameResult return fullnameResult, nameResult
end end
function outgame:getTrykerName() function outgame:getTrykerName()
local nameResult = ""; local nameResult = "";
local fullnameResult = ""; local fullnameResult = "";
local nbTrykerGivenNames = 0; local nbTrykerGivenNames = 0;
for _ in pairs(trykerGivenNames) do nbTrykerGivenNames = nbTrykerGivenNames + 1 end for _ in pairs(trykerGivenNames) do nbTrykerGivenNames = nbTrykerGivenNames + 1 end
local givenName = trykerGivenNames[math.random(nbTrykerGivenNames)]; local givenName = trykerGivenNames[math.random(nbTrykerGivenNames)];
local nbTrykerSurnames = 0; local nbTrykerSurnames = 0;
for _ in pairs(trykerSurnames) do nbTrykerSurnames = nbTrykerSurnames + 1 end for _ in pairs(trykerSurnames) do nbTrykerSurnames = nbTrykerSurnames + 1 end
local surname = trykerSurnames[math.random(nbTrykerSurnames)]; local surname = trykerSurnames[math.random(nbTrykerSurnames)];
fullnameResult = surname .. " " .. givenName; fullnameResult = surname .. " " .. givenName;
nameResult = givenName; nameResult = givenName;
return fullnameResult, nameResult return fullnameResult, nameResult
end end
function outgame:getZoraiName() function outgame:getZoraiName()
local nameResult = ""; local nameResult = "";
local fullnameResult = ""; local fullnameResult = "";
local nbGivenNameOne = 0; local nbGivenNameOne = 0;
for _ in pairs(zoraiGivenNameOne) do nbGivenNameOne = nbGivenNameOne + 1 end for _ in pairs(zoraiGivenNameOne) do nbGivenNameOne = nbGivenNameOne + 1 end
local givenNameOne = zoraiGivenNameOne[math.random(nbGivenNameOne)]; local givenNameOne = zoraiGivenNameOne[math.random(nbGivenNameOne)];
local nbGivenNameTwo = 0; local nbGivenNameTwo = 0;
for _ in pairs(zoraiGivenNameTwo) do nbGivenNameTwo = nbGivenNameTwo + 1 end for _ in pairs(zoraiGivenNameTwo) do nbGivenNameTwo = nbGivenNameTwo + 1 end
local givenNameTwo = zoraiGivenNameTwo[math.random(nbGivenNameTwo)]; local givenNameTwo = zoraiGivenNameTwo[math.random(nbGivenNameTwo)];
local nbSurnames = 0; local nbSurnames = 0;
for _ in pairs(zoraiSurnames) do nbSurnames = nbSurnames + 1 end for _ in pairs(zoraiSurnames) do nbSurnames = nbSurnames + 1 end
local surname = zoraiSurnames[math.random(nbSurnames)]; local surname = zoraiSurnames[math.random(nbSurnames)];
fullnameResult = surname .. " " .. givenNameOne .. "-" .. givenNameTwo; fullnameResult = surname .. " " .. givenNameOne .. "-" .. givenNameTwo;
nameResult = givenNameOne .. givenNameTwo; nameResult = givenNameOne .. givenNameTwo;
return fullnameResult, nameResult return fullnameResult, nameResult
end end
@ -108,10 +109,10 @@ function outgame:procGenerateName()
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 -->
local givenName = ""; local givenName = "";
@ -147,7 +148,7 @@ function outgame:procGenerateName()
-- Zorai -- Zorai
fullnameResult, tempResult_1 = self:getZoraiName() fullnameResult, tempResult_1 = self:getZoraiName()
end end
if tonumber(dbNameSubRace2) == 1 then if tonumber(dbNameSubRace2) == 1 then
-- Fyros -- Fyros
fullnameResult, tempResult_2 = self:getFyrosName() fullnameResult, tempResult_2 = self:getFyrosName()
@ -164,13 +165,13 @@ function outgame:procGenerateName()
-- Zorai -- Zorai
fullnameResult, tempResult_2 = self:getZoraiName() fullnameResult, tempResult_2 = self:getZoraiName()
end end
fullnameResult = tempResult_1 .. " " .. tempResult_2 fullnameResult = tempResult_1 .. " " .. tempResult_2
nameResult = tempResult_2 nameResult = tempResult_2
end end
uiNameFull.hardtext = fullnameResult; uiNameFull.hardtext = fullnameResult;
nameResult = string.gsub(nameResult, "'", ""); nameResult = string.gsub(nameResult, "'", "");
nameResult = string.gsub(nameResult, " ", ""); nameResult = string.gsub(nameResult, " ", "");
nameResult = string.gsub(nameResult, "-", ""); nameResult = string.gsub(nameResult, "-", "");
@ -183,28 +184,28 @@ 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");
local uiNameSubRaceSlider = getUI("ui:outgame:appear_name:name_sub_race_slider"); local uiNameSubRaceSlider = getUI("ui:outgame:appear_name:name_sub_race_slider");
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;
@ -212,7 +213,7 @@ function outgame:procUpdateNameRaceLabel()
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
uiNameSubRaceSlider.active = true; uiNameSubRaceSlider.active = true;
@ -222,21 +223,21 @@ function outgame:procUpdateNameRaceLabel()
uiNameSubRaceSlider.active = false; uiNameSubRaceSlider.active = false;
uiNameSubRace2Slider.active = false; uiNameSubRace2Slider.active = false;
end end
uiNameRaceText.hardtext= tostring(nameRaceType[tonumber(dbNameRace)]); uiNameRaceText.hardtext= tostring(nameRaceType[tonumber(dbNameRace)]);
end end
local matisF = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Female")) )):gsub("^%l", string.upper); local matisF = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Female")) )):gsub("^%l", string.upper);
local matisM = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Male")) )):gsub("^%l", string.upper); local matisM = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Male")) )):gsub("^%l", string.upper);
function outgame:procUpdateNameSubRaceLabel() function outgame:procUpdateNameSubRaceLabel()
local nameSubRaceType = { "Fyros", matisF, matisM, "Tryker", "Zoraï" } local nameSubRaceType = { "Fyros", matisF, matisM, "Tryker", "Zoraï" }
local uiNameSubRaceText = getUI("ui:outgame:appear_name:name_sub_race_slider:name_race"); local uiNameSubRaceText = getUI("ui:outgame:appear_name:name_sub_race_slider:name_race");
local dbNameSubRace = getDbProp("UI:TEMP:NAME_SUB_RACE"); local dbNameSubRace = getDbProp("UI:TEMP:NAME_SUB_RACE");
uiNameSubRaceText.hardtext= tostring(nameSubRaceType[tonumber(dbNameSubRace)]); uiNameSubRaceText.hardtext= tostring(nameSubRaceType[tonumber(dbNameSubRace)]);
end end
function outgame:procUpdateNameSubRace2Label() function outgame:procUpdateNameSubRace2Label()
@ -244,7 +245,7 @@ function outgame:procUpdateNameSubRace2Label()
local uiNameSubRace2Text = getUI("ui:outgame:appear_name:name_sub_race2_slider:name_race"); local uiNameSubRace2Text = getUI("ui:outgame:appear_name:name_sub_race2_slider:name_race");
local dbNameSubRace2 = getDbProp("UI:TEMP:NAME_SUB_RACE2"); local dbNameSubRace2 = getDbProp("UI:TEMP:NAME_SUB_RACE2");
uiNameSubRace2Text.hardtext= tostring(nameSubRace2Type[tonumber(dbNameSubRace2)]); uiNameSubRace2Text.hardtext= tostring(nameSubRace2Type[tonumber(dbNameSubRace2)]);
end end
@ -290,15 +291,15 @@ function outgame:buildActionPack()
-- Build Default Combat -- Build Default Combat
self:activePackElement(1, 'f1.tga'); -- Dagger self:activePackElement(1, 'f1.tga'); -- Dagger
self:activePackElement(2, 'f2.tga'); -- Accurate Attack self:activePackElement(2, 'f2.tga'); -- Accurate Attack
-- Build Default Magic -- Build Default Magic
self:activePackElement(6, 'm2.tga'); -- Gloves self:activePackElement(6, 'm2.tga'); -- Gloves
self:activePackElement(7, 'm1.tga'); -- Acid self:activePackElement(7, 'm1.tga'); -- Acid
-- Build Default Forage -- Build Default Forage
self:activePackElement(11, 'g1.tga'); -- Forage Tool self:activePackElement(11, 'g1.tga'); -- Forage Tool
self:activePackElement(12, 'g2.tga'); -- Basic Extract self:activePackElement(12, 'g2.tga'); -- Basic Extract
-- Build Default Craft -- Build Default Craft
self:activePackElement(16, 'c2.tga'); -- Craft Tool self:activePackElement(16, 'c2.tga'); -- Craft Tool
self:activePackElement(17, 'c1.tga'); -- 50 raw mat self:activePackElement(17, 'c1.tga'); -- 50 raw mat
@ -323,8 +324,8 @@ function outgame:buildActionPack()
self:setPackJobText('M', 1); self:setPackJobText('M', 1);
self:setPackJobText('G', 1); self:setPackJobText('G', 1);
self:setPackJobText('C', 1); self:setPackJobText('C', 1);
-- Set correct text for specalized version -- Set correct text for specalized version
if (getDbProp('UI:TEMP:JOB_FIGHT') == 2) then if (getDbProp('UI:TEMP:JOB_FIGHT') == 2) then
self:setPackJobText('F', 2); self:setPackJobText('F', 2);
elseif (getDbProp('UI:TEMP:JOB_MAGIC') == 2) then elseif (getDbProp('UI:TEMP:JOB_MAGIC') == 2) then
@ -334,7 +335,7 @@ function outgame:buildActionPack()
elseif (getDbProp('UI:TEMP:JOB_CRAFT') == 2) then elseif (getDbProp('UI:TEMP:JOB_CRAFT') == 2) then
self:setPackJobText('C', 2); self:setPackJobText('C', 2);
end end
end end
@ -375,8 +376,8 @@ end
--function outgame:setPatchProgress(progress) --function outgame:setPatchProgress(progress)
-- --debugInfo("*** 3 ***") -- --debugInfo("*** 3 ***")
-- local progressPercentText = string.format("%d%%", 100 * progress) -- local progressPercentText = string.format("%d%%", 100 * progress)
-- local progressPostfix = math.fmod(os.time(), 3) -- local progressPostfix = math.fmod(os.time(), 3)
-- --debugInfo("Patch in progress : " .. tostring(progress)) -- --debugInfo("Patch in progress : " .. tostring(progress))
-- local progressDate = nltime.getLocalTime() / 500 -- local progressDate = nltime.getLocalTime() / 500
-- local colValue = math.floor(230 + 24 * math.sin(progressDate)) -- local colValue = math.floor(230 + 24 * math.sin(progressDate))
-- local color = string.format("%d %d %d %d", colValue, colValue, colValue, 255) -- local color = string.format("%d %d %d %d", colValue, colValue, colValue, 255)
@ -392,7 +393,7 @@ end
-- --
--function outgame:setPatchError() --function outgame:setPatchError()
-- --debugInfo("*** 5 ***") -- --debugInfo("*** 5 ***")
-- --debugInfo("Patch error") -- --debugInfo("Patch error")
-- self:setProgressText(i18n.get("uiBGD_PatchError"), "255 0 0 255", 0) -- self:setProgressText(i18n.get("uiBGD_PatchError"), "255 0 0 255", 0)
--end --end
-- --
@ -408,9 +409,9 @@ end
function outgame:launchGame() function outgame:launchGame()
if not isPlayerSlotNewbieLand(getPlayerSelectedSlot()) then if not isPlayerSlotNewbieLand(getPlayerSelectedSlot()) then
if not isFullyPatched() then if not isFullyPatched() then
messageBoxWithHelp(i18n.get("uiBGD_MainlandCharFullPatchNeeded"), "ui:outgame") messageBoxWithHelp(i18n.get("uiBGD_MainlandCharFullPatchNeeded"), "ui:outgame")
return return
end end
end end
runAH(getUICaller(), "proc", "proc_charsel_play") runAH(getUICaller(), "proc", "proc_charsel_play")
end end