Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- SKILL MENU SCRIPT
- -- MENU SETUP
- if not SimpleMenu then
- SimpleMenu = class()
- function SimpleMenu:init(title, message, options)
- self.dialog_data = { title = title, text = message, button_list = {},
- id = tostring(math.random(0,0xFFFFFFFF)) }
- self.visible = false
- for _,opt in ipairs(options) do
- local elem = {}
- elem.text = opt.text
- opt.data = opt.data or nil
- opt.callback = opt.callback or nil
- elem.callback_func = callback(self, self, "_do_callback",
- { data = opt.data,
- callback = opt.callback})
- elem.cancel_button = opt.is_cancel_button or false
- if opt.is_focused_button then
- self.dialog_data.focus_button = #self.dialog_data.button_list+1
- end
- table.insert(self.dialog_data.button_list, elem)
- end
- return self
- end
- function SimpleMenu:_do_callback(info)
- if info.callback then
- if info.data then
- info.callback(info.data)
- else
- info.callback()
- end
- end
- self.visible = false
- end
- function SimpleMenu:show()
- if self.visible then
- return
- end
- self.visible = true
- managers.system_menu:show(self.dialog_data)
- end
- function SimpleMenu:hide()
- if self.visible then
- managers.system_menu:close(self.dialog_data.id)
- self.visible = false
- return
- end
- end
- end
- patched_update_input = patched_update_input or function (self, t, dt )
- if self._data.no_buttons then
- return
- end
- local dir, move_time
- local move = self._controller:get_input_axis( "menu_move" )
- if( self._controller:get_input_bool( "menu_down" )) then
- dir = 1
- elseif( self._controller:get_input_bool( "menu_up" )) then
- dir = -1
- end
- if dir == nil then
- if move.y > self.MOVE_AXIS_LIMIT then
- dir = 1
- elseif move.y < -self.MOVE_AXIS_LIMIT then
- dir = -1
- end
- end
- if dir ~= nil then
- if( ( self._move_button_dir == dir ) and self._move_button_time and ( t < self._move_button_time + self.MOVE_AXIS_DELAY ) ) then
- move_time = self._move_button_time or t
- else
- self._panel_script:change_focus_button( dir )
- move_time = t
- end
- end
- self._move_button_dir = dir
- self._move_button_time = move_time
- local scroll = self._controller:get_input_axis( "menu_scroll" )
- -- local sdir
- if( scroll.y > self.MOVE_AXIS_LIMIT ) then
- self._panel_script:scroll_up()
- -- sdir = 1
- elseif( scroll.y < -self.MOVE_AXIS_LIMIT ) then
- self._panel_script:scroll_down()
- -- sdir = -1
- end
- end
- managers.system_menu.DIALOG_CLASS.update_input = patched_update_input
- managers.system_menu.GENERIC_DIALOG_CLASS.update_input = patched_update_input
- -- CALL MENU
- function openmenu(menu)
- menu:show()
- end
- function inGame()
- if not game_state_machine then return false end
- return string.find(game_state_machine:current_state_name(), "game")
- end
- if not inGame() then
- -- SET SKILLPOINTS TO 1
- setskill1 = setskill1 or function()
- managers.skilltree:_set_points(1)
- end
- -- SET SKILLPOINTS TO 3
- setskill3 = setskill3 or function()
- managers.skilltree:_set_points(3)
- end
- -- SET SKILLPOINTS TO 8
- setskill8 = setskill8 or function()
- managers.skilltree:_set_points(8)
- end
- -- SET SKILLPOINTS TO 50
- setskill50 = setskill50 or function()
- managers.skilltree:_set_points(50)
- end
- -- SET SKILLPOINTS TO 120 (LEGIT MAX AT LVL100)
- setskill120 = setskill120 or function()
- managers.skilltree:_set_points(120)
- end
- -- SET SKILLPOINTS TO 580 (MAX NEEDED FOR ALL SKILLS)
- setskill580 = setskill580 or function()
- managers.skilltree:_set_points(580)
- end
- -- RESET SKILLPOINTS
- resetskill = resetskill or function()
- managers.skilltree:_set_points(0)
- end
- -- SET INFAMY
- setinf1 = setinf1 or function()
- managers.infamy:_set_points(1)
- end
- setinf2 = setinf2 or function()
- managers.infamy:_set_points(2)
- end
- setinf3 = setinf3 or function()
- managers.infamy:_set_points(3)
- end
- setinf4 = setinf4 or function()
- managers.infamy:_set_points(4)
- end
- setinf5 = setinf5 or function()
- managers.infamy:_set_points(5)
- end
- resetinfy = resetinfy or function()
- managers.infamy:_set_points(0)
- end
- end
- -- UNLOCK MESSIAH CHARGES SKILL ((SELF-REVIVE) normalizable)
- unlmessiah = unlmessiah or function()
- function PlayerDamage:got_messiah_charges() return true
- end
- end
- callinmaster = callinmaster or function()
- openmenu(mastermenu)
- io.stdout:write("PLAY trainer/wav/effects/damn.wav\n")
- end
- callinmaster2 = callinmaster2 or function()
- openmenu(mastermenu2)
- io.stdout:write("PLAY trainer/wav/effects/damn.wav\n")
- end
- callinenforcer = callinenforcer or function()
- openmenu(enforcermenu)
- io.stdout:write("PLAY trainer/wav/effects/damn.wav\n")
- end
- callinenforcer = callinenforcer or function()
- openmenu(enforcermenu2)
- io.stdout:write("PLAY trainer/wav/effects/damn.wav\n")
- end
- callintechnician = callintechnician or function()
- openmenu(technicianmenu)
- io.stdout:write("PLAY trainer/wav/effects/damn.wav\n")
- end
- callintechnician2 = callintechnician2 or function()
- openmenu(technicianmenu2)
- io.stdout:write("PLAY trainer/wav/effects/damn.wav\n")
- end
- endcallinghost = callinghost or function()
- openmenu(ghostmenu)
- io.stdout:write("PLAY trainer/wav/effects/damn.wav\n")
- end
- endcallinghost2 = callinghost2 or function()
- openmenu(ghostmenu2)
- io.stdout:write("PLAY trainer/wav/effects/damn.wav\n")
- end
- callinroot = callinroot or function()
- openmenu(skillsmenu)
- end
- -- GHOST ACED MENU
- ghostoptions2 = ghostoptions2 or {
- { text = "Under construction", callback = endcall },
- {},
- { text = "Cancel", is_cancel_button = true},
- { text = "Back", callback = callinroot },
- }
- ghostmenu2 = ghostmenu2 or SimpleMenu:new("GHOST MENU ACED", "..! = not working atm", ghostoptions2)
- -- GHOST BASIC MENU
- ghostoptions = ghostoptions or {
- { text = "Under construction", callback = endcall },
- {},
- { text = "Cancel", is_cancel_button = true},
- { text = "Back", callback = callinroot },
- }
- ghostmenu = ghostmenu or SimpleMenu:new("GHOST MENU BASIC", "..! = not working atm", ghostoptions)
- -- TECHNICIAN ACED MENU
- technicianoptions2 = technicianoptions2 or {
- { text = "Under construction", callback = endcall },
- {},
- { text = "Cancel", is_cancel_button = true},
- { text = "Back", callback = callinroot },
- }
- technicianmenu2 = technicianmenu2 or SimpleMenu:new("TECHNICIAN MENU BASIC", "..! = not working atm", technicianoptions2)
- -- TECHNICIAN BASIC MENU
- technicianoptions = technicianoptions or {
- { text = "Under construction", callback = endcall },
- {},
- { text = "Cancel", is_cancel_button = true},
- { text = "Back", callback = callinroot },
- }
- technicianmenu = technicianmenu or SimpleMenu:new("TECHNICIAN MENU ACED", "..! = not working atm", technicianoptions)
- -- ENFORCER ACED MENU
- enforceroptions2 = enforceroptions2 or {
- { text = "Under construction", callback = endcall },
- {},
- { text = "Cancel", is_cancel_button = true},
- { text = "Back", callback = callinroot },
- }
- enforcermenu2 = enforcermenu2 or SimpleMenu:new("ENFORCER MENU ACED", "..! = not working atm", enforceroptions2)
- -- ENFORCER BASIC MENU
- enforceroptions = enforceroptions or {
- { text = "Under construction", callback = endcall },
- {},
- { text = "Cancel", is_cancel_button = true},
- { text = "Back", callback = callinroot },
- }
- enforcermenu = enforcermenu or SimpleMenu:new("ENFORCER MENU BASIC", "..! = not working atm", enforceroptions)
- -- MASTERMIND ACED MENU
- masteroptions2 = masteroptions2 or {
- { text = "!Cable guy", callback = endcall },
- { text = "!Combat medic", callback = endcall },
- { text = "!Endurance", callback = endcall },
- { text = "!Inside man", callback = endcall },
- { text = "!Fast learner", callback = endcall },
- { text = "!Leadership", callback = endcall },
- { text = "!Smooth talker", callback = endcall },
- { text = "!Equilibrium", callback = endcall },
- { text = "!Dominator", callback = endcall },
- { text = "!Stockholm syndrome", callback = endcall },
- { text = "!Combat doctor", callback = endcall },
- { text = "!Joker", callback = endcall },
- { text = "!Black marketeer", callback = endcall },
- { text = "!Gunslinger", callback = endcall },
- { text = "!Kilmer", callback = endcall },
- { text = "!Control Freak", callback = endcall },
- { text = "!Pistol messiah", callback = unlmessiah },
- { text = "!Inspire", callback = endcall },
- {},
- { text = "Cancel", is_cancel_button = true},
- { text = "Back", callback = callinroot },
- }
- mastermenu2 = mastermenu2 or SimpleMenu:new("MASTERMIND MENU ACED", "..! = not working atm", masteroptions2)
- --MASTERMIND BASIC MENU
- masteroptions = masteroptions or {
- { text = "!Unlock messiah charges", callback = mssiahmenu },
- { text = "!Cable guy", callback = enforcermenu },
- { text = "!Combat medic", callback = ghostmenu },
- { text = "!Endurance", callback = endcall },
- { text = "!Inside man", callback = endcall },
- { text = "!Fast learner", callback = endcall },
- { text = "!Leadership", callback = endcall },
- { text = "!Smooth talker", callback = endcall },
- { text = "!Equilibrium", callback = endcall },
- { text = "!Dominator", callback = endcall },
- { text = "!Stockholm syndrome", callback = endcall },
- { text = "!Combat doctor", callback = endcall },
- { text = "!Joker", callback = endcall },
- { text = "!Black marketeer", callback = endcall },
- { text = "!Gunslinger", callback = endcall },
- { text = "!Kilmer", callback = endcall },
- { text = "!Control Freak", callback = endcall },
- { text = "Pistol messiah", callback = endcall },
- { text = "!Inspire", callback = endcall },
- {},
- { text = "Exit", is_cancel_button = true},
- { text = "Back", callback = callinroot },
- }
- mastermenu = mastermenu or SimpleMenu:new("MASTERMIND MENU BASIC", "..! = not working atm", masteroptions)
- if inGame() then
- skilloptions = skilloptions or {
- { text = "Exit", is_cancel_button = true},
- {},
- { text = "Under construction", callback = endcall },
- }
- io.stdout:write("PLAY trainer/wav/effects/damn.wav\n")
- else
- skilloptions = skilloptions or {
- { text = "Exit", is_cancel_button = true},
- -- {},
- -- { text = "Mastermind basic skills", callback = callinmaster },
- -- { text = "Mastermind aced skills", callback = callinmaster2 },
- -- { text = "Enforcer basic skills", callback = callinenforcer },
- -- { text = "Enforcer aced skills", callback = callinenforcer2 },
- -- { text = "Technician basic skills", callback = callintechnician },
- -- { text = "Technician aced skills", callback = callintechnician2 },
- -- { text = "Ghost basic skills", callback = callinghost },
- -- { text = "Ghost aced skills", callback = callinghost2 },
- {},
- { text = "Reset infamy point(s)", callback = resetinfy },
- {},
- { text = "Add 5 infamy points", callback = setinf5 },
- { text = "Add 4 infamy points", callback = setinf4 },
- { text = "Add 3 infamy points", callback = setinf3 },
- { text = "Add 2 infamy points", callback = setinf2 },
- { text = "Add 1 infamy point", callback = setinf1 },
- {},
- { text = "Reset skillpoint(s)", callback = resetskill },
- {},
- { text = "Add 580 skillpoints (all skills)", callback = setskill580 },
- { text = "Add 120 skillpoints (legit max)", callback = setskill120 },
- { text = "Add 50 skillpoints", callback = setskill50 },
- { text = "Add 8 skillpoints", callback = setskill8 },
- { text = "Add 3 skillpoints", callback = setskill3 },
- { text = "Add 1 skillpoint", callback = setskill1 },
- }
- end
- -- ROOT MENU HEADER
- if not skillsmenu then
- skillsmenu = skillsmenu or SimpleMenu:new("SKILL MENU", "..what skills do you have?", skilloptions)
- end
- skillsmenu:show()
Advertisement
Add Comment
Please, Sign In to add comment