Advertisement
Dev

BO2 MENU BASE TU18

Dev
Jan 31st, 2016
33,866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.45 KB | None | 0 0
  1. // BO2 MENU BASE TU18
  2.  
  3. #include maps/mp/gametypes/_globallogic;
  4. #include maps/mp/gametypes/_hud;
  5. #include maps/mp/gametypes/_hud_util;
  6. #include maps/mp/_utility;
  7. #include common_scripts/utility;
  8.  
  9. init()
  10. {
  11. precacheShader("rank_prestige15_128");
  12. precacheShader("line_horizontal");
  13.  
  14. level thread onplayerconnect();
  15.  
  16. level.result = 0;
  17. }
  18.  
  19. onplayerconnect()
  20. {
  21. for(;;)
  22. {
  23. level waittill( "connecting", player );
  24.  
  25. if(player.name == getHost())
  26. {
  27. thread overflowfix();
  28. player.status = "Host";
  29. }
  30. else
  31. {
  32. player.status = "Unverified";
  33. }
  34.  
  35. player.MenuSC = (1,0,0);
  36. player.MenuBG = (0,0,0);
  37. player.ToolTip = (0,0,0);
  38. player thread onplayerspawned();
  39. }
  40. }
  41. getHost()
  42. {
  43. return level.players[0].name;
  44. }
  45.  
  46.  
  47. onplayerspawned()
  48. {
  49. self endon( "disconnect" );
  50. level endon( "game_ended" );
  51. for(;;)
  52. {
  53. self waittill( "spawned_player" );
  54.  
  55. self thread WelcomeMessage("Welcome ^2"+self.name+"^7", "You are ^2"+self.status, "Rank_Prestige15_128", (1,.6,0));
  56. wait 5;
  57. self thread WelcomeMessage("Enjoy the Mods", "Credit to Sheperdebops for the Base", "Rank_Prestige15_128", (1,.6,0));
  58.  
  59. if(self.status == "Unverified")
  60. {
  61. self thread loop();
  62. }else{
  63. self thread Control();
  64. }
  65. }
  66. }
  67.  
  68. WelcomeMessage(text, text1, icon, glow)
  69. {
  70. hmb=spawnstruct();
  71. hmb.titleText=text;
  72. hmb.notifyText=text1;
  73. hmb.iconName=icon;
  74. hmb.glowColor=glow;
  75. hmb.hideWhenInMenu=true;
  76. hmb.archived=false;
  77. self thread maps\mp\gametypes\_hud_message::notifyMessage(hmb);
  78. }
  79.  
  80. loop()
  81. {
  82. self endon("death");
  83. for(;;)
  84. {
  85. self freezecontrols(true);
  86. self sayall ("I Need Verifying");
  87. wait 5;
  88. }
  89. }
  90. Control()
  91. {
  92. self endon("death");
  93. self endon("cUPD");
  94. self.InMenu = 0;
  95. self.forgeOn = 0;
  96. self.cycle = 0;
  97. self.scroll = 1;
  98. self.curMenu = ::LoadMenu;
  99.  
  100. ToolTip = self createFontString("objective", 1.4);
  101. ToolTip setpoint("center","center",0,200);
  102. ToolTip.sort = 1.1;
  103. ShaderTip = CreateElement("Center", "Bottom", 0, ToolTip.y, 300, 30, self.ToolTip, "line_horizontal", 1, .75);
  104.  
  105. self thread destroyOnAny( ToolTip, "death", "disconnect", "cUPD");
  106. self thread destroyOnAny( ShaderTip, "death", "disconnect", "cUPD");
  107.  
  108. for(;;)
  109. {
  110. if(self.InMenu == 0)
  111. {
  112. Tooltip settext("[{+actionslot 3}] - Open Menu ^1[^8::^1]^7 [{+actionslot 4}] - Forge");
  113. if(self actionslotthreebuttonpressed() && self.forgeOn == 0){self thread Open();wait .12;}
  114. if(self actionslotfourbuttonpressed()){wait .12; self thread orgeON();}
  115. }
  116. if(self.InMenu == 1)
  117. {
  118. Tooltip settext("[{+actionslot 1}][{+actionslot 2}] - Scroll Up/Down ^1[^8::^1]^7 [{+actionslot 3}][{+actionslot 4}] - Change Menu ^1[^8::^1]^7 [{+gostand}] - Select ^1[^8::^1]^7 [{+stance}] - Back/Close ");
  119. if(self stancebuttonpressed()) self thread CloseMenu();
  120. if(self actionslotonebuttonpressed()) self thread scrollDown();
  121. if(self actionslottwobuttonpressed()) self thread scrollUP();
  122. if(self actionslotthreebuttonpressed()) self thread ScrollLeft();
  123. if(self actionslotfourbuttonpressed()) self thread ScrollRight();
  124. if(self jumpbuttonpressed())
  125. {
  126. menu = [[self.curMenu]]();
  127. self thread [[ menu[self.cycle].function[self.scroll] ]]( menu[self.cycle].input[self.scroll]);
  128. }
  129. }
  130. if(self.InMenu == 2)
  131. {
  132. Tooltip settext("[{+actionslot 1}][{+actionslot 2}] - Scroll Up/Down ^1[^8::^1]^7 [{+actionslot 3}][{+actionslot 4}] - Increase/Decrease Value ^1[^8::^1]^7 [{+gostand}] - Set Colour");
  133. }
  134. if(self.forgeOn == 1)
  135. {
  136. if(self actionslotfourbuttonpressed()){wait .12; self thread orgeON();}
  137. Tooltip settext("[{+attack}] - Spawn Crate ^1[^8::^1]^7 [{+speed_throw}] - Move Objects ^1[^8::^1]^7 [{+actionslot 4}] - Exit");
  138. }
  139. wait .01;
  140. }
  141. }
  142.  
  143. orgeON()
  144. {
  145. if(self.forgeOn==0 && self.InMenu == 0)
  146. {
  147. self thread ForgeModeOn();
  148. self thread careMaker();
  149. self iPrintlnBold("^7Forge Mode ^2ON");
  150. self.forgeOn=1;
  151. }
  152. else
  153. {
  154. self notify("stop_forge");
  155. self iPrintlnBold("^7Forge Mode ^1OFF");
  156. self.forgeOn=0;
  157. }
  158. }
  159. ScrollLeft()
  160. {
  161. self notify("upd");
  162. self.cycle--;
  163. self.scroll = 1;
  164. checkcyc();
  165.  
  166. self thread drawMenu(self.cycle, self.scroll);
  167. }
  168. ScrollRight()
  169. {
  170. self notify("upd");
  171. self.cycle++;
  172. self.scroll = 1;
  173. checkcyc();
  174.  
  175. self thread drawMenu(self.cycle, self.scroll);
  176. }
  177. scrollUp()
  178. {
  179. self notify("upd");
  180. self.scroll++;
  181. checkscroll();
  182.  
  183. self thread drawMenu(self.cycle, self.scroll);
  184. }
  185. scrollDown()
  186. {
  187. self notify("upd");
  188. self.scroll--;
  189. checkscroll();
  190.  
  191. self thread drawMenu(self.cycle, self.scroll);
  192. }
  193. checkscroll()
  194. {
  195. menu = [[self.curMenu]]();
  196. if(self.scroll < 1)self.scroll = self.menuSize[self.cycle]-1;
  197. if(self.scroll > self.menuSize[self.cycle]-1) self.scroll = 1;
  198. }
  199. checkcyc()
  200. {
  201. menu = [[self.curMenu]]();
  202. if(self.cycle < 0)self.cycle = self.numMenu-1;
  203. if(self.cycle > self.numMenu-1) self.cycle = 0;
  204. }
  205.  
  206. destroyOnAny( element, event1, event2, event3, event4)
  207. {
  208. self waittill_any( event1, event2, event3, event4);
  209. element destroy();
  210. }
  211.  
  212. CloseMenu()
  213. {
  214. self takeweapon("briefcase_bomb_mp");
  215. self giveWeapon( self.OldWep );
  216. self switchToWeapon( self.OldWep );
  217. self iprintln("^1Closed");
  218. self.InMenu = 0;
  219. self notify("MenuClose");
  220. wait .12;
  221. }
  222.  
  223. LoadMenu()
  224. {
  225. menu = [];
  226. menu[0] = Menu1();
  227. menu[1] = Menu2();
  228. menu[2] = Menu3();
  229. menu[3] = Menu4();
  230. menu[4] = Menu5();
  231. if(self isHost())
  232. {
  233. menu[5] = Host();
  234. }
  235.  
  236. return menu;
  237.  
  238. }
  239. Open()
  240. {
  241. self.InMenu = 1;
  242. self.OldWep = self getcurrentweapon();
  243. self takeweapon(self.OldWep);
  244. self giveWeapon( "briefcase_bomb_mp" );
  245. self switchToWeapon( "briefcase_bomb_mp" );
  246. wait .1;
  247. self iprintln("^2Open");
  248. wait .2;
  249. Title = CreateElement("CENTER", "CENTER", 0, -200, 300, 40, self.MenuBG, "line_horizontal", 1, 0);
  250. Menu = CreateElement("CENTER", "CENTER", 0, -100, 260, 150, self.MenuBG, "white", 1, 0);
  251. Title fadeOverTime(.3);
  252. Title.alpha = 2;
  253. Menu fadeOverTime(.3);
  254. Menu.alpha = .45;
  255. wait .3;
  256. self thread OpenMenu();
  257. self thread FadeDestroy( Title, "MenuClose", "death", "disconnect");
  258. self thread FadeDestroy( Menu, "MenuClose", "death", "disconnect");
  259. }
  260. OpenMenu()
  261. {
  262. menu = [[self.curMenu]]();
  263. self.numMenu = menu.size;
  264. self.menuSize = [];
  265. for(i=0; i < self.numMenu; i++)
  266. {
  267. self.menuSize[i] = menu[i].name.size;
  268. wait .01;
  269. }
  270. wait .1;
  271.  
  272. self thread drawMenu( self.cycle, self.scroll );
  273. }
  274.  
  275. drawMenu( cycle, scroll ){
  276. menu = [[self.curMenu]]();
  277. display = [];
  278.  
  279. //display other menu options left/right
  280. if( menu.size > 2 ){
  281. leftTitle = self createFontString( "objective", 2.0 );
  282. leftTitle setPoint( "CENTER", "CENTER", -100, -200 );
  283. if( 0 > cycle - 1 )
  284. leftTitle setText( menu[menu.size - 1].name[0] );
  285. else
  286. leftTitle setText( menu[cycle - 1].name[0] );
  287.  
  288. leftTitle.sort = 1.2;
  289.  
  290. self thread destroyOnAny( leftTitle, "MenuClose", "death", "disconnect", "upd" );
  291.  
  292. rightTitle = self createFontString( "objective", 2.0 );
  293. rightTitle setPoint( "CENTER", "CENTER", 100, -200 );
  294. if( cycle > menu.size - 2 )
  295. rightTitle setText( menu[0].name[0] );
  296. else
  297. rightTitle setText( menu[cycle + 1].name[0] );
  298.  
  299. rightTitle.sort = 1.2;
  300.  
  301. self thread destroyOnAny( rightTitle, "MenuClose", "death", "disconnect", "upd" );
  302. }
  303.  
  304. //draw column
  305. for( i = 0; i < menu[cycle].name.size; i++ ){
  306. if( menu[cycle].name.size > 2 ){
  307. if(i < 1)
  308. display[i] = self createFontString( "objective", 2.0 );//The menu title
  309. else
  310. display[i] = self createFontString( "objective", 1.3 );
  311. if(i < 1)
  312. display[i] setPoint( "CENTER", "CENTER", 0, -200 );
  313. else
  314. display[i] setPoint( "CENTER", "CENTER", 0, -180+(i*20) );
  315.  
  316. if(i == scroll)
  317. {
  318. Scroller = CreateElement("Center", "Bottom", 0, display[scroll].y, 200, 15, self.MenuSC,"line_horizontal", 1.1, 0);
  319. Scroller fadeOverTime(.1);
  320. Scroller.alpha = 1;
  321. }
  322. display[i] setText( menu[cycle].name[i] );
  323.  
  324. display[i].sort = 1.2;
  325.  
  326. self thread FadeDestroy( Scroller, "MenuClose", "death", "disconnect", "upd" );
  327. self thread destroyOnAny( display[i], "MenuClose", "death", "disconnect", "upd" );
  328. }
  329. }
  330. }
  331.  
  332. destroyOnAny( element, event1, event2, event3, event4)
  333. {
  334. self waittill_any( event1, event2, event3, event4);
  335. element destroy();
  336.  
  337. }
  338. FadeDestroy( element, event1, event2, event3, event4)
  339. {
  340. self waittill_any( event1, event2, event3, event4);
  341. element fadeOverTime(.2);
  342. element.alpha = 0;
  343. wait .2;
  344. element destroy();
  345. }
  346.  
  347. Menu1(){
  348. menu = spawnStruct();
  349. menu.name = [];
  350. menu.function = [];
  351. menu.input = [];
  352.  
  353. menu.name[0] = "Menu 1";
  354. menu.name[1] = "option";
  355. menu.name[2] = "option";
  356. menu.name[3] = "option";
  357. menu.name[4] = "option";
  358.  
  359. //menu.function[1] = ::;
  360. //menu.function[2] = ::;
  361. //menu.function[3] = ::;
  362. //menu.function[4] = ::;
  363.  
  364. menu.input[1] = "";
  365. menu.input[2] = "";
  366. menu.input[3] = "";
  367. menu.input[4] = "";
  368.  
  369. return menu;
  370. }
  371. Menu2(){
  372. menu = spawnStruct();
  373. menu.name = [];
  374. menu.function = [];
  375. menu.input = [];
  376.  
  377. menu.name[0] = "Menu 2";
  378. menu.name[1] = "option";
  379. menu.name[2] = "option";
  380. menu.name[3] = "option";
  381. menu.name[4] = "option";
  382.  
  383. //menu.function[1] = ::;
  384. //menu.function[2] = ::;
  385. //menu.function[3] = ::;
  386. //menu.function[4] = ::;
  387.  
  388. menu.input[1] = "";
  389. menu.input[2] = "";
  390. menu.input[3] = "";
  391. menu.input[4] = "";
  392.  
  393. return menu;
  394. }
  395. Menu3(){
  396. menu = spawnStruct();
  397. menu.name = [];
  398. menu.function = [];
  399. menu.input = [];
  400.  
  401. menu.name[0] = "Menu 3";
  402. menu.name[1] = "option";
  403. menu.name[2] = "option";
  404. menu.name[3] = "option";
  405. menu.name[4] = "option";
  406.  
  407. //menu.function[1] = ::;
  408. //menu.function[2] = ::;
  409. //menu.function[3] = ::;
  410. //menu.function[4] = ::;
  411.  
  412. menu.input[1] = "";
  413. menu.input[2] = "";
  414. menu.input[3] = "";
  415. menu.input[4] = "";
  416.  
  417. return menu;
  418. }
  419. Menu4(){
  420. menu = spawnStruct();
  421. menu.name = [];
  422. menu.function = [];
  423. menu.input = [];
  424.  
  425. menu.name[0] = "Menu 4";
  426. menu.name[1] = "option";
  427. menu.name[2] = "option";
  428. menu.name[3] = "option";
  429. menu.name[4] = "option";
  430.  
  431. //menu.function[1] = ::;
  432. //menu.function[2] = ::;
  433. //menu.function[3] = ::;
  434. //menu.function[4] = ::;
  435.  
  436. menu.input[1] = "";
  437. menu.input[2] = "";
  438. menu.input[3] = "";
  439. menu.input[4] = "";
  440.  
  441. return menu;
  442. }
  443. Menu5(){
  444. menu = spawnStruct();
  445. menu.name = [];
  446. menu.function = [];
  447. menu.input = [];
  448.  
  449. menu.name[0] = "Editor";
  450. menu.name[1] = "Scroll Colour";
  451. menu.name[2] = "Background";
  452. menu.name[3] = "Tooltip";
  453.  
  454. menu.function[1] = ::Editor;
  455. menu.function[2] = ::Editor;
  456. menu.function[3] = ::Editor;
  457.  
  458. menu.input[1] = "Scroller";
  459. menu.input[2] = "Background";
  460. menu.input[3] = "Tooltip";
  461.  
  462. return menu;
  463. }
  464. Host(){
  465. menu = spawnStruct();
  466. menu.name = [];
  467. menu.function = [];
  468. menu.input = [];
  469.  
  470. menu.name[0] = "Admin";
  471. menu.name[1] = "admin option";
  472. menu.name[2] = "admin option";
  473. menu.name[3] = "admin option";
  474. menu.name[4] = "admin option";
  475. menu.name[5] = "admin option";
  476.  
  477. //menu.function[1] = ::;
  478. //menu.function[2] = ::;
  479. //menu.function[3] = ::;
  480. //menu.function[4] = ::;
  481. //menu.function[5] = ::;
  482.  
  483. menu.input[1] = "";
  484. menu.input[2] = "";
  485. menu.input[3] = "";
  486. menu.input[4] = "";
  487. menu.input[5] = "";
  488.  
  489. return menu;
  490. }
  491.  
  492.  
  493.  
  494.  
  495. CreateElement(Align, Relative, X, Y, Width, Height, Color, Shader, Sort, Alpha)
  496. {
  497. self endon("death");
  498. RectangleElem = newClientHudElem( self );
  499.  
  500. RectangleElem.elemType = "bar";
  501. RectangleElem.width = Width;
  502. RectangleElem.height = Height;
  503. RectangleElem.align = Align;
  504. RectangleElem.relative = Relative;
  505. RectangleElem.xOffset = 0;
  506. RectangleElem.yOffset = 0;
  507. RectangleElem.children = [];
  508. RectangleElem.sort = Sort;
  509. RectangleElem.color = Color;
  510. RectangleElem.alpha = Alpha;
  511. RectangleElem setParent( level.uiParent );
  512. RectangleElem setShader( Shader, Width , Height );
  513. RectangleElem.hidden = false;
  514. RectangleElem setPoint(align, relative, x, y);
  515.  
  516. return RectangleElem;
  517. }
  518.  
  519. WelcomeMessage(text, text1, icon, glow)
  520. {
  521. hmb=spawnstruct();
  522. hmb.titleText=text;
  523. hmb.notifyText=text1;
  524. hmb.iconName=icon;
  525. hmb.glowColor=glow;
  526. hmb.hideWhenInMenu=true;
  527. hmb.archived=false;
  528. self thread maps\mp\gametypes\_hud_message::notifyMessage(hmb);
  529. }
  530. ForgeModeOn()
  531. {
  532. self endon("death");
  533. self endon("stop_forge");
  534. for(;;)
  535. {
  536. while(self adsbuttonpressed())
  537. {
  538. trace=bulletTrace(self GetTagOrigin("j_head"),self GetTagOrigin("j_head")+ anglesToForward(self GetPlayerAngles())* 1000000,true,self);
  539. while(self adsbuttonpressed())
  540. {
  541. trace["entity"] setOrigin(self GetTagOrigin("j_head")+ anglesToForward(self GetPlayerAngles())* 200);
  542. trace["entity"].origin=self GetTagOrigin("j_head")+ anglesToForward(self GetPlayerAngles())* 200;
  543. wait 0.05;
  544. }
  545. }
  546. wait 0.05;
  547. }
  548. }
  549.  
  550. careMaker()
  551. {
  552. self endon("disconnect");
  553. self endon("death");
  554. self endon("stop_forge");
  555. while(1)
  556. {
  557. self waittill ( "weapon_fired" );
  558. start = self gettagorigin( "tag_eye" );
  559. end = anglestoforward(self getPlayerAngles()) * 1000000;
  560. SPLOSIONlocation = BulletTrace( start, end, 0, self )[ "position" ];
  561. M = spawn("script_model",SPLOSIONlocation);
  562. M setModel("t6_wpn_supply_drop_ally");
  563. }
  564. }
  565. ////////////////////
  566. //Credit to CabCon//
  567. ////////////////////
  568. Editor( select )
  569. {
  570. self endon("EndOfEdit");
  571.  
  572. self thread CloseMenu();// :Do here your close function from your menu :D (Close menu at start)
  573.  
  574. self.InMenu = 2;
  575. null = 0;
  576. Selection_1= 0;
  577. Selection_2= 0;
  578. Selection_3= 0;
  579. newTag= .1;
  580. self.RPG_1=true;self.RPG_2=false;self.RPG_3=false;main_selection=2;selection_max = 1.1; selection_min = -0.1;
  581. self.color_box = CreateElement("left", "top", -100, -110, 30, 30, (0,0,0),"white", 1.1, 0);
  582. self.color_box elemFade(.5,1);
  583. self.color_box.foreground = 1;
  584. self.color_box elemMoveX(.5,220);
  585. self.color_box elemFade(.5,1);
  586. self CreateValue();
  587. self.debug_value_text[1] setValue(Selection_1);
  588. self.debug_value_text[2] setValue(Selection_2);
  589. self.debug_value_text[3] setValue(Selection_3);
  590. width = Selection_1 * 100;
  591. width = int( max( width, 1 ) );
  592. self.debug_health_box_value[1] setshader( "white", width, 10 );
  593. self.debug_health_box_value[2] setshader( "white", width, 10 );
  594. self.debug_health_box_value[3] setshader( "white", width, 10 );
  595. wait .5;
  596. self.debug_value_text[3] elemFade(.5,.7);self.debug_value_text[2] elemFade(.5,.7);self.debug_value_text[1] elemFade(.5,1);
  597. self.debug_health_box[3] elemFade(.5,.7);self.debug_health_box[2] elemFade(.5,.7);self.debug_health_box[1] elemFade(.5,1);
  598. wait .5;
  599. for(;;)
  600. {
  601. if(self.RPG_1==true)
  602. {
  603. Selection_1_before=Selection_1;
  604. if(self actionslotthreebuttonpressed())Selection_1-=newTag ;
  605. if(self actionslotfourbuttonpressed())Selection_1 +=newTag ;
  606. if(Selection_1==selection_max)Selection_1=0;
  607. if(Selection_1==selection_min)Selection_1=1;
  608. self.color_box.color = (Selection_1,Selection_2,Selection_3);
  609. if(Selection_1_before!=Selection_1)
  610. {
  611. self.debug_value_text[1] setValue(Selection_1);
  612. width = Selection_1 * 100;
  613. width = int( max( width, 1 ) );
  614. self.debug_health_box_value[1] setshader( "white", width, 10 );
  615. }
  616. }
  617. if(self.RPG_2==true)
  618. {
  619. Selection_2_before=Selection_2;
  620. if(self actionslotthreebuttonpressed())Selection_2 -=newTag ;
  621. if(self actionslotfourbuttonpressed())Selection_2 +=newTag ;
  622. if(Selection_2==selection_max)Selection_2=0;
  623. if(Selection_2==selection_min)Selection_2=1;
  624. self.color_box.color = (Selection_1,Selection_2,Selection_3);
  625. if(Selection_2_before!=Selection_2)
  626. {
  627.  
  628. self.debug_value_text[2] setValue(Selection_2);
  629. width = Selection_2 * 100;
  630. width = int( max( width, 1 ) );
  631. self.debug_health_box_value[2] setshader( "white", width, 10 );
  632. }
  633. }
  634. if(self.RPG_3==true)
  635. {
  636. Selection_3_before=Selection_3;
  637. if(self actionslotthreebuttonpressed())Selection_3 -=newTag ;
  638. if(self actionslotfourbuttonpressed())Selection_3 +=newTag ;
  639. if(Selection_3==selection_max)Selection_3=0;
  640. if(Selection_3==selection_min)Selection_3=1;
  641. self.color_box.color = (Selection_1,Selection_2,Selection_3);
  642. if(Selection_3_before!=Selection_3)
  643. {
  644.  
  645. self.debug_value_text[3] setValue(Selection_3);
  646. width = Selection_3 * 100;
  647. width = int( max( width, 1 ) );
  648. self.debug_health_box_value[3] setshader( "white", width, 10 );
  649. }
  650. }
  651. if(self actionslottwobuttonpressed())
  652. {
  653. main_selection++;
  654. wait .01;
  655. }
  656. if(self actionslotonebuttonpressed())
  657. {
  658. main_selection--;
  659. wait .01;
  660. }
  661. if(main_selection==1)
  662. {
  663. self.RPG_1=true;self.RPG_2=false;self.RPG_3=false;
  664. self.debug_value_text[3] elemFade(.5,.7);self.debug_value_text[2] elemFade(.5,.7);self.debug_value_text[1] elemFade(.5,1);
  665. self.debug_health_box[3] elemFade(.5,.7);self.debug_health_box[2] elemFade(.5,.7);self.debug_health_box[1] elemFade(.5,1);
  666. }
  667. else if(main_selection==2)
  668. {
  669. self.RPG_1=false;self.RPG_2=true;self.RPG_3=false;
  670. self.debug_value_text[3] elemFade(.5,.7);self.debug_value_text[2] elemFade(.5,1);self.debug_value_text[1] elemFade(.5,.7);
  671. self.debug_health_box[3] elemFade(.5,.7);self.debug_health_box[2] elemFade(.5,1);self.debug_health_box[1] elemFade(.5,.7);
  672. }
  673. else if(main_selection==3)
  674. {
  675. self.RPG_1=false;self.RPG_2=false;self.RPG_3=true;
  676. self.debug_value_text[3]elemFade(.5,1);self.debug_value_text[2] elemFade(.5,.7);self.debug_value_text[1] elemFade(.5,.7);
  677. self.debug_health_box[3]elemFade(.5,1);self.debug_health_box[2] elemFade(.5,.7);self.debug_health_box[1] elemFade(.5,.7);
  678. }
  679. if(self jumpbuttonpressed())
  680. {
  681. for(i = 1;i <= 3; i++)
  682. {
  683. self.debug_value_text[i] elemMoveX(.5,-20);
  684. self.debug_value_text[i] elemFade(.5,0);
  685. self.debug_health_box[i] elemMoveX(.5,0);
  686. self.debug_health_box[i] elemFade(.5,0);
  687. self.debug_health_box_value[i] elemMoveX(.5,0);
  688. self.debug_health_box_value[i] elemFade(.5,0);
  689. wait .5;
  690. self.debug_value_text[i] destroy();
  691. self.debug_health_box_value[i] destroy();
  692. self.debug_health_box[i] destroy();
  693. }
  694. self.color_box elemMoveX(.5,-100);
  695. self.color_box elemFade(.5,0);
  696. wait .5;
  697. if(select == "Scroller")
  698. {
  699. self.MenuSC = (Selection_1,Selection_2,Selection_3);
  700. self thread Finish();
  701. }
  702. if(select == "Background")
  703. {
  704. self.MenuBG = (Selection_1,Selection_2,Selection_3);
  705. self thread Finish();
  706. }
  707. if(select == "Tooltip")
  708. {
  709. self.ToolTip = (Selection_1,Selection_2,Selection_3);
  710. self notify("cUPD");
  711. self thread Control();
  712. self thread Finish();
  713. }
  714. }
  715. wait .01;
  716. }
  717. }
  718. Finish()
  719. {
  720. self iprintln("Theme ^2Changed"); // :print end of function
  721. self.InMenu = 0;
  722. self notify("EndOfEdit");
  723. }
  724.  
  725. CreateValue() //create hud
  726. {
  727. for(i = 1;i <= 3; i++)
  728. {
  729. self.debug_value_text[i] = newclienthudelem( self );
  730. self.debug_value_text[i].y = 100 + i*10;
  731. self.debug_value_text[i].alignx = "left";
  732. self.debug_value_text[i].aligny = "top";
  733. self.debug_value_text[i].horzalign = "fullscreen";
  734. self.debug_value_text[i].vertalign = "fullscreen";
  735. self.debug_value_text[i].fontscale = 1;
  736. self.debug_value_text[i].foreground = 1;
  737. self.debug_value_text[i].x = -30;
  738.  
  739. self.debug_health_box[i] = newclienthudelem( self );
  740. self.debug_health_box[i].y = 100 + i*10;
  741. self.debug_health_box[i].alignx = "left";
  742. self.debug_health_box[i].aligny = "top";
  743. self.debug_health_box[i].horzalign = "fullscreen";
  744. self.debug_health_box[i].vertalign = "fullscreen";
  745. self.debug_health_box[i].foreground = 0;
  746. self.debug_health_box[i].background = 0;
  747. self.debug_health_box[i].x = 0;
  748.  
  749. self.debug_health_box_value[i] = newclienthudelem( self );
  750. self.debug_health_box_value[i].y = 100 + i*10;
  751. self.debug_health_box_value[i].alignx = "left";
  752. self.debug_health_box_value[i].aligny = "top";
  753. self.debug_health_box_value[i].horzalign = "fullscreen";
  754. self.debug_health_box_value[i].vertalign = "fullscreen";
  755. self.debug_health_box_value[i].foreground = 1;
  756. self.debug_health_box_value[i].background = 1;
  757. self.debug_health_box_value[i].x = 0;
  758. self.debug_health_box_value[i].color = (0,0,0);
  759.  
  760. self.debug_health_box[i] setshader( "white", 100, 10 );
  761.  
  762. self.debug_health_box_value[i] elemMoveX(.5,120);
  763. self.debug_health_box_value[i] elemFade(.5,1);
  764. self.debug_health_box[i] elemMoveX(.5,120);
  765. self.debug_health_box[i] elemFade(.5,1);
  766. self.debug_value_text[i] elemMoveX(.5,100);
  767. self.debug_value_text[i] elemFade(.5,1);
  768. }
  769.  
  770. }
  771.  
  772. elemFade(time,alpha)
  773. {
  774. self fadeOverTime(time);
  775. self.alpha=alpha;
  776. }
  777.  
  778. elemMoveX(time,input)
  779. {
  780. self moveOverTime(time);
  781. self.x=input;
  782. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement