Changed: Minor changes (spaces replaced by tabs)

--HG--
branch : develop
This commit is contained in:
kervala 2016-03-14 23:58:58 +01:00
parent 0a16b3b8dd
commit 7366a1f994
2 changed files with 427 additions and 422 deletions

View file

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

View file

@ -49,14 +49,14 @@
<!-- Name Generator. -->
<!-- We start at 1 not 0. -->
<variable entry="UI:TEMP:NAME_RACE" type="sint64" value="1" />
<variable entry="UI:TEMP:NAME_RACE" type="sint64" value="1" />
<!-- used for marauder names. -->
<variable entry="UI:TEMP:NAME_SUB_RACE" type="sint64" value="1" />
<variable entry="UI:TEMP:NAME_SUB_RACE2" type="sint64" value="1" />
<!-- you will have to change the max value of the slider too, since it seam not working to set it using that var directly. -->
<variable entry="UI:TEMP:NAME_RACE_NB" type="sint64" value="5" />
<variable entry="UI:TEMP:NAME_RACE_NB" type="sint64" value="5" />
<!-- We start at 1 not 0. -->
<variable entry="UI:TEMP:NAME_SEX" type="sint64" value="1" />
<variable entry="UI:TEMP:NAME_SEX" type="sint64" value="1" />
<!-- End Name Generator. -->
<template name="char_var_dec" id="#id" >
@ -1273,20 +1273,19 @@
<group type="modal" id="appear_name" posref="MM MM" w="400" h="680"
mouse_pos="false" escapable="false" exit_click_out="false"
on_active="proc" on_active_params="proc_appear_name_active"
display="false"
>
display="false">
<instance template="outgame_popup" id="back" posref="TL TL" />
<view type="text" id="text" posref="TM TM" x="0" y="-56" color="255 255 255 255" global_color="false" fontsize="17" multi_line="true" multi_line_space="0"
line_maxw="350" shadow="true" hardtext="uiCP_Name_Enter" />
<!-- NamingPolicy -->
<ctrl style="opt_button" id="name_policy" posref="BM BM" posparent="text" x="0" y="-40" hardtext="uiCP_Name_Policy"
text_color_over="208 258 16 255" text_color_normal="255 255 46 255" text_color_pushed="108 158 16 255"
onover="play_sound" params_over="name=specie_but_over"
onclick_l="open_url" params_l="cfg_ConditionsTermsURL" />
<!-- onclick_l="open_url" params_l="cfg_NamingPolicyURL" /> -->
<!-- NamingPolicy -->
<ctrl style="opt_button" id="name_policy" posref="BM BM" posparent="text" x="0" y="-40" hardtext="uiCP_Name_Policy"
text_color_over="208 258 16 255" text_color_normal="255 255 46 255" text_color_pushed="108 158 16 255"
onover="play_sound" params_over="name=specie_but_over"
onclick_l="open_url" params_l="cfg_ConditionsTermsURL" />
<!-- onclick_l="open_url" params_l="cfg_NamingPolicyURL" /> -->
<group type="edit_box" id="eb" posparent="name_policy" posref="BM TM" x="0" y="-8" w="300" h="52" render_layer="4" child_resize_h="true"
onenter="proc" params="proc_appear_name_enter"
@ -1531,7 +1530,7 @@
<action handler="set" params="target_property=ui:outgame:appear_name:eb:input_string|value=''" />
<action handler="set_keyboard_focus" params="target=ui:outgame:appear_name:eb|select_all=false" />
<!-- Name generator init. -->
<!-- Name generator init. -->
<action handler="set" params="target_property=ui:outgame:appear_name:name_sex_slider:name_sex_scroll:value|value=add(@UI:TEMP:CHAR3D:VPA:SEX,1)" />
<action handler="set" params="target_property=ui:outgame:appear_name:name_race_slider:name_race_scroll:value|value=add(@UI:TEMP:CHAR3D:PEOPLE,1)" />
<action handler="set" params="target_property=ui:outgame:appear_name:name_sub_race_slider:name_race_scroll:value|value=1" />
@ -1539,14 +1538,14 @@
<action handler="set" params="dblink=UI:TEMP:NAME_SEX|value=add(@UI:TEMP:CHAR3D:VPA:SEX,1)" />
<action handler="set" params="dblink=UI:TEMP:NAME_RACE|value=add(@UI:TEMP:CHAR3D:PEOPLE,1)" />
<action handler="set" params="dblink=UI:TEMP:NAME_SUB_RACE|value=1" />
<action handler="set" params="dblink=UI:TEMP:NAME_SUB2_RACE|value=1" />
<action handler="set" params="dblink=UI:TEMP:NAME_SUB_RACE_FIRST_NAME|value=1" />
<action handler="set" params="dblink=UI:TEMP:NAME_SUB_RACE_LAST_NAME|value=1" />
<action handler="lua:outgame:procUpdateNameSexLabel()" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
<action handler="lua:outgame:procUpdateNameSubRaceLabel()" />
<action handler="lua:outgame:procUpdateNameSubRace2Label()" />
<!-- End Name Generator. -->
<action handler="lua:outgame:procUpdateNameSexLabel()" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
<action handler="lua:outgame:procUpdateNameSubRaceFirstNameLabel()" />
<action handler="lua:outgame:procUpdateNameSubRaceLastNameLabel()" />
<!-- End Name Generator. -->
</proc>
@ -1624,31 +1623,31 @@
<!-- Name Generator. -->
<proc id="proc_appear_name_generate">
<action handler="lua:outgame:procGenerateName()" />
<action handler="lua:outgame:procGenerateName()" />
</proc>
<!-- Name Sex. -->
<proc id="proc_appear_name_sex_label_change">
<action handler="lua:outgame:procUpdateNameSexLabel()" />
<action handler="lua:outgame:procUpdateNameSexLabel()" />
</proc>
<proc id="proc_appear_name_sex_add_one">
<action handler="set" params="dblink=UI:TEMP:NAME_SEX|value=min(add(@UI:TEMP:NAME_SEX,1),2)" />
<action handler="lua:outgame:procUpdateNameSexLabel()" />
<action handler="lua:outgame:procUpdateNameSexLabel()" />
</proc>
<proc id="proc_appear_name_sex_sub_one">
<action handler="set" params="dblink=UI:TEMP:NAME_SEX|value=max(sub(@UI:TEMP:NAME_SEX,1),1)" />
<action handler="lua:outgame:procUpdateNameSexLabel()" />
<action handler="lua:outgame:procUpdateNameSexLabel()" />
</proc>
<!-- Name Race. -->
<proc id="proc_appear_name_race_label_change">
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
</proc>
<proc id="proc_appear_name_race_add_one">
<action handler="set" params="dblink=UI:TEMP:NAME_RACE|value=min(add(@UI:TEMP:NAME_RACE,1),@UI:TEMP:NAME_RACE_NB)" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
</proc>
<proc id="proc_appear_name_race_sub_one">
<action handler="set" params="dblink=UI:TEMP:NAME_RACE|value=max(sub(@UI:TEMP:NAME_RACE,1),1)" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
<action handler="lua:outgame:procUpdateNameRaceLabel()" />
</proc>
<!-- Name Sub Race. -->
<proc id="proc_appear_name_sub_race_label_change">