Beispiel #1
0
 public override void run(Player p)
 {
     startMenu();
     if (pKeyA && !keyA)
     {
         caller.setFlag(flag, option);
         p.popState();
     }
     if (pKeyB && !keyB)
     {
         caller.setFlag(flag, -1);
         p.popState();
     }
     if (pKeyUp && !keyUp)
     {
         option--;
         if (option == -1)
         {
             option = options.Length - 1;
         }
     }
     if (pKeyDown && !keyDown)
     {
         option++;
         if (option == options.Length)
         {
             option = 0;
         }
     }
     endMenu();
 }
Beispiel #2
0
 public override void run(Player p)
 {
     startMenu();
     if (pKeyA && !keyA)
     {
         caller.setFlag(flag, option);
         p.popState();
     }
     if (pKeyB && !keyB)
     {
         caller.setFlag(flag, -1);
         p.popState();
     }
     if (pKeyUp && (!keyUp || holdUp > 30))
     {
         option++;
         if (option > max)
         {
             option = min;
         }
     }
     else if (pKeyUp)
     {
         holdUp++;
     }
     else
     {
         holdUp = 0;
     }
     if (pKeyDown && (!keyDown || holdDown > 30))
     {
         option--;
         if (option < min)
         {
             option = max;
         }
     }
     else if (pKeyDown)
     {
         holdDown++;
     }
     else
     {
         holdDown = 0;
     }
     endMenu();
 }
Beispiel #3
0
 public override void run(Player p)
 {
     startMenu();
     if (pKeyA && !keyA)
     {
         for (int i = 0; i < 3; i++)
         {
             caller.setFlag(flag + i, elements[i]);
         }
         p.popState();
     }
     else if (pKeyB && !keyB)
     {
         caller.setFlag(flag, -1);
         p.popState();
     }
     else if (pKeyLeft)
     {
         if (elements[option] > 0)
         {
             elements[option] -= 2;
         }
     }
     else if (pKeyRight)
     {
         if (elements[option] < 254)
         {
             elements[option] += 2;
         }
     }
     else if (pKeyUp && !keyUp)
     {
         if (option > 0)
         {
             option--;
         }
     }
     else if (pKeyDown && !keyDown)
     {
         if (option < 2)
         {
             option++;
         }
     }
     endMenu();
 }
Beispiel #4
0
 public override void run(Player p)
 {
     frames++;
     startMenu();
     if (pKeyB && !keyB)
     {
         if (position == 0)
         {
             caller.setFlag(flag, -1);
             p.popState();
         }
         else
         {
             position--;
             chars[position] = ' ';
         }
     }
     else if (pKeyA && !keyA)
     {
         if (position + 1 < length)
         {
             chars[position] = getChar(option);
             position++;
         }
     }
     else if (pKeyUp && !keyUp)
     {
         if (option >= CHARS_PER_LINE)
         {
             option -= CHARS_PER_LINE;
         }
     }
     else if (pKeyDown && !keyDown)
     {
         if (option + CHARS_PER_LINE < CHAR_LIMIT)
         {
             option += CHARS_PER_LINE;
         }
     }
     else if (pKeyLeft && !keyLeft)
     {
         if (option % CHARS_PER_LINE != 0)
         {
             option--;
         }
     }
     else if (pKeyRight && !keyRight)
     {
         if (option % CHARS_PER_LINE != CHARS_PER_LINE - 1 && option + 1 != CHAR_LIMIT)
         {
             option++;
         }
     }
     else if (pKeyStart && !keyStart)
     {
         for (int i = 0; i < position; i++)
         {
             caller.setFlag(flag + i + 1, chars[i]);
         }
         caller.setFlag(flag, position);
         p.popState();
     }
     endMenu();
 }