Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function init()
- eaop = GetBool("savegame.mod.eaop")
- if eaop == 0 then eaop = 0.15 end
- changingkey = false
- selectedkey = ""
- end
- uniqueCharacters = {
- [1] = "lmb",
- [2] = "rmb",
- [3] = "up",
- [4] = "down",
- [5] = "left",
- [6] = "right",
- [7] = "space",
- [8] = "interact",
- [9] = "return",
- }
- function getAlphabet ()
- local letters = {}
- for ascii = 65, 90 do table.insert(letters, string.char(ascii)) end
- for key,value in ipairs(uniqueCharacters) do table.insert(letters, value) end
- return letters
- end
- alpha = getAlphabet()
- function tick()
- if(changingkey and (InputPressed("any") or InputPressed("rmb") )) then
- for key,value in ipairs(alpha) do
- if(InputPressed(value)) then
- SetString("savegame.mod.controls."..selectedkey,value)
- selectedkey = ""
- changingkey = false
- end
- end
- end
- end
- keybinds = {
- changetype = "V",
- changeammo = "C",
- changespread = "Z",
- }
- keybindorder = {
- [1] = "changetype",
- [2] = "changeammo",
- [3] = "changespread"
- }
- function draw()
- UiTranslate(UiCenter(), 350)
- UiAlign("center middle")
- UiFont("bold.ttf", 48)
- UiText("Enhanced AC130 airstrike")
- UiFont("regular.ttf", 26)
- UiTranslate(0, 70)
- -- UiPush()
- -- UiText("No Cooldown")
- -- UiTranslate(15, 40)
- -- UiAlign("right")
- -- UiColor(0.5, 0.8, 1)
- -- if eaop then
- -- if UiTextButton("Yes", 20, 20) then
- -- eaop = false
- -- SetBool("savegame.mod.eaop", eaop)
- -- end
- -- else
- -- if UiTextButton("No", 20, 20) then
- -- eaop = true
- -- SetBool("savegame.mod.eaop", eaop)
- -- end
- -- end
- UiColor(1,1,1)
- UiTranslate(-15,40)
- UiAlign("center middle")
- UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
- for key, val in ipairs(keybindorder) do
- local inputKey = keybinds[val]
- key = val
- if(GetString("savegame.mod.controls."..key,val)~="")then
- inputKey = GetString("savegame.mod.controls."..key,inputKey)
- end
- local displaytext = string.format("%-10s %5s",key..": ",inputKey)
- if(changingkey and selectedkey == key) then
- displaytext = string.format("%-10s %5s",key..": ","____")
- UiTextButton(displaytext, 250, 40)
- else
- if UiTextButton(displaytext, 250, 40) and not changingkey then
- changingkey = true
- selectedkey = key
- end
- end
- UiTranslate(0,50)
- end
- if UiTextButton("Reset to default",250,40) then
- for key, val in ipairs(keybindorder) do
- local inputKey = keybinds[val]
- SetString("savegame.mod.controls."..val,inputKey)
- end
- end
- UiPop()
- UiButtonImageBox("ui/common/box-outline-6.png", 6, 6)
- UiTranslate(0, 300)
- if UiTextButton("Close", 80, 40) then
- Menu()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment