teamturker

Login select Enter key

Mar 1st, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. #Event
  2.     def OnKeyDown(self, key):
  3.  
  4.         if 1 == key:
  5.             self.ExitSelect()
  6.         if 2 == key:
  7.             self.SelectSlot(0)
  8.         if 3 == key:
  9.             self.SelectSlot(1)
  10.         if 4 == key:
  11.             self.SelectSlot(2)
  12.  
  13.         if 28 == key:
  14.  
  15.             id = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_ID)
  16.             if 0 == id:
  17.                 self.CreateCharacter()
  18.  
  19.             else:
  20.                 self.StartGame()
  21.  
  22.         if 203 == key:
  23.             self.slot = (self.GetSlotIndex() - 1 + self.SLOT_COUNT) % self.SLOT_COUNT
  24.             self.SelectSlot(self.slot)
  25.         if 205 == key:
  26.             self.slot = (self.GetSlotIndex() + 1) % self.SLOT_COUNT
  27.             self.SelectSlot(self.slot)
  28.  
  29.         return TRUE
Advertisement
Add Comment
Please, Sign In to add comment