1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Fix have_inrerchange (#346)

This commit is contained in:
Hellss
2021-08-10 00:54:54 +03:00
committed by GitHub
parent 54e10bc40b
commit 41f81c0ad5
7 changed files with 47 additions and 33 deletions

View File

@@ -190,6 +190,13 @@ Metrostroi.AnnouncementsASNP = {}
Metrostroi.ASNPSetup = {}
function Metrostroi.AddANSPAnnouncer(name,soundtable,datatable)
if not soundtable or not datatable then return end
for k,v in pairs(datatable) do
if not istable(v) then continue end
for k2,stbl in pairs(v) do
if not istable(stbl) then continue end
if stbl.have_inrerchange then stbl.have_interchange = true end
end
end
for k,v in pairs(Metrostroi.AnnouncementsASNP) do
if v.name == name then
Metrostroi.AnnouncementsASNP[k] = soundtable
@@ -251,6 +258,13 @@ Metrostroi.RRISetup = {}
function Metrostroi.SetRRIAnnouncer(soundtable,datatable)
if not soundtable or not datatable then return end
Metrostroi.AnnouncementsRRI = {soundtable}
for k,v in pairs(datatable) do
if not istable(v) then continue end
for k2,stbl in pairs(v) do
if not istable(stbl) then continue end
if stbl.have_inrerchange then stbl.have_interchange = true end
end
end
Metrostroi.RRISetup = datatable
print("Metrostroi: Set RRI announcer.")

View File

@@ -196,7 +196,7 @@ Metrostroi.SetRRIAnnouncer({
dep = {{ "next_elektrosila"}, { "next_novoarmeyskaya",0.1,"handrails"}},
arrlast = {{"arr_komsomolskaya", 0.5, "last"}, {"arr_komsomolskaya", 0.5, "last"}, "komsomolskaya"},
not_last = {3, "to_komsomolskaya"},
have_inrerchange = true
have_interchange = true
},
{
116,"Elektrosila",
@@ -282,7 +282,7 @@ Metrostroi.SetRRIAnnouncer({
dep = {{ "next_elektrosila"}, { "next_novoarmeyskaya",0.1,"handrails"}},
arrlast = {{"arr_komsomolskaya", 0.5, "last"}, {"arr_komsomolskaya", 0.5, "last"}, "komsomolskaya"},
not_last = {3, "to_komsomolskaya"},
have_inrerchange = true
have_interchange = true
},
{
116,"Elektrosila",
@@ -508,7 +508,7 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
not_last = {3, "train_goes_to_m", "komsomolskaya_m"},
not_last_f = {3, "to_komsomolskaya_f"},
not_last_c = {"not_last_f"},spec_last_c = {"spec_last_f"}, spec_wait_c = {"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
right_doors=true,
},
{
@@ -632,7 +632,7 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
not_last = {3, "train_goes_to_m", "komsomolskaya_m"},
not_last_f = {3, "to_komsomolskaya_f"},
not_last_c = {"not_last_f"},spec_last_c = {"spec_last_f"}, spec_wait_c = {"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
right_doors=true,
},
{
@@ -877,7 +877,7 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
not_last = {3, "train_goes_to_m", "komsomolskaya_m"},
not_last_f = {3, "to_komsomolskaya_f"},
not_last_c = {"not_last_f"},spec_last_c = {"spec_last_f"}, spec_wait_c = {"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
right_doors=true,
},
{
@@ -1001,7 +1001,7 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
not_last = {3, "train_goes_to_m", "komsomolskaya_m"},
not_last_f = {3, "to_komsomolskaya_f"},
not_last_c = {"not_last_f"},spec_last_c = {"spec_last_f"}, spec_wait_c = {"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
right_doors=true,
},
{

View File

@@ -168,7 +168,7 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
arr = {{"station_m","politehnicheskaya_arr_m",0.2,"things_m"},{"arr_politehnicheskaya_f",0.2,"objects_f"}},
dep = {{"doors_closing_m","prospekt_suvorova_m"},{"doors_closing_f","next_park_kultury_f"}},
not_last_c = {nil,"not_last_f"},
have_inrerchange = true,
have_interchange = true,
right_doors=true,
},
{
@@ -364,7 +364,7 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
arr = {{"station_m","politehnicheskaya_arr_m",0.2,"things_m"},{"arr_politehnicheskaya_f",0.2,"objects_f"}},
dep = {{"doors_closing_m","prospekt_suvorova_m"},{"doors_closing_f","next_park_kultury_f"}},
not_last_c = {nil,"not_last_f"},
have_inrerchange = true,
have_interchange = true,
right_doors=true,
},
{

View File

@@ -272,14 +272,14 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
652,"Парк",
arr = {{"station_m","park_arr_m",0.1,"things_m"},{"arr_park_f",0.1,"objects_f"}},
dep = {{"doors_closing_m","metrostroiteley_next_m"},{"doors_closing_f","next_pervoaprelskaya_f"}},
have_inrerchange = true,
have_interchange = true,
},]]
{
653,"Метростроителей","Metrostroiteley",
arr = {{"station_m","metrostroiteley_arr_m",0.1,"objects_m"},{"arr_metrostroiteley_f","skip_park_f",0.1,"things_f"}},
dep = {{"doors_closing_m","morskaya_m"},{"doors_closing_f","next_pervoaprelskaya_f"}},
not_last_c = {nil, "not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
},
{
654,"Морская","Marine",
@@ -298,7 +298,7 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
not_last = {3,"train_goes_to_m","slavnaya_strana_next_m"},
not_last_f = {3,"to_slavnaya_strana_f"},
not_last_c = {nil, "not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
},
{
656,"Пионерская","Pionerskaya",
@@ -308,7 +308,7 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
not_last = {3,"train_goes_to_m","pionerskaya_next_m"},
not_last_f = {3,"to_pionerskaya_f"},
not_last_c = {nil, "not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
},
},
})
@@ -403,14 +403,14 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
652,"Парк",
arr = {{"station_m","park_arr_m",0.1,"things_m"},{"arr_park_f",0.1,"objects_f"}},
dep = {{"doors_closing_m","metrostroiteley_next_m"},{"doors_closing_f","next_pervoaprelskaya_f"}},
have_inrerchange = true,
have_interchange = true,
},]]
{
653,"Метростроителей","Metrostroiteley",
arr = {{"station_m","metrostroiteley_arr_m",0.1,"objects_m"},{"arr_metrostroiteley_f","skip_park_f",0.1,"things_f"}},
dep = {{"doors_closing_m","morskaya_m"},{"doors_closing_f","next_pervoaprelskaya_f"}},
not_last_c = {nil, "not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
},
{
654,"Морская","Marine",
@@ -429,7 +429,7 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
not_last = {3,"train_goes_to_m","slavnaya_strana_next_m"},
not_last_f = {3,"to_slavnaya_strana_f"},
not_last_c = {nil, "not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
},
{
656,"Пионерская","Pionerskaya",
@@ -439,7 +439,7 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
not_last = {3,"train_goes_to_m","pionerskaya_next_m"},
not_last_f = {3,"to_pionerskaya_f"},
not_last_c = {nil, "not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
},
},
})
@@ -491,7 +491,7 @@ Metrostroi.SetRRIAnnouncer({
653,"Метростроителей","Metrostroiteley",
arr = {{"arr_metrostroiteley",0.1,"objects"},{"arr_metrostroiteley","skip_park",0.1,"things"}},
dep = {{"next_morskaya"},{"next_pervoaprelskaya"}},
have_inrerchange = true,
have_interchange = true,
},
{
654,"Морская","Marine",
@@ -506,7 +506,7 @@ Metrostroi.SetRRIAnnouncer({
dep = {{"next_pionerskaya"},{"next_morskaya"}},
arrlast = {nil,{"arr_slavnaya_strana",0.5,"last",2,"things",2,"deadlock"}},
not_last = {3,"to_slavnaya_strana"},
have_inrerchange = true,
have_interchange = true,
},
{
656,"Пионерская","Pionerskaya",
@@ -514,7 +514,7 @@ Metrostroi.SetRRIAnnouncer({
dep = {{"next_pervoaprelskaya"},{"next_slavnaya_strana"}},
arrlast = {{"arr_pionerskaya",0.5,"last",2,"things",2,"deadlock"},{"arr_pionerskaya",0.5,"last",2,"things",2,"deadlock"}},
not_last = {3,"to_pionerskaya"},
have_inrerchange = true,
have_interchange = true,
},
},
})

View File

@@ -428,7 +428,7 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
arr = {{"station_m","slavnaya_strana_arr_m"}, "arr_slavnaya_strana_f"},
dep = {{"doors_closing_m","litiyevaya_next_m",0.1,"politeness_m"}, {"doors_closing_f","next_aeroport_f"}},
not_last_c = {nil,"not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true
have_interchange = true
},
{
--male<->female
@@ -436,7 +436,7 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
arr = {{"station_m","litiyevaya_arr_m"}, {"station_m","litiyevaya_arr_m"}},
dep = {{"doors_closing_f","next_arsenal_f"}, {"doors_closing_f","next_slavnaya_strana_f",0.1,"objects_f"}},
not_last_c = {nil,"not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true
have_interchange = true
},
{
455, "Арсенал","Arsenal",
@@ -452,7 +452,7 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
not_last = {3,"train_goes_to_m","park_m"},
not_last_f = {3,"to_park_f"},
not_last_c = {nil,"not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true,
have_interchange = true,
right_doors = true,
},
{
@@ -467,7 +467,7 @@ Metrostroi.AddANSPAnnouncer("ASNP Boiko + Pyaseckaya",{
arr = {"arr_vhe_f", {"station_m","vhe_m"}},
dep = {{"doors_closing_f","next_imeni_uollesa_brina_f",0.1,"exit_f"}, {"doors_closing_m","gcfscape_m"}},
not_last_c = {"not_last_f"},spec_last_c = {"spec_last_f"}, spec_wait_c = {"spec_wait_f"},
have_inrerchange = true
have_interchange = true
},
{
451, "У. Брина","W. Breen",
@@ -603,7 +603,7 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
arr = {{"station_m","slavnaya_strana_arr_m"}, "arr_slavnaya_strana_f"},
dep = {{"doors_closing_m","litiyevaya_next_m",0.1,"politeness_m"}, {"doors_closing_f","next_aeroport_f"}},
not_last_c = {nil,"not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true
have_interchange = true
},
{
--male<->female
@@ -611,7 +611,7 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
arr = {{"station_m","litiyevaya_arr_m"}, {"station_m","litiyevaya_arr_m"}},
dep = {{"doors_closing_f","next_arsenal_f"}, {"doors_closing_f","next_slavnaya_strana_f",0.1,"objects_f"}},
not_last_c = {nil,"not_last_f"},spec_last_c = {nil,"spec_last_f"}, spec_wait_c = {nil,"spec_wait_f"},
have_inrerchange = true
have_interchange = true
},
{
455, "Арсенал","Arsenal",
@@ -628,7 +628,7 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
not_last_f = {3,"to_park_f"},
not_last_c = {"not_last_f"},spec_last_c = {"spec_last_f"}, spec_wait_c = {"spec_wait_f"},
right_doors = true,
have_inrerchange = true
have_interchange = true
},
{
453, "GCFScape",
@@ -642,7 +642,7 @@ Metrostroi.AddANSPAnnouncer("RIU Boiko + Pyaseckaya",{
arr = {"arr_vhe_f", {"station_m","vhe_m"}},
dep = {{"doors_closing_f","next_imeni_uollesa_brina_f",0.1,"exit_f"}, {"doors_closing_m","gcfscape_m"}},
not_last_c = {"not_last_f"},spec_last_c = {"spec_last_f"}, spec_wait_c = {"spec_wait_f"},
have_inrerchange = true
have_interchange = true
},
{
451, "У. Брина","W. Breen",
@@ -722,14 +722,14 @@ Metrostroi.SetRRIAnnouncer({
457, "Славная стр.","Glorius c.",
arr = {"arr_slavnaya_strana", "arr_slavnaya_strana"},
dep = {{"next_litiyevaya",0.1,"politeness"}, "next_aeroport"},
have_inrerchange = true
have_interchange = true
},
{
--male<->female
456, "Литиевая","Lithium",
arr = {"arr_litiyevaya", "arr_litiyevaya"},
dep = {"next_arsenal", {"next_slavnaya_strana",0.1,"objects"}},
have_inrerchange = true
have_interchange = true
},
{
455, "Арсенал","Arsenal",
@@ -742,7 +742,7 @@ Metrostroi.SetRRIAnnouncer({
dep = {{"next_gcfscape"}, {"next_arsenal",0.1,"objects"}},
arrlast = {{"arr_park",0.5,"last"}, {"arr_park",0.5,"last"}},
not_last = {3,"to_park"},
have_inrerchange = true
have_interchange = true
},
{
453, "GCFScape",
@@ -753,7 +753,7 @@ Metrostroi.SetRRIAnnouncer({
452, "VHE",
arr = {"arr_vhe", "arr_vhe"},
dep = {{"next_imeni_uollesa_brina",0.1,"exit"}, "next_gcfscape"},
have_inrerchange = true
have_interchange = true
},
{
451, "У. Брина","W. Breen",

View File

@@ -433,7 +433,7 @@ function TRAIN_SYSTEM:Play(dep,not_last)
self:AnnQueue(message)
--local stbl = Metrostroi.ASNPSetup[self.Train:GetNW2Int("Announcer",1)][self.Line][self.Station]
if self.LastStation > 0 and not dep and self.Station ~= last and tbl[last].not_last and (stbl.have_inrerchange or math.abs(last-self.Station) <= 3) then
if self.LastStation > 0 and not dep and self.Station ~= last and tbl[last].not_last and (stbl.have_interchange or math.abs(last-self.Station) <= 3) then
local ltbl = tbl[last]
if stbl.not_last_c then
local patt = stbl.not_last_c[path]

View File

@@ -257,7 +257,7 @@ function TRAIN_SYSTEM:Play()
if lastst and not stbl.ignorelast then self:AnnQueue(-1) end
self:AnnQueue(message)
--local stbl = self.CurrentTable[self.Train:GetNW2Int("Announcer",1)][self.Line][self.Station]
if self.LastStation > 0 and not self.Arrived and self.Station ~= last and tbl[last].not_last and (stbl.have_inrerchange or math.abs(last-self.Station) <= 3) then
if self.LastStation > 0 and not self.Arrived and self.Station ~= last and tbl[last].not_last and (stbl.have_interchange or math.abs(last-self.Station) <= 3) then
local ltbl = tbl[last]
if stbl.not_last_c then
local patt = stbl.not_last_c[path]