Skip to content

Commit

Permalink
3.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorBarns committed Oct 22, 2021
1 parent 4078b72 commit 0c88f97
Show file tree
Hide file tree
Showing 83 changed files with 767 additions and 219 deletions.
28 changes: 27 additions & 1 deletion PLUGINS/cl_plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ Citizen.CreateThread(function()
}, RMenu:Get('lvc', 'extrasettings'))
end
-----------------------------------------------------------------------------------------------------------------
if ta_masterswitch then
RageUI.Button('Traffic Advisor Settings', "Open traffic advisor menu. (traffic_advisor)", {RightLabel = "→→→"}, true, {
onSelected = function()
end,
}, RMenu:Get('lvc', 'tasettings'))
end
-----------------------------------------------------------------------------------------------------------------
if trailer_masterswitch then
RageUI.Button('Trailer Support Settings', "Open trailer support settings menu. (trailer_support)", {RightLabel = "→→→"}, true, {
onSelected = function()
end,
}, RMenu:Get('lvc', 'trailersettings'))
end
-----------------------------------------------------------------------------------------------------------------
if ec_masterswitch then
RageUI.Button('Extra Controls Settings', "Open extra controls settings menu. (extra_controls)", {RightLabel = "→→→"}, true, {
onSelected = function()
end,
}, RMenu:Get('lvc', 'extracontrols'))
end
-----------------------------------------------------------------------------------------------------------------
end)
Citizen.Wait(0)
end
Expand All @@ -48,5 +69,10 @@ end)
function IsPluginMenuOpen()
return RageUI.Visible(RMenu:Get('lvc', 'smartsiren')) or
RageUI.Visible(RMenu:Get('lvc', 'tkdsettings')) or
RageUI.Visible(RMenu:Get('lvc', 'extrasettings'))
RageUI.Visible(RMenu:Get('lvc', 'extrasettings')) or
RageUI.Visible(RMenu:Get('lvc', 'tasettings')) or
RageUI.Visible(RMenu:Get('lvc', 'trailersettings')) or
RageUI.Visible(RMenu:Get('lvc', 'trailerextras')) or
RageUI.Visible(RMenu:Get('lvc', 'trailerdoors')) or
RageUI.Visible(RMenu:Get('lvc', 'extracontrols'))
end
42 changes: 14 additions & 28 deletions PLUGINS/extra_integration/UTIL/cl_extras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ end)
---------------ON RESOURCE STARTUP-----------------
Citizen.CreateThread(function()
Citizen.Wait(500)
EI:FixOversizeKeys()
UTIL:FixOversizeKeys(EXTRA_ASSIGNMENTS)
end)

---------------------------------------------------------------------
Expand All @@ -307,37 +307,23 @@ AddEventHandler('lvc:onVehicleChange', function()
end
end)

---------------------------------------------------------------------
--[[Shorten oversized <gameName> strings in EXTRA_ASSIGNMENTS (extra_integration/SETTINGS.LUA).
GTA only allows 11 characters. So to reduce confusion we'll shorten it if the user does not.]]
function EI:FixOversizeKeys()
for i, tbl in pairs(EXTRA_ASSIGNMENTS) do
if string.len(i) > 11 then
local shortened_gameName = string.sub(i,1,11)
EXTRA_ASSIGNMENTS[shortened_gameName] = EXTRA_ASSIGNMENTS[i]
EXTRA_ASSIGNMENTS[i] = nil
end
end
end

--[[Sets extras table a copy of EXTRA_ASSIGNMENTS for this vehicle]]
function EI:UpdateExtrasTable(veh)
local veh_name = GetDisplayNameFromVehicleModel(GetEntityModel(veh))
local veh_name_wildcard = string.gsub(veh_name, "%d+", "#")

if EXTRA_ASSIGNMENTS[veh_name] ~= nil then --Does profile exist as outlined in vehicle.meta
extras = EXTRA_ASSIGNMENTS[veh_name]
UTIL:Print("EI: Profile found for "..veh_name, false)
else
extras = EXTRA_ASSIGNMENTS['DEFAULT']
end

for _, item in pairs(extras) do
if type(item) == 'table' then

elseif EXTRA_ASSIGNMENTS[veh_name_wildcard] ~= nil then
extras = EXTRA_ASSIGNMENTS[veh_name_wildcard]
UTIL:Print("EI: Wildcard profile found for "..veh_name, false)
else
if EXTRA_ASSIGNMENTS['DEFAULT'] ~= nil then
extras = EXTRA_ASSIGNMENTS['DEFAULT']
UTIL:Print("EI: using default profile for "..veh_name, false)
else
if not DoesExtraExist(veh, item) then
HUD:ShowNotification("~b~LVC: ~y~Warning:~s~ Extra "..item.." does not exist for "..veh_name". Verify EI Settings.", true)
end
end
end
end

extras = { }
UTIL:Print("^3LVC WARNING: (EXTRA_INTEGRATION) 'DEFAULT' table missing from EXTRA_ASSIGNMENTS table. Using empty table for "..veh_name, false)
end end
end
2 changes: 1 addition & 1 deletion PLUGINS/extra_integration/UTIL/sv_version.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PURPOSE: Handle plugin version checking.
]]

local plugin_name = "extra_integration"
local plugin_version = "1.0.0"
local plugin_version = "1.0.2"

RegisterServerEvent("lvc:plugins_getVersions")
AddEventHandler("lvc:plugins_getVersions", function()
Expand Down
2 changes: 1 addition & 1 deletion PLUGINS/extra_integration/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.1
1.0.2
2 changes: 1 addition & 1 deletion PLUGINS/takedowns/SETTINGS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tkd_masterswitch = true
tkd_key = 74
-- Key to toggle TKD light. (default: 74 (H))
tkd_combokey = 21
-- Key that needs to be pressed in combination with tkd_key. Set to 0 to disable. (default: 21 (Left Shift))
-- Key that needs to be pressed in combination with tkd_key. Set to false to disable. (default: 21 (Left Shift))
tkd_intensity_default = 100
-- Overall brightness of TKD light.
tkd_radius_default = 50
Expand Down
8 changes: 4 additions & 4 deletions PLUGINS/takedowns/UTIL/cl_tkds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Citizen.CreateThread(function()
----- CONTROLS -----
if not IsPauseMenuActive() then
if not key_lock and tkd_mode ~= 3 then
if IsControlPressed(0, tkd_combokey) or tkd_combokey == 0 then
if IsControlPressed(0, tkd_combokey) or tkd_combokey == false then
DisableControlAction(0, tkd_key, true)
if IsDisabledControlJustReleased(0, tkd_key) then
if state_tkd[veh] == true then
Expand All @@ -86,7 +86,7 @@ Citizen.CreateThread(function()
----- AUTO BROADCAST VEH STATES -----
if count_bcast_timer > delay_bcast_timer then
count_bcast_timer = 0
TriggerServerEvent("lvc_TogTkdState_s", state_tkd[veh])
TriggerServerEvent('lvc:TogTkdState_s', state_tkd[veh])
else
count_bcast_timer = count_bcast_timer + 1
end
Expand Down Expand Up @@ -168,8 +168,8 @@ function TKDS:DrawTakeDown(veh)
end

---------------------------------------------------------------------
RegisterNetEvent("lvc_TogTkdState_c")
AddEventHandler("lvc_TogTkdState_c", function(sender, toggle)
RegisterNetEvent('lvc:TogTkdState_c')
AddEventHandler('lvc:TogTkdState_c', function(sender, toggle)
local player_s = GetPlayerFromServerId(sender)
local ped_s = GetPlayerPed(player_s)
if DoesEntityExist(ped_s) and not IsEntityDead(ped_s) then
Expand Down
6 changes: 3 additions & 3 deletions PLUGINS/takedowns/UTIL/sv_tkds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PURPOSE: Handle version checking, syncing sirens,
and opening links.
---------------------------------------------------
]]
RegisterServerEvent("lvc_TogTkdState_s")
AddEventHandler("lvc_TogTkdState_s", function(newstate)
TriggerClientEvent("lvc_TogTkdState_c", -1, source, newstate)
RegisterServerEvent('lvc:TogTkdState_s')
AddEventHandler('lvc:TogTkdState_s', function(newstate)
TriggerClientEvent('lvc:TogTkdState_c', -1, source, newstate)
end)
2 changes: 1 addition & 1 deletion PLUGINS/traffic_advisor/SETTINGS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ ta_combokey = false
--[[ Documentation / Wiki: https://github.com/TrevorBarns/luxart-vehicle-control/wiki/Traffic-Advisor ]]

TA_ASSIGNMENTS = {

['DEFAULT'] = { },
}
53 changes: 53 additions & 0 deletions PLUGINS/traffic_advisor/UI/cl_ragemenu.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
--[[
---------------------------------------------------
LUXART VEHICLE CONTROL V3 (FOR FIVEM)
---------------------------------------------------
Coded by Lt.Caine
ELS Clicks by Faction
Additional Modification by TrevorBarns
---------------------------------------------------
FILE: cl_ragemenu.lua
PURPOSE: Handle RageUI
---------------------------------------------------
]]

RMenu.Add('lvc', 'tasettings', RageUI.CreateSubMenu(RMenu:Get('lvc', 'plugins'),"Luxart Vehicle Control", "Traffic Advisor Settings"))
RMenu:Get('lvc', 'tasettings'):DisplayGlare(false)

Citizen.CreateThread(function()
while true do
--TKD SETTINGS
RageUI.IsVisible(RMenu:Get('lvc', 'tasettings'), function()
--[[
RageUI.List('Combo Key', {"Disabled", "LSHIFT", "LCTRL", "LALT", "LSHIFT OR (X)", "LCTRL OR (L3)"}, ta_combokey_index, "Select key that needs to be held in addition to TA Keys to activate. '~b~( )~s~' indicates controller key.", {}, true, {
onListChange = function(Index, Item)
ta_combokey_index = Index
end,
}) ]]
RageUI.List('TA HUD Pattern', {"1", "2", "3", "4", "5", "6", "7"}, hud_pattern, "Change pattern displayed on HUD traffic advisor indicators.", {}, true, {
onListChange = function(Index, Item)
hud_pattern = Index
HUD:SetItemState("ta_pattern", hud_pattern)
HUD:SetItemState("ta", state_ta[veh])
end,
})
RageUI.Checkbox('Save TA State', "Preserves traffic advisor state on lights toggling. Unchecking this will turn TA extras off when lights are turned off.", save_ta_state, {}, {
onChecked = function()
save_ta_state = true
end,
onUnChecked = function()
save_ta_state = false
end
})
RageUI.Checkbox('Sync TA State', "~o~Coming Soon~c ~ When able, sync TA state to nearby vehicles.", false, {Enabled = false}, {
onChecked = function()
sync_ta_state = true
end,
onUnChecked = function()
sync_ta_state = false
end
})
end)
Citizen.Wait(0)
end
end)
Loading

0 comments on commit 0c88f97

Please sign in to comment.