Created
November 3, 2012 18:45
-
-
Save Brianetta/4008245 to your computer and use it in GitHub Desktop.
New UI cheat menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Translate:Add({ | |
English = { | |
cheats = 'Cheats!', | |
} | |
}) | |
local ui = Engine.ui | |
local t = Translate:GetTranslator() | |
local cheatMission = function () | |
local cheats = { | |
{'Add cash', function () Game.player:SetMoney(Game.player:GetMoney() + 100000) end}, | |
{'Refuel', function () Game.player:SetFuel() end}, | |
{'Fit autopilot', function () Game.player:AddEquip('AUTOPILOT') end}, | |
{'Fit atmospheric shield', function () Game.player:AddEquip('ATMOSPHERIC_SHIELDING') end}, | |
{'Destroy combat target', function () Game.player:GetCombatTarget():Explode() end}, | |
} | |
local CheatList = ui:VBox() | |
for key,cheat in pairs(cheats) do | |
local cheatButton = ui:Button():SetInnerWidget(ui:Label(cheat[1])) | |
cheatButton.onClick:Connect(cheat[2]) | |
CheatList:PackEnd(cheatButton) | |
end | |
local cheats = function (ref) | |
return CheatList | |
end | |
Mission.RegisterClick('cheats', function (ref) return CheatList end) | |
local missionData = { | |
type = 'cheats', | |
client = Character.New({name = 'Alpha Tester'}), | |
due = Game.time, | |
reward = 0, | |
status = 'ACTIVE', | |
} | |
Timer:CallAt(5,function () Mission.Add(missionData) end) | |
end | |
Event.Register("onGameStart", cheatMission) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment