diff --git a/.all-contributorsrc b/.all-contributorsrc deleted file mode 100644 index 6b1991ab..00000000 --- a/.all-contributorsrc +++ /dev/null @@ -1,88 +0,0 @@ -{ - "files": [ - "CONTRIBUTORS.md" - ], - "imageSize": 100, - "commit": false, - "contributors": [ - { - "login": "JoshPiper", - "name": "JoshPiper", - "avatar_url": "https://avatars3.githubusercontent.com/u/32164094?v=4", - "profile": "https://doctor-internet.dev", - "contributions": [ - "code" - ] - }, - { - "login": "ischmal", - "name": "Alex Smith", - "avatar_url": "https://avatars0.githubusercontent.com/u/5350086?v=4", - "profile": "http://schmal.me", - "contributions": [ - "core", - "code", - "design", - "doc", - "example", - "infra", - "components", - "sirens", - "configs", - "tool", - "tutorial", - "vehicles", - "video" - ] - }, - { - "login": "Noble-N9", - "name": "Nick", - "avatar_url": "https://avatars1.githubusercontent.com/u/26795678?v=4", - "profile": "https://github.com/Noble-N9", - "contributions": [ - "core", - "bug", - "design", - "components", - "sirens", - "configs", - "vehicles" - ] - } - ], - "contributorsPerLine": 7, - "projectName": "Photon", - "projectOwner": "photonle", - "repoType": "github", - "repoHost": "https://github.com", - "skipCi": true, - "types": { - "vehicles": { - "symbol": "🚌", - "description": "Vehicle Creation", - "link": "[<%= symbol %>](<%= url %> \"<%= description %>\")," - }, - "components": { - "symbol": "🚨", - "description": "Photon Auto Components", - "link": "[<%= symbol %>](<%= url %> \"<%= description %>\")," - }, - "sirens": { - "symbol": "🔊", - "description": "Photon Sirens", - "link": "[<%= symbol %>](<%= url %> \"<%= description %>\")," - }, - "configs": { - "symbol": "🚓", - "description": "Photon Vehicle Configurations", - "link": "[<%= symbol %>](<%= url %> \"<%= description %>\")," - }, - "core": { - "symbol": "🛠️", - "description": "Being a member of Photon's Core Team.", - "link": "[<%= symbol %>](<%= url %> \"<%= description %>\")," - } - }, - "commitConvention": "none" -} diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index 049b2287..00000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/README.md b/README.md index 14b48737..56d91bbd 100644 --- a/README.md +++ b/README.md @@ -39,11 +39,13 @@ The Core Development team currently contains 6 people. | TDM | Vehicle Creator| ### Contributors -| Name | Contribution | +| Name | Contributions | | --- | --- | -| ANorthCanadianFriend | D&R RDS 17 | -| DatedGore | D&R RDS 17 | -| Officer Pringle | Touchmaster Delta | +| ANorthCanadianFriend | [D&R RDS 17](https://github.com/photonle/Photon/pull/53) | +| DatedGore | [Various](https://github.com/photonle/Photon/pulls?q=is%3Apr+is%3Amerged+author%3ADatedGore) | +| Officer Pringle | [Touchmaster Delta Phaser](https://github.com/photonle/Photon/pull/63) | +| Nardoras | Tinted Whelen Legacy | +| DBotThePony | [DHTML Creation Delay](https://github.com/photonle/Photon/pull/129) ### Other diff --git a/docs/index.html b/docs/index.html index ffbc8778..08cc5d03 100644 --- a/docs/index.html +++ b/docs/index.html @@ -35,6 +35,8 @@

Modules

  • Photon.AirEL
  • EMVU
  • EMVU.AutoLivery
  • +
  • autorun.photon.library.sirens.anemolis_chp_bike
  • +
  • autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate
  • functional
  • @@ -62,6 +64,14 @@

    Modules

    EMVU.AutoLivery Automatic Liveries + + autorun.photon.library.sirens.anemolis_chp_bike + Made by: anemolis72 + + + autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate + Made by: anemolis72 + functional Functional Programming / Currying Library. @@ -72,7 +82,7 @@

    Modules

    generated by LDoc 1.4.6 -Last updated 2019-12-05 11:26:19 +Last updated 2020-02-11 17:37:57
    diff --git a/docs/modules/EMVU.AutoLivery.html b/docs/modules/EMVU.AutoLivery.html index dec520e5..cc1a85c9 100644 --- a/docs/modules/EMVU.AutoLivery.html +++ b/docs/modules/EMVU.AutoLivery.html @@ -43,6 +43,8 @@

    Modules

  • Photon.AirEL
  • EMVU
  • EMVU.AutoLivery
  • +
  • autorun.photon.library.sirens.anemolis_chp_bike
  • +
  • autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate
  • functional
  • @@ -56,7 +58,7 @@

    Module EMVU.AutoLivery

    Info:

    @@ -449,7 +451,7 @@

    Tables

    generated by LDoc 1.4.6 -Last updated 2019-12-05 11:26:19 +Last updated 2020-02-11 17:37:57
    diff --git a/docs/modules/EMVU.html b/docs/modules/EMVU.html index 3f3b9082..97e134fc 100644 --- a/docs/modules/EMVU.html +++ b/docs/modules/EMVU.html @@ -43,6 +43,8 @@

    Modules

  • Photon.AirEL
  • EMVU
  • EMVU.AutoLivery
  • +
  • autorun.photon.library.sirens.anemolis_chp_bike
  • +
  • autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate
  • functional
  • @@ -56,7 +58,7 @@

    Module EMVU

    Info:

    @@ -514,7 +516,7 @@

    Tables

    generated by LDoc 1.4.6 -Last updated 2019-12-05 11:26:19 +Last updated 2020-02-11 17:37:57
    diff --git a/docs/modules/Photon.AirEL.html b/docs/modules/Photon.AirEL.html index 68b48ec3..c777a6ae 100644 --- a/docs/modules/Photon.AirEL.html +++ b/docs/modules/Photon.AirEL.html @@ -43,6 +43,8 @@

    Modules

  • Photon.AirEL
  • EMVU
  • EMVU.AutoLivery
  • +
  • autorun.photon.library.sirens.anemolis_chp_bike
  • +
  • autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate
  • functional
  • @@ -56,7 +58,7 @@

    Module Photon.AirEL

    Info:

    @@ -446,7 +448,7 @@

    Tables

    generated by LDoc 1.4.6 -Last updated 2019-12-05 11:26:19 +Last updated 2020-02-11 17:37:57
    diff --git a/docs/modules/autorun.emv_init.html b/docs/modules/autorun.emv_init.html index 908e03c2..a2d0b09d 100644 --- a/docs/modules/autorun.emv_init.html +++ b/docs/modules/autorun.emv_init.html @@ -38,6 +38,8 @@

    Modules

  • Photon.AirEL
  • EMVU
  • EMVU.AutoLivery
  • +
  • autorun.photon.library.sirens.anemolis_chp_bike
  • +
  • autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate
  • functional
  • @@ -51,7 +53,7 @@

    Module autorun.emv_init

    Info:

    @@ -67,7 +69,7 @@

    Info:

    generated by LDoc 1.4.6 -Last updated 2019-12-05 11:26:19 +Last updated 2020-02-11 17:37:57
    diff --git a/docs/modules/autorun.photon.library.sirens.anemolis_chp_bike.html b/docs/modules/autorun.photon.library.sirens.anemolis_chp_bike.html new file mode 100644 index 00000000..87fda196 --- /dev/null +++ b/docs/modules/autorun.photon.library.sirens.anemolis_chp_bike.html @@ -0,0 +1,70 @@ + + + + + Photon Lighting Documentation + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module autorun.photon.library.sirens.anemolis_chp_bike

    +

    Made by: anemolis72

    +

    + + + +
    +
    + + + + +
    +
    +
    +generated by LDoc 1.4.6 +Last updated 2020-02-11 17:37:57 +
    +
    + + diff --git a/docs/modules/autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate.html b/docs/modules/autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate.html new file mode 100644 index 00000000..64fad233 --- /dev/null +++ b/docs/modules/autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate.html @@ -0,0 +1,70 @@ + + + + + Photon Lighting Documentation + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate

    +

    Made by: anemolis72

    +

    + + + +
    +
    + + + + +
    +
    +
    +generated by LDoc 1.4.6 +Last updated 2020-02-11 17:37:57 +
    +
    + + diff --git a/docs/modules/functional.html b/docs/modules/functional.html index 73b384cb..5a3b89a3 100644 --- a/docs/modules/functional.html +++ b/docs/modules/functional.html @@ -42,6 +42,8 @@

    Modules

  • Photon.AirEL
  • EMVU
  • EMVU.AutoLivery
  • +
  • autorun.photon.library.sirens.anemolis_chp_bike
  • +
  • autorun.photon.library.sirens.anemolis_whelen_epsilon_alternate
  • functional
  • @@ -55,7 +57,7 @@

    Module functional

    Info:

    @@ -215,7 +217,7 @@

    Returns:

    generated by LDoc 1.4.6 -Last updated 2019-12-05 11:26:19 +Last updated 2020-02-11 17:37:57
    diff --git a/lua/autorun/emv_init.lua b/lua/autorun/emv_init.lua index 3dc86849..b2f38747 100644 --- a/lua/autorun/emv_init.lua +++ b/lua/autorun/emv_init.lua @@ -1,6 +1,6 @@ --[[-- Photon Init @copyright Photon Team -@release v73 Grand Lake +@release v74 Hot Sulphur Springs @author Photon Team --]]-- diff --git a/lua/autorun/photon/cl_emv_airel.lua b/lua/autorun/photon/cl_emv_airel.lua index 414692e6..b90f1378 100644 --- a/lua/autorun/photon/cl_emv_airel.lua +++ b/lua/autorun/photon/cl_emv_airel.lua @@ -1,6 +1,6 @@ --[[-- AirEl Client Handler. @copyright Photon Team -@release v73 Grand Lake +@release v74 Hot Sulphur Springs @author Photon Team @module Photon.AirEL --]]-- diff --git a/lua/autorun/photon/cl_emv_init.lua b/lua/autorun/photon/cl_emv_init.lua index f0c9fe88..8f2e10c8 100644 --- a/lua/autorun/photon/cl_emv_init.lua +++ b/lua/autorun/photon/cl_emv_init.lua @@ -1,6 +1,6 @@ --[[-- Photon EMV Client Loader. @copyright Photon Team -@release v73 Grand Lake +@release v74 Hot Sulphur Springs @author Photon Team @module EMVU --]]-- diff --git a/lua/autorun/photon/cl_emv_listener.lua b/lua/autorun/photon/cl_emv_listener.lua index b9ad3978..706cce57 100644 --- a/lua/autorun/photon/cl_emv_listener.lua +++ b/lua/autorun/photon/cl_emv_listener.lua @@ -1,6 +1,6 @@ --[[-- EMVU Key Listener. @copyright Photon Team -@release v73 Grand Lake +@release v74 Hot Sulphur Springs @author Photon Team @module EMVU --]]-- @@ -21,6 +21,11 @@ local key_siren2 = GetConVar("photon_key_siren2") local key_siren3 = GetConVar("photon_key_siren3") local key_siren4 = GetConVar("photon_key_siren4") local key_backtick = GetConVar("photon_key_alt_reverse") +local key_signal_activate = GetConVar("photon_key_signal_activate") +local key_signal_deactivate = GetConVar("photon_key_signal_deactivate") +local key_signal_left = GetConVar("photon_key_signal_left") +local key_signal_right = GetConVar("photon_key_signal_right") +local key_signal_hazard = GetConVar("photon_key_signal_hazard") local should_render = GetConVar("photon_emerg_enabled") hook.Add("InitPostEntity", "Photon.SetupLocalKeyBinds", function() @@ -35,9 +40,32 @@ hook.Add("InitPostEntity", "Photon.SetupLocalKeyBinds", function() key_illum = GetConVar("photon_key_illum") key_radar = GetConVar("photon_key_radar") key_backtick = GetConVar("photon_key_alt_reverse") + key_signal_activate = GetConVar("photon_key_signal_activate") + key_signal_deactivate = GetConVar("photon_key_signal_deactivate") + key_signal_left = GetConVar("photon_key_signal_left") + key_signal_right = GetConVar("photon_key_signal_right") + key_signal_hazard = GetConVar("photon_key_signal_hazard") should_render = GetConVar("photon_emerg_enabled") end) +local inputKeyDown = input.IsKeyDown +local inputMouseDown = input.IsMouseDown + +--- Check if a key / mouse button has been pressed. +-- @number key KEY_ or MOUSE_ enums. +-- @treturn bool Key press status. +local function keyDown(key) + if key > 0 and key < 107 then + return inputKeyDown(key) + end + + if key >= 107 and key < 114 then + return inputMouseDown(key) + end + + return false +end + --- Hook function called on key press. -- @ply ply Player pushing the key. -- @string bind The bind being pressed. @@ -49,26 +77,16 @@ function EMVU:Listener(ply, bind, press) local emv = ply:GetVehicle() if not IsValid(emv) then return false end - if string.find(bind, "+attack") and not string.find(bind, "+attack2") then - if ply:KeyDown(IN_MOVELEFT) then + if keyDown(key_signal_activate:GetInt()) and not keyDown(key_signal_deactivate:GetInt()) then + if keyDown(key_signal_left:GetInt()) then Photon:CarSignal("left") - elseif ply:KeyDown(IN_MOVERIGHT) then + elseif keyDown(key_signal_right:GetInt()) then Photon:CarSignal("right") - elseif ply:KeyDown(IN_BACK) then + elseif keyDown(key_signal_hazard:GetInt()) then Photon:CarSignal("hazard") else Photon:CarSignal("none") end - elseif ply:KeyDown(IN_ATTACK) then - if string.find(bind, "+moveleft") then - Photon:CarSignal("left") - elseif string.find(bind, "+moveright") then - Photon:CarSignal("right") - elseif string.find(bind, "+back") then - Photon:CarSignal("hazard") - elseif string.find(bind, "+forward") then - Photon:CarSignal("none") - end end end @@ -76,24 +94,6 @@ hook.Add("PlayerBindPress", "EMVU.Listener", function(pl, b, p) EMVU:Listener(pl, b, p) end) -local inputKeyDown = input.IsKeyDown -local inputMouseDown = input.IsMouseDown - ---- Check if a key / mouse button has been pressed. --- @number key KEY_ or MOUSE_ enums. --- @treturn bool Key press status. -local function keyDown(key) - if key > 0 and key < 107 then - return inputKeyDown(key) - end - - if key > 107 and key < 114 then - return inputMouseDown(key) - end - - return false -end - hook.Add("Think", "Photon.ButtonPress", function() if not should_render:GetBool() then return end if not LocalPlayer():InVehicle() or not IsValid( LocalPlayer():GetVehicle() ) or not LocalPlayer():GetVehicle():IsEMV() then return end @@ -242,22 +242,37 @@ hook.Add("Think", "Photon.ButtonPress", function() end end) -local function SirenSuggestions( cmd, args ) - - args = string.Trim( args ) - args = string.lower( args ) +local function SirenSuggestions(cmd, args) + arg = args:Trim():lower() + if arg == "" then + arg = false + end local result = {} - local i = 1 - for k,v in pairs( EMVU.GetSirenTable() ) do - - table.insert( result, "emv_siren " .. k .. " \"" .. v.Name .. "\"") - + for i, siren in ipairs(EMVU.GetSirenTable()) do + if arg then + local cat = siren.Category:lower() + local name = siren.Name:lower() + + if tostring(i) == arg then + table.insert(result, string.format("%s %s \"%s\"", cmd, i, siren.Name)) + elseif name:StartWith(arg) then + table.insert(result, string.format("%s %s \"%s\"", cmd, i, siren.Name)) + elseif cat:StartWith(arg) then + table.insert(result, string.format("%s %s \"%s\"", cmd, i, siren.Name)) + elseif arg:StartWith(cat) then + local test = arg:sub(#cat + 1):Trim() + if name:StartWith(test) then + table.insert(result, string.format("%s %s \"%s\"", cmd, i, siren.Name)) + end + end + else + table.insert(result, string.format("%s %s \"%s\"", cmd, i, siren.Name)) + end end return result - end concommand.Add("emv_siren", function(ply, cmd, args) @@ -318,6 +333,7 @@ function Photon:CarSignal(arg) if not car:Photon() then return end if not arg then return end + if #Photon.Vehicles.States.Blink_Left[car.VehicleName] == 0 and #Photon.Vehicles.States.Blink_Right[car.VehicleName] == 0 then return end if arg == "left" then Photon.Net:Signal(CAR_BLINKER_LEFT) diff --git a/lua/autorun/photon/cl_emv_livery.lua b/lua/autorun/photon/cl_emv_livery.lua index 75bf2a7a..e3ec55f9 100644 --- a/lua/autorun/photon/cl_emv_livery.lua +++ b/lua/autorun/photon/cl_emv_livery.lua @@ -1,6 +1,6 @@ --[[-- Automatic Liveries @copyright Photon Team -@release v73 Grand Lake +@release v74 Hot Sulphur Springs @author Photon Team @module EMVU.AutoLivery --]]-- diff --git a/lua/autorun/photon/cl_emv_meta.lua b/lua/autorun/photon/cl_emv_meta.lua index 56e2142f..a68432d3 100644 --- a/lua/autorun/photon/cl_emv_meta.lua +++ b/lua/autorun/photon/cl_emv_meta.lua @@ -94,6 +94,11 @@ function EMVU:MakeEMV( emv, name ) return ( self:Photon_ManualSiren() and self:Photon_Siren() ) end + function emv:Photon_ParkMode() + if not IsValid(self) then return false end + return self:GetNW2Bool("PhotonLE.PARK_MODE") + end + function emv:Photon_ManualHorn() if not IsValid( self ) then return false end return self:GetNW2Bool( "PhotonLE.EMV_HORN" ) @@ -195,6 +200,8 @@ function EMVU:MakeEMV( emv, name ) result = EMVHelper:GetSequence( self.VehicleName, option, self ) end if self.Photon_IsBraking and self:Photon_IsBraking() then result = EMVHelper.GetBrakeSequence( self.VehicleName, self, result ) end + if self.Photon_IsReversing and self:Photon_IsReversing() then result = EMVHelper.GetReverseSequence( self.VehicleName, self, result ) end + if self.Photon_ParkMode and self:Photon_ParkMode() then result = EMVHelper.GetParkSequence(self.VehicleName, self, result) end return result end @@ -800,6 +807,7 @@ function EMVU:MakeEMV( emv, name ) local fastest, nearest = self:Photon_RadarTargetSpeeds( rear ) PHOTON_RADAR_DISP_FAST = fastest or 0 PHOTON_RADAR_DISP_NEAR = nearest or 0 + if not GetConVar("photon_radar_sound"):GetBool() then return end local soundSpeed = nearest if fastest > nearest then soundSpeed = fastest end local handle = self.PhotonRadarSoundHandle @@ -815,6 +823,7 @@ function EMVU:MakeEMV( emv, name ) end function emv:Photon_RadarActive( arg ) + if EMVU.DisabledRadars[self:EMVName()] then return false end local prev = self.PhotonRadarActive or false if arg != nil then self.PhotonRadarActive = arg end if arg == false and IsValid( self.PhotonRadarSoundHandle ) then self.PhotonRadarSoundHandle:Pause() end diff --git a/lua/autorun/photon/cl_photon_builder.lua b/lua/autorun/photon/cl_photon_builder.lua index 5ab8fac8..b9ddc87b 100644 --- a/lua/autorun/photon/cl_photon_builder.lua +++ b/lua/autorun/photon/cl_photon_builder.lua @@ -30,7 +30,7 @@ function SetDebugTarget( index, cat ) if not IsValid( car ) or not car:Photon() then return end PHOTON_DEBUG_NAME = car.VehicleName end - + PHOTON_DEBUG_INDEX = index if cat == "ELS" then PHOTON_DEBUG_MODE = "ELS" @@ -39,7 +39,7 @@ function SetDebugTarget( index, cat ) PHOTON_DEBUG_MODE = "REG" PHOTON_DEBUG_LIGHT = Photon.Vehicles.Positions[ PHOTON_DEBUG_NAME ][ index ] elseif cat == "PROP" then - // PHOTON_DEBUG_LIGHT + -- PHOTON_DEBUG_LIGHT end end @@ -283,7 +283,6 @@ hook.Add( "Think", "Photon.Debug.ButtonPress", function() elseif not input.IsKeyDown( KEY_PAD_DECIMAL ) then P_KP_DECIMAL = false end - end) function PhotonDebugTarget( ply, args ) @@ -329,7 +328,7 @@ end) surface.CreateFont( "PHOTON_Debug", { font = "Consolas", size = 16, - weight = 900, + weight = 900, antialias = true } ) @@ -364,13 +363,6 @@ hook.Add( "PostDrawHUD", "Photon.Debug.HUDPaint", function() end end) -concommand.Add("photon_debug_bg", function( ply ) - if not ply:IsAdmin() then return end - local vehicle = ply:GetVehicle() - if not vehicle then return end - PrintTable( vehicle:GetBodyGroups() ) -end) - local PHOTON_CREATOR_TEMPLATE = [[ AddCSLuaFile() @@ -416,8 +408,6 @@ list.Set( "Vehicles", VehicleName, V ) if EMVU then EMVU:OverwriteIndex( VehicleName, EMV ) end ]] -local photon_creator_name, photon_creator_category, photon_creator_siren, photon_creator_lightbar - local function PhotonTemplateReplace( text, inject ) for key,value in pairs( inject ) do text = string.Replace( text, "%" .. key, tostring( value ) ) @@ -425,22 +415,6 @@ local function PhotonTemplateReplace( text, inject ) return text end -local function GetVehicleScript( model ) - local vehicles = list.Get( "Vehicles" ) - for index, data in pairs( vehicles ) do - if string.lower( data["Model"] ) == model then - if data["KeyValues"] then - for key, value in pairs( data["KeyValues"] ) do - if string.lower(tostring(key)) == "vehiclescript" then - return data["KeyValues"][key] - end - end - end - end - end - return "" -end - local function FormatLightbarChoice( id ) if not id or not EMVU.Auto[ id ] then return "{}" end return string.format([[ @@ -465,48 +439,40 @@ local function FormatBodygroupChoices( ent ) return resultTable end -local function PhotonCompileCreatorData( prefName, prefCategory, prefSiren, prefLightbar, ent ) +local function PhotonCompileCreatorData(prefName, prefCategory, prefSiren, prefLightbar, ent) local authorName = LocalPlayer():Nick() local col = ent:GetColor() - local formatColor = string.format( "Color(%s,%s,%s)", col.r, col.g, col.b ) + local formatColor = string.format("Color(%s,%s,%s)", col.r, col.g, col.b) + if EMVU.GetSirenTable()[prefSiren] and EMVU.GetSirenTable()[prefSiren].ID then prefSiren = "\"" .. EMVU.GetSirenTable()[prefSiren].ID .. "\"" end + + local vehicleClass = ent:GetVehicleClass() + local vehicleData = list.Get("Vehicles")[vehicleClass] + local injectTable = { ["PREF_NAME"] = prefName or "", ["PREF_SIREN"] = prefSiren or "1", ["ENT_SKIN"] = ent:GetSkin(), - ["ENT_BODYGROUPS"] = FormatBodygroupChoices( ent ), + ["ENT_BODYGROUPS"] = FormatBodygroupChoices(ent), ["ENT_COLOR"] = formatColor, - ["PREF_LIGHTBAR"] = FormatLightbarChoice( prefLightbar ), + ["PREF_LIGHTBAR"] = FormatLightbarChoice(prefLightbar), ["PREF_CATEGORY"] = prefCategory or "Emergency Vehicles", - ["ENT_MODEL"] = ent:GetModel(), + ["ENT_MODEL"] = vehicleData.Model, ["AUTHOR_NAME"] = authorName, - ["ENT_SCRIPT"] = GetVehicleScript( ent:GetModel() ) + ["ENT_SCRIPT"] = vehicleData.KeyValues.vehiclescript } - return PhotonTemplateReplace( PHOTON_CREATOR_TEMPLATE, injectTable ) + return PhotonTemplateReplace(PHOTON_CREATOR_TEMPLATE, injectTable) end function PhotonCopyConfiguration() local car = LocalPlayer():GetVehicle() if not IsValid( car ) then LocalPlayer():ChatPrint( "[Photon] You must be driving the target vehicle." ) return end - local returnCode = PhotonCompileCreatorData( photon_creator_name, photon_creator_category, photon_creator_siren, photon_creator_lightbar, car ) - // print( returnCode ) + local returnCode = PhotonCompileCreatorData(GetConVar("photon_creator_name"):GetString(), GetConVar("photon_creator_category"):GetString(), GetConVar("photon_creator_siren"):GetInt(), GetConVar("photon_creator_lightbar"):GetString(), car) SetClipboardText( returnCode ) LocalPlayer():ChatPrint( "[Photon] Configuration copied to your clipboard.\nPaste the code into a text editor and save as a .lua file in your garrysmod/lua/autorun folder.\nYou will likely need to restart the game for the vehicle to appear for the first time." ) end concommand.Add( "photon_creator_copyconfig", PhotonCopyConfiguration ) - -concommand.Add( "photon_creator_name", function( ply, cmd, args ) - photon_creator_name = args[1] -end ) - -concommand.Add( "photon_creator_category", function( ply, cmd, args ) - photon_creator_category = args[1] -end ) - -concommand.Add( "photon_creator_siren", function( ply, cmd, args ) - photon_creator_siren = tostring( args[1] ) -end ) - -concommand.Add( "photon_creator_lightbar", function( ply, cmd, args ) - photon_creator_lightbar = args[1] -end ) \ No newline at end of file +CreateClientConVar("photon_creator_name", "", false, false, "ConVar for the express creator") +CreateClientConVar("photon_creator_category", "", false, false, "ConVar for the express creator") +CreateClientConVar("photon_creator_siren", "", false, false, "ConVar for the express creator") +CreateClientConVar("photon_creator_lightbar", "", false, false, "ConVar for the express creator") \ No newline at end of file diff --git a/lua/autorun/photon/cl_photon_context.lua b/lua/autorun/photon/cl_photon_context.lua index b1cc0c77..a2d164a7 100644 --- a/lua/autorun/photon/cl_photon_context.lua +++ b/lua/autorun/photon/cl_photon_context.lua @@ -59,9 +59,13 @@ properties.Add("photon_siren", { end end + primarySubmenu:AddOption("None", function() + EMVU.Net:SirenSet(0, ent, false) + end):SetChecked(ent:Photon_SirenSet() == 0) + secondarySubmenu:AddOption("None", function() EMVU.Net:SirenSet(0, ent, true) - end) + end):SetChecked(ent:Photon_AuxSirenSet() == 0) end, Action = null }) @@ -350,6 +354,7 @@ properties.Add("photon_selection", { local submenu = option:AddSubMenu() for catIndex, cat in ipairs(options) do + if not cat.Name then cat.Name = "Unspecified #" .. catIndex; print("[Photon] Selection with the index #" .. catIndex .. " has no name specified.") end if #cat.Options == 2 and (cat.Options[1].Name == "None" or cat.Options[2].Name == "None") then local selected = ent:Photon_SelectionOption(catIndex) local isActive = cat.Options[selected].Name ~= "None" @@ -373,6 +378,7 @@ properties.Add("photon_selection", { for index, option in pairs(cat.Options) do local opt + if not option.Name then option.Name = "Unspecified #" .. index; print("[Photon] Option in selection '" .. cat.Name .. "' with the index #" .. index .. " has no name specified.") end if option.Category then if not subCategories[option.Category] then subCategories[option.Category] = category:AddSubMenu(option.Category) diff --git a/lua/autorun/photon/cl_photon_editor.lua b/lua/autorun/photon/cl_photon_editor.lua index 5b8aa0fc..706823e8 100644 --- a/lua/autorun/photon/cl_photon_editor.lua +++ b/lua/autorun/photon/cl_photon_editor.lua @@ -35,13 +35,13 @@ Photon.Editor.Update = function() end -concommand.Add( "photon_emv_editor_target", function( ply, cmd, args ) +concommand.Add( "photon_emv_editor_target", function( ply, cmd, args ) photon_emv_editor_target = args[1] Photon.Editor.SetTarget( photon_emv_editor_target ) if PHOTON_EDITOR_MENU_REF then Photon.Editor.CreateMenu( PHOTON_EDITOR_MENU_REF ) end end ) -concommand.Add( "photon_emv_editor_target_component", function( ply, cmd, args ) +concommand.Add( "photon_emv_editor_target_component", function( ply, cmd, args ) photon_emv_editor_target_component = tonumber(args[1]) Photon.Editor.SetComponentTarget( tonumber( args[1] ) ) -- print(tostring(photon_emv_editor_target_component) ) @@ -62,7 +62,7 @@ end local function createPhotonTargetLights( index ) local autoComponents = EMVU.AutoIndex[index] table.Empty( list.GetForEdit( "PhotonEMVTargetComponents" ) ) - + for i=1,#autoComponents do local light = autoComponents[i] -- list.Set( "PhotonEMVTargetComponents", i, tostring(i) .. ". " .. light.ID ) @@ -77,33 +77,6 @@ local function buildComponentPreview( panel ) panel:AddItem( panel.Preview ) end -local function buildConfigDeletion( panel ) - panel:AddControl( "Header", { Description = "Select row to DELETE local configuration: " } ) - local savedConfigs = EMVU.Configurations.Library - -- PrintTable( savedConfigs ) - local configList = vgui.Create( "DListView" ) - configList:SetMultiSelect( false ) - configList:SetSize( 30, 120 ) - local carIdColumn = configList:AddColumn( "Car" ) - carIdColumn:SetFixedWidth( 50 ) - local dateColumn = configList:AddColumn( "Date" ) - dateColumn:SetFixedWidth( 70 ) - local nameColumn = configList:AddColumn( "Name" ) - for _,parentCar in pairs( savedConfigs ) do - for key,data in pairs( parentCar ) do - if data.StoreType != "LOCAL FILE" then continue end - local newLine = configList:AddLine( data.VehicleTypeID, data.Date, data.Name ) - newLine.File = data.FileName - end - end - function configList:OnRowSelected( id, row ) - -- panel:AddControl( "Button", { Text = "Delete Selected", Command = "photon_cfgbld_deleteselected" } ) - if row.File then EMVU.Configurations.DeleteConfiguration( row.File ) end - panel:MetaReset() - end - configList:SortByColumn( 3 ) - panel:AddItem( configList ) -end local function buildComponentList( panel ) panel:AddControl( "Header", { Description = "Modify existing component: " } ) @@ -147,7 +120,7 @@ local function buildComponentList( panel ) function newLine:OnCursorEntered() if panel.Preview then panel.Preview:SetComponent( self.NameIndex ) end end - end + end function autoList:OnRowSelected( id, row ) RunConsoleCommand( "photon_emv_editor_create", row.NameIndex ) @@ -341,11 +314,11 @@ Photon.Editor.CreateMenu = function( panel ) panel:AddControl( "Button", { Text = "Change Component Selection", Command = "photon_emv_editor_target_component" } ) buildComponentEdit( panel ) - + else buildComponentList( panel ) end - + else panel:AddControl( "Header", { Description = "Select a vehicle to modify: " } ) buildTargetVehicles( panel ) @@ -353,48 +326,112 @@ Photon.Editor.CreateMenu = function( panel ) end end -local photon_cfgbld_name = "" +local photon_cfgbld_name = "" local photon_cfgbld_cat = false -local photon_cfgbld_bge = true -local photon_cfgbld_liv = true +local photon_cfgbld_bge = true +local photon_cfgbld_liv = true local photon_cfgbld_srn = true -Photon.Editor.CreateConfiguration = function( panel ) +CreateClientConVar("photon_cfgbld_name", "", false, false, "Photon Configuration Name") +CreateClientConVar("photon_cfgbld_cat", "", false, false, "Photon Configuration Category") +CreateClientConVar("photon_cfgbld_bge", "", false, false, "Photon Configuration Bodygroups & Equipment") +CreateClientConVar("photon_cfgbld_liv", "", false, false, "Photon Configuration Livery") +CreateClientConVar("photon_cfgbld_srn", "", false, false, "Photon Configuration Siren") + +function Photon.Editor.CreateConfiguration(panel) + -- Clear the panel. + panel:ClearControls() + + -- Add the header. + panel:Help("This is the Photon Configurations menu. Configurations are an easy way to save equipment, siren and livery configurations. Local configurations will only appear to you, while copying the Lua snippet allows server administrators and addon authors to include their own.") + + -- Text Configs. + panel:TextEntry("Name", "photon_cfgbld_name") + panel:TextEntry("Category", "photon_cfgbld_cat") + + -- Selections + panel:CheckBox("Bodygroups & Equipment", "photon_cfgbld_bge") + panel:CheckBox("Livery & Color", "photon_cfgbld_liv") + panel:CheckBox("Siren Models", "photon_cfgbld_srn") + + -- Output Stage + panel:Button("Save as Local Configuration", "photon_cfgbld_savelocal") + panel:Button("Copy Lua for Export", "photon_cfgbld_getlua") + + + -- Config Manager + panel:Help("Select row to DELETE local configuration:") + + local configList = vgui.Create("DListView") + configList:SetSize(30, 120) + configList:SetMultiSelect(false) + configList:AddColumn("Car"):SetFixedWidth(50) + configList:AddColumn("Date"):SetFixedWidth(70) + configList:AddColumn("Name") + function panel:MetaReset() - Photon.Editor.CreateConfiguration( panel ) + configList:ClearSelection() + configList:Clear() + + local configs = EMVU.Configurations.Library + for _, car in pairs(configs) do + for key, data in pairs(car) do + if data.StoreType ~= "LOCAL FILE" then continue end + + local line = configList:AddLine(data.VehicleTypeID, data.Date, data.Name) + line.File = data.FileName + end + end end - panel:ClearControls() - panel:AddControl( "Header", { Description = "This is the Photon Configurations menu. Configurations are an easy way to save equipment, siren and livery configurations. Local configurations will only appear to you, while copying the Lua snippet allows server administrators and addon authors to include their own." } ) - panel:AddControl( "TextBox", { Label = "Name", Command = "photon_cfgbld_name", WaitForEnter = "0" } ) - panel:AddControl( "TextBox", { Label = "Category", Command = "photon_cfgbld_cat", WaitForEnter = "0" } ) - panel:AddControl( "CheckBox", { Label = "Bodygroups and Equipment", Command = "photon_cfgbld_bge" } ) - panel:AddControl( "CheckBox", { Label = "Livery and Color", Command = "photon_cfgbld_liv" } ) - panel:AddControl( "CheckBox", { Label = "Siren Models", Command = "photon_cfgbld_srn" } ) - panel:AddControl( "Button", { Text = "Save as Local Configuration", Command = "photon_cfgbld_savelocal" } ) - panel:AddControl( "Button", { Text = "Copy Lua Code for Export", Command = "photon_cfgbld_getlua" } ) - buildConfigDeletion( panel ) -end + panel:MetaReset() -concommand.Add( "photon_cfgbld_name", function(_,_,args) photon_cfgbld_name = tostring( args[1] ) end) -concommand.Add( "photon_cfgbld_cat", function(_,_,args) photon_cfgbld_cat = tostring( args[1] ) end) -concommand.Add( "photon_cfgbld_bge", function(_,_,args) photon_cfgbld_bge = tobool( args[1] ) end) -concommand.Add( "photon_cfgbld_liv", function(_,_,args) photon_cfgbld_liv = tobool( args[1] ) end) -concommand.Add( "photon_cfgbld_srn", function(_,_,args) photon_cfgbld_srn = tobool( args[1] ) end) + function configList:OnRowSelected(id, row) + if row.File then + EMVU.Configurations.DeleteConfiguration(row.File) + end + panel:MetaReset() + end -concommand.Add( "photon_cfgbld_savelocal", function() + configList:SortByColumn(3) + panel:AddItem(configList) + + hook.Add("Photon.NewConfig", "PhotonEditorReset", function() + panel:MetaReset() + end) +end + +concommand.Add("photon_cfgbld_savelocal", function() local ply = LocalPlayer() + if not IsValid(ply) then return end + local ent = ply:GetVehicle() - if not IsValid( ent ) then chat.AddText( Color(255, 128, 64), "[Photon] You must be driving the vehicle you wish to save the configuration from." ) return end - local resultData = ent:Photon_ExportConfiguration( photon_cfgbld_bge, photon_cfgbld_liv, photon_cfgbld_liv, photon_cfgbld_srn, photon_cfgbld_bge ) - if not resultData then chat.AddText( Color(255, 128, 64), "[Photon] This vehicle is not compatible with Photon Configurations." ) return end - local result = EMVU.Configurations.SaveConfiguration( photon_cfgbld_name, photon_cfgbld_cat, LocalPlayer():Name(), resultData ) - if result then - chat.AddText( Color(128, 255, 64), string.format( "[Photon] %s has been saved, this configuration can now be selected from the Photon context menu.", tostring( photon_cfgbld_name ) ) ) + if not IsValid(ent) then + chat.AddText(Color(255, 128, 64), "[Photon] You must be driving the vehicle you wish to save the configuration from." ) return - else - chat.AddText( Color(255, 128, 64), "[Photon] An error occurred while saving vehicle configuration." ) + end + + local bge = GetConVar("photon_cfgbld_bge"):GetBool() + local liv = GetConVar("photon_cfgbld_liv"):GetBool() + local srn = GetConVar("photon_cfgbld_srn"):GetBool() + local resultData = ent:Photon_ExportConfiguration(bge, liv, liv, srn, bge) + if not resultData then + chat.AddText(Color(255, 128, 64), "[Photon] This vehicle is not compatible with Photon Configurations." ) return end + + local name = GetConVar("photon_cfgbld_name"):GetString() + local cat = GetConVar("photon_cfgbld_cat"):GetString() + local result = EMVU.Configurations.SaveConfiguration(name, cat, LocalPlayer():Name(), resultData) + if not result then + chat.AddText(Color(255, 128, 64), "[Photon] An error occurred while saving vehicle configuration.") + return + end + + chat.AddText(Color(128, 255, 64), string.format( + "[Photon] %s has been saved, this configuration can now be selected from the Photon context menu.", + name + )) + hook.Run("Photon.NewConfig", name, cat, resultData) end) local luaConfigInstructions = [[ @@ -413,10 +450,10 @@ concommand.Add( "photon_cfgbld_getlua", function() if result then SetClipboardText( result ) chat.AddText( Color(128, 255, 64), string.format( "[Photon] %s has been exported to your clipboard.", tostring( photon_cfgbld_name ) ) ) - chat.AddText( Color(255, 255, 255), luaConfigInstructions ) + chat.AddText( Color(255, 255, 255), luaConfigInstructions ) return else - chat.AddText( Color(255, 128, 64), "[Photon] An error occurred while saving vehicle configuration." ) + chat.AddText( Color(255, 128, 64), "[Photon] An error occurred while saving vehicle configuration." ) return end end ) diff --git a/lua/autorun/photon/cl_photon_eng.lua b/lua/autorun/photon/cl_photon_eng.lua index f6ee67bf..32559e5c 100644 --- a/lua/autorun/photon/cl_photon_eng.lua +++ b/lua/autorun/photon/cl_photon_eng.lua @@ -75,17 +75,8 @@ function Photon:ClearLightQueue() end function Photon:PrepareVehicleLight( parent, incolors, ilpos, gpos, lang, meta, pixvis, lnum, brght, multicolor, type, emitDynamic, contingent ) - if lnum == 14 then - -- print( string.format( "Type:%s\nParent:%s\nColors:%s\nLocal Position:%s\nGlobal Position:%s\nLocal Angle:%s\nMeta:%s\nPixVis:%s\nLocal Number:%s\n", - -- tostring(type), tostring(parent), tostring(incolors), tostring(ilpos), tostring(gpos), tostring(lang), tostring(meta), tostring(pixvis), tostring(lnum) )) - end - -- print("received light to render") - if not incolors or not ilpos or not lang or not meta or not gpos then return end - local resultTable = { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true } - -- PrintTable( meta ) - -- PrintTable( incolors ) - -- print(tostring(lang)) + local resultTable = { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true } local legacy = true if meta.NoLegacy == true then legacy = false end local colors = incolors @@ -95,10 +86,10 @@ function Photon:PrepareVehicleLight( parent, incolors, ilpos, gpos, lang, meta, if bloom_multi and bloom_multi:GetFloat() then manualBloom = bloom_multi:GetFloat() end lpos:Set( ilpos ) - + local rotating = false - - if offset == "R" or offset == "RR" then + + if offset == "R" or offset == "RR" then local speed = 2 if meta.Speed then speed = meta.Speed end offset = rotatingLight(emvHelp, speed, 10) @@ -129,7 +120,7 @@ function Photon:PrepareVehicleLight( parent, incolors, ilpos, gpos, lang, meta, lpos[1] = lpos[1] + lposMod lpos[2] = lpos[2] + lposMod end - + local worldPos = gpos // local worldPos = parent:LocalToWorld(lpos) @@ -159,7 +150,7 @@ function Photon:PrepareVehicleLight( parent, incolors, ilpos, gpos, lang, meta, end if not visible or visible <= 0 then return end - + if not meta.Scale then meta.Scale = 1 end if not meta.WMult then meta.WMult = 1 end local ca = parent:GetAngles() @@ -205,7 +196,7 @@ function Photon:PrepareVehicleLight( parent, incolors, ilpos, gpos, lang, meta, local brightness = 1 local rawBrightness = 1 local pulseOverride = false - + if brght and istable(brght) then brightness = pulsingLight( emvHelp, brght[1], brght[2], brght[3] ) pulseOverride = true @@ -222,8 +213,8 @@ function Photon:PrepareVehicleLight( parent, incolors, ilpos, gpos, lang, meta, local distModifier = ( 1 - clamp( ( dist / 512 ), 0, 1) ) viewFlare = viewFlare * distModifier - if meta.SourceOnly == true then - srcOnly = true + if meta.SourceOnly == true then + srcOnly = true end local al = Angle() @@ -289,6 +280,10 @@ function Photon:PrepareVehicleLight( parent, incolors, ilpos, gpos, lang, meta, resultTable[24] = false + resultTable[25] = meta.SubmatID + resultTable[26] = meta.SubmatMaterial + resultTable[27] = parent + if istable( meta.EmitArray ) then local emitResults = {} for _key,_val in pairs( meta.EmitArray ) do @@ -317,7 +312,8 @@ local endCam = cam.End3D2D local bloomRef = 0 local bloomColor = nil -function Photon.QuickDrawNoTable( srcOnly, drawSrc, camPos, camAng, srcSprite, srcT, srcR, srcB, srcL, worldPos, bloomScale, flareScale, widthScale, colSrc, colMed, colAmb, colBlm, colGlw, colRaw, colFlr, lightMod, cheap, viewFlare, multiEmit, debug_mode ) +function Photon.QuickDrawNoTable( srcOnly, drawSrc, camPos, camAng, srcSprite, srcT, srcR, srcB, srcL, worldPos, bloomScale, flareScale, widthScale, colSrc, colMed, colAmb, colBlm, colGlw, colRaw, colFlr, lightMod, cheap, viewFlare, multiEmit, SubmatID, SubmatMaterial, SubmatParent, debug_mode ) + if drawSrc then startCam( camPos, camAng, 1 ) setRenderLighting( 2 ) @@ -326,6 +322,17 @@ function Photon.QuickDrawNoTable( srcOnly, drawSrc, camPos, camAng, srcSprite, s setRenderLighting( 0 ) endCam() end + + if SubmatID then + SubmatParent:SetSubMaterial(SubmatID, SubmatMaterial) + if !timer.Exists(SubmatParent:GetVehicleClass() .. SubmatParent:EntIndex() .. SubmatID) then + timer.Create( SubmatParent:GetVehicleClass() .. SubmatParent:EntIndex() .. SubmatID, 0.01, 1, function() if SubmatParent:IsValid() then SubmatParent:SetSubMaterial(SubmatID, nil) end end ) + else + timer.Pause(SubmatParent:GetVehicleClass() .. SubmatParent:EntIndex() .. SubmatID) + timer.Start(SubmatParent:GetVehicleClass() .. SubmatParent:EntIndex() .. SubmatID) + end + end + if debug_mode == true then return end if not srcOnly then if istable( multiEmit ) then @@ -356,8 +363,6 @@ function Photon.QuickDrawNoTable( srcOnly, drawSrc, camPos, camAng, srcSprite, s drawSprite( worldPos, 12 * widthScale, 12 * bloomScale, colMed ) end end - - end local drawW = ScrW() * .5 @@ -369,7 +374,7 @@ local setSurfaceMaterial = surface.SetMaterial local setSurfaceColor = surface.SetDrawColor local drawTexturedRect = surface.DrawTexturedRect -function Photon.DrawScreenEffects( srcOnly, drawSrc, camPos, camAng, srcSprite, srcT, srcR, srcB, srcL, worldPos, bloomScale, flareScale, widthScale, colSrc, colMed, colAmb, colBlm, colGlw, colRaw, colFlr, lightMod, cheap, viewFlare, multiEmit, debug_mode ) +function Photon.DrawScreenEffects( srcOnly, drawSrc, camPos, camAng, srcSprite, srcT, srcR, srcB, srcL, worldPos, bloomScale, flareScale, widthScale, colSrc, colMed, colAmb, colBlm, colGlw, colRaw, colFlr, lightMod, cheap, viewFlare, multiEmit, SubmatID, SubmatMaterial, parent, debug_mode ) if false then return end if viewFlare and colFlr and viewFlare > 0 and not cheap then local width = drawW @@ -499,14 +504,14 @@ function Photon:RenderQueue( effects ) if photonRenderTable[i] != nil then local data = photonRenderTable[i] renderFunction( data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10], data[11], data[12], data[13], data[14], data[15], data[16], - data[17], data[18], data[19], data[20], data[21], data[22], data[23], data[24], debug_mode ) + data[17], data[18], data[19], data[20], data[21], data[22], data[23], data[24], data[25], data[26], data[27], debug_mode ) end end end if not effects then endCam3d() else endCam2d() end -- Photon:ClearLightQueue() end -hook.Add( "PreDrawEffects", "Photon.RenderQueue", function() +hook.Add( "PreDrawEffects", "Photon.RenderQueue", function() Photon:RenderQueue( false ) if draw_effects and draw_effects:GetBool() then Photon:RenderQueue( true ) @@ -518,8 +523,8 @@ local isFuckingBloomMap = false local fuckingBloomMaps = { ["gm_driversheaven_tdm"] = true, } -hook.Add( "InitPostEntity", "Photon.CheckForFuckingBloomMap", function() - isFuckingBloomMap = fuckingBloomMaps[ tostring( game.GetMap() ) ] +hook.Add( "InitPostEntity", "Photon.CheckForFuckingBloomMap", function() + isFuckingBloomMap = fuckingBloomMaps[ tostring( game.GetMap() ) ] end ) local mapBloomAdjust = 1 function Photon.DrawDirtyLensEffect() @@ -538,7 +543,7 @@ function Photon.DrawDirtyLensEffect() end if not mat7:IsError() then - hook.Add( "RenderScreenspaceEffects", "Photon.ScreenEffects", function() + hook.Add( "RenderScreenspaceEffects", "Photon.ScreenEffects", function() Photon.DrawDirtyLensEffect() end) else @@ -588,7 +593,6 @@ end) -- -- end -- end ) --- print("test") -- hook.Add( "PreDrawHalos", "Photon.PleaseFuckingWOrk", function() -- render.MaterialOverrideByIndex( 0, "sprites/emv/fs_valor" ) -- for k,v in pairs( ents.GetAll() ) do @@ -686,4 +690,4 @@ end) -- -- ent:SetColor( Color( 255, 255, 255 ) ) -- end -- end --- end) \ No newline at end of file +-- end) diff --git a/lua/autorun/photon/cl_photon_hud.lua b/lua/autorun/photon/cl_photon_hud.lua index b69a9705..9a62db75 100644 --- a/lua/autorun/photon/cl_photon_hud.lua +++ b/lua/autorun/photon/cl_photon_hud.lua @@ -47,7 +47,10 @@ Photon.AddCustomHUDIcon = function(name, data) PhotonHUD.Icons[name] = data PhotonHUD:BuildCode() - PhotonHUD:Init() + + if IsValid(PhotonHUD.Panel) then + PhotonHUD:Init() + end end function PhotonHUD:BuildCode() @@ -66,7 +69,7 @@ function PhotonHUD:BuildCode() clearSections: function(){$(".section").each(function(){"warning-lights"!=$(this).attr("id")&&$(this).remove()})}, addButton: function(t,e,n,i,o){var r="#"+t+"-section .button-row",s=photonUI.getButtonHtml(e,n,i);$(r).html($(r).html()+s),photonUI.updateButtonState(t,i,o)}, updateButtonState: function(t,e,n){t="#"+t+"-section";var i="";switch(n){case 0:i="";break;case 1:i="button_selected";break;case 2:i="button_active"}var o=$(t+' .button[index="'+e+'"]');$(o).removeClass("button_selected button_active"),$(o).addClass(i)}, - updateButtonExclusive: function(t,e,n){$("#"+t+"-section .button").each(function(){$(this).removeClass("button_selected button_active")}),photonUI.updateButtonState(t,e,n)}, + updateButtonExclusive: function(t,e,n){if (t != 'functions'){$("#"+t+"-section .button").each(function(){$(this).removeClass("button_selected button_active")})};photonUI.updateButtonState(t,e,n)}, resetPrimaryMeter: function(t){$("#primary-meter").html("");for(var e=1;t>=e;e++)$("#primary-meter").html($("#primary-meter").html()+'
    ')}, setActivePrimaryMeter:function(t){$("#primary-meter > div").each(function(){$(this).removeClass("active")}),$($("#primary-meter > div[index='"+t+"']")).addClass("active")},setPrimary:function(t){$("#primary-lights").toggleClass("on",t)}, setPrimaryOn: function(){$("#primary-lights").addClass("on")},setPrimaryOff:function(){$("#primary-lights").removeClass("on")}, @@ -302,7 +305,6 @@ function PhotonHUD:Init() if IsValid(self.Panel) then self.Panel:Remove() end self.Panel = vgui.Create( "DHTML" ) - if not self.Panel then timer.Simple(3, function() self:Init() end) return end self.Panel:SetPaintedManually(true) self.Panel:SetSize(512, 512) self.Panel:SetMouseInputEnabled(false) @@ -378,6 +380,8 @@ function PhotonHUD:UpdateState() if newData.Siren.Enabled then state = 2 end PhotonHUD.Panel:RunJavascript( "photonUI.updateButtonExclusive('siren'," .. newData.Siren.Active .. ", " .. state .. ");" ) end + else + PhotonHUD:Reset(newData) end if istable( newData.Illumination ) then if not oldData.Illumination then PhotonHUD:Reset( newData ) return end @@ -564,28 +568,32 @@ local function PhotonHtml() PhotonHUD:AutoUpdate() if not PhotonHUD.ShouldDraw then return end - if drawTexture != false then - local opacity = 255 * HUD_OPACITY:GetFloat() - setDrawColor(255, 255, 255, opacity) - setMaterial(drawTexture) + if not drawTexture then return end - local wOffset = CV_WIDTH:GetInt() - if wOffset < 0 then wOffset = 0 end + local opacity = 255 * HUD_OPACITY:GetFloat() + setDrawColor(255, 255, 255, opacity) + setMaterial(drawTexture) - local hOffset = CV_HEIGHT:GetInt() - if hOffset < 0 then hOffset = 0 end + local wOffset = CV_WIDTH:GetInt() + if wOffset < 0 then wOffset = 0 end - drawTexturedRect(scrW - 512 - wOffset, scrH - 512 - hOffset, 512, 512) - end -end -hook.Add( "HUDPaint", "Photon.NewHUDPaint", function() - PhotonHtml() -end) + local hOffset = CV_HEIGHT:GetInt() + if hOffset < 0 then hOffset = 0 end -if PhotonHUD then PhotonHUD:Init() end + drawTexturedRect(scrW - 512 - wOffset, scrH - 512 - hOffset, 512, 512) +end +hook.Add("HUDPaint", "Photon.NewHUDPaint", PhotonHtml) +if vgui.GetControlTable("DHTML") then + PhotonHUD:Init() +else + hook.Add("InitPostEntity", "PhotonHUD:Init", function() + PhotonHUD:Init() + end) +end +Photon.HUD = PhotonHUD local radarBase = Material( "photon/ui/radar_base.png" ) diff --git a/lua/autorun/photon/cl_photon_menu.lua b/lua/autorun/photon/cl_photon_menu.lua index 3d5e6e4b..a5a2bf2a 100644 --- a/lua/autorun/photon/cl_photon_menu.lua +++ b/lua/autorun/photon/cl_photon_menu.lua @@ -3,31 +3,30 @@ AddCSLuaFile() list.Set( "DesktopWindows", "PhotonMenu", { title = "Photon", icon = "photon/ui/photon_menu.png", - init = function( icon, window ) + init = function(icon, window) OpenPhotonMenu() end } ) function OpenPhotonMenu() if PhotonWebPage then PhotonWebPage:Refresh() end - if not PhotonWebPage then - PhotonWebPage = vgui.Create( "DHTML" ) - PhotonWebPage:SetVisible( false ) - PhotonWebPage:SetSize( ScrW() *.66, ScrH() * .66 ) + if not PhotonWebPage then + PhotonWebPage = vgui.Create("DHTML") + PhotonWebPage:SetVisible(false) + PhotonWebPage:SetSize(ScrW() * .66, ScrH() * .66) PhotonWebPage:Center() - -- PhotonWebPage:OpenURL( "http://peter.sh/files/calc.html" ) - PhotonWebPage:OpenURL( "https://photon.lighting/menu/" ) - PhotonWebPage:SetAllowLua( true ) + PhotonWebPage:OpenURL("https://photon.lighting/menu/") + PhotonWebPage:SetAllowLua(true) end - PhotonWebPage:SetVisible( true ) + PhotonWebPage:SetVisible(true) PhotonWebPage:MakePopup() end -concommand.Add( "photon_menu", OpenPhotonPanel ) +concommand.Add("photon_menu", OpenPhotonMenu) function ClosePhotonMenu() - if PhotonWebPage then PhotonWebPage:SetVisible( false ) end + if PhotonWebPage then PhotonWebPage:SetVisible(false) end end -net.Receive( "photon_menu", function() +net.Receive( "photon_menu", function() OpenPhotonMenu() end) \ No newline at end of file diff --git a/lua/autorun/photon/cl_photon_menubar.lua b/lua/autorun/photon/cl_photon_menubar.lua index dc9a33ce..6d9953be 100644 --- a/lua/autorun/photon/cl_photon_menubar.lua +++ b/lua/autorun/photon/cl_photon_menubar.lua @@ -1,21 +1,16 @@ AddCSLuaFile() -if ( SERVER ) then return end +if SERVER then return end - - -hook.Add( "PopulateMenuBar", "PhotonOptions_MenuBar", function( menubar ) - - local m = menubar:AddOrGetMenu( "Photon" ) +hook.Add( "PopulateMenuBar", "PhotonOptions_MenuBar", function(menubar) + local m = menubar:AddOrGetMenu("Photon") m:AddCVar( "Express Editing Mode", "photon_express_edit", "1", "0" ) m:AddCVar( "Toggle Debug Mode", "photon_debug" ) local dTarget = m:AddSubMenu( "Set Debug Target" ) + dTarget:SetDeleteSelf(false) - dTarget:SetDeleteSelf( false ) - - dTarget:AddCVar( "Regular Lighting", "photon_debugtarget", "REG" ) - dTarget:AddCVar( "Emergency Lighting", "photon_debugtarget", "ELS" ) - + dTarget:AddCVar("Regular Lighting", "photon_debugtarget", "REG") + dTarget:AddCVar("Emergency Lighting", "photon_debugtarget", "ELS") end ) \ No newline at end of file diff --git a/lua/autorun/photon/cl_photon_settings.lua b/lua/autorun/photon/cl_photon_settings.lua index 3e6d22d2..da2e3b3e 100644 --- a/lua/autorun/photon/cl_photon_settings.lua +++ b/lua/autorun/photon/cl_photon_settings.lua @@ -17,7 +17,12 @@ Photon.DefaultKeys = { Siren2 = KEY_2, Siren3 = KEY_3, Siren4 = KEY_4, - Alt_Reverse = KEY_BACKSLASH + Alt_Reverse = KEY_BACKSLASH, + Signal_Activate = MOUSE_LEFT, + Signal_Deactivate = MOUSE_RIGHT, + Signal_Hazard = KEY_S, + Signal_Left = KEY_A, + Signal_Right = KEY_D } concommand.Add("photon_keys_reset", function() @@ -33,6 +38,7 @@ end CreateClientConVar("photon_emerg_unit", "", true) CreateClientConVar("photon_emerg_enabled", "1", true) CreateClientConVar("photon_stand_enabled", "1", true) +CreateClientConVar("photon_radar_sound", 1, true) CreateClientConVar("photon_hud_opacity", "1", true) CreateClientConVar("photon_lens_effects", "1", true) CreateClientConVar("photon_bloom_modifier", 1, true) diff --git a/lua/autorun/photon/cl_photon_toolmenu.lua b/lua/autorun/photon/cl_photon_toolmenu.lua index ea8acd8d..cfc58071 100644 --- a/lua/autorun/photon/cl_photon_toolmenu.lua +++ b/lua/autorun/photon/cl_photon_toolmenu.lua @@ -1,21 +1,24 @@ AddCSLuaFile() -hook.Add( "AddToolMenuCategories", "Photon.AddMenuCategory", function() - spawnmenu.AddToolCategory( "Utilities", "Photon", "Photon" ) +local invis = Color(0, 0, 0, 0) + +hook.Add("AddToolMenuCategories", "Photon.AddMenuCategory", function() + spawnmenu.AddToolCategory("Utilities", "Photon", "Photon") end) + local function logoHeader(panel, imgpath) if not imgpath then imgpath = "photon/ui/settings_logo.png" end panel:AddControl("Header", { - Description = string.format( "Photon Lighting Engine | %s | Update #%s", PHOTON_SERIES, PHOTON_UPDATE) + Description = string.format("Photon Lighting Engine | %s | Update #%s", PHOTON_SERIES, PHOTON_UPDATE) }) - local parent = vgui.Create( "DPanel" ) + local parent = vgui.Create("DPanel") parent:SetSize(300, 256) - parent:SetBackgroundColor(Color(0, 0, 0, 0)) + parent:SetBackgroundColor(invis) local header = vgui.Create("DImage", parent) header:SetImage(imgpath) @@ -36,160 +39,90 @@ local function buildControlsMenu(panel) panel:AddControl("Numpad", {Label = "Blackout Mode", Command="photon_key_blackout", Label2 = "Radar", Command2="photon_key_radar"}) panel:AddControl("Numpad", {Label = "Siren 1", Command="photon_key_siren1", Label2 = "Siren 2", Command2="photon_key_siren2"}) panel:AddControl("Numpad", {Label = "Siren 3", Command="photon_key_siren3", Label2 = "Siren 4", Command2="photon_key_siren4"}) - panel:AddControl("Numpad", {Label = "Reverse Light/Siren/TA Mode (Hold)", Command="photon_key_alt_reverse"}) + panel:AddControl("Numpad", {Label = "Indicator Activate", Command="photon_key_signal_activate", Label2 = "Indicator Lock", Command2="photon_key_signal_deactivate"}) + panel:AddControl("Numpad", {Label = "Indicator Left", Command="photon_key_signal_left", Label2 = "Indicator Right", Command2="photon_key_signal_right"}) + panel:AddControl("Numpad", {Label = "Indicator Hazards", Command="photon_key_signal_hazard", Label2 = "Reverse Light/Siren/TA Mode (Hold)", Command2="photon_key_alt_reverse"}) panel:AddControl("Button", {Label = "Reset to Default", Command="photon_keys_reset"}) end -local function buildClientSettings( panel ) +local function buildClientSettings(panel) panel:ClearControls() - logoHeader( panel ) + + logoHeader(panel) if PHOTON_CHRISTMAS_PERMIT then - panel:AddControl( "Header", { Description = "Special" } ) - panel:AddControl( "CheckBox", { Label = "Holiday Mode", Command = "photon_christmas_mode_auto" } ) + panel:AddControl("Header", {Description = "Special"}) + panel:AddControl("CheckBox", {Label = "Holiday Mode", Command = "photon_christmas_mode_auto"}) end - panel:AddControl( "Header", { Description = "General Settings" } ) - panel:AddControl( "CheckBox", { Label = "Enable Emergency Lighting", Command = "photon_emerg_enabled" } ) - panel:AddControl( "CheckBox", { Label = "Enable Standard Lighting", Command = "photon_stand_enabled" } ) - panel:AddControl( "Header", { Description = "Performance & Appearance" } ) - panel:AddControl( "CheckBox", { Label = "Enable Lens Flare Effects", Command = "photon_lens_effects" } ) - panel:AddControl( "CheckBox", { Label = "Enable Dynamic Lighting", Command = "photon_dynamic_lights", Description = "Experimental feature. This WILL significantly decrease FPS." } ) - panel:AddControl( "Slider", { Label = "Light Bloom Modifier", Command = "photon_bloom_modifier", Type = "Float", Min = "0", Max = "2" } ) - panel:AddControl( "Header", { Description = "Change HUD settings" } ) - panel:AddControl( "Slider", { Label = "Opacity", Command = "photon_hud_opacity", Type = "Float", Min = "0", Max = "1" } ) - - panel:AddControl( "Header", { Description = "Personal Options" } ) - panel:AddControl( "TextBox", { Label = "Unit ID", Command = "photon_emerg_unit", WaitForEnter = "1", Max = "3" }) + + panel:AddControl("Header", {Description = "General Settings"}) + panel:AddControl("CheckBox", {Label = "Enable Emergency Lighting", Command = "photon_emerg_enabled"}) + panel:AddControl("CheckBox", {Label = "Enable Standard Lighting", Command = "photon_stand_enabled"}) + panel:AddControl("CheckBox", {Label = "Enable Radar Sound", Command = "photon_radar_sound"}) + panel:AddControl("Header", {Description = "Performance & Appearance"}) + panel:AddControl("CheckBox", {Label = "Enable Lens Flare Effects", Command = "photon_lens_effects"}) + panel:AddControl("CheckBox", {Label = "Enable Dynamic Lighting", Command = "photon_dynamic_lights", Description = "Experimental feature. This WILL significantly decrease FPS."}) + panel:AddControl("Slider", {Label = "Light Bloom Modifier", Command = "photon_bloom_modifier", Type = "Float", Min = "0", Max = "2"}) + panel:AddControl("Header", {Description = "Change HUD settings"}) + panel:AddControl("Slider", {Label = "Opacity", Command = "photon_hud_opacity", Type = "Float", Min = "0", Max = "1"}) + + panel:AddControl("Header", {Description = "Personal Options"}) + panel:AddControl("TextBox", {Label = "Unit ID", Command = "photon_emerg_unit", WaitForEnter = "1", Max = "3"}) end -local function buildServerSettings( panel ) +local function buildServerSettings(panel) panel:ClearControls() - logoHeader( panel ) - panel:AddControl( "Header", { Description = "Adjust server Photon settings" } ) + logoHeader(panel) + panel:AddControl("Header", {Description = "Adjust server Photon settings"}) panel:AddControl( "CheckBox", { Label = "Enable Changing Siren Model", Command = "photon_emv_changesirens" } ) panel:AddControl( "CheckBox", { Label = "Enable Changing Lighting Presets", Command = "photon_emv_changepresets" } ) - // panel:AddControl( "CheckBox", { Label = "Enable Rendering Illumination Light", Command = "photon_emv_useillum" } ) + panel:AddControl( "CheckBox", { Label = "Enable Siren Running Outside Of Vehicle", Command = "photon_emv_stayon" } ) + panel:AddControl( "CheckBox", { Label = "Enable Rendering Illumination Light", Command = "photon_emv_useillum" } ) end local function createSirenOptions() - list.Set( "PhotonSirenOptions", "None", { ["photon_creator_siren"] = "0" } ) + list.Set("PhotonSirenOptions", "None", {photon_creator_siren = "0"}) local sirenTable = EMVU.GetSirenTable() - for i=1,#EMVU.GetSirenTable() do - local siren = EMVU.GetSirenTable()[i] - list.Set( "PhotonSirenOptions", siren.Category .. " - " .. siren.Name, { ["photon_creator_siren"] = tostring( i ) } ) + for _, siren in ipairs(sirenTable) do + list.Set("PhotonSirenOptions", siren.Category .. " - " .. siren.Name, {photon_creator_siren = tostring(i)}) end end local function createLightbarOptions() - list.Set( "PhotonLightbarOptions", "None", { ["photon_creator_lightbar"] = 0 } ) + list.Set("PhotonLightbarOptions", "None", {photon_creator_lightbar = 0}) local autoComponents = EMVU.Auto for key, data in pairs( autoComponents ) do if data.Lightbar then - list.Set( "PhotonLightbarOptions", key, { ["photon_creator_lightbar"] = key } ) + list.Set("PhotonLightbarOptions", key, {photon_creator_lightbar = key}) end end end -local function buildCreatorMenu( panel ) +local function buildCreatorMenu(panel) createSirenOptions() createLightbarOptions() + panel:ClearControls() - logoHeader( panel, "photon/ui/settings_creator.png" ) - panel:AddControl( "Header", { Description = "This is the Photon Creator menu. Here you can pre-customize a vehicle's settings and copy them when creating your own Photon car." } ) - panel:AddControl( "Header", { Description = "Basic Parameters:" } ) - panel:AddControl( "TextBox", { Label = "Vehicle Name", Command = "photon_creator_name", WaitForEnter = "0" } ) - panel:AddControl( "TextBox", { Label = "Spawn Category", Command = "photon_creator_category", WaitForEnter = "0" } ) - panel:AddControl( "ListBox", { Label = "Siren Model", Options = list.Get( "PhotonSirenOptions" ), Height = 80 } ) - panel:AddControl( "ListBox", { Label = "Starter Lightbar", Options = list.Get( "PhotonLightbarOptions" ), Height = 80 } ) - panel:AddControl( "Header", { Description = "Configure skins, bodygroups and colors on a vehicle. Sit in the vehicle and press the button below to copy the initial data to the clipboard." } ) - panel:AddControl( "Button", { Text = "Copy Configuration", Command = "photon_creator_copyconfig" } ) + logoHeader(panel, "photon/ui/settings_creator.png") + + panel:AddControl("Header", {Description = "This is the Photon Creator menu. Here you can pre-customize a vehicle's settings and copy them when creating your own Photon car."}) + panel:AddControl("Header", {Description = "Basic Parameters:"}) + panel:AddControl("TextBox", {Label = "Vehicle Name", Command = "photon_creator_name", WaitForEnter = "0"}) + panel:AddControl("TextBox", {Label = "Spawn Category", Command = "photon_creator_category", WaitForEnter = "0"}) + panel:AddControl("ListBox", {Label = "Siren Model", Options = list.Get("PhotonSirenOptions"), Height = 80}) + panel:AddControl("ListBox", {Label = "Starter Lightbar", Options = list.Get("PhotonLightbarOptions"), Height = 80}) + panel:AddControl("Header", {Description = "Configure skins, bodygroups and colors on a vehicle. Sit in the vehicle and press the button below to copy the initial data to the clipboard."}) + panel:AddControl("Button", {Text = "Copy Configuration", Command = "photon_creator_copyconfig"}) end -local function buildExpressManager( panel ) - local expressPanel = vgui.Create( "DPanel" ) - expressPanel:Dock( FILL ) - expressPanel:SetHeight( 600 ) - expressPanel:SetBackgroundColor( Color( 0, 0, 0, 0 ) ) - local defaultPanel, vehicleList, importButton, vehicleInfo - local selectedVehicle = false - local function drawVehicleInfo( panel, clear, info ) - if clear and IsValid( vehicleInfo ) then vehicleInfo:Remove(); vehicleInfo = nil end - vehicleInfo = vgui.Create( "DPanel", panel ) - vehicleInfo:Dock( TOP ) - vehicleInfo:DockMargin( 0, 0, 0, 12 ) - vehicleInfo:SetBackgroundColor( Color( 0, 0, 0, 0 ) ) - - local titleLabel = vgui.Create( "DLabel", vehicleInfo ) - titleLabel:SetDark( 1 ) - titleLabel:SetText( info ) - titleLabel:Dock( TOP ) - - end - local function drawVehicleList( panel ) - importButton = vgui.Create( "DButton", panel ) - importButton:Dock( TOP ) - - importButton:SetText( "Import Vehicle Code" ) - importButton:DockMargin( 140, 0, 0, 12 ) - - vehicleList = vgui.Create( "DListView", panel ) - vehicleList:SetMultiSelect( false ) - vehicleList:Dock( TOP ) - vehicleList:SetHeight( 140 ) - vehicleList:AddColumn( "Vehicle Name" ) +hook.Add("PopulateToolMenu", "Photon.AddSettingsMenu", function() + spawnmenu.AddToolMenuOption("Utilities", "Photon", "photon_settings_controls", "Controls", "", "", buildControlsMenu) + spawnmenu.AddToolMenuOption("Utilities", "Photon", "photon_settings_client", "Client", "", "", buildClientSettings) + spawnmenu.AddToolMenuOption("Utilities", "Photon", "photon_settings_server", "Settings", "", "", buildServerSettings) + spawnmenu.AddToolMenuOption("Utilities", "Photon", "photon_settings_config_creator", "Configurations", "", "", Photon.Editor.CreateConfiguration) - function vehicleList:OnRowSelected( id, row ) - drawVehicleInfo( panel, true, row.File ) - end - - local vehicles = EMVU.FetchExpressVehicles() - for _,vehicle in pairs( vehicles ) do - local newLine = vehicleList:AddLine( vehicle[1] ) - newLine.File = vehicle[2] - function newLine:OnCursorEntered() - print( tostring(newLine.File) ) - end - end - end - local function createDefault() - defaultPanel = vgui.Create( "DPanel", expressPanel ) - defaultPanel:Dock( TOP ) - defaultPanel:SetHeight( 400 ) - defaultPanel:SetBackgroundColor( Color( 0, 0, 0, 0 ) ) - drawVehicleList( defaultPanel ) - - end - local function clearPanels() - if IsValid( defaultPanel ) then defaultPanel:Remove(); defaultPanel = nil end - if IsValid( vehicleList ) then vehicleList:Remove(); vehicleList = nil end - end - createDefault() - panel:AddItem( expressPanel ) -end - -hook.Add( "PopulateToolMenu", "Photon.AddSettingsMenu", function() - spawnmenu.AddToolMenuOption( "Utilities", "Photon", "photon_settings_controls", "Controls", "", "", buildControlsMenu ) - spawnmenu.AddToolMenuOption( "Utilities", "Photon", "photon_settings_client", "Client", "", "", buildClientSettings ) - spawnmenu.AddToolMenuOption( "Utilities", "Photon", "photon_settings_server", "Settings", "", "", buildServerSettings ) - spawnmenu.AddToolMenuOption( "Utilities", "Photon", "photon_settings_config_creator", "Configurations", "", "", Photon.Editor.CreateConfiguration ) if game.SinglePlayer() then - spawnmenu.AddToolMenuOption( "Utilities", "Photon", "photon_settings_creator", "Express Creator", "", "", buildCreatorMenu ) - --spawnmenu.AddToolMenuOption( "Utilities", "Photon", "photon_settings_express", "Express Vehicles", "", "", buildExpressManager ) - spawnmenu.AddToolMenuOption( "Utilities", "Photon", "photon_settings_editor", "Express Editor", "", "", Photon.Editor.CreateMenu ) + spawnmenu.AddToolMenuOption("Utilities", "Photon", "photon_settings_creator", "Express Creator", "", "", buildCreatorMenu) + spawnmenu.AddToolMenuOption("Utilities", "Photon", "photon_settings_editor", "Express Editor", "", "", Photon.Editor.CreateMenu) end -end ) - --- PrintTable( list.Get( "ThrusterSounds" ) ) - --- cvars.RemoveChangeCallback("photon_christmas_mode_auto","photon.christmas.hook") --- cvars.AddChangeCallback("photon_christmas_mode_auto",function(name, old, new) --- if tonumber( new ) == 1 then --- if PHOTON_CHRISTMAS_PERMIT then --- RunConsoleCommand( "photon_christmas_mode", "1" ) --- end --- else --- RunConsoleCommand( "photon_christmas_mode", "0" ) --- chat.AddText( Color( 255, 255, 128), "Photon Holiday Mode has been disabled." ) --- end - --- end,"photon.christmas.hook") +end) diff --git a/lua/autorun/photon/library/auto/fedsig_integrity.lua b/lua/autorun/photon/library/auto/fedsig_integrity.lua index bf9790a5..0e492746 100644 --- a/lua/autorun/photon/library/auto/fedsig_integrity.lua +++ b/lua/autorun/photon/library/auto/fedsig_integrity.lua @@ -15,7 +15,8 @@ COMPONENT.Bodygroups = {} COMPONENT.ColorInput = 1 COMPONENT.DefaultColors = { [1] = "RED", - [2] = "BLUE" + [2] = "BLUE", + [3] = "WHITE" } COMPONENT.Meta = { @@ -194,6 +195,164 @@ COMPONENT.Sections = { { 8, "_1", .55}, { 10, "_1", .55, .55, .55}, { 12, "_1", .55, .55}, { 14, "_1", .55} } }, + ["auto_fedsig_integrity_boston"] = { + + [1] = { + { 22, "_1"}, { 21, "_2"}, + { 1, "_2"}, { 2, "_1"}, + }, + [2] = { + { 20, "_1"}, { 22, "_1"}, { 21, "_2"}, { 19, "_2"}, + { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, + }, + [3] = { + { 18, "_1"}, { 20, "_1"}, { 22, "_1"}, { 21, "_2"}, { 19, "_2"}, { 17, "_2"}, + { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, + }, + [4] = { + { 16, "_1"}, { 18, "_1"}, { 20, "_1"}, { 22, "_1"}, { 21, "_2"}, { 19, "_2"}, { 17, "_2"}, { 15, "_2"}, + { 7, "_2"}, { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, { 8, "_1"}, + }, + [5] = { + { 18, "_1"}, { 20, "_1"}, { 19, "_2"}, { 17, "_2"}, + { 5, "_2"}, { 3, "_2"}, { 4, "_1"}, { 6, "_1"}, + }, + [6] = { + { 16, "_1"}, { 18, "_1"}, { 17, "_2"}, { 15, "_2"}, + { 7, "_2"}, { 5, "_2"}, { 6, "_1"}, { 8, "_1"}, + }, + [7] = { + { 16, "_1"}, { 15, "_2"}, + { 7, "_2"}, { 8, "_1"}, + }, + + [8] = { + { 22, "_1"}, { 21, "_2"}, + { 1, "_2"}, { 2, "_1"}, + }, + [9] = { + { 20, "_1"}, { 22, "_1"}, { 21, "_2"}, { 19, "_2"}, + { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, + }, + [10] = { + { 18, "_1"}, { 20, "_1"}, { 22, "_1"}, { 21, "_2"}, { 19, "_2"}, { 17, "_2"}, + { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, + }, + [11] = { + { 18, "_1"}, { 20, "_1"}, { 19, "_2"}, { 17, "_2"}, + { 16, "_1"}, { 15, "_2"}, + { 5, "_2"}, { 3, "_2"}, { 4, "_1"}, { 6, "_1"}, + { 7, "_2"}, { 8, "_1"}, + }, + [12] = { + { 18, "_1"}, { 17, "_2"}, + { 5, "_2"}, { 6, "_1"}, + }, + + [13] = { + { 16, "_1"}, { 15, "_2"}, + { 7, "_2"}, { 8, "_1"}, + }, + + [14] = { + { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, + }, + [15] = { + { 5, "_3"}, { 3, "_3"}, { 1, "_3"}, + }, + [16] = { + { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, + }, + [17] = { + { 2, "_3"}, { 4, "_3"}, { 6, "_3"}, + }, + [18] = { + { 5, "_3"}, { 3, "_3"}, { 1, "_3"}, + { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, + }, + [19] = { + { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, + { 2, "_3"}, { 4, "_3"}, { 6, "_3"}, + }, + [20] = { + { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, + { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, + }, + }, + ["auto_fedsig_integrity_corner_boston"] = { + + [1] = { + { 14, "_1"}, { 13, "_2"}, + { 9, "_2"}, { 10, "_1"}, + { 11, "_2"}, { 12, "_1"}, + }, + [2] = { + { 9, "_3"}, { 10, "_3"}, + }, + + [3] = { + { 11, "_2"}, { 9, "_2"}, { 7, "_2"}, + }, + [4] = { + { 11, "_3"}, { 9, "_3"}, { 7, "_3"}, + }, + [5] = { + { 8, "_1"}, { 10, "_1"}, { 12, "_1"}, + }, + [6] = { + { 8, "_3"}, { 10, "_3"}, { 12, "_3"}, + }, + [7] = { + { 11, "_3"}, { 9, "_3"}, { 7, "_3"}, + { 8, "_1"}, { 10, "_1"}, { 12, "_1"}, + }, + [8] = { + { 11, "_2"}, { 9, "_2"}, { 7, "_2"}, + { 8, "_3"}, { 10, "_3"}, { 12, "_3"}, + }, + [9] = { + { 11, "_2"}, { 9, "_2"}, { 7, "_2"}, + { 8, "_1"}, { 10, "_1"}, { 12, "_1"}, + }, + }, + ["auto_fedsig_integrity_rear_boston"] = { + [1] = { + { 18, "_1"}, { 20, "_1"}, { 22, "_1"}, + { 14, "_1"}, { 16, "_1"}, { 15, "_2"}, { 13, "_2"}, + }, + [2] = { + { 18, "_1"}, { 20, "_1"}, { 22, "_1"}, + { 15, "_2"}, { 13, "_2"}, + }, + [3] = { + { 15, "_2"}, { 13, "_2"}, + }, + [4] = { + { 18, "_1"}, { 20, "_1"}, { 22, "_1"}, + }, + [5] = { + { 18, "_1"}, { 20, "_1"}, { 22, "_1"}, { 21, "_2"}, { 19, "_2"}, { 17, "_2"}, + { 15, "_2"}, { 13, "_2"}, + }, + [6] = { + { 21, "_2"}, { 19, "_2"}, { 17, "_2"}, + { 14, "_1"}, { 16, "_1"}, { 15, "_2"}, { 13, "_2"}, + }, + [7] = { + { 21, "_2"}, { 19, "_2"}, { 17, "_2"}, + { 14, "_1"}, { 16, "_1"}, + }, + [8] = { + { 14, "_1"}, { 16, "_1"}, + }, + [9] = { + { 21, "_2"}, { 19, "_2"}, { 17, "_2"}, + }, + [10] = { + { 18, "_1"}, { 20, "_1"}, { 22, "_1"}, { 21, "_2"}, { 19, "_2"}, { 17, "_2"}, + { 14, "_1"}, { 16, "_1"}, + }, + }, ["auto_fedsig_integrity_signalmaster"] = { -- center out [1] = { { 22, A }, { 21, A }, }, @@ -267,7 +426,8 @@ COMPONENT.Patterns = { 12, 0, 12, 0, 12, 0, 13, 0, 13, 0, 13, 0, }, - ["alert"] = { 3, 15, 14, 2 } + ["alert"] = { 3, 15, 14, 2 }, + ["alertBPD"] = { 3, 15, 14, 2 }, }, ["auto_fedsig_integrity_corner"] = { ["cruise"] = { @@ -278,7 +438,21 @@ COMPONENT.Patterns = { 1, 0, 1, 0, 1, 2, 0, 2, 0, 2, } - } + }, + ["auto_fedsig_integrity_boston"] = { + ["code1BPD"] = { 1, 2, 3, 4, 4, 3, 5, 6, 7 }, + ["code2BPD"] = { 8, 9, 10, 11, 12, 13 }, + ["code3BPD"] = { 20, 14, 14, 19, 0, 19, 14, 20, 16, 16, 18, 0, 18, 16 }, + }, + ["auto_fedsig_integrity_corner_boston"] = { + ["cruise"] = { 0 }, + ["code1BPD"] = { 1, 1, 1, 1, 0, 0, 0, 0, 0 }, + ["code2BPD"] = { 1, 1, 0, 2, 0, 2 }, + ["code3BPD"] = { 8, 3, 9, 5, 5, 4, 0, 7, 5, 9, 3, 3, 6, 0 }, + }, + ["auto_fedsig_integrity_rear_boston"] = { + ["code3BPD"] = { 1, 2, 3, 0, 4, 2, 5, 6, 7, 8, 0, 9, 7, 10 }, + }, } COMPONENT.TrafficDisconnect = { @@ -291,22 +465,31 @@ COMPONENT.Modes = { Primary = { M1 = { ["auto_fedsig_integrity"] = "pattern_1", + ["auto_fedsig_integrity_boston"] = "code1", + ["auto_fedsig_integrity_corner_boston"] = "code1", }, M2 = { ["auto_fedsig_integrity"] = "code2", - ["auto_fedsig_integrity_corner"] = "alt_slow" + ["auto_fedsig_integrity_corner"] = "alt_slow", + ["auto_fedsig_integrity_boston"] = "code2", + ["auto_fedsig_integrity_corner_boston"] = "code2", }, M3 = { ["auto_fedsig_integrity"] = "code3", - ["auto_fedsig_integrity_corner"] = "code3" + ["auto_fedsig_integrity_corner"] = "code3", + ["auto_fedsig_integrity_boston"] = "code3", + ["auto_fedsig_integrity_corner_boston"] = "code3", + ["auto_fedsig_integrity_rear_boston"] = "code3", }, ALERT = { ["auto_fedsig_integrity"] = "alert", + } }, Auxiliary = { C = { - ["auto_fedsig_integrity_corner"] = "cruise" + ["auto_fedsig_integrity_corner"] = "cruise", + ["auto_fedsig_integrity_corner_boston"] = "cruise", }, L = { ["auto_fedsig_integrity_signalmaster"] = "left" diff --git a/lua/autorun/photon/library/auto/fedsig_micropulse.lua b/lua/autorun/photon/library/auto/fedsig_micropulse.lua index c5e0d3e6..9b24a9a8 100644 --- a/lua/autorun/photon/library/auto/fedsig_micropulse.lua +++ b/lua/autorun/photon/library/auto/fedsig_micropulse.lua @@ -101,15 +101,14 @@ COMPONENT.TrafficDisconnect = { COMPONENT.Modes = { Primary = { - M1 = { ["auto_pulse"] = "code1", }, - M2 = { ["auto_pulse"] = "code2", }, - M3 = { ["auto_pulse"] = "code3", }, + M1 = { ["auto_pulse"] = "code1" }, + M2 = { ["auto_pulse"] = "code2" }, + M3 = { ["auto_pulse"] = "code3" }, + PARK = { + ["auto_pulse"] = "parkkill", + } }, Auxiliary = { - - PK = { - ["auto_pulse"] = "parkkill", - }, L = { }, @@ -119,7 +118,6 @@ COMPONENT.Modes = { D = { }, - }, Illumination = { L = { diff --git a/lua/autorun/photon/library/auto/fedsig_valor.lua b/lua/autorun/photon/library/auto/fedsig_valor.lua index f9b44d9d..079fc8fa 100644 --- a/lua/autorun/photon/library/auto/fedsig_valor.lua +++ b/lua/autorun/photon/library/auto/fedsig_valor.lua @@ -15,7 +15,8 @@ COMPONENT.Bodygroups = {} COMPONENT.Category = "Lightbar" COMPONENT.DefaultColors = { [1] = "RED", - [2] = "BLUE" + [2] = "BLUE", + [3] = "WHITE" } COMPONENT.Meta = { @@ -370,7 +371,163 @@ COMPONENT.Sections = { { 12, "_1", .66 }, { 14, "_1", .66 }, { 16, "_1", .66 }, { 11, "_2", .55 }, { 13, "_2", .55 }, { 15, "_2", .55 }, }, - } + }, + ["auto_fedsig_valor_boston"] = { + [1] = { + { 24, "_1"}, { 23, "_2"}, + { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, + }, + [2] = { + { 22, "_1"}, { 24, "_1"}, { 23, "_2"}, { 21, "_2"}, + { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, + }, + [3] = { + { 20, "_1"}, { 22, "_1"}, { 24, "_1"}, { 23, "_2"}, { 21, "_2"}, { 19, "_2"}, + { 7, "_2"}, { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, { 8, "_1"}, + }, + [4] = { + { 18, "_1"}, { 20, "_1"}, { 22, "_1"}, { 24, "_1"}, { 23, "_2"}, { 21, "_2"}, { 19, "_2"}, { 17, "_2"}, + { 9, "_2"}, { 7, "_2"}, { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, { 8, "_1"}, { 10, "_1"}, + }, + [5] = { + { 20, "_1"}, { 22, "_1"}, { 21, "_2"}, { 19, "_2"}, + { 7, "_2"}, { 5, "_2"}, { 6, "_1"}, { 8, "_1"}, + }, + [6] = { + { 18, "_1"}, { 20, "_1"}, { 19, "_2"}, { 17, "_2"}, + { 9, "_2"}, { 7, "_2"}, { 8, "_1"}, { 10, "_1"}, + }, + [7] = { + { 18, "_1"}, { 17, "_2"}, + { 9, "_2"}, { 10, "_1"}, + }, + + [8] = { + { 24, "_1"}, { 23, "_2"}, + { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, + }, + [9] = { + { 22, "_1"}, { 24, "_1"}, { 23, "_2"}, { 21, "_2"}, + { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, + }, + [10] = { + { 20, "_1"}, { 22, "_1"}, { 24, "_1"}, { 23, "_2"}, { 21, "_2"}, { 19, "_2"}, + { 7, "_2"}, { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, { 8, "_1"}, + }, + [11] = { + { 20, "_1"}, { 22, "_1"}, { 21, "_2"}, { 19, "_2"}, + { 18, "_1"}, { 17, "_2"}, + { 7, "_2"}, { 5, "_2"}, { 6, "_1"}, { 8, "_1"}, + { 9, "_2"}, { 10, "_1"}, + }, + [12] = { + { 20, "_1"}, { 19, "_2"}, + { 7, "_2"}, { 8, "_1"}, + }, + + [13] = { + { 18, "_1"}, { 17, "_2"}, + { 9, "_2"}, { 10, "_1"}, + }, + + [14] = { + { 7, "_2"}, { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, + }, + [15] = { + { 7, "_3"}, { 5, "_3"}, { 3, "_3"}, { 1, "_3"}, + }, + [16] = { + { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, { 8, "_1"}, + }, + [17] = { + { 2, "_3"}, { 4, "_3"}, { 6, "_3"}, { 8, "_3"}, + }, + [18] = { + { 7, "_3"}, { 5, "_3"}, { 3, "_3"}, { 1, "_3"}, + { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, { 8, "_1"}, + }, + [19] = { + { 7, "_2"}, { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, + { 2, "_3"}, { 4, "_3"}, { 6, "_3"}, { 8, "_3"}, + }, + [20] = { + { 7, "_2"}, { 5, "_2"}, { 3, "_2"}, { 1, "_2"}, + { 2, "_1"}, { 4, "_1"}, { 6, "_1"}, { 8, "_1"}, + }, + }, + ["auto_fedsig_valor_corner_boston"] = { + [1] = { + { 16, "_1"}, { 15, "_2"}, + { 11, "_2"}, { 12, "_1"}, + { 13, "_2"}, { 14, "_1"}, + }, + [2] = { + { 11, "_3"}, { 12, "_3"}, + }, + + [3] = { + { 13, "_2"}, { 11, "_2"}, { 9, "_2"}, + }, + [4] = { + { 13, "_3"}, { 11, "_3"}, { 9, "_3"}, + }, + [5] = { + { 10, "_1"}, { 12, "_1"}, { 14, "_1"}, + }, + [6] = { + { 10, "_3"}, { 12, "_3"}, { 14, "_3"}, + }, + [7] = { + { 13, "_3"}, { 11, "_3"}, { 9, "_3"}, + { 10, "_1"}, { 12, "_1"}, { 14, "_1"}, + }, + [8] = { + { 13, "_2"}, { 11, "_2"}, { 9, "_2"}, + { 10, "_3"}, { 12, "_3"}, { 14, "_3"}, + }, + [9] = { + { 13, "_2"}, { 11, "_2"}, { 9, "_2"}, + { 10, "_1"}, { 12, "_1"}, { 14, "_1"}, + }, + }, + ["auto_fedsig_valor_rear_boston"] = { + [1] = { + { 20, "_1"}, { 22, "_1"}, { 24, "_1"}, + { 16, "_1"}, { 18, "_1"}, { 17, "_2"}, { 15, "_2"}, + }, + [2] = { + { 20, "_1"}, { 22, "_1"}, { 24, "_1"}, + { 17, "_2"}, { 15, "_2"}, + }, + [3] = { + { 17, "_2"}, { 15, "_2"}, + }, + [4] = { + { 20, "_1"}, { 22, "_1"}, { 24, "_1"}, + }, + [5] = { + { 20, "_1"}, { 22, "_1"}, { 24, "_1"}, { 23, "_2"}, { 21, "_2"}, { 19, "_2"}, + { 17, "_2"}, { 15, "_2"}, + }, + [6] = { + { 23, "_2"}, { 21, "_2"}, { 19, "_2"}, + { 16, "_1"}, { 18, "_1"}, { 17, "_2"}, { 15, "_2"}, + }, + [7] = { + { 23, "_2"}, { 21, "_2"}, { 19, "_2"}, + { 16, "_1"}, { 18, "_1"}, + }, + [8] = { + { 16, "_1"}, { 18, "_1"}, + }, + [9] = { + { 23, "_2"}, { 21, "_2"}, { 19, "_2"}, + }, + [10] = { + { 20, "_1"}, { 22, "_1"}, { 24, "_1"}, { 23, "_2"}, { 21, "_2"}, { 19, "_2"}, + { 16, "_1"}, { 18, "_1"}, + }, + }, } COMPONENT.Patterns = { @@ -468,8 +625,25 @@ COMPONENT.Patterns = { }, ["alert"] = { 2, 3, 4, 5 + }, + ["alertBPD"] = { + 2, 3, 4, 5 } - } + }, + ["auto_fedsig_valor_boston"] = { + ["code1BPD"] = { 1, 2, 3, 4, 4, 3, 5, 6, 7 }, + ["code2BPD"] = { 8, 9, 10, 11, 12, 13 }, + ["code3BPD"] = { 20, 14, 14, 19, 0, 19, 14, 20, 16, 16, 18, 0, 18, 16 }, + }, + ["auto_fedsig_valor_corner_boston"] = { + ["cruise"] = { 0 }, + ["code1BPD"] = { 1, 1, 1, 1, 0, 0, 0, 0, 0 }, + ["code2BPD"] = { 1, 1, 0, 2, 0, 2 }, + ["code3BPD"] = { 8, 3, 9, 5, 5, 4, 0, 7, 5, 9, 3, 3, 6, 0 }, + }, + ["auto_fedsig_valor_rear_boston"] = { + ["code3BPD"] = { 1, 2, 3, 0, 4, 2, 5, 6, 7, 8, 0, 9, 7, 10 }, + }, } COMPONENT.TrafficDisconnect = { @@ -485,15 +659,22 @@ COMPONENT.Modes = { Primary = { M1 = { ["auto_fedsig_valor"] = "code1", - ["auto_fedsig_valor_signalmaster"] = "stage1" + ["auto_fedsig_valor_signalmaster"] = "stage1", + ["auto_fedsig_valor_boston"] = "code1", + ["auto_fedsig_valor_corner_boston"] = "code1", }, M2 = { ["auto_fedsig_valor"] = "code2", - ["auto_fedsig_valor_signalmaster"] = "stage2" + ["auto_fedsig_valor_signalmaster"] = "stage2", + ["auto_fedsig_valor_boston"] = "code2", + ["auto_fedsig_valor_corner_boston"] = "code2", }, M3 = { ["auto_fedsig_valor"] = "code3", - ["auto_fedsig_valor_signalmaster"] = "stage2" + ["auto_fedsig_valor_signalmaster"] = "stage2", + ["auto_fedsig_valor_boston"] = "code3", + ["auto_fedsig_valor_corner_boston"] = "code3", + ["auto_fedsig_valor_rear_boston"] = "code3", }, ALERT = { ["auto_fedsig_valor"] = "alert", diff --git a/lua/autorun/photon/library/auto/fedsig_viper_dual.lua b/lua/autorun/photon/library/auto/fedsig_viper_dual.lua index 4237938e..db455f30 100644 --- a/lua/autorun/photon/library/auto/fedsig_viper_dual.lua +++ b/lua/autorun/photon/library/auto/fedsig_viper_dual.lua @@ -14,6 +14,7 @@ COMPONENT.ForwardTranslation = true COMPONENT.DefaultColors = { [1] = "RED", [2] = "BLUE", + [3] = "WHITE" } COMPONENT.Meta = { @@ -47,6 +48,9 @@ COMPONENT.Sections = { [1] = { { 1, "_1" }, { 2, "_2" } }, [2] = { { 1, "_1" } }, [3] = { { 2, "_2" } }, + + [4] = { { 1, "_3" } }, + [5] = { { 2, "_3" } }, }, } @@ -79,6 +83,9 @@ COMPONENT.Patterns = { 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, }, + ["code1BPD"] = { 3, 0, 3, 0, 3, 3, 3, 3, 3, 2, 0, 2, 0, 2, 2, 2, 2, 2 }, + ["code2BPD"] = { 3, 0, 3, 0, 3, 3, 3, 2, 0, 2, 0, 2, 2, 2 }, + ["code3BPD"] = { 3, 0, 3, 0, 3, 3, 3, 2, 0, 2, 0, 2, 2, 2, 5, 0, 5, 0, 5, 5, 5, 4, 0, 4, 0, 4, 4, 4 }, ["alert"] = { 2, 3 }, ["alertA"] = { 2, 3 }, ["alertB"] = { 3, 2 }, @@ -86,8 +93,8 @@ COMPONENT.Patterns = { ["alertD"] = { 2, 3 }, ["alertNYA"] = { 2, 3 }, ["alertNYB"] = { 3, 2 }, - ["brakeA"] = { 1 }, - ["brakeB"] = { 1 }, + ["alertBPD"] = { 2, 3 }, + ["brakeBPD"] = { 1 }, } } diff --git a/lua/autorun/photon/library/auto/int_lightbar_small.lua b/lua/autorun/photon/library/auto/int_lightbar_small.lua index b1660366..6fca6371 100644 --- a/lua/autorun/photon/library/auto/int_lightbar_small.lua +++ b/lua/autorun/photon/library/auto/int_lightbar_small.lua @@ -122,27 +122,27 @@ COMPONENT.TrafficDisconnect = { COMPONENT.Modes = { Primary = { - M1 = { + M1 = { ["auto_boston"] = "code1", }, - M2 = { + M2 = { ["auto_boston"] = "code2", }, - M3 = { + M3 = { ["auto_boston"] = "code3", }, + PARK = { + ["carbide_aux"] = "parkkill", + } }, Auxiliary = { - PK = { - ["carbide_aux"] = "parkkill", - }, C = { }, - L = { + L = { }, - R = { + R = { }, D = { diff --git a/lua/autorun/photon/library/auto/whelen_cenator.lua b/lua/autorun/photon/library/auto/whelen_cenator.lua new file mode 100644 index 00000000..241b71a9 --- /dev/null +++ b/lua/autorun/photon/library/auto/whelen_cenator.lua @@ -0,0 +1,258 @@ +AddCSLuaFile() + +local W = "WHITE" + +local name = "Whelen Cenator" + +local COMPONENT = {} + +COMPONENT.Model = "models/supermighty/photon/whelen_cenator.mdl" +COMPONENT.Lightbar = true +COMPONENT.Skin = 0 +COMPONENT.Category = "Lightbar" +COMPONENT.Bodygroups = {} +COMPONENT.DefaultColors = { + [1] = "BLUE", + [2] = "RED", + [3] = "AMBER" +} + +COMPONENT.Meta = { + cenator_f_main = { + AngleOffset = -90, + W = 8.5, + H = 6, + Sprite = "sprites/emv/emv_whelen_src", + WMult = 1.4, + Scale = 1, + EmitArray = { + Vector( 1.6, 0, 0 ), + --Vector( 0, 0, 0 ), + Vector( -1.6, 0, 0 ) + } + }, + cenator_r_main = { + AngleOffset = 90, + W = 8.5, + H = 6, + Sprite = "sprites/emv/emv_whelen_src", + WMult = 1.4, + Scale = 1, + EmitArray = { + Vector( 1.6, 0, 0 ), + Vector( 0, 0, 0 ), + Vector( -1.6, 0, 0 ) + } + }, + cenator_takedown = { + AngleOffset = -90, + W = 1.9, + H = 2.6, + Sprite = "sprites/emv/freedom_takedown", + WMult = 1.4, + Scale = 1, + } +} + +COMPONENT.Positions = { + + [1] = { Vector( 3.6, 6.29, 0.3 ), Angle( 0, 0, 0 ), "cenator_f_main" }, + [2] = { Vector( -3.6, 6.29, 0.3 ), Angle( 0, 0, 0 ), "cenator_f_main" }, + [3] = { Vector( 10.9, 6.29, 0.3 ), Angle( 0, 0, 0 ), "cenator_f_main" }, + [4] = { Vector( -10.9, 6.29, 0.3 ), Angle( 0, 0, 0 ), "cenator_f_main" }, + [5] = { Vector( 20.74, 6.09, 0.3 ), Angle( 0, 0, 0 ), "cenator_f_main" }, + [6] = { Vector( -20.74, 6.09, 0.3 ), Angle( 0, 0, 0 ), "cenator_f_main" }, + [7] = { Vector( 27.04, 3.69, 0.3 ), Angle( 0, -47, 0 ), "cenator_f_main" }, + [8] = { Vector( -27.04, 3.69, 0.3 ), Angle( 0, 47, 0 ), "cenator_f_main" }, + [9] = { Vector( 27.04, -3.69, 0.3 ), Angle( 0, 47, 0 ), "cenator_r_main" }, + [10] = { Vector( -27.04, -3.69, 0.3 ), Angle( 0, -47, 0 ), "cenator_r_main" }, + [11] = { Vector( 20.74, -6.09, 0.3 ), Angle( 0, 0, 0 ), "cenator_r_main" }, + [12] = { Vector( -20.74, -6.09, 0.3 ), Angle( 0, 0, 0 ), "cenator_r_main" }, + [13] = { Vector( 10.9, -6.29, 0.3 ), Angle( 0, 0, 0 ), "cenator_r_main" }, + [14] = { Vector( -10.9, -6.29, 0.3 ), Angle( 0, 0, 0 ), "cenator_r_main" }, + [15] = { Vector( 3.6, -6.29, 0.3 ), Angle( 0, 0, 0 ), "cenator_r_main" }, + [16] = { Vector( -3.6, -6.29, 0.3 ), Angle( 0, 0, 0 ), "cenator_r_main" }, + + [17] = { Vector( -16.505, 6.18, 0.34 ), Angle( 0, 0, 0 ), "cenator_takedown" }, + [18] = { Vector( 16.505, 6.18, 0.34), Angle( 0, 0, 0 ), "cenator_takedown" }, + + [19] = { Vector( -29.4, 0, 0.34 ), Angle( 0, 90, 0 ), "cenator_takedown" }, + [20] = { Vector( 29.4, 0, 0.34 ), Angle( 0, -90, 0 ), "cenator_takedown" } + +} + +COMPONENT.Sections = { + ["auto_cenator_corner"] = { + [1] = { + { 6, "_2" }, { 8, "_2" }, { 10, "_2" }, { 12, "_2" } + }, + [2] = { + { 5, "_1" }, { 7, "_1" }, { 9, "_1" }, { 11, "_1" } + }, + [3] = { + { 6, "_2" }, { 8, "_2" }, { 10, "_2" }, { 12, "_2" },{ 5, "_1" }, { 7, "_1" }, { 9, "_1" }, { 11, "_1" } + } + }, + ["auto_cenator"] = { + [1] = { + { 1, "_1" },{ 3, "_1"},{ 5, "_1"},{ 7, "_1"},{ 9, "_1"},{ 11, "_1"},{ 13, "_1"},{ 15, "_1"}, + { 2, "_2" },{ 4, "_2"},{ 6, "_2"},{ 8, "_2"},{ 10, "_2"},{ 12, "_2"},{ 14, "_2"},{ 16, "_2"}, + }, + [2] = { + { 1, "_1" },{ 3, "_1"},{ 5, "_1"},{ 7, "_1"},{ 9, "_1"},{ 11, "_1"},{ 13, "_1"},{ 15, "_1"}, + }, + [3] = { + { 2, "_2" },{ 4, "_2"},{ 6, "_2"},{ 8, "_2"},{ 10, "_2"},{ 12, "_2"},{ 14, "_2"},{ 16, "_2"}, + }, + [4] = { + { 6, "_2"},{ 8, "_2"},{ 10, "_2"},{ 12, "_2"},{ 1, "_1" }, { 3, "_1" },{ 13, "_1" }, { 15, "_1" }, + }, + [5] = { + { 7, "_1"},{ 9, "_1"},{ 11, "_1"},{ 16, "_2"},{ 2, "_2" }, { 4, "_2" },{ 14, "_2" }, { 5, "_1" }, + } + }, + ["auto_cenator_inner_f"] = { + [1] = { { 1, "_1" }, { 3, "_1" } }, + [2] = { { 2, "_2" }, { 4, "_2" } }, + [3] = { { 1, "_1" }, { 4, "_2" } }, + [4] = { { 2, "_2" }, { 3, "_1" } }, + [5] = { { 3, "_1" }, { 4, "_2" } }, + [6] = { { 1, "_1" }, { 2, "_2" } } + }, + ["auto_cenator_inner_r"] = { + [1] = { { 15, "_1" }, { 13, "_1" } }, + [2] = { { 16, "_2" }, { 14, "_2" } }, + [3] = { { 15, "_1" }, { 14, "_2" } }, + [4] = { { 16, "_2" }, { 13, "_1" } }, + [5] = { { 13, "_1" }, { 14, "_2" } }, + [6] = { { 15, "_1" }, { 16, "_2" } } + }, + ["auto_cenator_traffic"] = { + -- left ta -- + [1] = { { 11, "_3"}, }, + [2] = { { 11, "_3"},{ 13, "_3"}, }, + [3] = { { 11, "_3"},{ 13, "_3"},{ 15, "_3"}, }, + [4] = { { 11, "_3"},{ 13, "_3"},{ 15, "_3"},{ 16, "_3"}, }, + [5] = { { 11, "_3"},{ 13, "_3"},{ 15, "_3"},{ 16, "_3"},{ 14, "_3"}, }, + [6] = { { 11, "_3"},{ 13, "_3"},{ 15, "_3"},{ 16, "_3"},{ 14, "_3"},{ 12, "_3" }, }, + -- right ta -- + [7] = { { 12, "_3" } }, + [8] = { { 14, "_3"},{ 12, "_3" } }, + [9] = { { 16, "_3"},{ 14, "_3"},{ 12, "_3" }, }, + [10] = { { 15, "_3"},{ 16, "_3"},{ 14, "_3"},{ 12, "_3" }, }, + [11] = { { 13, "_3"},{ 15, "_3"},{ 16, "_3"},{ 14, "_3"},{ 12, "_3" } }, + [12] = { { 11, "_3"},{ 13, "_3"},{ 15, "_3"},{ 16, "_3"},{ 14, "_3"},{ 12, "_3" }, }, + -- divide -- + [13] = { { 15, "_3"},{ 16, "_3"}, }, + [14] = { { 15, "_3"},{ 16, "_3"},{ 14, "_3"},{ 13, "_3"}, }, + [15] = { { 15, "_3"},{ 16, "_3"},{ 14, "_3"},{ 13, "_3"},{ 12, "_3"},{ 11, "_3"} } + } +} + +COMPONENT.Patterns = { + ["auto_cenator"] = { + ["all"] = {1}, + ["code1"] = { 2, 2, 2, 2, 0, 3, 3, 3, 3, 0 }, + ["code2"] = { 2, 0, 2, 2, 2, 0, 0, 0, 3, 0, 3, 3, 3, 0, 0, 0, + 2, 0, 2, 2, 2, 0, 0, 0, 3, 0, 3, 3, 3, 0, 0, 0, + 2, 0, 2, 2, 2, 0, 0, 0, 3, 0, 3, 3, 3, 0, 0, 0, + 4, 0, 4, 4, 4, 0, 0, 0, 5, 0, 5, 5, 5, 0, 0, 0, + 4, 0, 4, 4, 4, 0, 0, 0, 5, 0, 5, 5, 5, 0, 0, 0, + 4, 0, 4, 4, 4, 0, 0, 0, 5, 0, 5, 5, 5, 0, 0, 0, + } + }, + ["auto_cenator_corner"] = { + ["code3"] = { 1, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, + 3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, + } + }, + ["auto_cenator_inner_f"] = { + ["code3"] = { + 1, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, + 1, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, + 3, 0, 3, 0, 3, 0, 4, 0, 4, 0, 4, 0, + 3, 0, 3, 0, 3, 0, 4, 0, 4, 0, 4, 0, + 5, 0, 5, 0, 5, 0, 6, 0, 6, 0, 6, 0, + 5, 0, 5, 0, 5, 0, 6, 0, 6, 0, 6, 0, + 5, 0, 5, 0, 6, 0, 6, 0, + 5, 0, 5, 0, 6, 0, 6, 0, + 5, 0, 6, 0, + 5, 0, 6, 0, + 1, 0, 1, 0, 2, 0, 2, 0, + 1, 0, 1, 0, 2, 0, 2, 0, + 1, 0, 1, 0, 2, 0, 2, 0, + } + }, + ["auto_cenator_inner_r"] = { + ["code3"] = { + 1, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, + 1, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, + 3, 0, 3, 0, 3, 0, 4, 0, 4, 0, 4, 0, + 3, 0, 3, 0, 3, 0, 4, 0, 4, 0, 4, 0, + 5, 0, 5, 0, 5, 0, 6, 0, 6, 0, 6, 0, + 5, 0, 5, 0, 5, 0, 6, 0, 6, 0, 6, 0, + 5, 0, 5, 0, 6, 0, 6, 0, + 5, 0, 5, 0, 6, 0, 6, 0, + 5, 0, 6, 0, + 5, 0, 6, 0, + 1, 0, 1, 0, 2, 0, 2, 0, + 1, 0, 1, 0, 2, 0, 2, 0, + 1, 0, 1, 0, 2, 0, 2, 0, + } + }, + ["auto_cenator_traffic"] = { + ["left"] = { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 0, 0, 0 }, + ["right"] = { 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 0, 0, 0 }, + ["divide"] = { 13, 13, 13, 14, 14, 14, 15, 15, 15, 0, 0, 0 }, + } +} + +COMPONENT.TrafficDisconnect = { + ["auto_cenator_traffic"] = { + 11, 12, 13, 14, 15, 16 + } +} + +COMPONENT.Modes = { + Primary = { + M1 = { + ["auto_cenator"] = "code1", + }, + M2 = { + ["auto_cenator"] = "code2", + }, + M3 = { + ["auto_cenator_corner"] = "code3", + ["auto_cenator_inner_f"] = "code3", + ["auto_cenator_inner_r"] = "code3", + } + }, + Auxiliary = { + L = { + ["auto_cenator_traffic"] = "left", + }, + R = { + ["auto_cenator_traffic"] = "right", + }, + D = { + ["auto_cenator_traffic"] = "divide", + } + }, + Illumination = { + L = { + { 19, W } + }, + R = { + { 20, W } + }, + F = { + { 17, W }, { 18, W } + }, + T = { + { 17, W }, { 18, W } + } + } +} + +EMVU:AddAutoComponent( COMPONENT, name ) \ No newline at end of file diff --git a/lua/autorun/photon/library/auto/whelen_ion_split.lua b/lua/autorun/photon/library/auto/whelen_ion_split.lua index 0e2614f5..c0f9de7e 100644 --- a/lua/autorun/photon/library/auto/whelen_ion_split.lua +++ b/lua/autorun/photon/library/auto/whelen_ion_split.lua @@ -59,6 +59,7 @@ COMPONENT.Sections = { COMPONENT.Patterns = { ["auto_ion"] = { ["code1"] = { 2, 0, 2, 0, 2, 2, 2, 0, 3, 0, 3, 0, 3, 3, 3, 0 }, + ["code1Interior"] = { 2, 0, 2, 0, 2, 2, 2, 0, 3, 0, 3, 0, 3, 3, 3, 0 }, ["code2"] = { 0, 3, 0, 3, 0, @@ -74,15 +75,16 @@ COMPONENT.Patterns = { 3, 3, 0, 2, 2, 3, 3, 0, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, - } + }, + ["code2Interior"] = {0} } } COMPONENT.Modes = { Primary = { - M1 = { ["auto_ion"] = "code1", }, - M2 = { ["auto_ion"] = "code2", }, - M3 = { ["auto_ion"] = "code2", } + M1 = {auto_ion = "code1"}, + M2 = {auto_ion = "code2"}, + M3 = {auto_ion = "code2"} }, Auxiliary = {}, Illumination = {} diff --git a/lua/autorun/photon/library/auto/whelen_ion_split_interior.lua b/lua/autorun/photon/library/auto/whelen_ion_split_interior.lua index 0d20d7f4..05811e64 100644 --- a/lua/autorun/photon/library/auto/whelen_ion_split_interior.lua +++ b/lua/autorun/photon/library/auto/whelen_ion_split_interior.lua @@ -4,6 +4,8 @@ local name = "Whelen Ion Interior Split" local COMPONENT = {} +COMPONENT.Deprecated = "Use the 'Whelen Ion Split' with phase 'Interior'" + COMPONENT.Model = "models/schmal/whelen_ion_interior.mdl" COMPONENT.Skin = 0 COMPONENT.Bodygroups = {} diff --git a/lua/autorun/photon/library/emv_auto.lua b/lua/autorun/photon/library/emv_auto.lua index 0c221670..103bcc42 100644 --- a/lua/autorun/photon/library/emv_auto.lua +++ b/lua/autorun/photon/library/emv_auto.lua @@ -10,6 +10,13 @@ function EMVU:AddAutoComponent(component, name) return end + if component.Deprecated then + PhotonWarning(Format("Component %s is deprecated and may be removed in a future version.", name)) + if isstring(component.Deprecated) then + PhotonWarning(component.Deprecated) + end + end + EMVU.Auto[name] = component end diff --git a/lua/autorun/photon/library/emv_lamps.lua b/lua/autorun/photon/library/emv_lamps.lua deleted file mode 100644 index 66a2015b..00000000 --- a/lua/autorun/photon/library/emv_lamps.lua +++ /dev/null @@ -1,2 +0,0 @@ -AddCSLuaFile() -EMVU.Lamps = {} \ No newline at end of file diff --git a/lua/autorun/photon/library/emv_other.lua b/lua/autorun/photon/library/emv_other.lua new file mode 100644 index 00000000..1005a5fb --- /dev/null +++ b/lua/autorun/photon/library/emv_other.lua @@ -0,0 +1,11 @@ +AddCSLuaFile() + +EMVU.Lamps = {} +EMVU.Patterns = {} +EMVU.LightMeta = {} +EMVU.Positions = {} +EMVU.PresetIndex = {} +EMVU.Props = {} +EMVU.Sections = {} +EMVU.Sequences = {} +EMVU.DisabledRadars = {} \ No newline at end of file diff --git a/lua/autorun/photon/library/emv_patterns.lua b/lua/autorun/photon/library/emv_patterns.lua deleted file mode 100644 index 7d663395..00000000 --- a/lua/autorun/photon/library/emv_patterns.lua +++ /dev/null @@ -1,2 +0,0 @@ -AddCSLuaFile() -EMVU.Patterns = {} \ No newline at end of file diff --git a/lua/autorun/photon/library/emv_position_meta.lua b/lua/autorun/photon/library/emv_position_meta.lua deleted file mode 100644 index b321fc1d..00000000 --- a/lua/autorun/photon/library/emv_position_meta.lua +++ /dev/null @@ -1,2 +0,0 @@ -AddCSLuaFile() -EMVU.LightMeta = {} diff --git a/lua/autorun/photon/library/emv_positions.lua b/lua/autorun/photon/library/emv_positions.lua deleted file mode 100644 index cc1e15dc..00000000 --- a/lua/autorun/photon/library/emv_positions.lua +++ /dev/null @@ -1,2 +0,0 @@ -AddCSLuaFile() -EMVU.Positions = {} diff --git a/lua/autorun/photon/library/emv_presets.lua b/lua/autorun/photon/library/emv_presets.lua deleted file mode 100644 index ce7c07d3..00000000 --- a/lua/autorun/photon/library/emv_presets.lua +++ /dev/null @@ -1,3 +0,0 @@ -AddCSLuaFile() - -EMVU.PresetIndex = {} \ No newline at end of file diff --git a/lua/autorun/photon/library/emv_props.lua b/lua/autorun/photon/library/emv_props.lua deleted file mode 100644 index e074c366..00000000 --- a/lua/autorun/photon/library/emv_props.lua +++ /dev/null @@ -1,2 +0,0 @@ -AddCSLuaFile() -EMVU.Props = {} \ No newline at end of file diff --git a/lua/autorun/photon/library/emv_sections.lua b/lua/autorun/photon/library/emv_sections.lua deleted file mode 100644 index e7b505ad..00000000 --- a/lua/autorun/photon/library/emv_sections.lua +++ /dev/null @@ -1,2 +0,0 @@ -AddCSLuaFile() -EMVU.Sections = {} \ No newline at end of file diff --git a/lua/autorun/photon/library/emv_sequences.lua b/lua/autorun/photon/library/emv_sequences.lua deleted file mode 100644 index 92272621..00000000 --- a/lua/autorun/photon/library/emv_sequences.lua +++ /dev/null @@ -1,3 +0,0 @@ -AddCSLuaFile() - -EMVU.Sequences = {} \ No newline at end of file diff --git a/lua/autorun/photon/library/emv_sirens.lua b/lua/autorun/photon/library/emv_sirens.lua index 1fee5566..7b44f0ba 100644 --- a/lua/autorun/photon/library/emv_sirens.lua +++ b/lua/autorun/photon/library/emv_sirens.lua @@ -123,6 +123,8 @@ local sirenTable = { Set = { {Name = "WAIL", Sound = "emv/sirens/federal sig 80k/emv_wail.wav", Icon="wail"}, {Name = "YELP", Sound = "emv/sirens/federal sig 80k/emv_yelp.wav", Icon="yelp"}, + {Name = "PRTY", Sound = "emv/sirens/federal sig 80k/emv_phaser.wav", Icon="phaser"}, + {Name = "HILO", Sound = "emv/sirens/federal sig 80k/emv_hilo.wav", Icon="hilo"}, }, Manual = "emv/sirens/federal sig 80k/emv_manual.wav", Horn = "emv/sirens/federal sig 80k/emv_horn.wav" @@ -257,6 +259,7 @@ local sirenTable = { {Name = "WAIL", Sound = "emv/sirens/chp/emv_wail.wav", Icon="wail"}, {Name = "YELP", Sound = "emv/sirens/chp/emv_yelp.wav", Icon="yelp"}, }, + Horn = "emv/sirens/chp/emv_horn.wav", }, [26] = { Name = "SQ Zone", @@ -409,14 +412,14 @@ local sirenTable = { Horn = "emv/sirens/federal signal pa 300/emv_horn.wav", }, [43] = { - Name = "Storm Pro", + Name = "Storm", Category = "Feniex", Set = { - {Name = "WAIL", Sound = "emv/sirens/feniex storm pro/emv_wail.wav", Icon="wail"}, - {Name = "YELP", Sound = "emv/sirens/feniex storm pro/emv_yelp.wav", Icon="yelp"}, - {Name = "PHSR", Sound = "emv/sirens/feniex storm pro/emv_phaser.wav", Icon="phaser"}, + {Name = "WAIL", Sound = "emv/sirens/feniex storm/emv_wail.wav", Icon="wail"}, + {Name = "YELP", Sound = "emv/sirens/feniex storm/emv_yelp.wav", Icon="yelp"}, + {Name = "PHSR", Sound = "emv/sirens/feniex storm/emv_phaser.wav", Icon="phaser"}, }, - Horn = "emv/sirens/feniex storm pro/emv_horn.wav", + Horn = "emv/sirens/feniex storm/emv_horn.wav", }, [44] = { Name = "PA640", @@ -481,7 +484,7 @@ local sirenTable = { Set = { {Name = "WAIL", Sound = "emv/sirens/galls street thunder 800/emv_wail.wav", Icon="wail"}, {Name = "YELP", Sound = "emv/sirens/galls street thunder 800/emv_yelp.wav", Icon="yelp"}, - {Name = "PHSR", Sound = "emv/sirens/galls street thunder 800/emv_phaser.wav", Icon="phaser"}, + {Name = "THNDR", Sound = "emv/sirens/galls street thunder 800/emv_thunder.wav", Icon="phaser"}, {Name = "HILO", Sound = "emv/sirens/galls street thunder 800/emv_hilo.wav", Icon = "hilo"}, }, Horn = "emv/sirens/galls street thunder 800/emv_horn.wav", diff --git a/lua/autorun/photon/library/sirens/ancf_d&r_rds17.lua b/lua/autorun/photon/library/sirens/ancf_d&r_rds17.lua index ec0d7b16..4778a6ee 100644 --- a/lua/autorun/photon/library/sirens/ancf_d&r_rds17.lua +++ b/lua/autorun/photon/library/sirens/ancf_d&r_rds17.lua @@ -8,19 +8,22 @@ EMVU.AddCustomSiren("ancf_d&r_rds_17", { Name = "INTER-CLEAR", Sound = "emv/sirens/d&r/rds-17/inter-clear.wav", Icon = "phaser" - }, { + }, + { Name = "WAIL", Sound = "emv/sirens/d&r/rds-17/wail.wav", Icon = "wail" - }, { + }, + { Name = "YELP", Sound = "emv/sirens/d&r/rds-17/yelp.wav", Icon = "yelp" - }, { + }, + { Name = "STINGER", Sound = "emv/sirens/d&r/rds-17/stinger.wav", Icon = "phaser" } }, Horn = "emv/sirens/d&r/rds-17/airhorn.wav" -}) +}) \ No newline at end of file diff --git a/lua/autorun/photon/library/sirens/anemolis_chp_bike.lua b/lua/autorun/photon/library/sirens/anemolis_chp_bike.lua new file mode 100644 index 00000000..764199ab --- /dev/null +++ b/lua/autorun/photon/library/sirens/anemolis_chp_bike.lua @@ -0,0 +1,13 @@ +---Made by: anemolis72 +if not EMVU then return end + +EMVU.AddCustomSiren("chp_bike", { + Name = "Cal. Highway Patrol Bike Siren", + Category = "Other", + Set = { + {Name = "WAIL", Sound = "emv/sirens/chp bike/emv_wail.wav", Icon="wail"}, + {Name = "YELP", Sound = "emv/sirens/chp bike/emv_yelp.wav", Icon="yelp"}, + }, + Horn = "emv/sirens/chp bike/emv_horn.wav", + Volume = 100 +}) \ No newline at end of file diff --git a/lua/autorun/photon/library/sirens/anemolis_whelen_epsilon_alternate.lua b/lua/autorun/photon/library/sirens/anemolis_whelen_epsilon_alternate.lua new file mode 100644 index 00000000..b105b4a0 --- /dev/null +++ b/lua/autorun/photon/library/sirens/anemolis_whelen_epsilon_alternate.lua @@ -0,0 +1,14 @@ +---Made by: anemolis72 +if not EMVU then return end + +EMVU.AddCustomSiren("whelen_epsilon_alternate", { + Name = "Epsilon Alternate", + Category = "Whelen", + Set = { + {Name = "WAIL", Sound = "emv/sirens/whelen epsilon alternate/emv_wail.wav", Icon="wail"}, + {Name = "YELP", Sound = "emv/sirens/whelen epsilon alternate/emv_yelp.wav", Icon="yelp"}, + {Name = "PHASER", Sound = "emv/sirens/whelen epsilon alternate/emv_phaser.wav", Icon="phaser"}, + }, + Horn = "emv/sirens/whelen epsilon alternate/emv_horn.wav", + Volume = 100 +}) \ No newline at end of file diff --git a/lua/autorun/photon/library/sirens/hella_rtk_7.lua b/lua/autorun/photon/library/sirens/hella_rtk_7.lua index e0784065..196fe4b5 100644 --- a/lua/autorun/photon/library/sirens/hella_rtk_7.lua +++ b/lua/autorun/photon/library/sirens/hella_rtk_7.lua @@ -59,7 +59,7 @@ EMVU.AddCustomSiren("hella_rtk_7_fr_police", { Name = "HILO", Sound = "emv/sirens/hella rtk 7/fr_police.wav", Icon = "hilo" - }, + } }, Horn = "emv/sirens/hella rtk 7/horn.wav", Volume = 85 @@ -73,7 +73,7 @@ EMVU.AddCustomSiren("hella_rtk_7_fr_gendarmerie", { Name = "HILO", Sound = "emv/sirens/hella rtk 7/fr_gendarmerie.wav", Icon = "hilo" - }, + } }, Horn = "emv/sirens/hella rtk 7/horn.wav", Volume = 85 @@ -87,7 +87,7 @@ EMVU.AddCustomSiren("hella_rtk_7_fr_firefighter", { Name = "HILO", Sound = "emv/sirens/hella rtk 7/fr_firefighter.wav", Icon = "hilo" - }, + } }, Horn = "emv/sirens/hella rtk 7/horn.wav", Volume = 85 @@ -101,7 +101,7 @@ EMVU.AddCustomSiren("hella_rtk_7_fr_ambulance", { Name = "HILO", Sound = "emv/sirens/hella rtk 7/fr_ambulance.wav", Icon = "hilo" - }, + } }, Horn = "emv/sirens/hella rtk 7/horn.wav", Volume = 85 @@ -116,7 +116,7 @@ EMVU.AddCustomSiren("hella_rtk_7_it_police", { Name = "HILO", Sound = "emv/sirens/hella rtk 7/it_police.wav", Icon = "hilo" - }, + } }, Horn = "emv/sirens/hella rtk 7/horn.wav", Volume = 85 @@ -130,7 +130,7 @@ EMVU.AddCustomSiren("hella_rtk_7_it_firefighter", { Name = "HILO", Sound = "emv/sirens/hella rtk 7/it_firefighter.wav", Icon = "hilo" - }, + } }, Horn = "emv/sirens/hella rtk 7/horn.wav", Volume = 85 @@ -145,7 +145,7 @@ EMVU.AddCustomSiren("hella_rtk_7_nl_twotone", { Name = "HILO", Sound = "emv/sirens/hella rtk 7/nl_twosound.wav", Icon = "hilo" - }, + } }, Horn = "emv/sirens/hella rtk 7/horn.wav", Volume = 85 diff --git a/lua/autorun/photon/library/sirens/sm_premier_hazard_7004.lua b/lua/autorun/photon/library/sirens/sm_premier_hazard_7004.lua index 1de21b11..ebed5bde 100644 --- a/lua/autorun/photon/library/sirens/sm_premier_hazard_7004.lua +++ b/lua/autorun/photon/library/sirens/sm_premier_hazard_7004.lua @@ -23,7 +23,7 @@ local siren = { Name = "HI-LO", Sound = "emv/sirens/premier hazard 7004/hilo.wav", Icon = "hilo" - }, + } }, Horn = "emv/sirens/premier hazard 7004/bullhorn.wav" } diff --git a/lua/autorun/photon/library/sirens/sm_woodway_whelen_cencom.lua b/lua/autorun/photon/library/sirens/sm_woodway_whelen_cencom.lua index 07388fe0..79adb0f9 100644 --- a/lua/autorun/photon/library/sirens/sm_woodway_whelen_cencom.lua +++ b/lua/autorun/photon/library/sirens/sm_woodway_whelen_cencom.lua @@ -18,7 +18,7 @@ local siren = { Name = "PHASER", Sound = "emv/sirens/woodway whelen cencom/priority.wav", Icon = "phaser" - }, + } }, Horn = "emv/sirens/premier hazard 7004/bullhorn.wav" -- uses the same bullhorn } diff --git a/lua/autorun/photon/sh_emv_config.lua b/lua/autorun/photon/sh_emv_config.lua index 9f327aa8..1ff2eeeb 100644 --- a/lua/autorun/photon/sh_emv_config.lua +++ b/lua/autorun/photon/sh_emv_config.lua @@ -8,8 +8,8 @@ PHOTON_BANNED_UNIT_IDS = { ["n1g"] = true } -PHOTON_UPDATE = 73 -PHOTON_SERIES = "Grand Lake" +PHOTON_UPDATE = 74 +PHOTON_SERIES = "Hot Sulphur Springs" --[[ DATATABLE CONFIGURATIONS diff --git a/lua/autorun/photon/sh_emv_helper.lua b/lua/autorun/photon/sh_emv_helper.lua index 6086b970..fc162dfa 100644 --- a/lua/autorun/photon/sh_emv_helper.lua +++ b/lua/autorun/photon/sh_emv_helper.lua @@ -65,23 +65,153 @@ function EMVU.Helper.GetAlertSequence( name, vehicle ) return resultTable end +function EMVU.Helper.GetParkSequence( name, vehicle, resultTable ) + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Park"]["BG_Components"] ) then + local bodygroups = vehicle:GetBodyGroups() -- BodyGroups of vehicle + local bgtable = EMVU.Sequences[name]["Park"]["BG_Components"] -- BodyGroups defined in vehicle specification file + for id,data in pairs( bodygroups ) do -- for index,value in each vehicle bodygroup + local indexId = id - 1 + if bgtable[ data["name"] ] then -- if this index is defined in the vehicle specifications + local selected = vehicle:GetBodygroup( indexId ) + if bgtable[ data["name"] ][ tostring( selected ) ] then + for component,option in pairs( bgtable[ data["name"] ][ tostring( selected ) ] ) do + resultTable[ component ] = option + end + end + end + end + end + + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Park"]["Preset_Components"] ) then + local preset = vehicle:Photon_ELPresetOption() + local ptable = EMVU.Sequences[name]["Park"]["Preset_Components"][preset] + if istable( ptable ) then + for id,data in pairs( ptable ) do + resultTable[ id ] = data + end + end + end + + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Park"]["Selection_Components"]) then + local selComp = EMVU.Sequences[name]["Park"]["Selection_Components"] + for i=1,#selComp do + local currentOption = vehicle:Photon_SelectionOption( i ) + if istable( selComp[i] ) then + local ptable = selComp[i][currentOption] + if istable( ptable ) then + for id,data in pairs( ptable ) do + resultTable[ id ] = data + end + end + end + end + end + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Park"]["Components"]) then + for component, option in pairs( EMVU.Sequences[name]["Park"]["Components"] ) do + resultTable[ component ] = option + end + end + + return resultTable +end + function EMVU.Helper.GetBrakeSequence( name, vehicle, resultTable ) + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Braking"]["BG_Components"] ) then + local bodygroups = vehicle:GetBodyGroups() -- BodyGroups of vehicle + local bgtable = EMVU.Sequences[name]["Braking"]["BG_Components"] -- BodyGroups defined in vehicle specification file + for id,data in pairs( bodygroups ) do -- for index,value in each vehicle bodygroup + local indexId = id - 1 + if bgtable[ data["name"] ] then -- if this index is defined in the vehicle specifications + local selected = vehicle:GetBodygroup( indexId ) + if bgtable[ data["name"] ][ tostring( selected ) ] then + for component,option in pairs( bgtable[ data["name"] ][ tostring( selected ) ] ) do + resultTable[ component ] = option + end + end + end + end + end + + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Braking"]["Preset_Components"] ) then + local preset = vehicle:Photon_ELPresetOption() + local ptable = EMVU.Sequences[name]["Braking"]["Preset_Components"][preset] + if istable( ptable ) then + for id,data in pairs( ptable ) do + resultTable[ id ] = data + end + end + end + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Braking"]["Selection_Components"]) then local selComp = EMVU.Sequences[name]["Braking"]["Selection_Components"] - for i,optionInfo in pairs( selComp ) do + for i=1,#selComp do local currentOption = vehicle:Photon_SelectionOption( i ) if istable( selComp[i] ) then local ptable = selComp[i][currentOption] if istable( ptable ) then for id,data in pairs( ptable ) do - if vehicle.EL.Frames[id] and vehicle.EL.Frames[id][data] then - resultTable[ id ] = data - end + resultTable[ id ] = data end end end end end + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Braking"]["Components"]) then + for component, option in pairs( EMVU.Sequences[name]["Braking"]["Components"] ) do + resultTable[ component ] = option + end + end + + return resultTable +end + +function EMVU.Helper.GetReverseSequence( name, vehicle, resultTable ) + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Reverse"]["BG_Components"] ) then + local bodygroups = vehicle:GetBodyGroups() -- BodyGroups of vehicle + local bgtable = EMVU.Sequences[name]["Reverse"]["BG_Components"] -- BodyGroups defined in vehicle specification file + for id,data in pairs( bodygroups ) do -- for index,value in each vehicle bodygroup + local indexId = id - 1 + if bgtable[ data["name"] ] then -- if this index is defined in the vehicle specifications + local selected = vehicle:GetBodygroup( indexId ) + if bgtable[ data["name"] ][ tostring( selected ) ] then + for component,option in pairs( bgtable[ data["name"] ][ tostring( selected ) ] ) do + resultTable[ component ] = option + end + end + end + end + end + + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Reverse"]["Preset_Components"] ) then + local preset = vehicle:Photon_ELPresetOption() + local ptable = EMVU.Sequences[name]["Reverse"]["Preset_Components"][preset] + if istable( ptable ) then + for id,data in pairs( ptable ) do + resultTable[ id ] = data + end + end + end + + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Reverse"]["Selection_Components"]) then + local selComp = EMVU.Sequences[name]["Reverse"]["Selection_Components"] + for i=1,#selComp do + local currentOption = vehicle:Photon_SelectionOption( i ) + if istable( selComp[i] ) then + local ptable = selComp[i][currentOption] + if istable( ptable ) then + for id,data in pairs( ptable ) do + resultTable[ id ] = data + end + end + end + end + end + if IsValid( vehicle ) and istable( EMVU.Sequences[name]["Reverse"]["Components"]) then + for component, option in pairs( EMVU.Sequences[name]["Reverse"]["Components"] ) do + resultTable[ component ] = option + end + end + return resultTable end @@ -363,10 +493,6 @@ function EMVU.Helper:PulsingLight( speed, min, offset ) return math.Clamp( ( (math.sin( (CurTime() + offset) * speed ) * .5 ) + .5), min, 1 ) end -// function EMVU.Helper:GetProps( name ) -// return EMVU.Props[name] -// end - function EMVU.Helper:GetProps( name, ent ) local results = {} -- ALL ABOUT THAT PRECACHIN if istable( EMVU.Props[name] ) and not ent:Photon_SelectionEnabled() then @@ -441,7 +567,6 @@ function EMVU.Helper:GetProps( name, ent ) end end end - --PrintTable( results ) return results end diff --git a/lua/autorun/photon/sh_emv_init.lua b/lua/autorun/photon/sh_emv_init.lua index acf22e77..06a01f55 100644 --- a/lua/autorun/photon/sh_emv_init.lua +++ b/lua/autorun/photon/sh_emv_init.lua @@ -36,18 +36,11 @@ if SERVER then include( "sv_emv_net.lua" ) end +include( "library/emv_other.lua" ) include( "library/emv_sirens.lua" ) include( "library/emv_colors.lua" ) include( "library/emv_sounds.lua" ) -include( "library/emv_patterns.lua" ) -include( "library/emv_position_meta.lua" ) -include( "library/emv_positions.lua" ) -include( "library/emv_sequences.lua" ) -include( "library/emv_sections.lua" ) -include( "library/emv_props.lua" ) -include( "library/emv_lamps.lua" ) include( "library/emv_auto.lua" ) -include( "library/emv_presets.lua" ) local emvVehicleTable = {} local emvLastScan = 0 diff --git a/lua/autorun/photon/sh_emv_vehicles.lua b/lua/autorun/photon/sh_emv_vehicles.lua index 249b1078..d434b542 100644 --- a/lua/autorun/photon/sh_emv_vehicles.lua +++ b/lua/autorun/photon/sh_emv_vehicles.lua @@ -312,6 +312,12 @@ function EMVU:OverwriteIndex(name, data) if data.Configuration then self:AddSupportedConfiguration(name, data.Configuration) end + + if data.RadarDisabled then + EMVU.DisabledRadars[name] = true + else + EMVU.DisabledRadars[name] = nil + end end --- Mark a vehicle as supporting configs. @@ -373,6 +379,18 @@ function EMVU.LoadModeData( name, data ) } end + if not data["Reverse"] then + data.Reverse = { + Preset_Components = {} + } + end + + if not data["Park"] then + data.Park = { + Preset_Components = {} + } + end + EMVU.Sequences[ name ] = data end @@ -498,6 +516,13 @@ function EMVU:CalculateAuto( name, data, autoInsert ) if not autoData.AutoPatterns or autoData.AutoPatterns != false then autoData.AutoPatterns = true end if not component then print( "[Photon] Auto component: " .. tostring( data[i].ID ) .. " was not found in the library. Requested in: " .. tostring( name ) .. ".") continue end + if component.Deprecated then + PhotonWarning("Auto component: " .. tostring(data[i].ID) .. " is deprecated and may be removed in a future version.") + if isstring(component.Deprecated) then + PhotonWarning(component.Deprecated) + end + PhotonWarning("The component was requested in: " .. tostring(name) .. ".") + end if not component.NotLegacy then adjustAng.p = autoAng.r @@ -549,11 +574,12 @@ function EMVU:CalculateAuto( name, data, autoInsert ) if prop == "H" then resultVal = val * autoScale end if prop == "EmitArray" and istable( val ) then local newArray = {} - for __i,__pos in pairs( val ) do - newArray[__i] = Vector() - newArray[__i]:Set( __pos ) - newArray[__i]:Mul( autoScale ) + for arrayIdx,pos in pairs(val) do + newArray[arrayIdx] = Vector() + newArray[arrayIdx]:Set(pos) + newArray[arrayIdx]:Mul(autoScale) end + resultVal = newArray end EMVU.LightMeta[ name ][ useId ][ prop ] = resultVal end @@ -600,6 +626,17 @@ function EMVU:CalculateAuto( name, data, autoInsert ) if istable( component.Modes.Primary.BRAKE ) then local targetCopy = component.Modes.Primary.BRAKE local sequence = EMVU.Sequences[ name ].Braking + if usesPresets then + for __,presetIndex in pairs( usedPresets ) do + if not sequence.Preset_Components[presetIndex] then sequence.Preset_Components[presetIndex] = {} end + for componentIndex, patternIndex in pairs( targetCopy ) do + local patternPhase = autoData.Phase or "" + if component.Patterns[componentIndex][patternIndex .. patternPhase] then + sequence.Preset_Components[presetIndex][componentIndex .. "_" .. i] = tostring(patternIndex .. patternPhase) + end + end + end + end if usesSelections then if not istable( sequence.Selection_Components ) then sequence.Selection_Components = {} end for _i, selection in pairs( activeSelections ) do @@ -608,7 +645,71 @@ function EMVU:CalculateAuto( name, data, autoInsert ) sequence.Selection_Components[_i][__i] = sequence.Selection_Components[_i][__i] or {} for componentIndex, patternIndex in pairs( targetCopy ) do local patternPhase = autoData.Phase or "" - sequence.Selection_Components[_i][__i][ componentIndex .. "_" .. i ] = tostring( patternIndex .. patternPhase ) + if component.Patterns[componentIndex][patternIndex .. patternPhase] then + sequence.Selection_Components[_i][__i][componentIndex .. "_" .. i] = tostring(patternIndex .. patternPhase) + end + end + end + end + end + end + + if istable( component.Modes.Primary.REVERSE ) then + local targetCopy = component.Modes.Primary.REVERSE + local sequence = EMVU.Sequences[ name ].Reverse + if usesPresets then + for __,presetIndex in pairs( usedPresets ) do + if not sequence.Preset_Components[presetIndex] then sequence.Preset_Components[presetIndex] = {} end + for componentIndex, patternIndex in pairs( targetCopy ) do + local patternPhase = autoData.Phase or "" + if component.Patterns[componentIndex][patternIndex .. patternPhase] then + sequence.Preset_Components[presetIndex][componentIndex .. "_" .. i] = tostring(patternIndex .. patternPhase) + end + end + end + end + if usesSelections then + if not istable( sequence.Selection_Components ) then sequence.Selection_Components = {} end + for _i, selection in pairs( activeSelections ) do + sequence.Selection_Components[_i] = sequence.Selection_Components[_i] or {} + for __i, option in pairs( selection ) do + sequence.Selection_Components[_i][__i] = sequence.Selection_Components[_i][__i] or {} + for componentIndex, patternIndex in pairs( targetCopy ) do + local patternPhase = autoData.Phase or "" + if component.Patterns[componentIndex][patternIndex .. patternPhase] then + sequence.Selection_Components[_i][__i][componentIndex .. "_" .. i] = tostring(patternIndex .. patternPhase) + end + end + end + end + end + end + + if istable( component.Modes.Primary.PARK ) then + local targetCopy = component.Modes.Primary.PARK + local sequence = EMVU.Sequences[ name ].Park + if usesPresets then + for __,presetIndex in pairs( usedPresets ) do + if not sequence.Preset_Components[presetIndex] then sequence.Preset_Components[presetIndex] = {} end + for componentIndex, patternIndex in pairs( targetCopy ) do + local patternPhase = autoData.Phase or "" + if component.Patterns[componentIndex][patternIndex .. patternPhase] then + sequence.Preset_Components[presetIndex][componentIndex .. "_" .. i] = tostring(patternIndex .. patternPhase) + end + end + end + end + if usesSelections then + if not istable( sequence.Selection_Components ) then sequence.Selection_Components = {} end + for _i, selection in pairs( activeSelections ) do + sequence.Selection_Components[_i] = sequence.Selection_Components[_i] or {} + for __i, option in pairs( selection ) do + sequence.Selection_Components[_i][__i] = sequence.Selection_Components[_i][__i] or {} + for componentIndex, patternIndex in pairs( targetCopy ) do + local patternPhase = autoData.Phase or "" + if component.Patterns[componentIndex][patternIndex .. patternPhase] then + sequence.Selection_Components[_i][__i][componentIndex .. "_" .. i] = tostring(patternIndex .. patternPhase) + end end end end diff --git a/lua/autorun/photon/sh_functional.lua b/lua/autorun/photon/sh_functional.lua index c2aa2b8d..a75aa164 100644 --- a/lua/autorun/photon/sh_functional.lua +++ b/lua/autorun/photon/sh_functional.lua @@ -1,6 +1,6 @@ --[[-- Functional Programming / Currying Library. @copyright Photon Team -@release v73 Grand Lake +@release v74 Hot Sulphur Springs @author Joshua Piper @module functional --]]-- diff --git a/lua/autorun/photon/sh_photon_vehicles.lua b/lua/autorun/photon/sh_photon_vehicles.lua index 4e15734b..7ce77f92 100644 --- a/lua/autorun/photon/sh_photon_vehicles.lua +++ b/lua/autorun/photon/sh_photon_vehicles.lua @@ -28,11 +28,6 @@ function Photon:SpawnedVehicle( ent ) end function Photon:EntityCreated( ent ) - -- print( tostring( ent ) ) - -- print( "Valid spawned ent: " .. tostring( IsValid( ent ) ) ) - -- timer.Simple(.5,function() - -- print("After .5 seconds: " .. tostring( ent ) ) - -- end) timer.Simple(.05,function() if ent:IsVehicle() then local timerId = ent:EntIndex() .. "-PHOTON-" .. CurTime() @@ -117,7 +112,7 @@ function Photon:PreloadVehicle( car ) Photon.Vehicles.Positions[ car.Name ] = {} end end - + if car.Photon.Meta and istable( car.Photon.Meta ) then Photon.Vehicles.Meta[ car.Name ] = car.Photon.Meta elseif car.Photon.Meta and isstring( car.Photon.Meta ) then @@ -130,7 +125,7 @@ function Photon:PreloadVehicle( car ) Photon.Vehicles.States.Headlights[ car.Name ] = car.Photon.States.Headlights elseif car.Photon.States.Headlights and isstring( car.Photon.States.Headlights ) then Photon.Vehicles.States.Headlights[ car.Name ] = Photon.Vehicles.States.Headlights[ car.Photon.States.Headlights ] - else + else Photon.Vehicles.States.Headlights[ car.Name ] = {} end @@ -196,7 +191,7 @@ function Photon:OverwriteIndex( name, data ) if not data then return end if data.Positions != nil then Photon.Vehicles.Positions[name] = data.Positions end if data.Meta != nil then Photon.Vehicles.Meta[name] = data.Meta end - if istable( data.States ) then + if istable( data.States ) then if data.States.Headlights != nil then Photon.Vehicles.States.Headlights[name] = data.States.Headlights end if data.States.Brakes != nil then Photon.Vehicles.States.Brakes[name] = data.States.Brakes end if data.States.Blink_Left != nil then Photon.Vehicles.States.Blink_Left[name] = data.States.Blink_Left end @@ -204,9 +199,9 @@ function Photon:OverwriteIndex( name, data ) if data.States.Reverse != nil then Photon.Vehicles.States.Reverse[name] = data.States.Reverse end if data.States.Running != nil then Photon.Vehicles.States.Running[name] = data.States.Running end end - if istable( data.WheelOptions ) then - Photon.Vehicles.WheelOptions[name] = data.WheelOptions - if istable( data.WheelPositions ) then + if istable( data.WheelOptions ) then + Photon.Vehicles.WheelOptions[name] = data.WheelOptions + if istable( data.WheelPositions ) then Photon.Vehicles.WheelPositions[name] = data.WheelPositions else Photon.Vehicles.WheelPositions[name] = { diff --git a/lua/autorun/photon/sh_photon_xml.lua b/lua/autorun/photon/sh_photon_xml.lua index 536f8b1e..775b2bbe 100644 --- a/lua/autorun/photon/sh_photon_xml.lua +++ b/lua/autorun/photon/sh_photon_xml.lua @@ -3,94 +3,54 @@ AddCSLuaFile() Photon.XML = {} local function parseargs(s) - local arg = {} - string.gsub(s, "([%-%w]+)=([\"'])(.-)%2", function (w, _, a) - arg[w] = a - end) - return arg + local arg = {} + string.gsub(s, "([%-%w]+)=([\"'])(.-)%2", function (w, _, a) + arg[w] = a + end) + return arg end - + local function collect(s) - local stack = {} - local top = {} - table.insert(stack, top) - local ni,c,label,xarg, empty - local i, j = 1, 1 - while true do - ni,j,c,label,xarg, empty = string.find(s, "<(%/?)([%w:]+)(.-)(%/?)>", i) - if not ni then break end - local text = string.sub(s, i, ni-1) - if not string.find(text, "^%s*$") then - table.insert(top, text) - end - if empty == "/" then -- empty element tag - table.insert(top, {label=label, xarg=parseargs(xarg), empty=1}) - elseif c == "" then -- start tag - top = {label=label, xarg=parseargs(xarg)} - table.insert(stack, top) -- new level - else -- end tag - local toclose = table.remove(stack) -- remove top - top = stack[#stack] - if #stack < 1 then - error("nothing to close with "..label) - end - if toclose.label ~= label then - error("trying to close "..toclose.label.." with "..label) - end - table.insert(top, toclose) - end - i = j+1 - end - local text = string.sub(s, i) - if not string.find(text, "^%s*$") then - table.insert(stack[#stack], text) - end - if #stack > 1 then - error("unclosed "..stack[#stack].label) - end - return stack[1] + local stack = {} + local top = {} + table.insert(stack, top) + local ni,c,label,xarg, empty + local i, j = 1, 1 + while true do + ni,j,c,label,xarg, empty = string.find(s, "<(%/?)([%w:]+)(.-)(%/?)>", i) + if not ni then break end + local text = string.sub(s, i, ni-1) + if not string.find(text, "^%s*$") then + table.insert(top, text) + end + if empty == "/" then -- empty element tag + table.insert(top, {label=label, xarg=parseargs(xarg), empty=1}) + elseif c == "" then -- start tag + top = {label=label, xarg=parseargs(xarg)} + table.insert(stack, top) -- new level + else -- end tag + local toclose = table.remove(stack) -- remove top + top = stack[#stack] + if #stack < 1 then + error("nothing to close with "..label) + end + if toclose.label ~= label then + error("trying to close "..toclose.label.." with "..label) + end + table.insert(top, toclose) + end + i = j+1 + end + local text = string.sub(s, i) + if not string.find(text, "^%s*$") then + table.insert(stack[#stack], text) + end + if #stack > 1 then + error("unclosed "..stack[#stack].label) + end + return stack[1] end -local xmltest = [[ - - 1 - 5 - - - 0 - 0 - 0 - - - - Dome Light Amber - 1 - - - A - - - - - - - - - - - - - - - - SenCo - Schmal - models/lonewolfie/gmc_savana.mdl - - - -]] - Photon.XML.ParseVehicleFromXML = function( inputXml ) local xt = collect( tostring( inputXml ) ) local emv = {} @@ -174,14 +134,14 @@ Photon.XML.ConvertToXML = function( emv ) %s %s -]], +]], emv.VehicleDefinition.Name or "", emv.Siren or 0, emv.Skin or 0, emv.Color.r or 255, emv.Color.g or 255, emv.Color.b or 255 ) if ( istable( emv.BodyGroups ) ) then - result = result .. + result = result .. [[ ]] for _,bodygroup in pairs( emv.BodyGroups ) do @@ -189,7 +149,7 @@ Photon.XML.ConvertToXML = function( emv ) %s ]], bodygroup[1], bodygroup[2] ) end - result = result .. + result = result .. [[ ]] end @@ -211,11 +171,11 @@ Photon.XML.ConvertToXML = function( emv ) else inputString = string.format( [[ <%s>%s]], k, tostring( v ), k ) end result = result .. inputString .. "\n" end - result = result .. + result = result .. [[ ]] end - result = result .. + result = result .. [[ ]] end @@ -224,7 +184,7 @@ Photon.XML.ConvertToXML = function( emv ) result = result .. [[ ]] - + for key, sys in pairs( emv.Sequences ) do local displayName = "" if key == "Sequences" then displayName = "primary" @@ -256,13 +216,42 @@ Photon.XML.ConvertToXML = function( emv ) return result end -local testemv = Photon.XML.ParseVehicleFromXML( xmltest ) -local back = Photon.XML.ConvertToXML( testemv ) --- print(tostring(back)) --- print( tostring( testemv ) ) --- PrintTable( testemv ) - - --- hook.Add( "PopulateVehicles", "AddEntityContentPhotonListen", function( pnlContent, tree, node ) - --- end ) \ No newline at end of file +--[[local xmltest = [[ + + 1 + 5 + + + 0 + 0 + 0 + + + + Dome Light Amber + 1 + + + A + + + + + + + + + + + + + + + + SenCo + Schmal + models/lonewolfie/gmc_savana.mdl + + + +]]-- \ No newline at end of file diff --git a/lua/autorun/photon/sv_emv_meta.lua b/lua/autorun/photon/sv_emv_meta.lua index ece9ed34..8599e19e 100644 --- a/lua/autorun/photon/sv_emv_meta.lua +++ b/lua/autorun/photon/sv_emv_meta.lua @@ -124,6 +124,7 @@ function EMVU:MakeEMV( ent, emv ) self:ELS_Illuminate( true ) if not self.ELS_Lamps then self.ELS_Lamps = {} end + if not GetConVar("photon_emv_useillum"):GetBool() then return end local lampMode = self:ELS_IlluminateOption() local lamps = EMVU.Helper:GetIlluminationLights( self.Name, lampMode ) for k,l in pairs( lamps ) do @@ -419,7 +420,7 @@ function EMVU:MakeEMV( ent, emv ) function ent:ELS_SetSirenSet( num ) if not IsValid( self ) then return end - if num <= 0 or num > #EMVU.GetSirenTable() then return false end + if num < 0 or num > #EMVU.GetSirenTable() then return false end self:ELS_SirenOff() self:ELS_SirenSet( num ) @@ -472,7 +473,7 @@ function EMVU:MakeEMV( ent, emv ) end end self:SetNW2Bool( "PhotonLE.CAR_MANUAL", false ) - end + end end function ent:ELS_Horn( state ) @@ -498,6 +499,11 @@ function EMVU:MakeEMV( ent, emv ) end end + function ent:ELS_ParkMode(state) + if not IsValid(self) then return end + self:SetNW2Bool("PhotonLE.PARK_MODE", state) + end + function ent:ELS_Blackout( state ) if not IsValid( self ) then return end if self:ELS_NoSiren() then return end @@ -702,7 +708,7 @@ function EMVU:MakeEMV( ent, emv ) if istable( emv.Auto ) and emv.Auto[1] and istable( emv.Presets ) then ent:ELS_PresetOption( 1 ) end - + ent:ELS_SirenOption( 1 ) ent:ELS_LightOption( 1 ) ent:ELS_IlluminateOption ( 1 ) @@ -713,14 +719,4 @@ function EMVU:MakeEMV( ent, emv ) ent:ELS_ManualSiren( false ) ent:Photon_ApplySubMaterials() ent:Photon_ResetSelections() -end - --- concommand.Add("makecaronme", function(ply) --- local ent = ents.Create("prop_vehicle_jeep") --- ent:SetModel( "models/schmal/fpiu/ford_utility.mdl" ) --- ent:SetKeyValue( "vehiclescript", "scripts/vehicles/schmal/ford_pol_int_2016.txt" ) --- ent:SetPos( ply:GetPos() ) --- ent:SetAngles( ply:GetAngles() ) --- ent:Spawn() --- ent:Activate() --- end) \ No newline at end of file +end \ No newline at end of file diff --git a/lua/autorun/photon/sv_emv_net.lua b/lua/autorun/photon/sv_emv_net.lua index 42ec21dd..4b786115 100644 --- a/lua/autorun/photon/sv_emv_net.lua +++ b/lua/autorun/photon/sv_emv_net.lua @@ -110,7 +110,7 @@ function EMVU.Net:SirenSet( ply ) local modifyBlocked = hook.Call( "Photon.CanPlayerModify", GM, ply, emv ) if modifyBlocked != false then if not isAux then - if recv != 0 then emv:ELS_SetSirenSet(recv) end + emv:ELS_SetSirenSet(recv) else emv:ELS_SetAuxSirenSet( recv ) end diff --git a/lua/autorun/photon/sv_photon_hooks.lua b/lua/autorun/photon/sv_photon_hooks.lua index 84477acc..848be627 100644 --- a/lua/autorun/photon/sv_photon_hooks.lua +++ b/lua/autorun/photon/sv_photon_hooks.lua @@ -1,27 +1,32 @@ function Photon:RunningScan() for k,v in pairs( self:AllVehicles() ) do - if IsValid( v ) and IsValid( v:GetDriver() ) and v:GetDriver():IsPlayer() then - - if v:HasPhotonELS() and v.ELS.Blackout then - v:CAR_Running( false ) + if IsValid( v ) and IsValid(v:GetDriver()) and v:GetDriver():IsPlayer() then + local hasELS = v:HasPhotonELS() + if hasELS and v.ELS.Blackout then + v:CAR_Running(false) else - v:CAR_Running( true ) + v:CAR_Running(true) end - if v:IsBraking() then v:CAR_Braking( true ) else v:CAR_Braking( false ) end - if v:IsReversing() then v:CAR_Reversing( true ) else v:CAR_Reversing( false ) end + if v:IsBraking() then v:CAR_Braking(true) else v:CAR_Braking(false) end + if v:IsReversing() then v:CAR_Reversing(true) else v:CAR_Reversing(false) end + if hasELS then v:ELS_ParkMode(false) end v.LastSpeed = v:Photon_GetSpeed() - elseif IsValid( v) and not v:GetDriver():IsValid() and not v:GetDriver():IsPlayer() and not v:GetPhotonLEStayOn() then - v:CAR_Running( false ) - v:CAR_Braking( false ) - v:CAR_Reversing( false ) - if v:HasPhotonELS() then - if v:ELS_Siren() then v:ELS_SirenOff() end - v:ELS_Horn( false ) - v:ELS_ManualSiren( false ) + elseif IsValid(v) and not v:GetDriver():IsValid() and not v:GetDriver():IsPlayer() then + local hasELS = v:HasPhotonELS() + if hasELS then v:ELS_ParkMode(true) end + if not v:GetPhotonLEStayOn() then + v:CAR_Running(false) + v:CAR_Braking(false) + v:CAR_Reversing(false) + if hasELS then + if v:ELS_Siren() then v:ELS_SirenOff() end + v:ELS_Horn(false) + v:ELS_ManualSiren(false) + end end end end @@ -71,7 +76,7 @@ hook.Add( "Photon.CanPlayerModify", "Photon.DefaultModifyCheck", function( ply, local isOwner = ( ent:GetOwner() == ply ) local spawner = ent.PhotonVehicleSpawner local isSpawner = ( IsValid( spawner ) and ( spawner == ply ) ) - if isDriver or ply == owner or game.SinglePlayer() or isSpawner then + if isDriver or ply == isOwner or game.SinglePlayer() or isSpawner then return true else return false diff --git a/lua/autorun/photon/sv_photon_meta.lua b/lua/autorun/photon/sv_photon_meta.lua index cd3fcc8c..8bab9b6a 100644 --- a/lua/autorun/photon/sv_photon_meta.lua +++ b/lua/autorun/photon/sv_photon_meta.lua @@ -93,6 +93,7 @@ function Photon:SetupCar( ent, index ) end function ent:GetPhotonLEStayOn() + if GetConVar("photon_emv_stayon"):GetBool() then return true end return self:GetNW2Bool("PhotonLEStayOn", false) end function ent:SetPhotonLEStayOn(val) diff --git a/lua/autorun/photon/sv_photon_settings.lua b/lua/autorun/photon/sv_photon_settings.lua index 07d3f78b..70dbfe53 100644 --- a/lua/autorun/photon/sv_photon_settings.lua +++ b/lua/autorun/photon/sv_photon_settings.lua @@ -1,5 +1,6 @@ CreateConVar("photon_emv_changesirens", "1", FCVAR_ARCHIVE, "Whether players are permitted to change their siren model or not") CreateConVar("photon_emv_changepresets", "1", FCVAR_ARCHIVE, "Whether players are permitted to change emergency lighting presets") +CreateConVar("photon_emv_stayon", "0", FCVAR_ARCHIVE, "Whether the siren stays on after leaving the vehicle") CreateConVar("photon_emv_unitnumbers", "1", FCVAR_ARCHIVE, "Whether players are permitted to use custom unit numbers") CreateConVar("photon_emv_allowradar", "1", FCVAR_ARCHIVE, "Whether vehicle speed radar is enabled or not") --- CreateConVar("photon_emv_useillum", "1", FCVAR_ARCHIVE, "Whether emergency vehicle illumination should render light") \ No newline at end of file +CreateConVar("photon_emv_useillum", "1", FCVAR_ARCHIVE, "Whether emergency vehicle illumination should render light") diff --git a/materials/models/supermighty/photon/whelen_cenator/cenator.vmt b/materials/models/supermighty/photon/whelen_cenator/cenator.vmt new file mode 100644 index 00000000..c0e40e38 --- /dev/null +++ b/materials/models/supermighty/photon/whelen_cenator/cenator.vmt @@ -0,0 +1,33 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/supermighty/photon/whelen_cenator/cenator" + "$bumpmap" "models/supermighty/photon/shared/skin_nm" + "$translucent" 0 + "$normalmapalphaenvmapmask" 1 + "$nodecal" "1" + + "$phong" 1 + "$phongtint" "[1 1 1]" + "$phongexponent" 120 + "$phongboost" "2" + "$phongfresnelranges" "[.1 .3 .2]" + + "$envmap" "env_cubemap" + "$envmaptint" "[0.3 0.3 0.25]" + "$envmapfresnel" "1" + + "$rimlight" "1" + "$rimlightexponent" "4" + "$rimlightboost" "0.1" +// "$rimmask" "1" + + "$colorfix" "{255 255 255}" + "Proxies" + { + "Equals" + { + srcVar1 $colorfix + resultVar $color + } + } +} \ No newline at end of file diff --git a/materials/models/supermighty/photon/whelen_cenator/cenator.vtf b/materials/models/supermighty/photon/whelen_cenator/cenator.vtf new file mode 100644 index 00000000..5c79cd26 Binary files /dev/null and b/materials/models/supermighty/photon/whelen_cenator/cenator.vtf differ diff --git a/materials/models/supermighty/photon/whelen_cenator/clear_glass.vmt b/materials/models/supermighty/photon/whelen_cenator/clear_glass.vmt new file mode 100644 index 00000000..211d11a5 --- /dev/null +++ b/materials/models/supermighty/photon/whelen_cenator/clear_glass.vmt @@ -0,0 +1,34 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/supermighty/photon/whelen_cenator/clear_glass2" + "$bumpmap" "models/smcars/shared/skin_nm" + + "$translucent" 1 + "$normalmapalphaenvmapmask" 1 + "$nodecal" "1" + + "$phong" 1 + "$phongtint" "[1 1 1]" + "$phongexponent" 120 + "$phongboost" "2" + "$phongfresnelranges" "[.1 .3 .2]" + + "$envmap" "env_cubemap" + "$envmaptint" "[0.3 0.3 0.25]" + "$envmapfresnel" "1" + + "$rimlight" "1" + "$rimlightexponent" "4" + "$rimlightboost" "0.1" +// "$rimmask" "1" + + "$colorfix" "{255 255 255}" + "Proxies" + { + "Equals" + { + srcVar1 $colorfix + resultVar $color + } + } +} \ No newline at end of file diff --git a/materials/models/supermighty/photon/whelen_cenator/clear_glass2.vtf b/materials/models/supermighty/photon/whelen_cenator/clear_glass2.vtf new file mode 100644 index 00000000..8f0fa0fa Binary files /dev/null and b/materials/models/supermighty/photon/whelen_cenator/clear_glass2.vtf differ diff --git a/materials/models/supermighty/photon/whelen_cenator/lb_glass.vmt b/materials/models/supermighty/photon/whelen_cenator/lb_glass.vmt new file mode 100644 index 00000000..941680aa --- /dev/null +++ b/materials/models/supermighty/photon/whelen_cenator/lb_glass.vmt @@ -0,0 +1,34 @@ +"VertexlitGeneric" +{ + "$basetexture" "models/supermighty/photon/whelen_cenator/clear_glass2" + "$bumpmap" "models/smcars/shared/skin_nm" + + "$translucent" 1 + "$normalmapalphaenvmapmask" 1 + "$nodecal" "1" + + "$phong" 1 + "$phongtint" "[1 1 1]" + "$phongexponent" 120 + "$phongboost" "2" + "$phongfresnelranges" "[.1 .3 .2]" + + "$envmap" "env_cubemap" + "$envmaptint" "[0.3 0.3 0.25]" + "$envmapfresnel" "1" + + "$rimlight" "1" + "$rimlightexponent" "4" + "$rimlightboost" "0.1" +// "$rimmask" "1" + + "$colorfix" "{255 255 255}" + "Proxies" + { + "Equals" + { + srcVar1 $colorfix + resultVar $color + } + } +} diff --git a/materials/models/supermighty/photon/whelen_cenator/lb_glass.vtf b/materials/models/supermighty/photon/whelen_cenator/lb_glass.vtf new file mode 100644 index 00000000..2c689563 Binary files /dev/null and b/materials/models/supermighty/photon/whelen_cenator/lb_glass.vtf differ diff --git a/materials/models/supermighty/photon/whelen_cenator/lib2.vmt b/materials/models/supermighty/photon/whelen_cenator/lib2.vmt new file mode 100644 index 00000000..f473aa16 --- /dev/null +++ b/materials/models/supermighty/photon/whelen_cenator/lib2.vmt @@ -0,0 +1,22 @@ +"VertexlitGeneric" +{ + //"$basetexture" "models/smcars/shared/alt_black" + "$basetexture" "models/supermighty/photon/whelen_cenator/lib2" + "$bumpmap" "models/supermighty/photon/shared/skin_nm" +"$nocull" "1" + "$normalmapalphaenvmapmask" 1 + "$phong" "1" + "$phongexponent" "2" + "$phongboost" "0.01" + "$phongfresnelranges" "[1 1 1]" + "$nodecal" "1" + "$colorfix" "{255 255 255}" + "Proxies" + { + "Equals" + { + srcVar1 $colorfix + resultVar $color + } + } +} \ No newline at end of file diff --git a/materials/models/supermighty/photon/whelen_cenator/lib2.vtf b/materials/models/supermighty/photon/whelen_cenator/lib2.vtf new file mode 100644 index 00000000..8bb45d6c Binary files /dev/null and b/materials/models/supermighty/photon/whelen_cenator/lib2.vtf differ diff --git a/materials/models/supermighty/photon/whelen_cenator/lib2_emis.vmt b/materials/models/supermighty/photon/whelen_cenator/lib2_emis.vmt new file mode 100644 index 00000000..f0e66a02 --- /dev/null +++ b/materials/models/supermighty/photon/whelen_cenator/lib2_emis.vmt @@ -0,0 +1,27 @@ +"VertexlitGeneric" +{ + //"$basetexture" "models/smcars/shared/alt_black" + "$basetexture" "models/supermighty/photon/whelen_cenator/lib2" + "$bumpmap" "models/supermighty/photon/shared/skin_nm" +"$nocull" "1" + $surfaceprop "metal" + "$envmap" env_cubemap + "$envmaptint" "[0.005 0.005 0.005]" + "$envmapmasknormalmapalpha" "1" + $phong "1" + $phongexponent "7" + $phongboost "1" + $phongfresnelranges "[.05 .3 1]" + "$alphatest" "1" + "$allowalphatocoverage" "1" + "$carpenisenabled" "1" + Proxies + { + Equals + { + srcVar1 $carpenisenabled + resultVar $color + + } + } +} diff --git a/materials/models/supermighty/photon/whelen_cenator/lib2_nm.vtf b/materials/models/supermighty/photon/whelen_cenator/lib2_nm.vtf new file mode 100644 index 00000000..0d4ae79a Binary files /dev/null and b/materials/models/supermighty/photon/whelen_cenator/lib2_nm.vtf differ diff --git a/materials/models/supermighty/photon/whelen_cenator/liberty_2.vtf b/materials/models/supermighty/photon/whelen_cenator/liberty_2.vtf new file mode 100644 index 00000000..0315fc69 Binary files /dev/null and b/materials/models/supermighty/photon/whelen_cenator/liberty_2.vtf differ diff --git a/materials/models/supermighty/photon/whelen_cenator/linz6.vmt b/materials/models/supermighty/photon/whelen_cenator/linz6.vmt new file mode 100644 index 00000000..ebd551fb --- /dev/null +++ b/materials/models/supermighty/photon/whelen_cenator/linz6.vmt @@ -0,0 +1,27 @@ +"VertexlitGeneric" +{ + //"$basetexture" "models/smcars/shared/alt_black" + "$basetexture" "models/supermighty/photon/whelen_linz6/linz6" + "$bumpmap" "models/supermighty/photon/shared/skin_nm" +"$nocull" "1" + $surfaceprop "metal" + "$envmap" env_cubemap + "$envmaptint" "[0.005 0.005 0.005]" + "$envmapmasknormalmapalpha" "1" + $phong "1" + $phongexponent "7" + $phongboost "1" + $phongfresnelranges "[.05 .3 1]" + "$alphatest" "1" + "$allowalphatocoverage" "1" + "$carpenisenabled" "1" + Proxies + { + Equals + { + srcVar1 $carpenisenabled + resultVar $color + + } + } +} diff --git a/materials/photon/shared/tint_legacy.vmt b/materials/photon/shared/tint_legacy.vmt new file mode 100644 index 00000000..3c633496 --- /dev/null +++ b/materials/photon/shared/tint_legacy.vmt @@ -0,0 +1,7 @@ +"VertexLitGeneric" +{ + "$basetexture" "photon/shared/tint_legacy" + "$bumpmap" "schmal/whelen_legacy/emerglights704_normal" +} + + diff --git a/materials/photon/shared/tint_legacy.vtf b/materials/photon/shared/tint_legacy.vtf new file mode 100644 index 00000000..1181721c Binary files /dev/null and b/materials/photon/shared/tint_legacy.vtf differ diff --git a/materials/photon/shared/tint_lens.vmt b/materials/photon/shared/tint_lens.vmt new file mode 100644 index 00000000..0a2e262c --- /dev/null +++ b/materials/photon/shared/tint_lens.vmt @@ -0,0 +1,25 @@ +"VertexLitGeneric" +{ + "$basetexture" "photon/shared/tint_lens" + //"$bumpmap" "schmal/shared/flat" + "$translucent" 1 + "$halflambert" 1 + "$phong" "1" + "$phongboost" "0" + "$phongfresnelranges" "[1 1 1]" + "$surfaceprop" "Glass" + "$nocull" 1 + "$rimlight" "100" + "$rimlightexponent" "2" + "$rimlightboost" "0.01" + "$rimmask" "0" + + "$envmap" "env_cubemap" + "$envmaptint" "[.5 .5 .5]" + + "$normalmapalphaenvmapmask" 1 + "$envmapFresnel" "1" + + hdr?$envmaptint "[ 2 2 2 ]" + hdr?$envmaptint "[ 1 1 1 ]" +} \ No newline at end of file diff --git a/materials/photon/shared/tint_lens.vtf b/materials/photon/shared/tint_lens.vtf new file mode 100644 index 00000000..db828ef0 Binary files /dev/null and b/materials/photon/shared/tint_lens.vtf differ diff --git a/models/supermighty/photon/whelen_cenator.dx80.vtx b/models/supermighty/photon/whelen_cenator.dx80.vtx new file mode 100644 index 00000000..626d5787 Binary files /dev/null and b/models/supermighty/photon/whelen_cenator.dx80.vtx differ diff --git a/models/supermighty/photon/whelen_cenator.dx90.vtx b/models/supermighty/photon/whelen_cenator.dx90.vtx new file mode 100644 index 00000000..ab953e14 Binary files /dev/null and b/models/supermighty/photon/whelen_cenator.dx90.vtx differ diff --git a/models/supermighty/photon/whelen_cenator.mdl b/models/supermighty/photon/whelen_cenator.mdl new file mode 100644 index 00000000..649fb0d6 Binary files /dev/null and b/models/supermighty/photon/whelen_cenator.mdl differ diff --git a/models/supermighty/photon/whelen_cenator.phy b/models/supermighty/photon/whelen_cenator.phy new file mode 100644 index 00000000..02dfd3e3 Binary files /dev/null and b/models/supermighty/photon/whelen_cenator.phy differ diff --git a/models/supermighty/photon/whelen_cenator.sw.vtx b/models/supermighty/photon/whelen_cenator.sw.vtx new file mode 100644 index 00000000..8b39ebb3 Binary files /dev/null and b/models/supermighty/photon/whelen_cenator.sw.vtx differ diff --git a/models/supermighty/photon/whelen_cenator.vvd b/models/supermighty/photon/whelen_cenator.vvd new file mode 100644 index 00000000..11e2d6ba Binary files /dev/null and b/models/supermighty/photon/whelen_cenator.vvd differ diff --git a/sound/emv/sirens/chp bike/emv_horn.wav b/sound/emv/sirens/chp bike/emv_horn.wav new file mode 100644 index 00000000..8f2be60e Binary files /dev/null and b/sound/emv/sirens/chp bike/emv_horn.wav differ diff --git a/sound/emv/sirens/chp bike/emv_wail.wav b/sound/emv/sirens/chp bike/emv_wail.wav new file mode 100644 index 00000000..787480c4 Binary files /dev/null and b/sound/emv/sirens/chp bike/emv_wail.wav differ diff --git a/sound/emv/sirens/chp bike/emv_yelp.wav b/sound/emv/sirens/chp bike/emv_yelp.wav new file mode 100644 index 00000000..55933d51 Binary files /dev/null and b/sound/emv/sirens/chp bike/emv_yelp.wav differ diff --git a/sound/emv/sirens/chp/emv_horn.wav b/sound/emv/sirens/chp/emv_horn.wav new file mode 100644 index 00000000..8f2be60e Binary files /dev/null and b/sound/emv/sirens/chp/emv_horn.wav differ diff --git a/sound/emv/sirens/federal sig 80k/emv_hilo.wav b/sound/emv/sirens/federal sig 80k/emv_hilo.wav new file mode 100644 index 00000000..f054dae3 Binary files /dev/null and b/sound/emv/sirens/federal sig 80k/emv_hilo.wav differ diff --git a/sound/emv/sirens/federal sig 80k/emv_horn.wav b/sound/emv/sirens/federal sig 80k/emv_horn.wav index 80859ba1..cf298314 100644 Binary files a/sound/emv/sirens/federal sig 80k/emv_horn.wav and b/sound/emv/sirens/federal sig 80k/emv_horn.wav differ diff --git a/sound/emv/sirens/federal sig 80k/emv_manual.wav b/sound/emv/sirens/federal sig 80k/emv_manual.wav index 714e2888..01f02c6d 100644 Binary files a/sound/emv/sirens/federal sig 80k/emv_manual.wav and b/sound/emv/sirens/federal sig 80k/emv_manual.wav differ diff --git a/sound/emv/sirens/federal sig 80k/emv_phaser.wav b/sound/emv/sirens/federal sig 80k/emv_phaser.wav new file mode 100644 index 00000000..4a161fae Binary files /dev/null and b/sound/emv/sirens/federal sig 80k/emv_phaser.wav differ diff --git a/sound/emv/sirens/federal sig 80k/emv_wail.wav b/sound/emv/sirens/federal sig 80k/emv_wail.wav index ccca7fcb..f535368c 100644 Binary files a/sound/emv/sirens/federal sig 80k/emv_wail.wav and b/sound/emv/sirens/federal sig 80k/emv_wail.wav differ diff --git a/sound/emv/sirens/federal sig 80k/emv_yelp.wav b/sound/emv/sirens/federal sig 80k/emv_yelp.wav index 654a2959..2cccf827 100644 Binary files a/sound/emv/sirens/federal sig 80k/emv_yelp.wav and b/sound/emv/sirens/federal sig 80k/emv_yelp.wav differ diff --git a/sound/emv/sirens/feniex storm pro/emv_horn.wav b/sound/emv/sirens/feniex storm/emv_horn.wav similarity index 100% rename from sound/emv/sirens/feniex storm pro/emv_horn.wav rename to sound/emv/sirens/feniex storm/emv_horn.wav diff --git a/sound/emv/sirens/feniex storm pro/emv_phaser.wav b/sound/emv/sirens/feniex storm/emv_phaser.wav similarity index 100% rename from sound/emv/sirens/feniex storm pro/emv_phaser.wav rename to sound/emv/sirens/feniex storm/emv_phaser.wav diff --git a/sound/emv/sirens/feniex storm pro/emv_wail.wav b/sound/emv/sirens/feniex storm/emv_wail.wav similarity index 100% rename from sound/emv/sirens/feniex storm pro/emv_wail.wav rename to sound/emv/sirens/feniex storm/emv_wail.wav diff --git a/sound/emv/sirens/feniex storm pro/emv_yelp.wav b/sound/emv/sirens/feniex storm/emv_yelp.wav similarity index 100% rename from sound/emv/sirens/feniex storm pro/emv_yelp.wav rename to sound/emv/sirens/feniex storm/emv_yelp.wav diff --git a/sound/emv/sirens/french/fr_vsav-ar.wav b/sound/emv/sirens/french/fr_vsav-ar.wav index 2bcecd17..061e641e 100644 Binary files a/sound/emv/sirens/french/fr_vsav-ar.wav and b/sound/emv/sirens/french/fr_vsav-ar.wav differ diff --git a/sound/emv/sirens/galls street thunder 800/emv_phaser.wav b/sound/emv/sirens/galls street thunder 800/emv_phaser.wav deleted file mode 100644 index 8af33de0..00000000 Binary files a/sound/emv/sirens/galls street thunder 800/emv_phaser.wav and /dev/null differ diff --git a/sound/emv/sirens/galls street thunder 800/emv_thunder.wav b/sound/emv/sirens/galls street thunder 800/emv_thunder.wav new file mode 100644 index 00000000..f69fc868 Binary files /dev/null and b/sound/emv/sirens/galls street thunder 800/emv_thunder.wav differ diff --git a/sound/emv/sirens/whelen epsilon alternate/emv_horn.wav b/sound/emv/sirens/whelen epsilon alternate/emv_horn.wav new file mode 100644 index 00000000..f0d79413 Binary files /dev/null and b/sound/emv/sirens/whelen epsilon alternate/emv_horn.wav differ diff --git a/sound/emv/sirens/whelen epsilon alternate/emv_phaser.wav b/sound/emv/sirens/whelen epsilon alternate/emv_phaser.wav new file mode 100644 index 00000000..35bc09f7 Binary files /dev/null and b/sound/emv/sirens/whelen epsilon alternate/emv_phaser.wav differ diff --git a/sound/emv/sirens/whelen epsilon alternate/emv_wail.wav b/sound/emv/sirens/whelen epsilon alternate/emv_wail.wav new file mode 100644 index 00000000..c52c7804 Binary files /dev/null and b/sound/emv/sirens/whelen epsilon alternate/emv_wail.wav differ diff --git a/sound/emv/sirens/whelen epsilon alternate/emv_yelp.wav b/sound/emv/sirens/whelen epsilon alternate/emv_yelp.wav new file mode 100644 index 00000000..2769f76f Binary files /dev/null and b/sound/emv/sirens/whelen epsilon alternate/emv_yelp.wav differ