diff options
author | orwell <orwell@bleipb.de> | 2025-06-17 23:42:55 +0200 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2025-06-17 23:42:55 +0200 |
commit | 803bd1c2a28499125d5b1fb49e5595a033e07d39 (patch) | |
tree | 87c6eaaa9182677d1546161a4d83e02f6efc7e52 /advtrains_line_automation/station_announcement.lua | |
parent | b178379811f9fb62226719213767649f7e76b2e7 (diff) | |
download | advtrains-803bd1c2a28499125d5b1fb49e5595a033e07d39.tar.gz advtrains-803bd1c2a28499125d5b1fb49e5595a033e07d39.tar.bz2 advtrains-803bd1c2a28499125d5b1fb49e5595a033e07d39.zip |
[CH merge] Adapt code after rebase, emulate/copy some code from CH
Diffstat (limited to 'advtrains_line_automation/station_announcement.lua')
-rw-r--r-- | advtrains_line_automation/station_announcement.lua | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/advtrains_line_automation/station_announcement.lua b/advtrains_line_automation/station_announcement.lua index c4ee162..c075597 100644 --- a/advtrains_line_automation/station_announcement.lua +++ b/advtrains_line_automation/station_announcement.lua @@ -1,12 +1,22 @@ local al = advtrains.lines local F = core.formspec_escape -local ifthenelse = assert(ch_core.ifthenelse) +local ch_core = al.ch_core +--[[ +Jednoduchá funkce, která vyhodnotí condition jako podmínku +a podle výsledku vrátí buď true_result, nebo false_result. +]] +local function ifthenelse(condition, true_result, false_result) + if condition then + return true_result + else + return false_result + end +end local rwt = assert(advtrains.lines.rwt) local def local function CF(s) if s ~= nil then return F(s) else return "" end end -local has_ch_time = core.get_modpath("ch_time") local has_signs_api = core.get_modpath("signs_api") local has_unifieddyes = core.get_modpath("unifieddyes") local rozhlas_node_name = "advtrains_line_automation:stanicni_rozhlas" @@ -1011,12 +1021,6 @@ local function update_ann(stn, epos, signs, records, rwtime) end end end - if has_ch_time then - local cas = ch_time.aktualni_cas() - any_line.HH = string.format("%02d", cas.hodina) - any_line.MM = string.format("%02d", cas.minuta) - any_line.SS = string.format("%02d", cas.sekunda) - end local lines = {} for _, record in ipairs(records) do assert(record.start ~= nil) |