1. CHARACTER_FACING_INCREMENT = 2;
  2. MAX_RACES = 10;
  3. MAX_CLASSES_PER_RACE = 11;
  4. NUM_CHAR_CUSTOMIZATIONS = 5;
  5. MIN_CHAR_NAME_LENGTH = 2;
  6. CHARACTER_CREATE_ROTATION_START_X = nil;
  7. CHARACTER_CREATE_INITIAL_FACING = nil;
  8. PAID_CHARACTER_CUSTOMIZATION = 1;
  9. PAID_RACE_CHANGE = 2;
  10. PAID_FACTION_CHANGE = 3;
  11. PAID_SERVICE_CHARACTER_ID = nil;
  12. PAID_SERVICE_TYPE = nil;
  13. FACTION_BACKDROP_COLOR_TABLE = {
  14. ["Alliance"] = {0.5, 0.5, 0.5, 0.09, 0.09, 0.19},
  15. ["Horde"] = {0.5, 0.2, 0.2, 0.19, 0.05, 0.05},
  16. };
  17. FRAMES_TO_BACKDROP_COLOR = {
  18. "CharacterCreateCharacterRace",
  19. "CharacterCreateCharacterClass",
  20. -- "CharacterCreateCharacterFaction",
  21. "CharacterCreateNameEdit",
  22. };
  23. RACE_ICON_TCOORDS = {
  24. ["HUMAN_MALE"] = {0, 0.125, 0, 0.25},
  25. ["DWARF_MALE"] = {0.125, 0.25, 0, 0.25},
  26. ["GNOME_MALE"] = {0.25, 0.375, 0, 0.25},
  27. ["NIGHTELF_MALE"] = {0.375, 0.5, 0, 0.25},
  28. ["TAUREN_MALE"] = {0, 0.125, 0.25, 0.5},
  29. ["SCOURGE_MALE"] = {0.125, 0.25, 0.25, 0.5},
  30. ["TROLL_MALE"] = {0.25, 0.375, 0.25, 0.5},
  31. ["ORC_MALE"] = {0.375, 0.5, 0.25, 0.5},
  32. ["HUMAN_FEMALE"] = {0, 0.125, 0.5, 0.75},
  33. ["DWARF_FEMALE"] = {0.125, 0.25, 0.5, 0.75},
  34. ["GNOME_FEMALE"] = {0.25, 0.375, 0.5, 0.75},
  35. ["NIGHTELF_FEMALE"] = {0.375, 0.5, 0.5, 0.75},
  36. ["TAUREN_FEMALE"] = {0, 0.125, 0.75, 1.0},
  37. ["SCOURGE_FEMALE"] = {0.125, 0.25, 0.75, 1.0},
  38. ["TROLL_FEMALE"] = {0.25, 0.375, 0.75, 1.0},
  39. ["ORC_FEMALE"] = {0.375, 0.5, 0.75, 1.0},
  40. ["BLOODELF_MALE"] = {0.5, 0.625, 0.25, 0.5},
  41. ["BLOODELF_FEMALE"] = {0.5, 0.625, 0.75, 1.0},
  42. ["DRAENEI_MALE"] = {0.5, 0.625, 0, 0.25},
  43. ["DRAENEI_FEMALE"] = {0.5, 0.625, 0.5, 0.75},
  44. };
  45. CLASS_ICON_TCOORDS = {
  46. ["WARRIOR"] = {0, 0.25, 0, 0.25},
  47. ["MAGE"] = {0.25, 0.49609375, 0, 0.25},
  48. ["ROGUE"] = {0.49609375, 0.7421875, 0, 0.25},
  49. ["DRUID"] = {0.7421875, 0.98828125, 0, 0.25},
  50. ["HUNTER"] = {0, 0.25, 0.25, 0.5},
  51. ["SHAMAN"] = {0.25, 0.49609375, 0.25, 0.5},
  52. ["PRIEST"] = {0.49609375, 0.7421875, 0.25, 0.5},
  53. ["WARLOCK"] = {0.7421875, 0.98828125, 0.25, 0.5},
  54. ["PALADIN"] = {0, 0.25, 0.5, 0.75},
  55. ["DEATHKNIGHT"] = {0.25, 0.49609375, 0.5, 0.75},
  56. ["DEMONHUNTER"] = {0.49609375, 0.7421875, 0.5, 0.75},
  57. };
  58. function CharacterCreate_OnLoad(self)
  59. self:SetSequence(0);
  60. self:SetCamera(0);
  61. CharacterCreate.numRaces = 0;
  62. CharacterCreate.selectedRace = 0;
  63. CharacterCreate.numClasses = 0;
  64. CharacterCreate.selectedClass = 0;
  65. CharacterCreate.selectedGender = 0;
  66. SetCharCustomizeFrame("CharacterCreate");
  67. --CharCreateModel:SetLight(1, 0, 0, -0.707, -0.707, 0.7, 1.0, 1.0, 1.0, 0.8, 1.0, 1.0, 0.8);
  68. for i=1, NUM_CHAR_CUSTOMIZATIONS, 1 do
  69. _G["CharacterCustomizationButtonFrame"..i.."Text"]:SetText(_G["CHAR_CUSTOMIZATION"..i.."_DESC"]);
  70. end
  71. -- Color edit box backdrop
  72. local backdropColor = FACTION_BACKDROP_COLOR_TABLE["Alliance"];
  73. CharacterCreateNameEdit:SetBackdropBorderColor(backdropColor[1], backdropColor[2], backdropColor[3]);
  74. CharacterCreateNameEdit:SetBackdropColor(backdropColor[4], backdropColor[5], backdropColor[6]);
  75. end
  76. function CharacterCreate_OnShow()
  77. for i=1, MAX_CLASSES_PER_RACE, 1 do
  78. local button = _G["CharacterCreateClassButton"..i];
  79. button:Enable();
  80. SetButtonDesaturated(button, false)
  81. end
  82. for i=1, MAX_RACES, 1 do
  83. local button = _G["CharacterCreateRaceButton"..i];
  84. button:Enable();
  85. SetButtonDesaturated(button, false)
  86. end
  87. if ( PAID_SERVICE_TYPE ) then
  88. CustomizeExistingCharacter( PAID_SERVICE_CHARACTER_ID );
  89. CharacterCreateNameEdit:SetText( PaidChange_GetName() );
  90. else
  91. --randomly selects a combination
  92. ResetCharCustomize();
  93. CharacterCreateNameEdit:SetText("");
  94. CharCreateRandomizeButton:Show();
  95. end
  96. CharacterCreateEnumerateRaces(GetAvailableRaces());
  97. SetCharacterRace(GetSelectedRace());
  98. CharacterCreateEnumerateClasses(GetAvailableClasses());
  99. local_,_,index = GetSelectedClass();
  100. SetCharacterClass(index);
  101. SetCharacterGender(GetSelectedSex())
  102. -- Hair customization stuff
  103. CharacterCreate_UpdateHairCustomization();
  104. SetCharacterCreateFacing(-15);
  105. if ( ALLOW_RANDOM_NAME_BUTTON ) then
  106. CharacterCreateRandomName:Show();
  107. end
  108. GlueFrameFadeIn(CharacterCreate, VX_FADE_LOAD);
  109. -- setup customization
  110. CharacterChangeFixup();
  111. end
  112. function CharacterCreate_OnHide()
  113. PAID_SERVICE_CHARACTER_ID = nil;
  114. PAID_SERVICE_TYPE = nil;
  115. end
  116. function CharacterCreateFrame_OnMouseDown(button)
  117. if ( button == "LeftButton" ) then
  118. CHARACTER_CREATE_ROTATION_START_X = GetCursorPosition();
  119. CHARACTER_CREATE_INITIAL_FACING = GetCharacterCreateFacing();
  120. end
  121. end
  122. function CharacterCreateFrame_OnMouseUp(button)
  123. if ( button == "LeftButton" ) then
  124. CHARACTER_CREATE_ROTATION_START_X = nil
  125. end
  126. end
  127. function CharacterCreateFrame_OnUpdate()
  128. if ( CHARACTER_CREATE_ROTATION_START_X ) then
  129. local x = GetCursorPosition();
  130. local diff = (x - CHARACTER_CREATE_ROTATION_START_X) * CHARACTER_ROTATION_CONSTANT;
  131. CHARACTER_CREATE_ROTATION_START_X = GetCursorPosition();
  132. SetCharacterCreateFacing(GetCharacterCreateFacing() + diff);
  133. end
  134. end
  135. function CharacterCreateEnumerateRaces(...)
  136. CharacterCreate.numRaces = select("#", ...)/3;
  137. if ( CharacterCreate.numRaces > MAX_RACES ) then
  138. message("Too many races! Update MAX_RACES");
  139. return;
  140. end
  141. local coords;
  142. local index = 1;
  143. local button;
  144. local gender;
  145. local selectedSex = GetSelectedSex();
  146. if ( selectedSex == SEX_MALE ) then
  147. gender = "MALE";
  148. elseif ( selectedSex == SEX_FEMALE ) then
  149. gender = "FEMALE";
  150. end
  151. for i=1, select("#", ...), 3 do
  152. coords = RACE_ICON_TCOORDS[strupper(select(i+1, ...).."_"..gender)];
  153. _G["CharacterCreateRaceButton"..index.."NormalTexture"]:SetTexCoord(coords[1], coords[2], coords[3], coords[4]);
  154. _G["CharacterCreateRaceButton"..index.."PushedTexture"]:SetTexCoord(coords[1], coords[2], coords[3], coords[4]);
  155. button = _G["CharacterCreateRaceButton"..index];
  156. button:Show();
  157. if ( select(i+2, ...) == 1 ) then
  158. button.enable = true;
  159. SetButtonDesaturated(button);
  160. button.name = select(i, ...)
  161. button.tooltip = select(i, ...);
  162. else
  163. button.enable = false;
  164. SetButtonDesaturated(button, 1);
  165. button.name = select(i, ...)
  166. button.tooltip = _G[strupper(select(i+1, ...).."_".."DISABLED")];
  167. end
  168. index = index + 1;
  169. end
  170. for i=CharacterCreate.numRaces + 1, MAX_RACES, 1 do
  171. _G["CharacterCreateRaceButton"..i]:Hide();
  172. end
  173. end
  174. function CharacterCreateEnumerateClasses(...)
  175. CharacterCreate.numClasses = select("#", ...)/3;
  176. if ( CharacterCreate.numClasses > MAX_CLASSES_PER_RACE ) then
  177. message("Too many classes! Update MAX_CLASSES_PER_RACE");
  178. return;
  179. end
  180. local coords;
  181. local index = 1;
  182. local button;
  183. for i=1, select("#", ...), 3 do
  184. coords = CLASS_ICON_TCOORDS[strupper(select(i+1, ...))];
  185. button = _G["CharacterCreateClassButton"..index];
  186. button:Show();
  187. if ( (select(i+2, ...) == 1) and (IsRaceClassValid(CharacterCreate.selectedRace, index)) ) then
  188. button.enable = true;
  189. button:Enable();
  190. SetButtonDesaturated(button);
  191. button.name = select(i, ...)
  192. button.tooltip = select(i, ...);
  193. _G["CharacterCreateClassButton"..index.."DisableTexture"]:Hide();
  194. else
  195. button.enable = false;
  196. button:Disable();
  197. SetButtonDesaturated(button, 1);
  198. button.name = select(i, ...)
  199. button.tooltip = _G[strupper(select(i+1, ...).."_".."DISABLED")];
  200. _G["CharacterCreateClassButton"..index.."DisableTexture"]:Show();
  201. end
  202. index = index + 1;
  203. end
  204. for i=CharacterCreate.numClasses + 1, MAX_CLASSES_PER_RACE, 1 do
  205. _G["CharacterCreateClassButton"..i]:Hide();
  206. end
  207. end
  208. function SetCharacterRace(id)
  209. CharacterCreate.selectedRace = id;
  210. local selectedButton;
  211. for i=1, CharacterCreate.numRaces, 1 do
  212. local button = _G["CharacterCreateRaceButton"..i];
  213. if ( i == id ) then
  214. _G["CharacterCreateRaceButton"..i.."Text"]:SetText(button.name);
  215. button:SetChecked(1);
  216. selectedButton = button;
  217. else
  218. _G["CharacterCreateRaceButton"..i.."Text"]:SetText("");
  219. button:SetChecked(0);
  220. end
  221. end
  222. -- Set Faction
  223. local name, faction = GetFactionForRace(CharacterCreate.selectedRace);
  224. -- Set Race
  225. local race, fileString = GetNameForRace();
  226. CharacterCreateRaceLabel:SetText(race);
  227. fileString = strupper(fileString);
  228. if ( GetSelectedSex() == SEX_MALE ) then
  229. gender = "MALE";
  230. else
  231. gender = "FEMALE";
  232. end
  233. local coords = RACE_ICON_TCOORDS[fileString.."_"..gender];
  234. CharacterCreateRaceIcon:SetTexCoord(coords[1], coords[2], coords[3], coords[4]);
  235. local raceText = _G["RACE_INFO_"..fileString];
  236. local abilityIndex = 1;
  237. local tempText = _G["ABILITY_INFO_"..fileString..abilityIndex];
  238. abilityText = "";
  239. while ( tempText ) do
  240. abilityText = abilityText..tempText.."\n\n";
  241. abilityIndex = abilityIndex + 1;
  242. tempText = _G["ABILITY_INFO_"..fileString..abilityIndex];
  243. end
  244. CharacterCreateRaceScrollFrameScrollBar:SetValue(0);
  245. CharacterCreateRaceText:SetText(GetFlavorText("RACE_INFO_"..strupper(fileString), GetSelectedSex()).."|n|n");
  246. if ( abilityText and abilityText ~= "" ) then
  247. CharacterCreateRaceAbilityText:SetText(abilityText);
  248. else
  249. CharacterCreateRaceAbilityText:SetText("");
  250. end
  251. -- Set backdrop colors based on faction
  252. local backdropColor = FACTION_BACKDROP_COLOR_TABLE[faction];
  253. local frame;
  254. for index, value in pairs(FRAMES_TO_BACKDROP_COLOR) do
  255. frame = _G[value];
  256. frame:SetBackdropColor(backdropColor[4], backdropColor[5], backdropColor[6]);
  257. end
  258. CharacterCreateConfigurationBackground:SetVertexColor(backdropColor[4], backdropColor[5], backdropColor[6]);
  259. local backgroundFilename = GetCreateBackgroundModel();
  260. SetBackgroundModel(CharacterCreate, backgroundFilename);
  261. GlueFrameFadeIn(CharacterCreate, VX_FADE_REFRESH);
  262. end
  263. function SetCharacterClass(id)
  264. CharacterCreate.selectedClass = id;
  265. for i=1, CharacterCreate.numClasses, 1 do
  266. local button = _G["CharacterCreateClassButton"..i];
  267. if ( i == id ) then
  268. CharacterCreateClassName:SetText(button.name);
  269. button:SetChecked(1);
  270. else
  271. button:SetChecked(0);
  272. end
  273. end
  274. local className, classFileName, _, tank, healer, damage = GetSelectedClass();
  275. local abilityIndex = 0;
  276. local tempText = _G["CLASS_INFO_"..classFileName..abilityIndex];
  277. abilityText = "";
  278. while ( tempText ) do
  279. abilityText = abilityText..tempText.."\n\n";
  280. abilityIndex = abilityIndex + 1;
  281. tempText = _G["CLASS_INFO_"..classFileName..abilityIndex];
  282. end
  283. local coords = CLASS_ICON_TCOORDS[classFileName];
  284. CharacterCreateClassLabel:SetText(className);
  285. CharacterCreateClassScrollFrameScrollBar:SetValue(0);
  286. end
  287. function CharacterCreate_OnChar()
  288. end
  289. function CharacterCreate_OnKeyDown(key)
  290. if ( key == "ESCAPE" ) then
  291. CharacterCreate_Back();
  292. elseif ( key == "ENTER" ) then
  293. CharacterCreate_Okay();
  294. elseif ( key == "PRINTSCREEN" ) then
  295. Screenshot();
  296. end
  297. end
  298. function CharacterCreate_UpdateModel(self)
  299. UpdateCustomizationScene();
  300. self:AdvanceTime();
  301. end
  302. function CharacterCreate_Okay()
  303. if ( PAID_SERVICE_TYPE ) then
  304. GlueDialog_Show("CONFIRM_PAID_SERVICE");
  305. else
  306. CreateCharacter(CharacterCreateNameEdit:GetText());
  307. end
  308. PlaySound("gsCharacterCreationCreateChar");
  309. end
  310. function CharacterCreate_Back()
  311. PlaySound("gsCharacterCreationCancel");
  312. GlueFrameFadeOut(CharacterCreate, VX_FADE_UNLOAD, CharacterCreate_Back_Wait);
  313. --SetGlueScreen("charselect");
  314. end
  315. function CharacterCreate_Back_Wait()
  316. SetGlueScreen("charselect");
  317. end
  318. function CharacterClass_OnClick(id)
  319. PlaySound("gsCharacterCreationClass");
  320. local _,_,currClass = GetSelectedClass();
  321. if ( currClass ~= id and IsRaceClassValid(GetSelectedRace(), id) ) then
  322. CharacterCreate.id = id;
  323. GlueFrameFadeOut(CharacterCreate, VX_FADE_REFRESH, CharacterCreateFadeInClass);
  324. end
  325. end
  326. function CharacterCreateFadeInClass()
  327. SetSelectedClass(CharacterCreate.id);
  328. SetCharacterClass(CharacterCreate.id);
  329. SetCharacterRace(GetSelectedRace());
  330. CharacterChangeFixup();
  331. CharacterCreate.id = nil;
  332. end
  333. function CharacterRace_OnWait(self, id)
  334. if ( GetSelectedRace() ~= id ) then
  335. SetSelectedRace(id);
  336. SetCharacterRace(id);
  337. SetSelectedSex(GetSelectedSex());
  338. SetCharacterCreateFacing(-15);
  339. CharacterCreateEnumerateClasses(GetAvailableClasses());
  340. local _,_,classIndex = GetSelectedClass();
  341. if ( PAID_SERVICE_TYPE ) then
  342. classIndex = PaidChange_GetCurrentClassIndex();
  343. end
  344. SetCharacterClass(classIndex);
  345. -- Hair customization stuff
  346. CharacterCreate_UpdateHairCustomization();
  347. CharacterChangeFixup();
  348. end
  349. end
  350. function CharacterCreateFadeInRace()
  351. CharacterRace_OnWait(CharacterCreate.tg, CharacterCreate.tgId);
  352. CharacterCreate.tg = nil;
  353. CharacterCreate.tgId = nil;
  354. end
  355. function CharacterRace_OnClick(self, id)
  356. CharacterCreate.tg = self;
  357. CharacterCreate.tgId = id;
  358. PlaySound("gsCharacterCreationClass");
  359. if ( not self:GetChecked() ) then
  360. self:SetChecked(1);
  361. return;
  362. end
  363. GlueFrameFadeOut(CharacterCreate, VX_FADE_REFRESH, CharacterCreateFadeInRace);
  364. end
  365. function SetCharacterGender(sex)
  366. CharacterCreate.sex = sex;
  367. GlueFrameFadeOut(CharacterCreate, VX_FADE_REFRESH, SetCharacterGender_Wait);
  368. end
  369. function SetCharacterGender_Wait()
  370. sex = CharacterCreate.sex;
  371. CharacterCreate.sex = nil;
  372. local gender;
  373. SetSelectedSex(sex);
  374. if ( sex == SEX_MALE ) then
  375. gender = "MALE";
  376. CharacterCreateGender:SetText(MALE);
  377. CharacterCreateGenderButtonMale:SetChecked(1);
  378. CharacterCreateGenderButtonFemale:SetChecked(nil);
  379. elseif ( sex == SEX_FEMALE ) then
  380. gender = "FEMALE";
  381. CharacterCreateGender:SetText(FEMALE);
  382. CharacterCreateGenderButtonMale:SetChecked(nil);
  383. CharacterCreateGenderButtonFemale:SetChecked(1);
  384. end
  385. -- Update race images to reflect gender
  386. CharacterCreateEnumerateRaces(GetAvailableRaces());
  387. CharacterCreateEnumerateClasses(GetAvailableClasses());
  388. SetCharacterRace(GetSelectedRace());
  389. local _,_,classIndex = GetSelectedClass();
  390. if ( PAID_SERVICE_TYPE ) then
  391. classIndex = PaidChange_GetCurrentClassIndex();
  392. end
  393. SetCharacterClass(classIndex);
  394. CharacterCreate_UpdateHairCustomization();
  395. -- Update right hand race portrait to reflect gender change
  396. -- Set Race
  397. local race, fileString = GetNameForRace();
  398. CharacterCreateRaceLabel:SetText(race);
  399. fileString = strupper(fileString);
  400. local coords = RACE_ICON_TCOORDS[fileString.."_"..gender];
  401. CharacterCreateRaceIcon:SetTexCoord(coords[1], coords[2], coords[3], coords[4]);
  402. CharacterChangeFixup();
  403. end
  404. function CharacterCustomization_Left(id)
  405. PlaySound("gsCharacterCreationLook");
  406. CycleCharCustomization(id, -1);
  407. end
  408. function CharacterCustomization_Right(id)
  409. PlaySound("gsCharacterCreationLook");
  410. CycleCharCustomization(id, 1);
  411. end
  412. function CharacterCreate_Randomize()
  413. PlaySound("gsCharacterCreationLook");
  414. RandomizeCharCustomization();
  415. end
  416. function CharacterCreateRotateRight_OnUpdate(self)
  417. if ( self:GetButtonState() == "PUSHED" ) then
  418. SetCharacterCreateFacing(GetCharacterCreateFacing() + CHARACTER_FACING_INCREMENT);
  419. end
  420. end
  421. function CharacterCreateRotateLeft_OnUpdate(self)
  422. if ( self:GetButtonState() == "PUSHED" ) then
  423. SetCharacterCreateFacing(GetCharacterCreateFacing() - CHARACTER_FACING_INCREMENT);
  424. end
  425. end
  426. function CharacterCreate_UpdateHairCustomization()
  427. CharacterCustomizationButtonFrame3Text:SetText(_G["HAIR_"..GetHairCustomization().."_STYLE"]);
  428. CharacterCustomizationButtonFrame4Text:SetText(_G["HAIR_"..GetHairCustomization().."_COLOR"]);
  429. CharacterCustomizationButtonFrame5Text:SetText(_G["FACIAL_HAIR_"..GetFacialHairCustomization()]);
  430. end
  431. function SetButtonDesaturated(button, desaturated, r, g, b)
  432. if ( not button ) then
  433. return;
  434. end
  435. local icon = button:GetNormalTexture();
  436. if ( not icon ) then
  437. return;
  438. end
  439. local shaderSupported = icon:SetDesaturated(desaturated);
  440. if ( not desaturated ) then
  441. r = 1.0;
  442. g = 1.0;
  443. b = 1.0;
  444. elseif ( not r or not shaderSupported ) then
  445. r = 0.5;
  446. g = 0.5;
  447. b = 0.5;
  448. end
  449. icon:SetVertexColor(r, g, b);
  450. end
  451. function GetFlavorText(tagname, sex)
  452. local primary, secondary;
  453. if ( sex == SEX_MALE ) then
  454. primary = "";
  455. secondary = "_FEMALE";
  456. else
  457. primary = "_FEMALE";
  458. secondary = "";
  459. end
  460. local text = _G[tagname..primary];
  461. if ( (text == nil) or (text == "") ) then
  462. text = _G[tagname..secondary];
  463. end
  464. return text;
  465. end
  466. function CharacterChangeFixup()
  467. if ( PAID_SERVICE_TYPE ) then
  468. for i=1, MAX_CLASSES_PER_RACE, 1 do
  469. if (CharacterCreate.selectedClass ~= i) then
  470. local button = _G["CharacterCreateClassButton"..i];
  471. button:Disable();
  472. SetButtonDesaturated(button, true)
  473. end
  474. end
  475. for i=1, MAX_RACES, 1 do
  476. local allow = false;
  477. if ( PAID_SERVICE_TYPE == PAID_FACTION_CHANGE ) then
  478. local faction = GetFactionForRace(PaidChange_GetCurrentRaceIndex());
  479. if ( (i == PaidChange_GetCurrentRaceIndex()) or ((GetFactionForRace(i) ~= faction) and (IsRaceClassValid(i,CharacterCreate.selectedClass))) ) then
  480. allow = true;
  481. end
  482. elseif ( PAID_SERVICE_TYPE == PAID_RACE_CHANGE ) then
  483. local faction = GetFactionForRace(PaidChange_GetCurrentRaceIndex());
  484. if ( (i == PaidChange_GetCurrentRaceIndex()) or ((GetFactionForRace(i) == faction) and (IsRaceClassValid(i,CharacterCreate.selectedClass))) ) then
  485. allow = true
  486. end
  487. elseif ( PAID_SERVICE_TYPE == PAID_CHARACTER_CUSTOMIZATION ) then
  488. if ( i == CharacterCreate.selectedRace ) then
  489. allow = true
  490. end
  491. end
  492. if (not allow) then
  493. local button = _G["CharacterCreateRaceButton"..i];
  494. button:Disable();
  495. SetButtonDesaturated(button, true)
  496. end
  497. end
  498. end
  499. end