Advertisement
baddog-11

F1 - Cheat List.lua

Jan 31st, 2014
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.05 KB | None | 0 0
  1. -- CHEAT LIST MENU SCRIPT (v.1.1)
  2. -- MENU SETUP
  3. if not SimpleMenu then
  4. SimpleMenu = class()
  5.  
  6. function SimpleMenu:init(title, message, options)
  7. self.dialog_data = { title = title, text = message, button_list = {},
  8. id = tostring(math.random(0,0xFFFFFFFF)) }
  9. self.visible = false
  10. for _,opt in ipairs(options) do
  11. local elem = {}
  12. elem.text = opt.text
  13. opt.data = opt.data or nil
  14. opt.callback = opt.callback or nil
  15. elem.callback_func = callback(self, self, "_do_callback",
  16. { data = opt.data,
  17. callback = opt.callback})
  18. elem.cancel_button = opt.is_cancel_button or false
  19. if opt.is_focused_button then
  20. self.dialog_data.focus_button = #self.dialog_data.button_list+1
  21. end
  22. table.insert(self.dialog_data.button_list, elem)
  23. end
  24. return self
  25. end
  26.  
  27. function SimpleMenu:_do_callback(info)
  28. if info.callback then
  29. if info.data then
  30. info.callback(info.data)
  31. else
  32. info.callback()
  33. end
  34. end
  35. self.visible = false
  36. end
  37.  
  38. function SimpleMenu:show()
  39. if self.visible then
  40. return
  41. end
  42. self.visible = true
  43. managers.system_menu:show(self.dialog_data)
  44. end
  45.  
  46. function SimpleMenu:hide()
  47. if self.visible then
  48. managers.system_menu:close(self.dialog_data.id)
  49. self.visible = false
  50. return
  51. end
  52. end
  53. end
  54.  
  55. patched_update_input = patched_update_input or function (self, t, dt )
  56. if self._data.no_buttons then
  57. return
  58. end
  59.  
  60. local dir, move_time
  61. local move = self._controller:get_input_axis( "menu_move" )
  62.  
  63. if( self._controller:get_input_bool( "menu_down" )) then
  64. dir = 1
  65. elseif( self._controller:get_input_bool( "menu_up" )) then
  66. dir = -1
  67. end
  68.  
  69. if dir == nil then
  70. if move.y > self.MOVE_AXIS_LIMIT then
  71. dir = 1
  72. elseif move.y < -self.MOVE_AXIS_LIMIT then
  73. dir = -1
  74. end
  75. end
  76.  
  77. if dir ~= nil then
  78. if( ( self._move_button_dir == dir ) and self._move_button_time and ( t < self._move_button_time + self.MOVE_AXIS_DELAY ) ) then
  79. move_time = self._move_button_time or t
  80. else
  81. self._panel_script:change_focus_button( dir )
  82. move_time = t
  83. end
  84. end
  85.  
  86. self._move_button_dir = dir
  87. self._move_button_time = move_time
  88.  
  89. local scroll = self._controller:get_input_axis( "menu_scroll" )
  90. -- local sdir
  91. if( scroll.y > self.MOVE_AXIS_LIMIT ) then
  92. self._panel_script:scroll_up()
  93. -- sdir = 1
  94. elseif( scroll.y < -self.MOVE_AXIS_LIMIT ) then
  95. self._panel_script:scroll_down()
  96. -- sdir = -1
  97. end
  98. end
  99. managers.system_menu.DIALOG_CLASS.update_input = patched_update_input
  100. managers.system_menu.GENERIC_DIALOG_CLASS.update_input = patched_update_input
  101. ---------------------
  102. -- GLOBAL SETTINGS --
  103. ---------------------
  104. -- CALL MENU
  105. function openmenu(menu)
  106. menu:show()
  107. end
  108. ----------------------
  109. -- OUTGAME SETTINGS --
  110. ----------------------
  111. ---------------------
  112. -- INGAME SETTINGS --
  113. ---------------------
  114. ------------------
  115. -- MENU CONTENT --
  116. ------------------
  117. showkbmenu = function()
  118. openmenu(kbmenu)
  119. end
  120. showkbmenu2 = function()
  121. openmenu(kbmenutwo)
  122. end
  123. showkbmenu3 = function()
  124. openmenu(kbmenuthree)
  125. end
  126. showkbmenu4 = function()
  127. openmenu(kbmenufour)
  128. end
  129. shownpmenu = function()
  130. openmenu(npmenu)
  131. end
  132. shownpmenu2 = function()
  133. openmenu(npmenu2)
  134. end
  135. showmousemenu = function()
  136. openmenu(mousemenu)
  137. end
  138. returnhome = function()
  139. openmenu(clistrootmenu)
  140. end
  141. evacgtfo = function()
  142. SimpleMenu:hide()
  143. end
  144. ppt4pd2so = ppt4pd2so or function()
  145. Steam:overlay_activate( "url", "http://ppt4pd2.tumblr.com/" )
  146. end
  147. -- KEYBOARD MENU 1 - F Keys
  148. kbopt = {
  149. { text = "Main menu", callback = returnhome },
  150. { text = "", is_cancel_button = true },
  151. { text = "Previous", callback = showmousemenu },
  152. { text = "Next", callback = showkbmenu2 },
  153. }
  154. kbmenu = kbmenu or SimpleMenu:new("\[Cheat List - Keyboard 1 - F Keys\]", "F1 - Cheat List\nF2 - Godmode Toggle\nF3 - Weapon Menu\nF4 - Dexterity Menu\nF5 - Infinite All\nF6 - Evil Mastermind\nF7 - Ghost Recon\nF8 - Money Menu\nF9 - Skill Menu\nF10 - Level Menu\nF11 - Inventory Menu\nF12 - AS", kbopt)
  155. -- KEYBOARD MENU 2 - Letter Keys
  156. kbopt2 = {
  157. { text = "Main menu", callback = returnhome },
  158. { text = "", is_cancel_button = true },
  159. { text = "Previous", callback = showkbmenu },
  160. { text = "Next", callback = showkbmenu3 },
  161. }
  162. kbmenutwo = kbmenutwo or SimpleMenu:new("\[Cheat List - Keyboard 2 - Letter Keys\]", "X - X-Ray Vision Toggle\nY - Ammo and Health Refill\nQ - FOV Enhancer in Ghost Recon\nP - Setup Deathmatch", kbopt2)
  163. -- KEYBOARD MENU 3 - Number Keys
  164. kbopt3 = {
  165. { text = "Main menu", callback = returnhome },
  166. { text = "", is_cancel_button = true },
  167. { text = "Previous", callback = showkbmenu2 },
  168. { text = "Next", callback = showkbmenu4 },
  169. }
  170. kbmenuthree = kbmenuthree or SimpleMenu:new("\[Cheat List - Keyboard 3 - Number Keys\]", "4 - Ammo Bag\n5 - Medikit\n6 - Sentry Gun\n7 - Ecm\n8 - Tripmine\n9 - Smoke Grenade\n0 - Flash Grenade\nß - Holy Grenade", kbopt3)
  171. -- KEYBOARD MENU 4 - Extra Keys
  172. kbopt4 = {
  173. { text = "Main menu", callback = returnhome },
  174. { text = "", is_cancel_button = true },
  175. { text = "Previous", callback = showkbmenu3 },
  176. { text = "Next", callback = shownpmenu },
  177. }
  178. kbmenufour = kbmenufour or SimpleMenu:new("\[Cheat List - Keyboard 4 - Extra Keys\]", "Insert - Overkill\nDelete - Normalizer\nHome - Spawn Menu\nEnd - Hover\nPageup - Instant Win\nPagedown - Instant Lose\nEnter - Dlc.lua\n'-' - Remove Lego\n'+' - Add Lego\n',' - Ascend\n'.' - Descend", kbopt4)
  179. -- Numeric keypad Keys
  180. npopt = {
  181. { text = "Main menu", callback = returnhome },
  182. { text = "", is_cancel_button = true },
  183. { text = "Previous", callback = showkbmenu2 },
  184. { text = "Next", callback = shownpmenu2 },
  185. }
  186. npmenu = npmenu or SimpleMenu:new("\[Cheat List - Numeric keypad Keys\]", "Numpad 1 - Troll\nNumpad 2 - Goofy Goober\nNumpad 3 - Bender\nNumpad 4 - Bouncing Betty\nNumpad 5 - Stairway to Heaven\nNumpad 6 - Lego Menu\nNumpad 7 - Terminator\nNumpad 8 - Gifthunter\nNumpad 9 - Driv3r\nNumpad 0 - Job Menu\nNumpad '/' - Media Module\nNumpad '*' - Pvp\nNumpad '-' - Character Menu\nNumpad '+' - Mod Menu\nNumpad ',' - Costum Script", npopt)
  187. -- Arrow Keys
  188. npopt2 = {
  189. { text = "Main menu", callback = returnhome },
  190. { text = "", is_cancel_button = true },
  191. { text = "Previous", callback = shownpmenu },
  192. { text = "Next", callback = showmousemenu },
  193. }
  194. npmenu2 = npmenu2 or SimpleMenu:new("\[Cheat List - Arrow Keys\]", "UPArrow - Drive Vehicle forward\nDownArrow - Drive Vehicle backwards\nLeftArrow - Turn Vehicle left\nRightArrow - Turn Vehicle Right", npopt2)
  195. -- MOUSE MENU
  196. mouseopt = {
  197. { text = "Main menu", callback = returnhome },
  198. { text = "", is_cancel_button = true },
  199. { text = "Previous", callback = shownpmenu2 },
  200. { text = "Next", callback = showkbmenu },
  201. }
  202. mousemenu = mousemenu or SimpleMenu:new("\[Cheat List - Mouse Keys\]", "MiddleMouseButton - Slow Mo\nMouseButton4 - Teleport", mouseopt)
  203. --ROOT MENU
  204. clistroot = {
  205. { text = "F Keys", callback = showkbmenu },
  206. { text = "Letter Keys", callback = showkbmenu2 },
  207. { text = "Number Keys", callback = showkbmenu3 },
  208. { text = "Extra Keys", callback = showkbmenu4 },
  209. { text = "Numeric keypad Keys", callback = shownpmenu },
  210. { text = "Arrow Keys", callback = shownpmenu2 },
  211. { text = "Mouse Keys", callback = showmousemenu },
  212. {},
  213. { text = "Pirate Perfection - Tumblr", callback = ppt4pd2so },
  214. { text = "", is_cancel_button = true },
  215. { text = "Exit", callback = evacgtfo },
  216. }
  217. if not clistrootmenu then
  218. clistrootmenu = SimpleMenu:new("CHEAT LIST", "Dementia friendly.", clistroot)
  219. end
  220. clistrootmenu:show()
  221. io.stdout:write("PLAY trainer/wav/effects/captainslog.wav\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement