Advertisement
Guest User

Untitled

a guest
Feb 24th, 2011
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.72 KB | None | 0 0
  1.  
  2. CurrentGlueMusic = "GS_LichKing";
  3.  
  4. GlueCreditsSoundKits = { };
  5. GlueCreditsSoundKits[1] = "Menu-Credits01";
  6. GlueCreditsSoundKits[2] = "Menu-Credits02";
  7. GlueCreditsSoundKits[3] = "Menu-Credits03";
  8.  
  9.  
  10. GlueScreenInfo = { };
  11. GlueScreenInfo["login"] = "AccountLogin";
  12. GlueScreenInfo["charselect"] = "CharacterSelect";
  13. GlueScreenInfo["realmwizard"] = "RealmWizard";
  14. GlueScreenInfo["charcreate"] = "CharacterCreate";
  15. GlueScreenInfo["patchdownload"] = "PatchDownload";
  16. GlueScreenInfo["trialconvert"] = "TrialConvert";
  17. GlueScreenInfo["movie"] = "MovieFrame";
  18. GlueScreenInfo["credits"] = "CreditsFrame";
  19. GlueScreenInfo["options"] = "OptionsFrame";
  20.  
  21. CharModelFogInfo = { };
  22. CharModelFogInfo["HUMAN"] = { r=0.8, g=0.65, b=0.73, far=222 };
  23. CharModelFogInfo["ORC"] = { r=0.5, g=0.5, b=0.5, far=270 };
  24. CharModelFogInfo["DWARF"] = { r=0.85, g=0.88, b=1.0, far=500 };
  25. CharModelFogInfo["NIGHTELF"] = { r=0.25, g=0.22, b=0.55, far=611 };
  26. CharModelFogInfo["TAUREN"] = { r=1.0, g=0.61, b=0.42, far=153 };
  27. CharModelFogInfo["SCOURGE"] = { r=0, g=0.22, b=0.22, far=26 };
  28. CharModelFogInfo["CHARACTERSELECT"] = { r=0.8, g=0.65, b=0.73, far=222 };
  29.  
  30. CharModelGlowInfo = { };
  31. CharModelGlowInfo["WORGEN"] = 0.0;
  32. CharModelGlowInfo["GOBLIN"] = 0.0;
  33. CharModelGlowInfo["HUMAN"] = 0.15;
  34. CharModelGlowInfo["DWARF"] = 0.15;
  35. CharModelGlowInfo["CHARACTERSELECT"] = 0.3;
  36.  
  37. GlueAmbienceTracks = { };
  38. GlueAmbienceTracks["HUMAN"] = "GlueScreenHuman";
  39. GlueAmbienceTracks["ORC"] = "GlueScreenOrcTroll";
  40. GlueAmbienceTracks["DWARF"] = "GlueScreenDwarfGnome";
  41. GlueAmbienceTracks["TAUREN"] = "GlueScreenTauren";
  42. GlueAmbienceTracks["SCOURGE"] = "GlueScreenUndead";
  43. GlueAmbienceTracks["NIGHTELF"] = "GlueScreenNightElf";
  44. GlueAmbienceTracks["DRAENEI"] = "GlueScreenDraenei";
  45. GlueAmbienceTracks["BLOODELF"] = "GlueScreenBloodElf";
  46. GlueAmbienceTracks["DARKPORTAL"] = "GlueScreenIntro";
  47. GlueAmbienceTracks["DEATHKNIGHT"] = "GlueScreenIntro";
  48. GlueAmbienceTracks["CHARACTERSELECT"] = "GlueScreenIntro";
  49. GlueAmbienceTracks["GOBLIN"] = "GlueScreenOrcTroll";
  50. GlueAmbienceTracks["TUSKARR"] = "GlueScreenOrcTroll";
  51. GlueAmbienceTracks["BROKEN"] = "GlueScreenOrcTroll";
  52. GlueAmbienceTracks["TAUNKA"] = "GlueScreenOrcTroll";
  53. GlueAmbienceTracks["VRYKUL"] = "GlueScreenOrcTroll";
  54. GlueAmbienceTracks["NAGA"] = "GlueScreenOrcTroll";
  55. GlueAmbienceTracks["ARAKKOA"] = "GlueScreenOrcTroll";
  56. GlueAmbienceTracks["FURBOLG"] = "GlueScreenOrcTroll";
  57. GlueAmbienceTracks["OGRE"] = "GlueScreenOrcTroll";
  58. GlueAmbienceTracks["MURLOC"] = "GlueScreenOrcTroll";
  59.  
  60. -- RaceLights[] duplicates the 3.2.2 color values in the models. Henceforth, the models no longer contain directional lights
  61. RaceLights = {
  62. HUMAN = {
  63. {1, 0, 0.000000, 0.000000, -1.000000, 1.0, 0.27, 0.27, .27, 1.0, 0, 0, 0},
  64. {1, 0, -0.45756075, -0.58900136, -0.66611975, 1.0, 0.000000, 0.000000, 0.000000, 1.0, 0.19882353, 0.34921569, 0.43588236 },
  65. {1, 0, -0.64623469, 0.57582057, -0.50081086, 1.0, 0.000000, 0.000000, 0.000000, 2.0, 0.52196085, 0.44, 0.29764709 },
  66. },
  67. ORC = {
  68. {1, 0, 0.00000, 0.00000, -1.00000, 1.0, 0.15000, 0.15000, 0.15000, 1.0, 0.00000, 0.00000, 0.00000},
  69. {1, 0, -0.74919, 0.35208, -0.56103, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.44706, 0.54510, 0.73725},
  70. {1, 0, 0.53162, -0.84340, 0.07780, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.55, 0.338625, 0.148825},
  71. },
  72. DWARF = {
  73. {1, 0, -0.00000, -0.00000, -1.00000, 1.0, 0.30000, 0.30000, 0.30000, 0.0, 0.00000, 0.00000, 0.00000},
  74. {1, 0, -0.88314, 0.42916, -0.18945, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.44706, 0.67451, 0.760785},
  75. },
  76. TAUREN = {
  77. {1, 0, -0.48073, 0.71827, -0.50297, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.65, 0.397645, 0.2727},
  78. {1, 0, -0.49767, -0.78677, 0.36513, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.60000, 0.47059, 0.32471},
  79. },
  80. SCOURGE = {
  81. {1, 0, 0.00000, 0.00000, -1.00000, 1.0, 0.20000, 0.20000, 0.20000, 1.0, 0.00000, 0.00000, 0.00000},
  82. },
  83. NIGHTELF = {
  84. {1, 0, -0.00000, -0.00000, -1.00000, 1.0, 0.09020, 0.09020, 0.17020, 1.0, 0.00000, 0.00000, 0.00000},
  85. },
  86. DRAENEI = {
  87. {1, 0, 0.61185, 0.62942, -0.47903, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.56941, 0.52000, 0.60000},
  88. {1, 0, -0.64345, -0.31052, -0.69968, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.60941, 0.60392, 0.70000},
  89. {1, 0, -0.46481, -0.14320, 0.87376, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.5835, 0.48941, 0.60000},
  90. },
  91. BLOODELF = {
  92. {1, 0, -0.82249, -0.54912, -0.14822, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.581175, 0.50588, 0.42588},
  93. {1, 0, 0.00000, -0.00000, -1.00000, 1.0, 0.60392, 0.61490, 0.70000, 1.0, 0.00000, 0.00000, 0.00000},
  94. {1, 0, 0.02575, 0.86518, -0.50081, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.59137, 0.51745, 0.63471},
  95. },
  96. DEATHKNIGHT = {
  97. {1, 0, 0.00000, 0.00000, -1.00000, 1.0, 0.38824, 0.66353, 0.76941, 1.0, 0.00000, 0.00000, 0.00000},
  98. },
  99. CHARACTERSELECT = {
  100. {1, 0, 0.00000, 0.00000, -1.00000, 1.0, 0.15000, 0.15000, 0.15000, 1.0, 0.00000, 0.00000, 0.00000},
  101. {1, 0, -0.74919, 0.35208, -0.56103, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.44706, 0.54510, 0.73725},
  102. {1, 0, 0.53162, -0.84340, 0.07780, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.55, 0.338625, 0.148825},
  103. },
  104. }
  105.  
  106. -- indicies for adding lights ModelFFX:Add*Light
  107. LIGHT_LIVE = 0;
  108. LIGHT_GHOST = 1;
  109.  
  110. -- Alpha animation stuff
  111. FADEFRAMES = {};
  112. CURRENT_GLUE_SCREEN = nil;
  113. PENDING_GLUE_SCREEN = nil;
  114. -- Time in seconds to fade
  115. LOGIN_FADE_IN = 1.5;
  116. LOGIN_FADE_OUT = 0.5;
  117. CHARACTER_SELECT_FADE_IN = 0.75;
  118. RACE_SELECT_INFO_FADE_IN = .5;
  119. RACE_SELECT_INFO_FADE_OUT = .5;
  120.  
  121. -- Realm Split info
  122. SERVER_SPLIT_SHOW_DIALOG = false;
  123. SERVER_SPLIT_CLIENT_STATE = -1; -- -1 uninitialized; 0 - no choice; 1 - realm 1; 2 - realm 2
  124. SERVER_SPLIT_STATE_PENDING = -1; -- -1 uninitialized; 0 - no server split; 1 - server split (choice mode); 2 - server split (no choice mode)
  125. SERVER_SPLIT_DATE = nil;
  126.  
  127. -- Account Messaging info
  128. ACCOUNT_MSG_NUM_AVAILABLE = 0;
  129. ACCOUNT_MSG_PRIORITY = 0;
  130. ACCOUNT_MSG_HEADERS_LOADED = false;
  131. ACCOUNT_MSG_BODY_LOADED = false;
  132. ACCOUNT_MSG_CURRENT_INDEX = nil;
  133.  
  134. -- Gender Constants
  135. SEX_NONE = 1;
  136. SEX_MALE = 2;
  137. SEX_FEMALE = 3;
  138.  
  139.  
  140. function SetGlueScreen(name)
  141. local newFrame;
  142. for index, value in pairs(GlueScreenInfo) do
  143. local frame = _G[value];
  144. if ( frame ) then
  145. frame:Hide();
  146. if ( index == name ) then
  147. newFrame = frame;
  148. end
  149. end
  150. end
  151.  
  152. if ( newFrame ) then
  153. newFrame:Show();
  154. SetCurrentScreen(name);
  155. SetCurrentGlueScreenName(name);
  156. if ( name == "credits" ) then
  157. PlayCreditsMusic( GlueCreditsSoundKits[CreditsFrame.creditsType] );
  158. StopGlueAmbience();
  159. elseif ( name ~= "movie" ) then
  160. PlayGlueMusic(CurrentGlueMusic);
  161. if (name == "login") then
  162. PlayGlueAmbience(GlueAmbienceTracks["DARKPORTAL"], 4.0);
  163. end
  164. end
  165. end
  166. end
  167.  
  168. function SetCurrentGlueScreenName(name)
  169. CURRENT_GLUE_SCREEN = name;
  170. end
  171.  
  172. function GetCurrentGlueScreenName()
  173. return CURRENT_GLUE_SCREEN;
  174. end
  175.  
  176. function SetPendingGlueScreenName(name)
  177. PENDING_GLUE_SCREEN = name;
  178. end
  179.  
  180. function GetPendingGlueScreenName()
  181. return PENDING_GLUE_SCREEN;
  182. end
  183.  
  184. function GlueParent_OnLoad(self)
  185. local width = GetScreenWidth();
  186. local height = GetScreenHeight();
  187.  
  188. if ( width / height > 16 / 9) then
  189. local maxWidth = height * 16 / 9;
  190. local barWidth = ( width - maxWidth ) / 2;
  191. self:ClearAllPoints();
  192. self:SetPoint("TOPLEFT", barWidth, 0);
  193. self:SetPoint("BOTTOMRIGHT", -barWidth, 0);
  194. end
  195.  
  196. self:RegisterEvent("FRAMES_LOADED");
  197. self:RegisterEvent("SET_GLUE_SCREEN");
  198. self:RegisterEvent("START_GLUE_MUSIC");
  199. self:RegisterEvent("DISCONNECTED_FROM_SERVER");
  200. self:RegisterEvent("GET_PREFERRED_REALM_INFO");
  201. self:RegisterEvent("SERVER_SPLIT_NOTICE");
  202. self:RegisterEvent("ACCOUNT_MESSAGES_AVAILABLE");
  203. self:RegisterEvent("ACCOUNT_MESSAGES_HEADERS_LOADED");
  204. self:RegisterEvent("ACCOUNT_MESSAGES_BODY_LOADED");
  205. end
  206.  
  207. function GlueParent_OnEvent(event, arg1, arg2, arg3)
  208. if ( event == "FRAMES_LOADED" ) then
  209. LocalizeFrames();
  210. elseif ( event == "SET_GLUE_SCREEN" ) then
  211. GlueScreenExit(GetCurrentGlueScreenName(), arg1);
  212. elseif ( event == "START_GLUE_MUSIC" ) then
  213. PlayGlueMusic(CurrentGlueMusic);
  214. PlayGlueAmbience(GlueAmbienceTracks["DARKPORTAL"], 4.0);
  215. elseif ( event == "DISCONNECTED_FROM_SERVER" ) then
  216. TokenEntry_Cancel(TokenEnterDialog);
  217. SetGlueScreen("login");
  218. if ( arg1 == 4 ) then
  219. GlueDialog_Show("PARENTAL_CONTROL");
  220. else
  221. GlueDialog_Show("DISCONNECTED");
  222. end
  223. AddonList:Hide();
  224. elseif ( event == "GET_PREFERRED_REALM_INFO" ) then
  225. if( arg1 == 1) then
  226. SetPreferredInfo(1);
  227. else
  228. SetGlueScreen("realmwizard");
  229. PlayGlueAmbience(GlueAmbienceTracks["DARKPORTAL"], 4.0);
  230. end
  231. elseif ( event == "SERVER_SPLIT_NOTICE" ) then
  232. CharacterSelectRealmSplitButton:Show();
  233. if ( SERVER_SPLIT_STATE_PENDING == -1 and arg1 == 0 and arg2 == 1 ) then
  234. SERVER_SPLIT_SHOW_DIALOG = true;
  235. end
  236. SERVER_SPLIT_CLIENT_STATE = arg1;
  237. SERVER_SPLIT_STATE_PENDING = arg2;
  238. SERVER_SPLIT_DATE = arg3;
  239. elseif ( event == "ACCOUNT_MESSAGES_AVAILABLE" ) then
  240. -- ACCOUNT_MSG_NUM_AVAILABLE = arg1;
  241. ACCOUNT_MSG_HEADERS_LOADED = false;
  242. ACCOUNT_MSG_BODY_LOADED = false;
  243. ACCOUNT_MSG_CURRENT_INDEX = nil;
  244. AccountMsg_LoadHeaders();
  245. elseif ( event == "ACCOUNT_MESSAGES_HEADERS_LOADED" ) then
  246. ACCOUNT_MSG_HEADERS_LOADED = true;
  247. ACCOUNT_MSG_NUM_AVAILABLE = AccountMsg_GetNumUnreadMsgs();
  248. ACCOUNT_MSG_CURRENT_INDEX = AccountMsg_GetIndexNextUnreadMsg();
  249. if ( ACCOUNT_MSG_NUM_AVAILABLE > 0 ) then
  250. AccountMsg_LoadBody( ACCOUNT_MSG_CURRENT_INDEX );
  251. end
  252. elseif ( event == "ACCOUNT_MESSAGES_BODY_LOADED" ) then
  253. ACCOUNT_MSG_BODY_LOADED = true;
  254. end
  255. end
  256.  
  257. -- Glue screen animation handling
  258. function GlueScreenExit(currentFrame, pendingFrame)
  259. if ( currentFrame == "login" and pendingFrame == "charselect" ) then
  260. GlueFrameFadeOut(AccountLoginUI, LOGIN_FADE_OUT, GoToPendingGlueScreen);
  261. SetPendingGlueScreenName(pendingFrame);
  262. else
  263. SetGlueScreen(pendingFrame);
  264. end
  265. end
  266.  
  267. function GoToPendingGlueScreen()
  268. SetGlueScreen(GetPendingGlueScreenName());
  269. end
  270.  
  271. -- Generic fade function
  272. function GlueFrameFade(frame, timeToFade, mode, finishedFunction)
  273. if ( frame ) then
  274. frame.fadeTimer = 0;
  275. frame.timeToFade = timeToFade;
  276. frame.mode = mode;
  277. -- finishedFunction is an optional function that is called when the animation is complete
  278. if ( finishedFunction ) then
  279. frame.finishedFunction = finishedFunction;
  280. end
  281. tinsert(FADEFRAMES, frame);
  282. end
  283. end
  284.  
  285. -- Fade in function
  286. function GlueFrameFadeIn(frame, timeToFade, finishedFunction)
  287. GlueFrameFade(frame, timeToFade, "IN", finishedFunction);
  288. end
  289.  
  290. -- Fade out function
  291. function GlueFrameFadeOut(frame, timeToFade, finishedFunction)
  292. GlueFrameFade(frame, timeToFade, "OUT", finishedFunction);
  293. end
  294.  
  295. -- Function that actually performs the alpha change
  296. function GlueFrameFadeUpdate(elapsed)
  297. local index = 1;
  298. while FADEFRAMES[index] do
  299. local frame = FADEFRAMES[index];
  300. frame.fadeTimer = frame.fadeTimer + elapsed;
  301. if ( frame.fadeTimer < frame.timeToFade ) then
  302. if ( frame.mode == "IN" ) then
  303. frame:SetAlpha(frame.fadeTimer / frame.timeToFade);
  304. elseif ( frame.mode == "OUT" ) then
  305. frame:SetAlpha((frame.timeToFade - frame.fadeTimer) / frame.timeToFade);
  306. end
  307. else
  308. if ( frame.mode == "IN" ) then
  309. frame:SetAlpha(1.0);
  310. elseif ( frame.mode == "OUT" ) then
  311. frame:SetAlpha(0);
  312. end
  313. GlueFrameFadeRemoveFrame(frame);
  314. if ( frame.finishedFunction ) then
  315. frame.finishedFunction();
  316. frame.finishedFunction = nil;
  317. end
  318. end
  319. index = index + 1;
  320. end
  321. end
  322.  
  323. function GlueFrameRemoveFrame(frame, list)
  324. local index = 1;
  325. while list[index] do
  326. if ( frame == list[index] ) then
  327. tremove(list, index);
  328. end
  329. index = index + 1;
  330. end
  331. end
  332.  
  333. function GlueFrameFadeRemoveFrame(frame)
  334. GlueFrameRemoveFrame(frame, FADEFRAMES);
  335. end
  336.  
  337. function SetLighting(model, race)
  338. model:SetSequence(0);
  339. model:SetCamera(0);
  340. local fogInfo = CharModelFogInfo[race];
  341. if ( fogInfo ) then
  342. model:SetFogColor(fogInfo.r, fogInfo.g, fogInfo.b);
  343. model:SetFogNear(0);
  344. model:SetFogFar(fogInfo.far);
  345. else
  346. model:ClearFog();
  347. end
  348.  
  349. local glowInfo = CharModelGlowInfo[race];
  350. if ( glowInfo ) then
  351. model:SetGlow(glowInfo);
  352. else
  353. model:SetGlow(0.3);
  354. end
  355.  
  356. model:ResetLights();
  357. --[[
  358. ResetLights() sets all 6 light sets to default for the background. The six sets are:
  359.  
  360. background - live
  361. background - ghost
  362. character - live
  363. character - ghost
  364. pet - live
  365. pet - ghost
  366.  
  367. If you add a light to any one of these, NONE of the default lights are used for that set (most backgrounds have 3).
  368.  
  369. You can add up to four lights per light set in the current version. They are merged in the engine.
  370.  
  371. The current version only supports setting directional lights, and pulls the default point lights from the models.
  372. ]]
  373. local LightValues = RaceLights[race];
  374. if(LightValues) then
  375. for index, Array in pairs (LightValues) do
  376. if (Array[1]==1) then -- is this light enabled?
  377. for j, f in pairs ({model.AddCharacterLight, model.AddLight, model.AddPetLight }) do
  378. f(model, LIGHT_LIVE, unpack(Array));
  379. end
  380. end
  381. end
  382. end
  383. end
  384.  
  385. -- Function to set the background model for character select and create screens
  386. function SetBackgroundModel(model, name)
  387. if ( name == "Vrykul" or name == "VRYKUL" ) then
  388. name = "Orc";
  389. elseif ( name == "Goblin" or name == "GOBLIN" ) then
  390. name = "Orc";
  391. elseif ( name == "Tuskarr" or name == "TUSKARR" ) then
  392. name = "Orc";
  393. elseif ( name == "Taunka" or name == "TAUNKA" ) then
  394. name = "Orc";
  395. elseif ( name == "Broken" or name == "BROKEN" ) then
  396. name = "Orc";
  397. elseif ( name == "Naga_" or name == "NAGA" ) then
  398. name = "Orc";
  399. elseif ( name == "Arakkoa" or name == "ARAKKOA" ) then
  400. name = "Orc";
  401. elseif ( name == "Furbolg" or name == "FURBOLG" ) then
  402. name = "Orc";
  403. elseif ( name == "Ogre" or name == "OGRE" ) then
  404. name = "Orc";
  405. elseif ( name == "Murloc" or name == "MURLOC" ) then
  406. name = "Orc";
  407. end
  408. local nameupper = strupper(name);
  409. local path = "Interface\\Glues\\Models\\UI_"..name.."\\UI_"..name..".m2";
  410. if ( model == CharacterCreate ) then
  411. SetCharCustomizeBackground(path);
  412. else
  413. SetCharSelectBackground(path);
  414. end
  415. PlayGlueAmbience(GlueAmbienceTracks[nameupper], 4.0);
  416. SetLighting(model, nameupper)
  417. end
  418.  
  419. function SecondsToTime(seconds, noSeconds)
  420. local time = "";
  421. local count = 0;
  422. local tempTime;
  423. seconds = floor(seconds);
  424. if ( seconds >= 86400 ) then
  425. tempTime = floor(seconds / 86400);
  426. time = tempTime.." "..DAYS_ABBR.." ";
  427. seconds = mod(seconds, 86400);
  428. count = count + 1;
  429. end
  430. if ( seconds >= 3600 ) then
  431. tempTime = floor(seconds / 3600);
  432. time = time..tempTime.." "..HOURS_ABBR.." ";
  433. seconds = mod(seconds, 3600);
  434. count = count + 1;
  435. end
  436. if ( count < 2 and seconds >= 60 ) then
  437. tempTime = floor(seconds / 60);
  438. time = time..tempTime.." "..MINUTES_ABBR.." ";
  439. seconds = mod(seconds, 60);
  440. count = count + 1;
  441. end
  442. if ( count < 2 and seconds > 0 and not noSeconds ) then
  443. seconds = format("%d", seconds);
  444. time = time..seconds.." "..SECONDS_ABBR.." ";
  445. end
  446. return time;
  447. end
  448.  
  449. function MinutesToTime(mins, hideDays)
  450. local time = "";
  451. local count = 0;
  452. local tempTime;
  453. -- only show days if hideDays is false
  454. if ( mins > 1440 and not hideDays ) then
  455. tempTime = floor(mins / 1440);
  456. time = tempTime.." "..DAYS_ABBR.." ";
  457. mins = mod(mins, 1440);
  458. count = count + 1;
  459. end
  460. if ( mins > 60 ) then
  461. tempTime = floor(mins / 60);
  462. time = time..tempTime.." "..HOURS_ABBR.." ";
  463. mins = mod(mins, 60);
  464. count = count + 1;
  465. end
  466. if ( count < 2 ) then
  467. tempTime = mins;
  468. time = time..tempTime.." "..MINUTES_ABBR.." ";
  469. count = count + 1;
  470. end
  471. return time;
  472. end
  473.  
  474. function TriStateCheckbox_SetState(checked, checkButton)
  475. local checkedTexture = _G[checkButton:GetName().."CheckedTexture"];
  476. if ( not checkedTexture ) then
  477. message("Can't find checked texture");
  478. end
  479. if ( not checked or checked == 0 ) then
  480. -- nil or 0 means not checked
  481. checkButton:SetChecked(nil);
  482. checkButton.state = 0;
  483. elseif ( checked == 2 ) then
  484. -- 2 is a normal
  485. checkButton:SetChecked(1);
  486. checkedTexture:SetVertexColor(1, 1, 1);
  487. checkedTexture:SetDesaturated(0);
  488. checkButton.state = 2;
  489. else
  490. -- 1 is a gray check
  491. checkButton:SetChecked(1);
  492. local shaderSupported = checkedTexture:SetDesaturated(1);
  493. if ( not shaderSupported ) then
  494. checkedTexture:SetVertexColor(0.5, 0.5, 0.5);
  495. end
  496. checkButton.state = 1;
  497. end
  498. end
  499.  
  500. function SetStateRequestInfo( choice )
  501. if ( SERVER_SPLIT_CLIENT_STATE ~= choice ) then
  502. SERVER_SPLIT_CLIENT_STATE = choice;
  503. SetRealmSplitState(choice);
  504. RealmSplit_SetChoiceText();
  505. -- RequestRealmSplitInfo();
  506. end
  507. end
  508.  
  509. function UpgradeAccount()
  510. PlaySound("gsLoginNewAccount");
  511. LaunchURL(AUTH_NO_TIME_URL);
  512. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement