Guest User

Untitled

a guest
May 17th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. kiwiMenu()
  2. {
  3. self endon("death");
  4. self endon("disconnect");
  5. self endon("menu_exit");
  6.  
  7. menu = spawnStruct();
  8. menu.option = [];
  9. menu.function = [];
  10. display = [];
  11. self.chosen = 0;
  12.  
  13. menu.option = strTok("Test 1|Test 2|Test 3|Test 4|Test 5", "|");
  14. //Functions
  15. //menu.function[0] = ::;
  16. //menu.function[1] = ::;
  17. //menu.function[2] = ::;
  18. //menu.function[3] = ::;
  19. //menu.function[4] = ::;
  20.  
  21. for(i=0;i<=4;i++)
  22. {
  23. display[i] = self createFontString( "objective", 2.0 );
  24. display[i] setPoint( "TOP", "TOP", 0, 0 + (i*40));
  25. display[i] setText(menu.option[i]);
  26. }
  27. for(;;)
  28. {
  29. hilighted = self createFontString( "objective", 2.0 );
  30. hilighted setPoint( "TOP", "TOP", 0, 0 + (self.chosen*40));
  31. hilighted setText("^2"+menu.option[self.chosen]);
  32. self waittill("option_checked");
  33. }
  34. self thread watchUp();
  35. self thread watchDown();
  36. }
  37. watchChosen()
  38. {
  39. if(self.chosen<0)
  40. {
  41. self.chosen = 0;
  42. }
  43. self notify("option_checked");
  44. }
  45. watchUp()
  46. {
  47. self notifyOnPlayerCommand("4","+actionslot 4");
  48. for(;;)
  49. {
  50. self waittill("4");
  51. self.chosen--;
  52. self thread watchChosen();
  53. }
  54. }
  55. watchDown()
  56. {
  57. self notifyOnPlayerCommand("5","+actionslot 2");
  58. for(;;)
  59. {
  60. self waittill("5");
  61. self.chosen++;
  62. self thread watchChosen();
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment