1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00
Resolved #462 #461 #459 #449
This commit is contained in:
Ilya Krasnow
2022-04-09 23:32:23 +03:00
parent 2bbb67ff9a
commit 1b00a60d7a
8 changed files with 344 additions and 331 deletions

View File

@@ -249,42 +249,50 @@ ENT.ButtonMap["AVU"] = {
}},
}
}
ENT.ClientProps["asotp"] = {
model = "models/metrostroi_train/81-707/asotp.mdl",
model = "models/metrostroi_train/81-707/asotp_new.mdl",
pos = Vector(0,0,0),
ang = Angle(0,0,0),
hideseat = 1,
}
local corr = -1.79
ENT.ButtonMap["ASNP"] = {
pos = Vector(461.42,-35.2,36.4),
ang = Angle(-0.4,-97,90),
width = 115,
height = 60,
pos = Vector(459.616-corr,-34.662-corr-1.30,35.545),
ang = Angle(-.4,264,90),
width = 150,
height = 130,
scale = 0.0625,
hideseat = 0.2,
buttons = {
{ID = "R_ASNPMenuSet",x=58, y=48.5, radius=8, tooltip = "Информатор: Меню",model = {
model = "models/metrostroi_train/81-720/button_round.mdl",
var="R_ASNPMenu",speed=12, vmin=0, vmax=0.9,z=-3,
sndvol = 0.5,snd = function(val) return val and "pnm_button1_on" or "pnm_button1_off" end,
{ID = "R_ASNPMenuSet",x=72.8, y=65.3, radius=8, tooltip = "АСНП: Меню",model = {
model = "models/metrostroi_train/81-710/asotp_pu_menu_button.mdl",
var="R_ASNPMenu",speed=12, vmin=0, vmax=0.7, ang=Angle(0,90,-90), z=-0.1,
sndvol = 0.5,snd = function(val) return val and "pnm_button2_on" or "pnm_button2_on" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPUpSet",x=105, y=14.5, radius=8, tooltip = "Информатор: Вверх",model = {
model = "models/metrostroi_train/81-720/button_round.mdl",
var="R_ASNPUp",speed=12, vmin=0, vmax=0.9,z=-3,
{ID = "R_ASNPUpSet",x=131.8, y=23, radius=8, tooltip = "АСНП: Вверх",model = {
model = "models/metrostroi_train/81-710/asotp_pu_triangle_button.mdl",
var="R_ASNPUp",speed=12, vmin=0, vmax=1, ang=Angle(0,90,-90), z=-3,
sndvol = 0.5,snd = function(val) return val and "pnm_button1_on" or "pnm_button2_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPDownSet",x=105, y=31, radius=8, tooltip = "Информатор: Вниз",model = {
model = "models/metrostroi_train/81-720/button_round.mdl",
var="R_ASNPDown",speed=12, vmin=0, vmax=0.9,z=-3,
{ID = "R_ASNPDownSet",x=131.8, y=41, radius=8, tooltip = "АСНП: Вниз",model = {
model = "models/metrostroi_train/81-710/asotp_pu_triangle_button.mdl",
var="R_ASNPDown",speed=12, vmin=0, vmax=1, ang=Angle(0,90,90), z=-3,
sndvol = 0.5,snd = function(val) return val and "pnm_button2_on" or "pnm_button1_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPOnToggle",x=12, y=18, radius=8, tooltip = "Информатор: Включение",model = {
model = "models/metrostroi_train/81-720/tumbler2.mdl", ang=0, z = -3,
var="R_ASNPOn",speed=12, vmin=1, vmax=0,
{ID = "R_ASNPPathToggle",x=9, y=29, radius=8, tooltip = "АСНП: Установка пути",model = {
model = "models/metrostroi_train/81-710/asotp_pu_track_tumbler.mdl", ang = Angle(0,90,-90), z=-3,
var="R_ASNPPath",speed=12, vmin=1, vmax=0,
sndvol = 0.5,snd = function(val) return val and "pnm_on" or "pnm_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPOnToggle",x=33.5, y=91, radius=25, tooltip = "АСНП: Включение",model = {
model = "models/metrostroi_train/81-710/asotp_pu_power_tumbler.mdl", ang=Angle(0,90,-90), z = -24.5,
var="R_ASNPOn",speed=12, vmin=0, vmax=1,
sndvol = 0.5,snd = function(val) return val and "pnm_on" or "pnm_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
@@ -292,66 +300,75 @@ ENT.ButtonMap["ASNP"] = {
}
ENT.ButtonMap["ASNPScreen"] = {
pos = ENT.ButtonMap["ASNP"].pos+Vector(-0.1,-1.6,-0.85),
ang = Angle(-.4,-97,90),
pos = ENT.ButtonMap["ASNP"].pos+Vector(0.25,-2.03,-1.2),
ang = Angle(-.4,263,90),
width = 512,
height = 128,
scale = 0.008,
scale = 0.025/2.51,
hideseat = 0.2,
hide=true,
}
ENT.ButtonMap["IGLAButtons"] = {
pos = Vector(459.1,-53.7,15.81+1),
ang = Angle(-0,237.1,90),
width = 87,
height = 70,
pos = Vector(415.93,-58.0,28.666),
ang = Angle(-0,180,90),
width = 120,
height = 80,
scale = 0.0625,
hideseat = 0.2,
buttons = {
{ID = "IGLA1USet",x=11, y=39, w=12, h=7, tooltip=""},
{ID = "IGLA1Set",x=11, y=46, w=12, h=7, tooltip=""},
{ID = "IGLA1DSet",x=11, y=53, w=12, h=7, tooltip=""},
{ID = "IGLA2USet",x=65, y=39, w=12, h=7, tooltip=""},
{ID = "IGLA2Set",x=65, y=46, w=12, h=7, tooltip=""},
{ID = "IGLA2DSet",x=65, y=53, w=12, h=7, tooltip=""},
{ID = "!IGLASR",x=17.9, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLASR",color=Color(175,250,20),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-1,}
-- {ID = "IGLA1USet",x=19, y=55.5, w=18, h=7, tooltip=""},
{ID = "IGLA1Set",x=15.3, y=60.2, w=18, h=7, tooltip="", model = {
model = "models/metrostroi_train/81-710/asotp_pu_rect_button.mdl", z=-3, ang=Angle(90,90,180),
var="IGLA1",speed=12,vmin=0,vmax=1,
sndvol = 1, snd = function(val) return val and "vu223_on" or "vu223_off" end,
sndmin = 100, sndmax = 1e3, sndang = Angle(0,0,0),
}},
{ID = "!IGLARX",x=27.5, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLARX",color=Color(255,56,30),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-1,}
-- {ID = "IGLA1DSet",x=19, y=65.5, w=18, h=7, tooltip=""},
-- {ID = "IGLA2USet",x=85, y=55.5, w=18, h=7, tooltip=""},
{ID = "IGLA2Set",x=82.5, y=60.2, w=18, h=7, tooltip="", model = {
model = "models/metrostroi_train/81-710/asotp_pu_rect_button.mdl", z=-3, ang=Angle(90,90,180),
var="IGLA2",speed=12,vmin=0,vmax=1,
sndvol = 1, snd = function(val) return val and "vu223_on" or "vu223_off" end,
sndmin = 100, sndmax = 1e3, sndang = Angle(0,0,0),
}},
{ID = "!IGLAErr",x=40.5, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAErr",color=Color(255,168,000),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,168,000),z=-1,}
-- {ID = "IGLA2DSet",x=85, y=65.5, w=18, h=7, tooltip=""},
{ID = "!IGLASR",x=24.5, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLASR",color=Color(175,250,20),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-5,}
}},
{ID = "!IGLAOSP",x=50, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOSP",color=Color(175,250,20),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-1,}
{ID = "!IGLARX",x=37, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLARX",color=Color(255,56,30),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-5,}
}},
{ID = "!IGLAPI",x=59.5, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAPI",color=Color(255,56,30),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-1,}
{ID = "!IGLAErr",x=54, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAErr",color=Color(255,168,000),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,168,000),z=-5,}
}},
{ID = "!IGLAOff",x=69, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOff",color=Color(255,56,30),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-1,}
{ID = "!IGLAOSP",x=66, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOSP",color=Color(175,250,20),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-5,}
}},
{ID = "!IGLAPI",x=79, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAPI",color=Color(255,56,30),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-5,}
}},
{ID = "!IGLAOff",x=91, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOff",color=Color(255,56,30),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-5,}
}},
}
}
ENT.ButtonMap["IGLA"] = {
pos = ENT.ButtonMap["IGLAButtons"].pos+Vector(-0.30,-0.6,-1.25),
pos = ENT.ButtonMap["IGLAButtons"].pos+Vector(-0.9,-0.32,-1.75),
ang = ENT.ButtonMap["IGLAButtons"].ang,
width = 512,
height = 128,
scale = 0.025/2.7,
scale = 0.025/2.36,
hideseat = 0.2,
hide=true,
}
ENT.ClientProps["E_informator"] = {
model = "models/metrostroi_train/equipment/rri_informator_portable.mdl",
pos = Vector(404.75,-38,-4.2),
@@ -1146,13 +1163,6 @@ ENT.ClientProps["sunprotectors"] = {
hide = 2.0,
}
ENT.ClientProps["asotp"] = {
model = "models/metrostroi_train/81-707/asotp.mdl",
pos = Vector(0,0,1),
ang = Angle(0,0,0),
hide = 2.0,
}
ENT.ClientProps["underwagon"] = {
model = "models/metrostroi_train/81-508/81-508_underwagon.mdl",
pos = Vector(0.2,0,-18),

View File

@@ -544,41 +544,48 @@ ENT.ButtonMap["LampsALS2"] = {
}--]]
ENT.ClientProps["asotp"] = {
model = "models/metrostroi_train/81-707/asotp.mdl",
model = "models/metrostroi_train/81-707/asotp_new.mdl",
pos = Vector(0,0,0),
ang = Angle(0,0,0),
hideseat = 1,
}
local corr = -1.79
ENT.ButtonMap["ASNP"] = {
pos = Vector(461.42,-35.2,35.4),
ang = Angle(-0.4,-97,90),
width = 115,
height = 60,
pos = Vector(459.616-corr,-34.662-corr-1.30,35.545),
ang = Angle(-.4,264,90),
width = 150,
height = 130,
scale = 0.0625,
hideseat = 0.2,
buttons = {
{ID = "R_ASNPMenuSet",x=58, y=48.5, radius=8, tooltip = "Информатор: Меню",model = {
model = "models/metrostroi_train/81-720/button_round.mdl",
var="R_ASNPMenu",speed=12, vmin=0, vmax=0.9,z=-3,
sndvol = 0.5,snd = function(val) return val and "pnm_button1_on" or "pnm_button1_off" end,
{ID = "R_ASNPMenuSet",x=72.8, y=65.3, radius=8, tooltip = "АСНП: Меню",model = {
model = "models/metrostroi_train/81-710/asotp_pu_menu_button.mdl",
var="R_ASNPMenu",speed=12, vmin=0, vmax=0.7, ang=Angle(0,90,-90), z=-0.1,
sndvol = 0.5,snd = function(val) return val and "pnm_button2_on" or "pnm_button2_on" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPUpSet",x=105, y=14.5, radius=8, tooltip = "Информатор: Вверх",model = {
model = "models/metrostroi_train/81-720/button_round.mdl",
var="R_ASNPUp",speed=12, vmin=0, vmax=0.9,z=-3,
{ID = "R_ASNPUpSet",x=131.8, y=23, radius=8, tooltip = "АСНП: Вверх",model = {
model = "models/metrostroi_train/81-710/asotp_pu_triangle_button.mdl",
var="R_ASNPUp",speed=12, vmin=0, vmax=1, ang=Angle(0,90,-90), z=-3,
sndvol = 0.5,snd = function(val) return val and "pnm_button1_on" or "pnm_button2_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPDownSet",x=105, y=31, radius=8, tooltip = "Информатор: Вниз",model = {
model = "models/metrostroi_train/81-720/button_round.mdl",
var="R_ASNPDown",speed=12, vmin=0, vmax=0.9,z=-3,
{ID = "R_ASNPDownSet",x=131.8, y=41, radius=8, tooltip = "АСНП: Вниз",model = {
model = "models/metrostroi_train/81-710/asotp_pu_triangle_button.mdl",
var="R_ASNPDown",speed=12, vmin=0, vmax=1, ang=Angle(0,90,90), z=-3,
sndvol = 0.5,snd = function(val) return val and "pnm_button2_on" or "pnm_button1_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPOnToggle",x=12, y=18, radius=8, tooltip = "Информатор: Включение",model = {
model = "models/metrostroi_train/81-720/tumbler2.mdl", ang=0, z = -3,
var="R_ASNPOn",speed=12, vmin=1, vmax=0,
{ID = "R_ASNPPathToggle",x=9, y=29, radius=8, tooltip = "АСНП: Установка пути",model = {
model = "models/metrostroi_train/81-710/asotp_pu_track_tumbler.mdl", ang = Angle(0,90,-90), z=-3,
var="R_ASNPPath",speed=12, vmin=1, vmax=0,
sndvol = 0.5,snd = function(val) return val and "pnm_on" or "pnm_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPOnToggle",x=33.5, y=91, radius=25, tooltip = "АСНП: Включение",model = {
model = "models/metrostroi_train/81-710/asotp_pu_power_tumbler.mdl", ang=Angle(0,90,-90), z = -24.5,
var="R_ASNPOn",speed=12, vmin=0, vmax=1,
sndvol = 0.5,snd = function(val) return val and "pnm_on" or "pnm_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
@@ -586,62 +593,72 @@ ENT.ButtonMap["ASNP"] = {
}
ENT.ButtonMap["ASNPScreen"] = {
pos = ENT.ButtonMap["ASNP"].pos+Vector(-0.1,-1.6,-0.85),
ang = Angle(-.4,-97,90),
pos = ENT.ButtonMap["ASNP"].pos+Vector(0.25,-2.03,-1.2),
ang = Angle(-.4,263,90),
width = 512,
height = 128,
scale = 0.008,
scale = 0.025/2.51,
hideseat = 0.2,
hide=true,
}
ENT.ButtonMap["IGLAButtons"] = {
pos = Vector(459.1,-53.7,15.81),
ang = Angle(-0,237.1,90),
width = 87,
height = 70,
pos = Vector(415.93,-58.0,28.666),
ang = Angle(-0,180,90),
width = 120,
height = 80,
scale = 0.0625,
hideseat = 0.2,
buttons = {
{ID = "IGLA1USet",x=11, y=39, w=12, h=7, tooltip=""},
{ID = "IGLA1Set",x=11, y=46, w=12, h=7, tooltip=""},
{ID = "IGLA1DSet",x=11, y=53, w=12, h=7, tooltip=""},
{ID = "IGLA2USet",x=65, y=39, w=12, h=7, tooltip=""},
{ID = "IGLA2Set",x=65, y=46, w=12, h=7, tooltip=""},
{ID = "IGLA2DSet",x=65, y=53, w=12, h=7, tooltip=""},
{ID = "!IGLASR",x=17.9, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLASR",color=Color(175,250,20),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-1,}
-- {ID = "IGLA1USet",x=19, y=55.5, w=18, h=7, tooltip=""},
{ID = "IGLA1Set",x=15.3, y=60.2, w=18, h=7, tooltip="", model = {
model = "models/metrostroi_train/81-710/asotp_pu_rect_button.mdl", z=-3, ang=Angle(90,90,180),
var="IGLA1",speed=12,vmin=0,vmax=1,
sndvol = 1, snd = function(val) return val and "vu223_on" or "vu223_off" end,
sndmin = 100, sndmax = 1e3, sndang = Angle(0,0,0),
}},
{ID = "!IGLARX",x=27.5, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLARX",color=Color(255,56,30),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-1,}
-- {ID = "IGLA1DSet",x=19, y=65.5, w=18, h=7, tooltip=""},
-- {ID = "IGLA2USet",x=85, y=55.5, w=18, h=7, tooltip=""},
{ID = "IGLA2Set",x=82.5, y=60.2, w=18, h=7, tooltip="", model = {
model = "models/metrostroi_train/81-710/asotp_pu_rect_button.mdl", z=-3, ang=Angle(90,90,180),
var="IGLA2",speed=12,vmin=0,vmax=1,
sndvol = 1, snd = function(val) return val and "vu223_on" or "vu223_off" end,
sndmin = 100, sndmax = 1e3, sndang = Angle(0,0,0),
}},
{ID = "!IGLAErr",x=40.5, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAErr",color=Color(255,168,000),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,168,000),z=-1,}
-- {ID = "IGLA2DSet",x=85, y=65.5, w=18, h=7, tooltip=""},
{ID = "!IGLASR",x=24.5, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLASR",color=Color(175,250,20),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-5,}
}},
{ID = "!IGLAOSP",x=50, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOSP",color=Color(175,250,20),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-1,}
{ID = "!IGLARX",x=37, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLARX",color=Color(255,56,30),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-5,}
}},
{ID = "!IGLAPI",x=59.5, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAPI",color=Color(255,56,30),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-1,}
{ID = "!IGLAErr",x=54, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAErr",color=Color(255,168,000),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,168,000),z=-5,}
}},
{ID = "!IGLAOff",x=69, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOff",color=Color(255,56,30),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-1,}
{ID = "!IGLAOSP",x=66, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOSP",color=Color(175,250,20),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-5,}
}},
{ID = "!IGLAPI",x=79, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAPI",color=Color(255,56,30),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-5,}
}},
{ID = "!IGLAOff",x=91, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOff",color=Color(255,56,30),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-5,}
}},
}
}
ENT.ButtonMap["IGLA"] = {
pos = ENT.ButtonMap["IGLAButtons"].pos+Vector(-0.30,-0.6,-1.25),
pos = ENT.ButtonMap["IGLAButtons"].pos+Vector(-0.9,-0.32,-1.75),
ang = ENT.ButtonMap["IGLAButtons"].ang,
width = 512,
height = 128,
scale = 0.025/2.7,
scale = 0.025/2.36,
hideseat = 0.2,
hide=true,
@@ -1518,12 +1535,6 @@ ENT.ClientProps["controller_2"] = {
hide = 2.0,
}
ENT.ClientProps["asotp"] = {
model = "models/metrostroi_train/81-707/asotp.mdl",
pos = Vector(0,0,0),
ang = Angle(0,0,0),
hide = 2.0,
}
ENT.ClientProps["underwagon"] = {
model = "models/metrostroi_train/81-508/81-508_underwagon.mdl",
pos = Vector(0.2,0,-18),

View File

@@ -510,36 +510,44 @@ ENT.ButtonMap["AV1"] = {
}},
}
}
local corr = -1.5
ENT.ButtonMap["ASNP"] = {
pos = Vector(462.77,-51.43-1.3,5.85),
ang = Angle(-.4,230,90),
width = 220,
height = 100,
pos = Vector(459.491-corr,-54.762-corr-0.1,8.675),
ang = Angle(-.4,210,90),
width = 150,
height = 130,
scale = 0.0625,
hideseat = 0.2,
buttons = {
{ID = "R_ASNPMenuSet",x=100, y=40, radius=8, tooltip = "Информатор: Меню",model = {
model = "models/metrostroi_train/81-720/button_round.mdl",
var="R_ASNPMenu",speed=12, vmin=0, vmax=0.9,
sndvol = 0.5,snd = function(val) return val and "pnm_button1_on" or "pnm_button1_off" end,
{ID = "R_ASNPMenuSet",x=72.8, y=65.3, radius=8, tooltip = "АСНП: Меню",model = {
model = "models/metrostroi_train/81-710/asotp_pu_menu_button.mdl",
var="R_ASNPMenu",speed=12, vmin=0, vmax=1, ang=Angle(0,90,-90), z=-1,
sndvol = 0.5,snd = function(val) return val and "pnm_button2_on" or "pnm_button2_on" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPUpSet",x=140, y=8, radius=8, tooltip = "Информатор: Вверх",model = {
model = "models/metrostroi_train/81-720/button_round.mdl",
var="R_ASNPUp",speed=12, vmin=0, vmax=0.9,
{ID = "R_ASNPUpSet",x=131.8, y=23, radius=8, tooltip = "АСНП: Вверх",model = {
model = "models/metrostroi_train/81-710/asotp_pu_triangle_button.mdl",
var="R_ASNPUp",speed=12, vmin=0, vmax=1, ang=Angle(0,90,-90), z=-3,
sndvol = 0.5,snd = function(val) return val and "pnm_button1_on" or "pnm_button2_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPDownSet",x=140, y=8+15, radius=8, tooltip = "Информатор: Вниз",model = {
model = "models/metrostroi_train/81-720/button_round.mdl",
var="R_ASNPDown",speed=12, vmin=0, vmax=0.9,
{ID = "R_ASNPDownSet",x=131.8, y=41, radius=8, tooltip = "АСНП: Вниз",model = {
model = "models/metrostroi_train/81-710/asotp_pu_triangle_button.mdl",
var="R_ASNPDown",speed=12, vmin=0, vmax=1, ang=Angle(0,90,90), z=-3,
sndvol = 0.5,snd = function(val) return val and "pnm_button2_on" or "pnm_button1_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPOnToggle",x=52, y=8, radius=8, tooltip = "Информатор: Включение",model = {
model = "models/metrostroi_train/81-720/tumbler2.mdl", ang=0, z = 7,
var="R_ASNPOn",speed=12, vmin=1, vmax=0,
{ID = "R_ASNPPathToggle",x=9, y=29, radius=8, tooltip = "АСНП: Установка пути",model = {
model = "models/metrostroi_train/81-710/asotp_pu_track_tumbler.mdl", ang = Angle(0,90,-90), z=-3,
var="R_ASNPPath",speed=12, vmin=1, vmax=0,
sndvol = 0.5,snd = function(val) return val and "pnm_on" or "pnm_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
{ID = "R_ASNPOnToggle",x=33.5, y=91, radius=25, tooltip = "АСНП: Включение",model = {
model = "models/metrostroi_train/81-710/asotp_pu_power_tumbler.mdl", ang=Angle(0,90,-90), z = -24.5,
var="R_ASNPOn",speed=12, vmin=0, vmax=1,
sndvol = 0.5,snd = function(val) return val and "pnm_on" or "pnm_off" end,
sndmin = 50, sndmax = 1e3, sndang = Angle(-90,0,0),
}},
@@ -547,61 +555,71 @@ ENT.ButtonMap["ASNP"] = {
}
ENT.ButtonMap["ASNPScreen"] = {
pos = Vector(459.77,-54.43-1.3,5.85),
ang = Angle(-.4,230,90),
pos = Vector(459.48,-54.73,7.5),
ang = Angle(0,210,90),
width = 512,
height = 128,
scale = 0.025/3,
scale = 0.025/2.52,
hideseat = 0.2,
hide=true,
}
ENT.ButtonMap["IGLAButtons"] = {
pos = Vector(460.9,-53.3,14),
ang = Angle(-0,229.5,90),
width = 87,
height = 70,
pos = Vector(459.744-corr-0.8,-54.596-corr-0.8,18),
ang = Angle(-0,210,90),
width = 120,
height = 80,
scale = 0.0625,
hideseat = 0.2,
buttons = {
{ID = "IGLA1USet",x=11, y=39, w=12, h=7, tooltip=""},
{ID = "IGLA1Set",x=11, y=46, w=12, h=7, tooltip=""},
{ID = "IGLA1DSet",x=11, y=53, w=12, h=7, tooltip=""},
{ID = "IGLA2USet",x=65, y=39, w=12, h=7, tooltip=""},
{ID = "IGLA2Set",x=65, y=46, w=12, h=7, tooltip=""},
{ID = "IGLA2DSet",x=65, y=53, w=12, h=7, tooltip=""},
{ID = "!IGLASR",x=17.9, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLASR",color=Color(175,250,20),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-1,}
-- {ID = "IGLA1USet",x=19, y=55.5, w=18, h=7, tooltip=""},
{ID = "IGLA1Set",x=15.3, y=60.2, w=18, h=7, tooltip="", model = {
model = "models/metrostroi_train/81-710/asotp_pu_rect_button.mdl", z=-3, ang=Angle(90,90,180),
var="IGLA1",speed=12,vmin=0,vmax=1,
sndvol = 1, snd = function(val) return val and "vu223_on" or "vu223_off" end,
sndmin = 100, sndmax = 1e3, sndang = Angle(0,0,0),
}},
{ID = "!IGLARX",x=27.5, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLARX",color=Color(255,56,30),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-1,}
-- {ID = "IGLA1DSet",x=19, y=65.5, w=18, h=7, tooltip=""},
-- {ID = "IGLA2USet",x=85, y=55.5, w=18, h=7, tooltip=""},
{ID = "IGLA2Set",x=82.5, y=60.2, w=18, h=7, tooltip="", model = {
model = "models/metrostroi_train/81-710/asotp_pu_rect_button.mdl", z=-3, ang=Angle(90,90,180),
var="IGLA2",speed=12,vmin=0,vmax=1,
sndvol = 1, snd = function(val) return val and "vu223_on" or "vu223_off" end,
sndmin = 100, sndmax = 1e3, sndang = Angle(0,0,0),
}},
{ID = "!IGLAErr",x=40.5, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAErr",color=Color(255,168,000),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,168,000),z=-1,}
-- {ID = "IGLA2DSet",x=85, y=65.5, w=18, h=7, tooltip=""},
{ID = "!IGLASR",x=24.5, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLASR",color=Color(175,250,20),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-5,}
}},
{ID = "!IGLAOSP",x=50, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOSP",color=Color(175,250,20),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-1,}
{ID = "!IGLARX",x=37, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLARX",color=Color(255,56,30),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-5,}
}},
{ID = "!IGLAPI",x=59.5, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAPI",color=Color(255,56,30),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-1,}
{ID = "!IGLAErr",x=54, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAErr",color=Color(255,168,000),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,168,000),z=-5,}
}},
{ID = "!IGLAOff",x=69, y=10.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOff",color=Color(255,56,30),z=-2},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-1,}
{ID = "!IGLAOSP",x=66, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOSP",color=Color(175,250,20),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(175,250,20),z=-5,}
}},
{ID = "!IGLAPI",x=79, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAPI",color=Color(255,56,30),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-5,}
}},
{ID = "!IGLAOff",x=91, y=14.5, radius=3, tooltip="", model = {
lamp = {speed=16,model = "models/metrostroi_train/common/lamps/svetodiod2.mdl", var="IGLAOff",color=Color(255,56,30),z=-5},
sprite = {bright=0.5,size=0.25,scale=0.01,color=Color(255,56,30),z=-5,}
}},
}
}
ENT.ButtonMap["IGLA"] = {
pos = Vector(460.5,-53.87,12.67),
ang = Angle(-0,229.5,90),
pos = Vector(459.8,-54.65,16.2),
ang = Angle(-0,210,90),
width = 512,
height = 128,
scale = 0.025/2.96,
scale = 0.025/2.36,
hideseat = 0.2,
hide=true,
}
@@ -1079,7 +1097,7 @@ ENT.ClientProps["rcureverser"] = {
}
ENT.ClientProps["brake_disconnect"] = {
model = "models/metrostroi_train/81-710/ezh3_red_brake.mdl",
pos = Vector(430.7,-58.90,-21.01),
pos = Vector(430.7,-58.8,-21.2),
ang = Angle(0,270,0),
hideseat = 0.2,
}
@@ -1091,7 +1109,7 @@ ENT.ClientProps["train_disconnect"] = {
}
ENT.ClientProps["EPK_disconnect"] = {
model = "models/metrostroi_train/81-710/ezh3_epk.mdl",
pos = Vector(430.7+6.87,-56.30,-28.51),
pos = Vector(430.7+7.17,-56.7,-29.11),
ang = Angle(0,270,0),
hideseat = 0.2,
}
@@ -1185,7 +1203,7 @@ ENT.ClientProps["salon2"] = {
hide = 2.0,
}
ENT.ClientProps["asotp"] = {
model = "models/metrostroi_train/81-710/710_asotp.mdl",
model = "models/metrostroi_train/81-710/710_asotp_new.mdl",
pos = Vector(0,0,0),
ang = Angle(0,0,0),
hideseat = 1.0,

View File

@@ -352,8 +352,8 @@ function ENT:Think()
end
-- Move pedestrian
local speed = 1024
if distance > 1048576--[[1024]] then speed = 2048 end
local speed = 256
if distance > 1048576--[[1024]] then speed = 512 end
v.ent:SetPos(v.ent:GetPos() + targetDir*math.min(threshold,speed*self.DeltaTime))
-- Rotate pedestrian
v.ent:SetAngles(targetDir:Angle() + Angle(0,180,0))

View File

@@ -89,7 +89,7 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter)
--RRI_VV.CabinSpeakerPower = T[13]
else
local ASNP_VV = Train.ASNP_VV
ASNP_VV.Power = BO*Train.R_Radio.Value*Train.R_ASNPOn.Value
ASNP_VV.Power = BO*Train.R_ASNPOn.Value
ASNP_VV.AmplifierPower = ASNP_VV.Power*Train.ASNP.LineOut*Train.R_UNch.Value
ASNP_VV.CabinSpeakerPower = ASNP_VV.Power*Train.ASNP.LineOut*Train.R_G.Value
Train:WriteTrainWire(13,ASNP_VV.AmplifierPower)

View File

@@ -18,6 +18,8 @@ function TRAIN_SYSTEM:Initialize()
"R_Program2",
"R_Program1H",
"R_Program2H",
"R_ASNPPath",
"R_Radio"
--R_Announcer
--R_Line
}
@@ -39,6 +41,7 @@ function TRAIN_SYSTEM:Initialize()
self.Train:LoadSystem("R_ASNPMenu","Relay","Switch",{bass = true })
self.Train:LoadSystem("R_ASNPUp","Relay","Switch",{bass = true })
self.Train:LoadSystem("R_ASNPDown","Relay","Switch",{bass = true })
self.Train:LoadSystem("R_ASNPPath","Relay","Switch",{normally_closed = false, bass = true })
end
self.K1 = 0
self.K2 = 0
@@ -150,17 +153,11 @@ if CLIENT then
return
end
if State == 2 then
local RouteNumber = Format("%02d",Train:GetNW2Int("ASNP:RouteNumber",0))
local RouteNumber = Format("%2d",Train:GetNW2Int("ASNP:RouteNumber",0))
local sel = Train:GetNW2Int("ASNP:Selected",0)
self:PrintText(0,0,"Номер маршрута:")
if sel == 2 then
self:PrintText(4,1,"\"+-\" отм \"MENU\" ввод")
else
self:PrintText(4,1,"\"+-\" выб \"MENU\" след")
end
self:PrintText(0,0,"Выбор N маршрута")
if sel~=0 or RealTime()%1 > 0.5 then self:PrintText(0,1,RouteNumber[1]) end
if sel~=1 or RealTime()%1 > 0.5 then self:PrintText(1,1,RouteNumber[2]) end
self:PrintText(0,1,RouteNumber)
end
local stbl = Metrostroi.ASNPSetup and Metrostroi.ASNPSetup[Train:GetNW2Int("Announcer",1)]
@@ -174,17 +171,18 @@ if CLIENT then
local Line = self.Train:GetNW2Int("ASNP:Line",1)
local ltbl = stbl[Line]
local St,En = ltbl[1],ltbl[#ltbl]
self:PrintText(0,0,ltbl.Loop and "Маршрут (кол)" or "Маршрут")
self:PrintText(20,0,"-")
if RealTime()%0.8 > 0.4 then
self:PrintText(17,0,Format("%03d",St[1]))
self:PrintText(21,0,Format("%03d",En[1]))
end
local timer = math.ceil(RealTime()%6/1.5)
if timer == 1 then self:PrintText(0,1,(ltbl.Name or "Нет названия"))
elseif timer == 2 then self:PrintText(0,1,"От:") self:PrintText(3,1,St[2])
elseif timer == 3 then self:PrintText(0,1,"До:") self:PrintText(3,1,En[2])
elseif timer == 4 then self:PrintText(0,1,"\"+-\" выбор \"MENU\" ввод") end
self:PrintText(0,0,ltbl.Loop and "Выбор линии (кол)" or "Выбор линии -")
-- self:PrintText(20,0,"-")
-- if RealTime()%0.8 > 0.4 then
-- self:PrintText(17,0,Format("%03d",St[1]))
-- self:PrintText(21,0,Format("%03d",En[1]))
-- end
-- local timer = math.ceil(RealTime()%6/1.5)
self:PrintText(0,1,(ltbl.Name or "Нет названия"))
-- if timer == 1 then self:PrintText(0,1,(ltbl.Name or "Нет названия"))
-- elseif timer == 2 then self:PrintText(0,1,"От:") self:PrintText(3,1,St[2])
-- elseif timer == 3 then self:PrintText(0,1,"До:") self:PrintText(3,1,En[2])
-- elseif timer == 4 then self:PrintText(0,1,"\"+-\" выбор \"MENU\" ввод") end
end
if State == 4 then
@@ -198,13 +196,9 @@ if CLIENT then
if RealTime()%0.8 > 0.4 then self:PrintText(18,0,Train:GetNW2Bool("ASNP:Path") and "II" or "I") end
self:PrintText(20,0,"-")
else
local St = ltbl[Train:GetNW2Int("ASNP:FirstStation",1)]
self:PrintText(0,0,"Начальная ст.")
self:PrintText(0,1,St[1]..":"..St[2])
self:PrintText(20,0,"-")
if RealTime()%0.8 > 0.4 then
self:PrintText(17,0,Format("%03d",St[1]))
end
local St = ltbl[Train:GetNW2Int("ASNP:Station",1)]
self:PrintText(0,0,"Текущая станция -")
self:PrintText(0,1,St[2])
end
end
@@ -214,7 +208,7 @@ if CLIENT then
if ltbl.Loop then
local station = Train:GetNW2Int("ASNP:LastStation",1)
local En = ltbl[station]
self:PrintText(0,0,"Конечная ст.")
self:PrintText(0,0,"Конечная станция ")
if station == 0 then
self:PrintText(0,1," ():".."Кольцевой")
else
@@ -222,56 +216,33 @@ if CLIENT then
end
local Path = Train:GetNW2Bool("ASNP:Path") and "II" or "I"
self:PrintText(18,0,Path)
self:PrintText(20,0,"-")
if RealTime()%0.8 > 0.4 then
if En then
self:PrintText(21,0,Format("%03d",En[1]))
else
self:PrintText(22,0,Path)
end
end
-- self:PrintText(20,0,"-")
-- if RealTime()%0.8 > 0.4 then
-- if En then
-- self:PrintText(21,0,Format("%03d",En[1]))
-- else
-- self:PrintText(22,0,Path)
-- end
-- end
else
local St = ltbl[Train:GetNW2Int("ASNP:FirstStation",1)]
local En = ltbl[Train:GetNW2Int("ASNP:LastStation",1)]
self:PrintText(0,0,"Конечная станция")
self:PrintText(0,1,En[1]..":"..En[2])
self:PrintText(20,0,"-")
self:PrintText(17,0,Format("%03d",St[1]))
if RealTime()%0.8 > 0.4 then
self:PrintText(21,0,Format("%03d",En[1]))
end
self:PrintText(0,0,"Выбор ст. оборота -")
self:PrintText(0,1,En[2])
-- self:PrintText(20,0,"-")
-- self:PrintText(17,0,Format("%03d",St[1]))
-- if RealTime()%0.8 > 0.4 then
-- self:PrintText(21,0,Format("%03d",En[1]))
-- end
end
end
if State == 6 then
local Line = Train:GetNW2Int("ASNP:Line",1)
local ltbl = stbl[Line]
local Path = Train:GetNW2Bool("ASNP:Path")
self:PrintText(0,0,"Проверьте данные")
self:PrintText(17,0,Format("%02d",Line))
self:PrintText(20,0,Format("%02d",Train:GetNW2Int("ASNP:RouteNumber",0)))
self:PrintText(23,0,Path and "II" or "I")
if ltbl.Loop then
local station = Train:GetNW2Int("ASNP:LastStation",1)
local En = ltbl[station]
--self:PrintText(20,0,"()")
local timer = math.ceil(RealTime()%4.5/1.5)
if timer == 1 then self:PrintText(0,1,"(кол) "..(ltbl.Name or "Нет названия"))
elseif timer == 2 and station > 0 then self:PrintText(0,1,"До:");self:PrintText(3,1,En[2]);self:PrintText(21,1,tostring(En[1]))
elseif timer == 2 and station == 0 then self:PrintText(0,1,"Без конечной")
elseif timer == 3 then self:PrintText(0,1,"\"+-\" отмена \"MENU\" ок") end
else
local St = ltbl[Train:GetNW2Int("ASNP:FirstStation",1)]
local En = ltbl[Train:GetNW2Int("ASNP:LastStation",1)]
if Path then
local StT = En;En=St;St=StT
end
local timer = math.ceil(RealTime()%6/1.5)
if timer == 1 then self:PrintText(0,1,(ltbl.Name or "Нет названия"))
elseif timer == 2 then self:PrintText(0,1,"От:");self:PrintText(3,1,St[2]);self:PrintText(21,1,tostring(St[1]))
elseif timer == 3 then self:PrintText(0,1,"До:");self:PrintText(3,1,En[2]);self:PrintText(21,1,tostring(En[1]))
elseif timer == 4 then self:PrintText(0,1,"\"+-\" выб \"MENU\" ввод") end
end
local Arrived = Train:GetNW2Bool("ASNP:Arrived")
self:PrintText(0,0,"Выбор приб / отпр")
self:PrintText(0,1,Arrived and "Отпр." or "Приб.")
end
if State == 7 then
local Line = Train:GetNW2Int("ASNP:Line",1)
@@ -295,18 +266,19 @@ if CLIENT then
if Dep then self:PrintText(0,0,"Отпр.") else self:PrintText(0,0,"Приб.") end
self:PrintText(6,0,Station[2])
if Train:GetNW2Bool("ASNP:Playing",false) then
self:PrintText(0,1,"<<< ИДЕТ ОБЪЯВЛЕНИЕ >>>")
self:PrintText(0,1,"<<< ИДЕТ ОБЪЯВЛЕНИЕ >>>")
--elseif Station == En then
-- self:PrintText(0,1,"<<< КОНЕЧАЯ >>>")
else
--self:PrintText(0,1,string.rep("I",Path and 2 or 1))
if Path then
local ezh = Train.SubwayTrain.Name:find("zh")
if not ezh and Path then
self:PrintText(-0.2,1,"I")
self:PrintText( 0.2,1,"I")
else
elseif not ezh then
self:PrintText(0,1,"I")
end
self:PrintText(2,1,string.format("% 2d.",Train:GetNW2Int("ASNP:RouteNumber",0)))
self:PrintText(ezh and 0 or 2,1,string.format("%2d",Train:GetNW2Int("ASNP:RouteNumber",0)))
if ltbl.Loop and Train:GetNW2Int("ASNP:LastStation",1) == 0 then
self:PrintText(6,1,"Кольцевой")
else
@@ -512,7 +484,21 @@ end
function TRAIN_SYSTEM:Trigger(name,value)
local tbl = Metrostroi.ASNPSetup[self.Train:GetNW2Int("Announcer",1)]
if (name == "R_Program2" or name == "R_Program2H") and value then
if name=="R_ASNPPath" then
self.Train.Announcer:Reset()
self.Path = value
self.Arrived = true
self.FirstStation = 1
self.LastStation = self.Path and 1 or #tbl[self.Line]
self.Station = self.Path and #tbl[self.Line] or 1
self.PlayNextArmed = false
return
end
if name:find("R_ASNP") then
self.TriggerButton = value and false or name
self.TriggerButtonTime = value and false or CurTime()
end
if (not self.Train.R_Radio or self.Train.R_Radio.Value>0) and (name == "R_Program2" or name == "R_Program2H") and value then
if self.State ~= 7 and tbl[self.Line] and tbl[self.Line].spec_last then
if self.LineOut>0 then self:AnnQueue{-2,"buzz_end","click2"} end
self:AnnQueue{"click1","buzz_start"}
@@ -556,21 +542,22 @@ function TRAIN_SYSTEM:Trigger(name,value)
end
end
end
if name == "R_Radio" and not value and self.LineOut>0 then
self.Train.Announcer:Reset()
self.PlayNextArmed = false
return
end
if self.State == 1 and name == "R_ASNPMenu" and value then
self.State = 2
self.Selected = 0
-- self.Selected = 0
elseif self.State == 2 and value then
if name == "R_ASNPMenu" then
self.Selected = self.Selected + 1
if self.Selected > 2 then
self.State = 3
end
self.State = 3
end
if (name == "R_ASNPUp" or name == "R_ASNPDown") and self.Selected < 2 then
local sel = 1-self.Selected
local num = Format("%02d",self.RouteNumber)[self.Selected+1]
if name == "R_ASNPUp" then if num == "9" then self.RouteNumber = self.RouteNumber - 10^sel*9 else self.RouteNumber = self.RouteNumber + 10^sel end end
if name == "R_ASNPDown" then if num == "0" then self.RouteNumber = self.RouteNumber + 10^sel*9 else self.RouteNumber = self.RouteNumber - 10^sel end end
if (name == "R_ASNPUp" or name == "R_ASNPDown") then
local num = Format("%02d",self.RouteNumber)
if name == "R_ASNPUp" then self.RouteNumber = tonumber(self.RouteNumber)>=99 and 99 or self.RouteNumber+1 end
if name == "R_ASNPDown" then self.RouteNumber = tonumber(self.RouteNumber)<=0 and 0 or self.RouteNumber-1 end
end
if (name == "R_ASNPUp" or name == "R_ASNPDown") and self.Selected == 2 then self.Selected = 0 end
elseif self.State == 3 and value then
@@ -592,34 +579,19 @@ function TRAIN_SYSTEM:Trigger(name,value)
elseif self.State == 4 and value and not tbl[self.Line].Loop then --Не кольцевой
local stbl = Metrostroi.ASNPSetup[self.Train:GetNW2Int("Announcer",1)][self.Line]
if name == "R_ASNPDown" then
local found = false
for i=self.FirstStation+1,#stbl do
if stbl[i].arrlast then self.FirstStation = i;found=true;break end
end
if not found then
for i=1,#stbl do
if stbl[i].arrlast then self.FirstStation = i;break end
end
end
self.Station = math.min(#stbl,self.Station+1)
end
if name == "R_ASNPUp" then
local found = false
for i=self.FirstStation-1,1,-1 do
if stbl[i].arrlast then self.FirstStation = i;found=true;break end
end
if not found then
for i=#stbl,1,-1 do
if stbl[i].arrlast then self.FirstStation = i;break end
end
end
self.Station = math.max(1,self.Station-1)
end
if name == "R_ASNPMenu" then
self.State = 5
self.LastStation = 1
while stbl[self.LastStation] and not stbl[self.LastStation].arrlast or self.LastStation == self.FirstStation do
self.LastStation = self.LastStation - 1
if self.LastStation < 1 then self.LastStation = #stbl end
end
-- self.LastStation = 1
-- while stbl[self.LastStation] and not stbl[self.LastStation].arrlast or self.LastStation == self.Station do
-- self.LastStation = self.LastStation - 1
-- if self.LastStation < 1 then self.LastStation = #stbl end
-- end
self.FirstStation = self.Path and #stbl or 1
end
elseif self.State == 4 and value and tbl[self.Line].Loop then --Кольцевой
if name == "R_ASNPDown" or name == "R_ASNPUp" then
@@ -633,30 +605,18 @@ function TRAIN_SYSTEM:Trigger(name,value)
elseif self.State == 5 and value and not tbl[self.Line].Loop then --Не кольцевой
local stbl = Metrostroi.ASNPSetup[self.Train:GetNW2Int("Announcer",1)][self.Line]
if name == "R_ASNPDown" then
local found = false
for i=self.LastStation+1,#stbl do
if i ~= self.FirstStation and stbl[i].arrlast then self.LastStation = i;found=true;break end
end
if not found then
for i=1,#stbl do
if i ~= self.FirstStation and stbl[i].arrlast then self.LastStation = i;break end
end
for i=math.min(#stbl,self.LastStation+1),#stbl do
if i ~= self.Station and stbl[i].arrlast then self.LastStation = i;found=true;break end
end
end
if name == "R_ASNPUp" then
local found = false
for i=self.LastStation-1,1,-1 do
if i ~= self.FirstStation and stbl[i].arrlast then self.LastStation = i;found=true;break end
end
if not found then
for i=#stbl,1,-1 do
if i ~= self.FirstStation and stbl[i].arrlast then self.LastStation = i;break end
end
for i=math.max(1,self.LastStation-1),1,-1 do
if i ~= self.Station and stbl[i].arrlast then self.LastStation = i;found=true;break end
end
end
if name == "R_ASNPMenu" then
self.Path = self.FirstStation > self.LastStation
self.Station = self.FirstStation
self.Path = self.Station > self.LastStation
-- self.Station = self.FirstStation
if self.Path then
local first = self.LastStation
self.LastStation = self.FirstStation
@@ -697,20 +657,18 @@ function TRAIN_SYSTEM:Trigger(name,value)
self.Arrived = true
end
elseif self.State == 6 and value then
local stbl = Metrostroi.ASNPSetup[self.Train:GetNW2Int("Announcer",1)][self.Line]
if name == "R_ASNPDown" or name == "R_ASNPUp" then
self.State = 2
self.Selected = 0
self.Arrived = not self.Arrived
end
if name == "R_ASNPMenu" then
if self.FirstStation ~= 0 then
if self.LineOut>0 then self:AnnQueue{-2,"buzz_end","click2"} end
if self.Path then
self:AnnQueue{"click1","buzz_start","announcer_ready",stbl[self.LastStation].arrlast[3],stbl[self.FirstStation].arrlast[3],"buzz_end","click2"}
else
self:AnnQueue{"click1","buzz_start","announcer_ready",stbl[self.FirstStation].arrlast[3],stbl[self.LastStation].arrlast[3],"buzz_end","click2"}
end
end
-- if self.FirstStation ~= 0 then
-- if self.LineOut>0 then self:AnnQueue{-2,"buzz_end","click2"} end
-- if self.Path then
-- self:AnnQueue{"click1","buzz_start","announcer_ready",stbl[self.LastStation].arrlast[3],stbl[self.FirstStation].arrlast[3],"buzz_end","click2"}
-- else
-- self:AnnQueue{"click1","buzz_start","announcer_ready",stbl[self.FirstStation].arrlast[3],stbl[self.LastStation].arrlast[3],"buzz_end","click2"}
-- end
-- end
self.State = 7
self:UpdateBoards()
self:SyncASNP()
@@ -718,19 +676,23 @@ function TRAIN_SYSTEM:Trigger(name,value)
end
elseif self.State == 7 then
local stbl = Metrostroi.ASNPSetup[self.Train:GetNW2Int("Announcer",1)][self.Line]
if name == "R_ASNPMenu" and value then self.ReturnTimer = CurTime() end
if name == "R_ASNPMenu" and not value and self.ReturnTimer and self.ReturnTimer - CurTime() < 0.7 then
self.ReturnTimer = nil
-- if name == "R_ASNPMenu" and value then self.ReturnTimer = CurTime() end
-- if name == "R_ASNPMenu" and not value and self.ReturnTimer and self.ReturnTimer - CurTime() < 0.0 then
-- self.ReturnTimer = nil
-- end
if name == "R_ASNPMenu" and value then
self.State = 2
if self.LineOut>0 then self:AnnQueue{-2,"buzz_end","click2"} end
end
if name == "R_ASNPDown" and value then self:Next() end
if name == "R_ASNPUp" and value then self:Prev() end
if (name == "R_Program1" or name == "R_Program1H") and value then
-- if name == "R_ASNPDown" and value then self:Next() end
-- if name == "R_ASNPUp" and value then self:Prev() end
if (name == "R_Program1" or name == "R_Program1H") and value and (not self.Train.R_Radio or self.Train.R_Radio.Value>0) then
if self.LineOut>0 then self:AnnQueue{-2,"buzz_end","click2"} end
if self.Arrived and self.Station == (self.Path and self.FirstStation or self.LastStation) then
self:Zero()
end
self:Play(self.Arrived)
self:Next()
self.PlayNextArmed = true
end
end
end
@@ -762,7 +724,7 @@ function TRAIN_SYSTEM:Think()
self.ASNPTimer = CurTime()-math.Rand(-0.3,0.3)
end
if self.State == -1 and self.ASNPTimer and CurTime()-self.ASNPTimer > 1 then
self.State = Metrostroi.ASNPSetup and #Metrostroi.ASNPSetup > 0 and 1 or -2
self.State = Metrostroi.ASNPSetup and #Metrostroi.ASNPSetup > 0 and 7 or -2
end
if Power and self.State > -1 then
for k,v in pairs(self.TriggerNames) do
@@ -781,13 +743,22 @@ function TRAIN_SYSTEM:Think()
if self.PassSchemeWork then self:UpdateBoards() end
end
if self.ReturnTimer and CurTime()-self.ReturnTimer > 0.7 then
if self.State == 7 then
self.State = 6
if self.LineOut>0 then self:AnnQueue{-2,"buzz_end","click2"} end
end
self.ReturnTimer = nil
local LineOut = #Train.Announcer.Schedule>0 and 1 or 0
if self.PlayNextArmed and self.LineOut~=LineOut and self.LineOut==1 and LineOut==0 then
self:Next()
end
if self.TriggerButton and CurTime()>self.TriggerButtonTime+0.2 and Train[self.TriggerButton].Value>0 then
self:Trigger(self.TriggerButton,true)
end
-- if self.ReturnTimer and CurTime()-self.ReturnTimer > 0.7 then
-- if self.State == 7 then
-- self.State = 6
-- if self.LineOut>0 then self:AnnQueue{-2,"buzz_end","click2"} end
-- end
-- self.ReturnTimer = nil
-- end
Train:SetNW2Int("ASNP:State",self.State)
Train:SetNW2Int("ASNP:RouteNumber",self.RouteNumber)
@@ -799,7 +770,7 @@ function TRAIN_SYSTEM:Think()
Train:SetNW2Bool("ASNP:Station",self.Station)
Train:SetNW2Bool("ASNP:Arrived",self.Arrived)
self.LineOut = #Train.Announcer.Schedule>0 and 1 or 0
self.LineOut = LineOut
Train:SetNW2Bool("ASNP:Playing",self.LineOut>0)
if Train.VBD and self.State>0 then
Train:SetNW2Bool("ASNP:CanLocked",true)

View File

@@ -420,7 +420,7 @@ else
self.Error = CurTime()%0.5 > 0.25
elseif self.State == 2 then
if #self.Log > 100 then table.remove(self.Log,1) end
local Standby = CurTime()-self.StandbyTimer > 10
local Standby = CurTime()-self.StandbyTimer > 60
if self.State2 > 0 and Standby then self.State2 = 0 end
if self.ShowTimeTimer and self.ShowTimeTimer ~= true and CurTime()-self.ShowTimeTimer > 1.5 then
self.ShowTime = not self.ShowTime

View File

@@ -115,7 +115,7 @@ if CLIENT then
local Train = self.Train
local State = self.Train:GetNW2Int("IGLA:State",0)
if State > -2 then
surface.SetDrawColor(81,223,0,self.Warm and 100 or 255)
surface.SetDrawColor(140,190,0,self.Warm and 130 or 255)
surface.DrawRect(0,0,512,80)
self.Warm = true
else
@@ -136,8 +136,8 @@ if CLIENT then
end
if State2 == 0 then
--self:PrintText(0,"")
self:PrintText(0,Format("[%03d]",Train:GetNW2Int("IGLA:Messages")))
self:PrintText(7,"ПЦБК-"..Train:GetNW2Int("IGLA:Count",0))
self:PrintText(2,Format("[%03d]",Train:GetNW2Int("IGLA:Messages")))
self:PrintText(8,"ПЦБК-"..Train:GetNW2Int("IGLA:Count",0))
elseif State2 == 1 then
local w = Train:GetNW2Int("IGLA:WagNumber")
local m = Train:GetNW2String("IGLA:LogID")
@@ -246,7 +246,7 @@ else
function TRAIN_SYSTEM:Trigger(name,value)
if self.State == 2 then
if self.State2 == 0 then
if name == "IGLA2D" and value and #self.Log > 0 then
if name == "IGLA1" and value and #self.Log > 0 then
self.State2 = 1
self.StandbyTimer = CurTime()
self.Selected = #self.Log
@@ -256,9 +256,12 @@ else
self.StandbyTimer = CurTime()
self.Selected = #self.Messages
end
if name =="IGLA2" and value then
self.State = -2
end
elseif self.State2 == 1 then
self.StandbyTimer = CurTime()
if name == "IGLA2D" and value and self.Selected > 1 then
if name == "IGLA1" and value and self.Selected > 1 then
self.Selected = self.Selected - 1
end
if name == "IGLA2" and value then