Forgot staged files
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
-- @name Ford Mustang GT 2015
|
||||
-- @author Opti1337, DarkSupah
|
||||
-- @include /koptilnya/mesh_loader/builder.txt
|
||||
-- @include /koptilnya/car_systems/lights_controller.txt
|
||||
require("/koptilnya/mesh_loader/builder.txt")
|
||||
require("/koptilnya/car_systems/lights_controller.txt")
|
||||
|
||||
DEBUG_MODE = true
|
||||
|
||||
@@ -23,7 +25,8 @@ local MATERIALS = {
|
||||
MirrorsAndExhaust = "models/debug/debugwhite",
|
||||
Lights = "models/debug/debugwhite",
|
||||
Glass = "phoenix_storms/glass",
|
||||
ExteriorDetails2 = "models/debug/debugwhite"
|
||||
ExteriorDetails2 = "models/debug/debugwhite",
|
||||
LightsBase = "models/debug/debugwhite"
|
||||
}
|
||||
local COLORS = {
|
||||
Interior = Color(40, 40, 40),
|
||||
@@ -40,14 +43,20 @@ local COLORS = {
|
||||
MirrorsAndExhaust = Color(255, 255, 255),
|
||||
Lights = Color(255, 255, 255),
|
||||
Glass = Color(255, 255, 255),
|
||||
ExteriorDetails2 = Color(130, 130, 130)
|
||||
ExteriorDetails2 = Color(130, 130, 130),
|
||||
LightsBase = Color(255, 255, 255)
|
||||
}
|
||||
|
||||
local builder = {}
|
||||
local lightsController = {}
|
||||
|
||||
if SERVER then
|
||||
builder = MeshBuilder:new(LINK)
|
||||
|
||||
builder.onObjectParsed = function(builder, objectsNames)
|
||||
printTable(objectsNames)
|
||||
end
|
||||
|
||||
|
||||
builder:build("Interior_body1_model0", Vector(0), Angle(0), SCALE, COLORS.Interior, MATERIALS.Interior, chip(), chip())
|
||||
builder:build("Torpedo_body1_model0.001", Vector(0), Angle(0), SCALE, COLORS.Torpedo, MATERIALS.Torpedo, chip(), chip())
|
||||
builder:build("Seats_body1_model0.002", Vector(0), Angle(0), SCALE, COLORS.Seats, MATERIALS.Seats, chip(), chip())
|
||||
@@ -63,13 +72,50 @@ if SERVER then
|
||||
builder:build("Lights_body1_model0.012", Vector(0), Angle(0), SCALE, COLORS.Lights, MATERIALS.Lights, chip(), chip())
|
||||
builder:build("Glass_body1_model0.013", Vector(0), Angle(0), SCALE, COLORS.Glass, MATERIALS.Glass, chip(), chip())
|
||||
builder:build("ExteriorDetails_body1_model0.014", Vector(0), Angle(0), SCALE, COLORS.ExteriorDetails, MATERIALS.ExteriorDetails, chip(), chip())
|
||||
|
||||
local result = builder:getResult()
|
||||
builder:build("DoorPanels_body1_model0.003", Vector(0), Angle(0), SCALE, COLORS.Interior, MATERIALS.Interior, chip(), chip())
|
||||
|
||||
-- Lights
|
||||
local StopLights = builder:build("StopLights_body1_model0.016", Vector(0), Angle(0), SCALE, COLORS.LightsBase, MATERIALS.LightsBase, chip(), chip())
|
||||
local ReverseLights = builder:build("ReverseLight_body1_model0.015", Vector(0), Angle(0), SCALE, COLORS.LightsBase, MATERIALS.LightsBase, chip(), chip())
|
||||
local LowBeamLights = builder:build("LowBeamLights_body1_model0.006", Vector(0), Angle(0), SCALE, COLORS.LightsBase, MATERIALS.LightsBase, chip(), chip())
|
||||
local HighBeamLights = builder:build("HighBeamLights_body1_model0.017", Vector(0), Angle(0), SCALE, COLORS.LightsBase, MATERIALS.LightsBase, chip(), chip())
|
||||
local FogLights = builder:build("FogLights_body1_model0.018", Vector(0), Angle(0), SCALE, COLORS.LightsBase, MATERIALS.LightsBase, chip(), chip())
|
||||
|
||||
local result = builder:getResult()
|
||||
|
||||
local lights = {
|
||||
StopLights = {Entities = {StopLights}, LerpSpeed = 0.2, Colors = {On = Color(250, 0, 0), Off = Color(30, 0, 0), Active = Color(90, 0, 0)}},
|
||||
ReverseLights = {Entities = {ReverseLights}, LerpSpeed = 0.1, Colors = {On = Color(255, 255, 255), Off = Color(20, 20, 20)}},
|
||||
LowBeamLights = {Entities = {LowBeamLights}, LerpSpeed = 0.1, Colors = {On = Color(255, 255, 255), Off = Color(20, 20, 20)}},
|
||||
HighBeamLights = {Entities = {HighBeamLights}, LerpSpeed = 0.1, Colors = {On = Color(255, 255, 255), Off = Color(20, 20, 20)}},
|
||||
FogLights = {Entities = {FogLights}, LerpSpeed = 0.1, Colors = {On = Color(255, 255, 255), Off = Color(20, 20, 20)}}
|
||||
}
|
||||
|
||||
-- local lightsEntities = {StopLights = {StopLights}, ReverseLights = {ReverseLights}, LowBeamLights = {LowBeamLights}, HighBeamLights = {HighBeamLights}}
|
||||
-- local lightColors = {StopLights = {On = Color(250, 0, 0), Off = Color(30, 0, 0), Active = Color(90, 0, 0)}, ReverseLights = {On = Color(255, 255, 255), Off = Color(20, 20, 20), Active = Color(20, 20, 20)}}
|
||||
-- local lights = {Lights = lightsEntities, Colors = lightColors}
|
||||
|
||||
lightsController = LightsController:new(lights)
|
||||
|
||||
wire.adjustPorts({LightInputs = "table"}, {})
|
||||
|
||||
hook.add("think", "lights", function()
|
||||
lightsController:useStopLights(wire.ports.LightInputs.Stop)
|
||||
lightsController:useReverseLights(wire.ports.LightInputs.Reverse)
|
||||
lightsController:useLowBeam(wire.ports.LightInputs.LowBeam)
|
||||
lightsController:useHighBeam(wire.ports.LightInputs.HighBeam)
|
||||
|
||||
lightsController:setActive(wire.ports.LightInputs.LowBeam == 1)
|
||||
|
||||
lightsController:update()
|
||||
end
|
||||
)
|
||||
else
|
||||
function init()
|
||||
builder = MeshBuilder:new(LINK)
|
||||
end
|
||||
|
||||
|
||||
if hasPermission("http.get") and hasPermission("mesh") and hasPermission("entities.setRenderProperty", chip()) then
|
||||
init()
|
||||
else
|
||||
@@ -79,6 +125,7 @@ else
|
||||
if permissionRequestSatisfied() then
|
||||
init()
|
||||
end
|
||||
end)
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user