From e660513ac60bfa31749ac951409fae8bc0d0b735 Mon Sep 17 00:00:00 2001 From: lionur Date: Fri, 4 Nov 2022 20:06:10 +0300 Subject: [PATCH] changed button hierarchy --- easy-cruise.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/easy-cruise.lua b/easy-cruise.lua index 16dc858..fe3b29e 100644 --- a/easy-cruise.lua +++ b/easy-cruise.lua @@ -25,7 +25,7 @@ end function doCruise() local car = storeCarCharIsInNoSave(playerPed) if not isCharInAnyCar(playerPed) or not isCarEngineOn(car) then - if cruise then + if cruise then cruise = false printStringNow('~R~cruise control - OFF', 1500) end @@ -57,7 +57,7 @@ function check_press_key(table) if isKeyDown(vkeys[table[i]]) then result = true result_key_text = table[i]:gsub("VK_", "") - break + break end end return result, result_key_text @@ -68,7 +68,7 @@ script_update = { check_update_url = "https://git.deadpoo.net/rubin/easy-cruise/raw/branch/master/version", auto_update = false, auto_update_url = "https://git.deadpoo.net/rubin/easy-cruise/raw/branch/master/easy-cruise.lua", - address_ini = "rubin-scripts-updates.ini", + address_ini = "rubin-mods-updates.ini", main = function() local name = thisScript().name local ini = inicfg.load({ @@ -80,7 +80,7 @@ script_update = { script_update.check_update = ini[name].check_update script_update.auto_update = ini[name].auto_update inicfg.save(ini, script_update.address_ini) - if script_update.check_update then + if script_update.check_update or script_update.auto_update then local fpath = os.tmpname() local text = openURL(script_update.check_update_url, fpath) if text ~= "" and not string.find(text, thisScript().version) then @@ -144,16 +144,16 @@ script_update = { script_update.menu.dialog[#script_update.menu.dialog+1] = function() script_update.menu.show() end - script_update.menu.text[#script_update.menu.text+1] = string.format("\tcheck update %s", (ini[k].check_update and "on" or "off")) + script_update.menu.text[#script_update.menu.text+1] = string.format("\tauto update %s", (ini[k].auto_update and "{59fc30}ON" or "{ff0000}OFF")) script_update.menu.dialog[#script_update.menu.dialog+1] = function() - ini[k].check_update = not ini[k].check_update + ini[k].auto_update = not ini[k].auto_update inicfg.save(ini, script_update.address_ini) script_update.menu.show() end - if ini[k].check_update then - script_update.menu.text[#script_update.menu.text+1] = string.format("\tauto update %s", (ini[k].auto_update and "on" or "off")) + if not ini[k].auto_update then + script_update.menu.text[#script_update.menu.text+1] = string.format("\tcheck update %s", (ini[k].check_update and "{59fc30}ON" or "{ff0000}OFF")) script_update.menu.dialog[#script_update.menu.dialog+1] = function() - ini[k].auto_update = not ini[k].auto_update + ini[k].check_update = not ini[k].check_update inicfg.save(ini, script_update.address_ini) script_update.menu.show() end @@ -182,8 +182,8 @@ function openURL(url, fpath) end end) - repeat - wait(1000) + repeat + wait(1000) until final_download local text = "" @@ -191,7 +191,7 @@ function openURL(url, fpath) if f then text = f:read("*a") io.close(f) - end + end os.remove(fpath) return text end