Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- kiwiMenu()
- {
- self endon("death");
- self endon("disconnect");
- self endon("menu_exit");
- menu = spawnStruct();
- menu.option = [];
- menu.function = [];
- display = [];
- self.chosen = 0;
- menu.option = strTok("Test 1|Test 2|Test 3|Test 4|Test 5", "|");
- //Functions
- //menu.function[0] = ::;
- //menu.function[1] = ::;
- //menu.function[2] = ::;
- //menu.function[3] = ::;
- //menu.function[4] = ::;
- for(i=0;i<=4;i++)
- {
- display[i] = self createFontString( "objective", 2.0 );
- display[i] setPoint( "TOP", "TOP", 0, 0 + (i*40));
- display[i] setText(menu.option[i]);
- }
- for(;;)
- {
- hilighted = self createFontString( "objective", 2.0 );
- hilighted setPoint( "TOP", "TOP", 0, 0 + (self.chosen*40));
- hilighted setText("^2"+menu.option[self.chosen]);
- self waittill("option_checked");
- }
- self thread watchUp();
- self thread watchDown();
- }
- watchChosen()
- {
- if(self.chosen<0)
- {
- self.chosen = 0;
- }
- self notify("option_checked");
- }
- watchUp()
- {
- self notifyOnPlayerCommand("4","+actionslot 4");
- for(;;)
- {
- self waittill("4");
- self.chosen--;
- self thread watchChosen();
- }
- }
- watchDown()
- {
- self notifyOnPlayerCommand("5","+actionslot 2");
- for(;;)
- {
- self waittill("5");
- self.chosen++;
- self thread watchChosen();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment