1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
Loïc Guilloux 29223cc6c2
Merge 185ca3a7f5 into 1d21edde8d 2025-07-21 04:48:04 +00:00
translators 1d21edde8d Update: Translations from eints
english (us): 1 change by 2TallTyler
2025-07-21 04:47:54 +00:00
glx22 185ca3a7f5 Change: [Script] Replace ScriptDate with ScriptEconomyDate and ScriptCalendarDate 2025-05-24 23:23:48 +02:00
52 changed files with 510 additions and 210 deletions

View File

@ -7,6 +7,19 @@
/* This file contains code to downgrade the API from 15 to 14. */
AIDate <- AIEconomyDate;
AIDate.IsValidDate <- function(date) { return AIDate(date).IsValid(); }
AIDate.GetCurrentDateCompat14 <- AIDate.GetCurrentDate;
AIDate.GetCurrentDate <- function() { return AIDate.GetCurrentDateCompat14().date(); }
AIDate.GetYearCompat14 <- AIDate.GetYear;
AIDate.GetYear <- function(date) { return AIDate(date).GetYearCompat14(); }
AIDate.GetMonthCompat14 <- AIDate.GetMonth;
AIDate.GetMonth <- function(date) { return AIDate(date).GetMonthCompat14(); }
AIDate.GetDayOfMonthCompat14 <- AIDate.GetDayOfMonth;
AIDate.GetDayOfMonth <- function(date) { return AIDate(date).GetDayOfMonthCompat14(); }
AIDate.GetDateCompat14 <- AIDate.GetDate;
AIDate.GetDate <- function(year, month, day) { return AIDate.GetDateCompat14(year, month, day).date(); }
AIBridge.GetBridgeID <- AIBridge.GetBridgeType;
class AICompat14 {
@ -17,6 +30,8 @@ class AICompat14 {
}
}
AIBaseStation.GetConstructionDateCompat14 <- AIBaseStation.GetConstructionDate;
AIBaseStation.GetConstructionDate <- function(station_id) { return AIBaseStation.GetConstructionDateCompat14(station_id).date(); }
AIBaseStation.SetNameCompat14 <- AIBaseStation.SetName;
AIBaseStation.SetName <- function(id, name) { return AIBaseStation.SetNameCompat14(id, AICompat14.Text(name)); }
@ -25,12 +40,18 @@ AICompany.SetName <- function(name) { return AICompany.SetNameCompat14(AICompat1
AICompany.SetPresidentNameCompat14 <- AICompany.SetPresidentName;
AICompany.SetPresidentName <- function(name) { return AICompany.SetPresidentNameCompat14(AICompat14.Text(name)); }
AIEngine.GetDesignDateCompat14 <- AIEngine.GetDesignDate;
AIEngine.GetDesignDate <- function(engine_id) { return AIEngine.GetDesignDateCompat14(engine_id).date(); }
AIGroup.SetNameCompat14 <- AIGroup.SetName;
AIGroup.SetName <- function(id, name) { return AIGroup.SetNameCompat14(id, AICompat14.Text(name)); }
AISign.BuildSignCompat14 <- AISign.BuildSign;
AISign.BuildSign <- function(id, name) { return AISign.BuildSignCompat14(id, AICompat14.Text(name)); }
AISubsidy.GetExpireDateCompat14 <- AISubsidy.GetExpireDate;
AISubsidy.GetExpireDate <- function(subsidy_id) { return AISubsidy.GetExpireDateCompat14(subsidy_id).date(); }
AITown.FoundTownCompat14 <- AITown.FoundTown;
AITown.FoundTown <- function(tile, size, city, layout, name) { return AITown.FoundTownCompat14(tile, size, city, layout, AICompat14.Text(name)); }

View File

@ -7,6 +7,19 @@
/* This file contains code to downgrade the API from 15 to 14. */
GSDate <- GSEconomyDate;
GSDate.IsValidDate <- function(date) { return GSDate(date).IsValid(); }
GSDate.GetCurrentDateCompat14 <- GSDate.GetCurrentDate;
GSDate.GetCurrentDate <- function() { return GSDate.GetCurrentDateCompat14().date(); }
GSDate.GetYearCompat14 <- GSDate.GetYear;
GSDate.GetYear <- function(date) { return GSDate(date).GetYearCompat14(); }
GSDate.GetMonthCompat14 <- GSDate.GetMonth;
GSDate.GetMonth <- function(date) { return GSDate(date).GetMonthCompat14(); }
GSDate.GetDayOfMonthCompat14 <- GSDate.GetDayOfMonth;
GSDate.GetDayOfMonth <- function(date) { return GSDate(date).GetDayOfMonthCompat14(); }
GSDate.GetDateCompat14 <- GSDate.GetDate;
GSDate.GetDate <- function(year, month, day) { return GSDate.GetDateCompat14(year, month, day).date(); }
GSBridge.GetBridgeID <- GSBridge.GetBridgeType;
/* Emulate old GSText parameter padding behaviour */
@ -21,6 +34,8 @@ class GSCompat14 {
}
}
GSBaseStation.GetConstructionDateCompat14 <- GSBaseStation.GetConstructionDate;
GSBaseStation.GetConstructionDate <- function(station_id) { return GSBaseStation.GetConstructionDateCompat14(station_id).date(); }
GSBaseStation.SetNameCompat14 <- GSBaseStation.SetName;
GSBaseStation.SetName <- function(id, name) { return GSBaseStation.SetNameCompat14(id, GSCompat14.Text(name)); }
@ -29,6 +44,9 @@ GSCompany.SetName <- function(name) { return GSCompany.SetNameCompat14(GSCompat1
GSCompany.SetPresidentNameCompat14 <- GSCompany.SetPresidentName;
GSCompany.SetPresidentName <- function(name) { return GSCompany.SetPresidentNameCompat14(GSCompat14.Text(name)); }
GSEngine.GetDesignDateCompat14 <- GSEngine.GetDesignDate;
GSEngine.GetDesignDate <- function(engine_id) { return GSEngine.GetDesignDateCompat14(engine_id).date(); }
GSGoal.NewCompat14 <- GSGoal.New;
GSGoal.New <- function(company, goal, type, dest) { return GSGoal.NewCompat14(company, GSCompat14.Text(goal), type, dest); }
GSGoal.SetTextCompat14 <- GSGoal.SetText;
@ -43,6 +61,10 @@ GSGoal.QuestionClient <- function(id, target, is_client, question, type, buttons
GSGroup.SetNameCompat14 <- GSGroup.SetName;
GSGroup.SetName <- function(id, name) { return GSGroup.SetNameCompat14(id, GSCompat14.Text(name)); }
GSIndustry.GetConstructionDateCompat14 <- GSIndustry.GetConstructionDate;
GSIndustry.GetConstructionDate <- function(industry_id) { return GSIndustry.GetConstructionDateCompat14(industry_id).date(); }
GSIndustry.GetCargoLastAcceptedDateCompat14 <- GSIndustry.GetCargoLastAcceptedDate;
GSIndustry.GetCargoLastAcceptedDate <- function(industry_id, cargo_type) { return GSIndustry.GetCargoLastAcceptedDateCompat14(industry_id, cargo_type).date(); }
GSIndustry.SetTextCompat14 <- GSIndustry.SetText;
GSIndustry.SetText <- function(id, text) { return GSIndustry.SetTextCompat14(id, GSCompat14.Text(text)); }
GSIndustry.SetProductionLevelCompat14 <- GSIndustry.SetProductionLevel;
@ -63,15 +85,22 @@ GSNews.Create <- function(type, text, company, ref_type, ref) { return GSNews.Cr
GSSign.BuildSignCompat14 <- GSSign.BuildSign;
GSSign.BuildSign <- function(id, name) { return GSSign.BuildSignCompat14(id, GSCompat14.Text(name)); }
GSStoryPage.GetDateCompat14 <- GSStoryPage.GetDate;
GSStoryPage.GetDate <- function(story_page_id) { return GSStoryPage.GetDateCompat14(story_page_id).date(); }
GSStoryPage.NewCompat14 <- GSStoryPage.New;
GSStoryPage.New <- function(company, title) { return GSStoryPage.NewCompat14(company, GSCompat14.Text(title)); }
GSStoryPage.NewElementCompat14 <- GSStoryPage.NewElement;
GSStoryPage.NewElement <- function(page, type, ref, text) { return GSStoryPage.NewElementCompat14(page, type, ref, GSCompat14.Text(text)); }
GSStoryPage.UpdateElementCompat14 <- GSStoryPage.UpdateElement;
GSStoryPage.UpdateElement <- function(id, ref, text) { return GSStoryPage.UpdateElementCompat14(id, ref, GSCompat14.Text(text)); }
GSStoryPage.SetDateCompat14 <- GSStoryPage.SetDate;
GSStoryPage.SetDate <- function(story_page_id, date) { return GSStoryPage.SetDateCompat14(story_page_id, GSCalendarDate(date)); }
GSStoryPage.SetTitleCompat14 <- GSStoryPage.SetTitle;
GSStoryPage.SetTitle <- function(page, tile) { return GSStoryPage.SetTitleCompat14(page, GSCompat14.Text(title)); }
GSSubsidy.GetExpireDateCompat14 <- GSSubsidy.GetExpireDate;
GSSubsidy.GetExpireDate <- function(subsidy_id) { return GSSubsidy.GetExpireDateCompat14(subsidy_id).date(); }
GSTown.SetNameCompat14 <- GSTown.SetName;
GSTown.SetName <- function(id, name) { return GSTown.SetNameCompat14(id, GSCompat14.Text(name)); }
GSTown.SetTextCompat14 <- GSTown.SetText;

View File

@ -635,7 +635,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Não mos
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Mostrar/Ocultar gráfico para este tipo de carga
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Histórico da Produção
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produzido
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transportado
@ -4025,8 +4024,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Produç
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Produção no último minuto:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transportado)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centralizar visualização principal na localização da indústria. Ctrl+Clique para abrir uma nova visualização na localização da indústria
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Gráfico de Produção
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Mostrar gráfico do histórico de produção da indústria
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Nível de produção: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}A indústria anunciou fechamento iminente!

View File

@ -628,7 +628,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Скри
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Активирай/деактивирай графиката за видовете товар
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - История на производството
STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Покажи подробен рейтинг на представянето
@ -3967,8 +3966,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Прои
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Произведено последната минута:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% превозено)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Центриране камерата върху индустрията. Ctrl+Click отваря прозорец с нов изглед към индустрията
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Производствена графика
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Показва графиката на производствената история на индустрията
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Ниво на производство: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Индустрията обяви незабавна ликвидация!

View File

@ -635,7 +635,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}No mostr
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Mostra/amaga el tipus de càrrega al gràfic
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Historial de producció
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produït
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transportat
@ -4025,8 +4024,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producci
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Producció durant l'últim minut:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}{NBSP}% transportat)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centra la vista principal al lloc de la indústria. Amb Ctrl+clic, s'obre una vista nova centrada al lloc on és la indústria.
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Gràfic de producció
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Mostra el gràfic de l'evolució de la producció de la indústria.
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Nivell de producció: {YELLOW}{COMMA}{NBSP}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}La indústria ha anunciat la seva clausura imminent!

View File

@ -720,7 +720,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Skryje v
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Zobrazit nebo skrýt graf pro určitý druh nákladu
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Historie produkce
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Vyprodukováno
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Přepraveno
@ -4069,8 +4068,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Produkce
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Produkce v minulé minutě:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% přepraveno)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Vystředit pohled na průmysl. Ctrl+Klik otevře nový pohled na umístění průmyslu
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Graf výroby
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Zobrazí graf historie produkce průmyslu
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Produkce: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Průmysl oznámila blížící se uzavření!

View File

@ -633,7 +633,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Vis inte
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Skift grafen for denne lasttype til/fra
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Produktionshistorie
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produceret
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transporteret
@ -4013,8 +4012,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Produkti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Produktion sidste minut:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transporteret)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centrer skærmen over industriens lokalitet. Ctrl+Klik åbner et nyt vindue ved industriens lokalitet.
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Produktionsgraf
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Viser grafen over industriens produktionshistorie
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Produktions niveauet: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Industrien har rapporteret øjeblikkelig nedlukning!

View File

@ -634,7 +634,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Geen vra
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Grafiek voor dit vrachttype weergeven-verbergen
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Productiegeschiedenis
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Geproduceerd
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Vervoerd
@ -4024,8 +4023,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Productie vorige minuut:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% vervoerd)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centreer het hoofdscherm op de locatie van de industrie. Ctrl+klik opent een nieuws venster op de locatie van de industrie
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Productiegrafiek
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Geeft de grafiek weer van de productiegeschiedenis van de industrie
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Productieniveau: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}De industrie heeft een dreigende sluiting aangekondigd!

View File

@ -634,7 +634,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Display
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Toggle graph of this cargo type
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Production History
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produced
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transported
@ -4024,8 +4023,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Production last minute:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transported)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centre the main view on industry location. Ctrl+Click to open a new viewport on industry location
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Production Graph
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Shows the graph of industry production history
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Production level: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}The industry has announced imminent closure!

View File

@ -634,7 +634,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Display
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Toggle graph of this cargo type
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Production History
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produced
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transported
@ -4024,8 +4023,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Production last minute:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transported)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Center the main view on industry location. Ctrl+Click to open a new viewport on industry location
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Production Graph
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Shows the graph of industry production history
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Production level: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}The industry has announced imminent closure!
@ -5001,6 +4998,7 @@ STR_ERROR_FLAT_LAND_REQUIRED :{WHITE}Flat lan
STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION :{WHITE}Land sloped in wrong direction
STR_ERROR_CAN_T_DO_THIS :{WHITE}Can't do this...
STR_ERROR_BUILDING_MUST_BE_DEMOLISHED :{WHITE}Building must be demolished first
STR_ERROR_BUILDING_IS_PROTECTED :{WHITE}... building is protected
STR_ERROR_CAN_T_CLEAR_THIS_AREA :{WHITE}Can't clear this area...
STR_ERROR_SITE_UNSUITABLE :{WHITE}... site unsuitable
STR_ERROR_ALREADY_BUILT :{WHITE}... already built

View File

@ -634,7 +634,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Älä n
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Valitse, näytetäänkö tämän rahdin kuvaaja
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} Tuotantohistoria
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Tuotettu
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Kuljetettu
@ -4024,8 +4023,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Tuotanto
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Tuotanto viime minuutissa:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}{NBSP}% kuljetettu)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Keskitä päänäkymä tuotantolaitoksen sijaintiin. Ctrl+napsautus avataksesi uuden näkymäikkunan laitoksen sijaintiin
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Tuotannon kuvaaja
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Näyttää tuotantohistorian kuvaajana
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Tuotantotaso: {YELLOW}{COMMA}{NBSP}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Teollisuuslaitos ilmoittaa välittömästä lakkautuksesta!

View File

@ -634,7 +634,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}N'affich
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Afficher/Cacher le type de marchandise
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Historique de production
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produit
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transporté
@ -4002,8 +4001,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Production la minute précédente{NBSP}:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}{NBSP}% transporté{P "" s})
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centrer la vue sur l'industrie. Ctrl-clic pour ouvrir une nouvelle vue sur l'industrie.
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Graphe de production
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Affiche le graphe de l'historique de la production des industries
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Niveau de production{NBSP}: {YELLOW}{COMMA}{NBSP}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}L'industrie a annoncé sa fermeture imminente{NBSP}!

View File

@ -635,7 +635,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Non amos
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Amosar/ocultar gráfica para o tipo de carga
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Historial de produción
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Producido
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transportado
@ -4025,8 +4024,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Produci
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Producción no último minuto:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transportado)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centrar a vista principal na localización da industria. Ctrl+Clic abre unha nova fiestra na localización da industria
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Gráfico de produción
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Amosa o gráfico co histórico de produción industrial
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Nivel de produción: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}A industria anunció un peche inminente

View File

@ -627,7 +627,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Zeige ke
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Diagramm für diesen Frachttyp ein/aus
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Produktionshistorie
STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Zeige detailierte Leistungsaufschlüsselung
@ -3958,8 +3957,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Produkti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Produktion in der letzten Minute:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% befördert)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Hauptansicht auf den Industriestandort zentrieren. Mit Strg+Klick wird eine neue Zusatzansicht auf den Industriestandort geöffnet
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Produktionsgraph
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Zeigt den Graphen der Produktionshistorie der Industrie an
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Produktionsrate: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Diese Industrie wird in Kürze schließen!

View File

@ -727,7 +727,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Εμφά
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Εναλλαγή γραφήματος αυτού του τύπου φορτίου
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Ιστορικό Παραγωγής
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Παράχθηκε/αν
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Μεταφέρθηκε/αν
@ -4118,8 +4117,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Παρα
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Παραγωγή τελευταίου λεπτού:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% μεταφέρθηκαν)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Κεντράρισμα εικόνας στην περιοχή της βιομηχανίας. Ctrl+Κλικ για άνοιγμα νέου παραθύρου προβολής στην περιοχή της βιομηχανίας
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Γράφημα Παραγωγής
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Εμφανίζει το γράφημα ιστορικού παραγωγής της βιομηχανίας
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Επίπεδο παραγωγής: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Η βιομηχανία έχει ανακοινώσει άμεσο κλείσιμο!

View File

@ -697,7 +697,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Ne mutas
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Adott rakomány grafikonjának mutatása be/ki
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Termelési előzmények
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Előállított
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Szállítva
@ -4088,8 +4087,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Múlt ha
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Termelés az elmúlt percben:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% elszállítva)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}A fő nézetet a gazdasági épületre állítja. Ctrl+kattintással új nézet nyílik a gazdasági épület helyzeténél
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Termelési grafikon
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Megjeleníti az ipar termelési történetének grafikonját
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Termelési szint: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}A gyár bejelentette a közelgő bezárását!

View File

@ -635,7 +635,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}화물
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}이 화물의 그래프를 표시하거나 숨깁니다
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - 생산량 이력
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :생산량
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :수송량
@ -4025,8 +4024,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}지난
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}지난 1분간 생산량:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% 수송됨)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}이 산업시설로 이동합니다. CTRL+클릭하면 이 산업시설을 기준으로 새로운 외부 화면을 엽니다
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}생산량 그래프
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}산업시설 생산량 이력 그래프를 보여줍니다
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}생산 수준: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}산업시설이 곧 폐쇄됩니다!

View File

@ -635,7 +635,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Nerādī
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Paslēgt kravas veida diagrammu
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Ražošanas Vēsture
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Saražots
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Pārvadāts
@ -4021,8 +4020,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Iepriek
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Ražošanas pēdējā minūtē:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} (pārvadāti {COMMA}%)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centrēt galveno skatu uz ražotni. Ctrl+klikšķis atvērs skatu uz ražotni jaunā skatlaukā
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Ražošanas Grafiks
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Parāda nozares ražošanas vēstures grafiku
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Ražošanas līmenis: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Nozare ir paziņojusi par nenovēršamu slēgšanu!

View File

@ -633,7 +633,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Keng Wue
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Schalt d'Grafik fir de Wuerentyp em
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Produktiounshistorie
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produzéiert
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transportéiert
@ -3994,8 +3993,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Produkti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Produktioun déi läscht Minutt:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transportéiert)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Zentréiert d'Siicht op d'Industrie. Ctrl+Klick erstellt eng nei Usiicht op d'Industrie
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Produktiounsgrafik
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Weist d'Grafik vun der Industrieproduktiounshistorie un
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Produktiounslevel: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}D'Industrie annoncéiert dass se zougemaach gëtt

View File

@ -635,7 +635,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Skjul al
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Vis/skjul graf for en bestemt varetype
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Produksjonshistorikk
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produsert
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transportert
@ -4025,8 +4024,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Produksj
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Produksjon forrige minutt:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}{NBSP}% transportert)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Sentrer hovedvisningen på industrilokasjon. Ctrl+klikk for å åpne et nytt tilleggsvindu på industrilokasjon
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Graf over produksjon
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Viser grafen for industriell produksjonshistorikk
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Produksjonsnivå: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Næringen har annonsert snarlig nedleggelse!

View File

@ -1013,7 +1013,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Ukryj ws
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Przełącz ukrywanie/wyświetlanie wykresu danego typu ładunku
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Historia Produkcji
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Wyprodukowano
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Przetransportowano
@ -4404,8 +4403,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Wyproduk
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Wyprodukowano w poprzedniej minucie:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% przetransportowano)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Wyśrodkuj widok główny na lokalizacji przedsiębiorstwa. Użyj Ctrl, aby otworzyć nowy podgląd na jego lokalizację
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Wykres Produkcji
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Wyświetl wykres historii produkcji tego przedsiębiorstwa
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Poziom produkcji: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Przedsiębiorstwo ogłosiło likwidację!

View File

@ -635,7 +635,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Não mos
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Alternar o gráfico para este tipo de carga
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Histórico da Produção
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produzido
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transportado
@ -4025,8 +4024,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Produç
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Produção no último minuto:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transportado)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centrar visualização na localização da indústria. Ctrl+Clique para abrir um novo visualizador na localização da indústria
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Gráfico de Produção
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Mostrar gráfico do histórico de produção da indústria
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Nível de produção: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}A indústria anunciou encerramento iminente!

View File

@ -3976,8 +3976,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producț
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Producție în ultimul minut:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transportat)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centrează imaginea pe locația industriei. Ctrl+Click pentru a deshide o fereastra cu locația industriei
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Grafic de producție
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Arată graficul de producție istoric al industriei
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Nivelul producției: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Industria a anunțat închiderea iminentă!

View File

@ -772,7 +772,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Скры
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Включить/отключить отображение груза на графике
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}График производительности: {INDUSTRY}
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Произведено
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Перевезено
@ -4199,8 +4198,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Прои
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Произведено за минуту:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% перевезено)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Показать предприятие в основном окне. Ctrl+щелчок{NBSP}- показать в дополнительном окне.
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}График производительности
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Показать график производительности этого предприятия
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Производительность: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Предприятие скоро закрывается!

View File

@ -634,7 +634,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}在货
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}切换显示货物
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - 产量历史
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :已生产
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :已运输
@ -4024,8 +4023,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}上月
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}上分钟产量:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK}(已运输 {COMMA}%
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}将屏幕中心移动到当前工业的位置。按住 <Ctrl> 键点选会在新视点中显示工业位置
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}产量图表
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}显示工业产量历史图表
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}生产等级:{YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}此工业已经宣布即刻停业倒闭!

View File

@ -634,7 +634,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Oculta t
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Alterna entre mostrar/ocultar la gráfica para este tipo de carga
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Historial de Producción
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Producido
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transportado
@ -4011,8 +4010,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producci
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Producción el minuto anterior:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transportado)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centra la vista principal sobre la industria. Ctrl+clic abre un punto de vista en dicha posición
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Gráfico de Producción
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Muestra el gráfico del historial de producción de la industria
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Nivel de producción: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}La industria ha anunciado su cierre inminente!

View File

@ -635,7 +635,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Ocultar
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Mostrar u ocultar gráfica de este tipo de carga
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Historial de producción
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Producido
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transportado
@ -4025,8 +4024,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producci
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Producción último minuto:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transportad{G 0 o a o a}{P 0 "" s})
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centrar vista en la industria. Ctrl+Clic abre una vista aparte en su ubicación
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Gráfica de producción
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Mostrar la gráfica histórica de producción de la industria
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Nivel de producción: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}¡La industria ha anunciado su cierre inminente!

View File

@ -633,7 +633,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Visa ing
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Slå på/av denna godstyps graf
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Produktionshistorik
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Producerat
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transporterat
@ -4001,8 +4000,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Produkti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Produktion förra minuten:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transporterat)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centrera huvudvyn ovanför industrin. Ctrl+Klick för att öppna en ny fönstervy industrins läge
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Produktionsgraf
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Visar en graf över den historiska industriproduktionen
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Produktionsnivå: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Industrin har annonserat att den snart kommer att stänga!

View File

@ -634,7 +634,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}於貨
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}切換該貨物類型圖示
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - 產量歷史
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :已產出
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :已運送
@ -4024,8 +4023,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}上月
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}上分鐘產量︰
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} (運送了 {COMMA}%)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}將工業置於畫面正中央。按住 <Ctrl> 點選可於工業位置開啟新檢視視窗
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}產量圖表
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}顯示工業產量歷史圖表
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}產出等級:{YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}該工業已宣佈關閉!

View File

@ -770,7 +770,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Не п
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Ввімк/вимик графік типів вантажу
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Історія виробництва
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Вироблено
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Перевезено
@ -4150,8 +4149,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Виро
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Вироблено за минулу хвилину:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% перевезено)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Показати підприємство у центрі екрану. Ctrl+клац мишею відкриє нове вікно з видом на підприємство
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Графік продуктивності
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Відобразити графік продуктивності підприємства
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Обсяг виробництва: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Підприємство оголосило про близьке закриття!

View File

@ -627,7 +627,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Không h
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Bật/tắt đồ thị cho hàng hóa này
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Lịch Sử Sản Xuất
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Đã cung cấp
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Đã vận chuyển
@ -3976,8 +3975,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Sản l
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Sản lượng phút trước:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% đã vận chuyển)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Xem vị trí trung tâm của nhà máy. Ctrl+Click mở cửa sổ mới để xem
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Biểu Đồ Sản Xuất
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Hiển thị biểu đồ lịch sử sản xuất của nhà máy
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Mức sản lượng: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Nhà máy này đã thông báo sắp đóng cửa!

View File

@ -633,7 +633,6 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Peidio a
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Toglu'r graff ar gyfer y math llwyth yma
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_PRODUCTION_CAPTION :{WHITE}{INDUSTRY} - Hanes Cynhyrchu
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Cynhyrchwyd
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Cludwyd
@ -3994,8 +3993,6 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Cynnyrch
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Cynnyrch y munud olaf:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% wedi'i gludo)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Canoli'r brif olygfa ar y diwydiant. Ctrl+Clic i agor ffenest golwg newydd ar leoliad y diwydiant
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH :{BLACK}Graff Cynhyrchiant
STR_INDUSTRY_VIEW_PRODUCTION_GRAPH_TOOLTIP :{BLACK}Dangos graff o hanes cynhyrchu diwydiant
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Lefel cynhyrchu: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Mae'r diwydiant wedi datgan ei fod ar fin cau!

View File

@ -40,13 +40,15 @@ foreach(API "ai;AI" "game;GS" "template;Template")
list(GET API 1 APIUC)
foreach(SCRIPT_API_FILE IN LISTS SCRIPT_API_FILES)
if("${SCRIPT_API_FILE}" MATCHES ".*script_controller.*")
continue()
endif()
get_filename_component(SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE}" NAME_WE)
string(REPLACE "script_" "${APILC}_" SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE_NAME}")
set(SCRIPT_API_BINARY_FILE "${CMAKE_BINARY_DIR}/generated/script/api/${APILC}/${SCRIPT_API_FILE_NAME}.sq.hpp")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${APILC}/${SCRIPT_API_FILE_NAME}.sq.hpp")
file(REMOVE "${SCRIPT_API_BINARY_FILE}")
continue()
endif()
add_custom_command_timestamp(OUTPUT ${SCRIPT_API_BINARY_FILE}
COMMAND ${CMAKE_COMMAND}
-DSCRIPT_API_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/squirrel_export.sq.hpp.in
@ -74,6 +76,7 @@ foreach(API "ai;AI" "game;GS" "template;Template")
if(NOT "${APILC}" STREQUAL "template")
list(APPEND SCRIPT_${APIUC}_BINARY_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${APILC}/${APILC}_controller.sq.hpp")
list(APPEND SCRIPT_${APIUC}_BINARY_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${APILC}/${APILC}_date.sq.hpp")
set(INCLUDES_BINARY_FILE "${CMAKE_BINARY_DIR}/generated/script/api/${APILC}/${APILC}_includes.hpp")
set(API_FILES "${CMAKE_CURRENT_BINARY_DIR}/${APILC}.files")
file(GENERATE OUTPUT ${API_FILES} CONTENT "${SCRIPT_${APIUC}_BINARY_FILES}")
@ -120,6 +123,7 @@ foreach(API "ai;AI" "game;GS" "template;Template")
)
endif()
else()
list(APPEND SCRIPT_Template_BINARY_FILES "${CMAKE_CURRENT_SOURCE_DIR}/template/template_date.sq.hpp")
add_dependencies(script_api
script_${APILC}
)
@ -233,7 +237,6 @@ add_files(
script_company.cpp
script_companymode.cpp
script_controller.cpp
script_date.cpp
script_depotlist.cpp
script_engine.cpp
script_enginelist.cpp

View File

@ -0,0 +1,62 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../script_date.hpp"
#include "../template/template_date.sq.hpp"
template <> SQInteger PushClassName<ScriptEconomyDate, ScriptType::AI>(HSQUIRRELVM vm) { sq_pushstring(vm, "AIEconomyDate"); return 1; }
template <> SQInteger PushClassName<ScriptCalendarDate, ScriptType::AI>(HSQUIRRELVM vm) { sq_pushstring(vm, "AICalendarDate"); return 1; }
void SQAIDate_Register(Squirrel &engine)
{
DefSQClass<ScriptEconomyDate, ScriptType::AI> SQAIEconomyDate("AIEconomyDate");
SQAIEconomyDate.PreRegister(engine, "AIObject");
SQAIEconomyDate.AddSQAdvancedConstructor(engine);
SQAIEconomyDate.DefSQConst(engine, ScriptEconomyDate::DATE_INVALID, "DATE_INVALID");
SQAIEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetCurrentDate, "GetCurrentDate", ".");
SQAIEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetDate, "GetDate", ".iii");
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::IsValid, "IsValid", ".");
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetYear, "GetYear", ".");
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetMonth, "GetMonth", ".");
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetDayOfMonth, "GetDayOfMonth", ".");
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::date, "date", ".");
SQAIEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_tostring, "_tostring");
SQAIEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_add, "_add");
SQAIEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_sub, "_sub");
SQAIEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_cmp, "_cmp");
SQAIEconomyDate.PostRegister(engine);
DefSQClass<ScriptCalendarDate, ScriptType::AI> SQAICalendarDate("AICalendarDate");
SQAICalendarDate.PreRegister(engine, "AIObject");
SQAICalendarDate.AddSQAdvancedConstructor(engine);
SQAICalendarDate.DefSQConst(engine, ScriptCalendarDate::DATE_INVALID, "DATE_INVALID");
SQAICalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetCurrentDate, "GetCurrentDate", ".");
SQAICalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetDate, "GetDate", ".iii");
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::IsValid, "IsValid", ".");
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetYear, "GetYear", ".");
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetMonth, "GetMonth", ".");
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetDayOfMonth, "GetDayOfMonth", ".");
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::date, "date", ".");
SQAICalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_tostring, "_tostring");
SQAICalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_add, "_add");
SQAICalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_sub, "_sub");
SQAICalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_cmp, "_cmp");
SQAICalendarDate.PostRegister(engine);
}

View File

@ -28,6 +28,11 @@
* \li AICargo::CC_POTABLE
* \li AICargo::CC_NON_POTABLE
* \li AIVehicleList_Waypoint
* \li AIEconomyDate
* \li AICalendarDate
*
* API removals:
* \li AIDate
*
* Other changes:
* \li AIBridge::GetBridgeID renamed to AIBridge::GetBridgeType

View File

@ -0,0 +1,62 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../script_date.hpp"
#include "../template/template_date.sq.hpp"
template <> SQInteger PushClassName<ScriptEconomyDate, ScriptType::GS>(HSQUIRRELVM vm) { sq_pushstring(vm, "GSEconomyDate"); return 1; }
template <> SQInteger PushClassName<ScriptCalendarDate, ScriptType::GS>(HSQUIRRELVM vm) { sq_pushstring(vm, "GSCalendarDate"); return 1; }
void SQGSDate_Register(Squirrel &engine)
{
DefSQClass<ScriptEconomyDate, ScriptType::GS> SQGSEconomyDate("GSEconomyDate");
SQGSEconomyDate.PreRegister(engine, "GSObject");
SQGSEconomyDate.AddSQAdvancedConstructor(engine);
SQGSEconomyDate.DefSQConst(engine, ScriptEconomyDate::DATE_INVALID, "DATE_INVALID");
SQGSEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetCurrentDate, "GetCurrentDate", ".");
SQGSEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetDate, "GetDate", ".iii");
SQGSEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetSystemTime, "GetSystemTime", ".");
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::IsValid, "IsValid", ".");
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetYear, "GetYear", ".");
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetMonth, "GetMonth", ".");
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetDayOfMonth, "GetDayOfMonth", ".");
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::date, "date", ".");
SQGSEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_tostring, "_tostring");
SQGSEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_add, "_add");
SQGSEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_sub, "_sub");
SQGSEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_cmp, "_cmp");
SQGSEconomyDate.PostRegister(engine);
DefSQClass<ScriptCalendarDate, ScriptType::GS> SQGSCalendarDate("GSCalendarDate");
SQGSCalendarDate.PreRegister(engine, "GSObject");
SQGSCalendarDate.AddSQAdvancedConstructor(engine);
SQGSCalendarDate.DefSQConst(engine, ScriptCalendarDate::DATE_INVALID, "DATE_INVALID");
SQGSCalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetCurrentDate, "GetCurrentDate", ".");
SQGSCalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetDate, "GetDate", ".iii");
SQGSCalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetSystemTime, "GetSystemTime", ".");
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::IsValid, "IsValid", ".");
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetYear, "GetYear", ".");
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetMonth, "GetMonth", ".");
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetDayOfMonth, "GetDayOfMonth", ".");
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::date, "date", ".");
SQGSCalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_tostring, "_tostring");
SQGSCalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_add, "_add");
SQGSCalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_sub, "_sub");
SQGSCalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_cmp, "_cmp");
SQGSCalendarDate.PostRegister(engine);
}

View File

@ -29,6 +29,11 @@
* \li GSCargo::CC_NON_POTABLE
* \li GSVehicleList_Waypoint
* \li GSBaseStation::GetOwner
* \li GSEconomyDate
* \li GSCalendarDate
*
* API removals:
* \li GSDate
*
* Other changes:
* \li GSBridge::GetBridgeID renamed to GSBridge::GetBridgeType

View File

@ -66,9 +66,9 @@
return ::BaseStation::Get(station_id)->xy;
}
/* static */ ScriptDate::Date ScriptBaseStation::GetConstructionDate(StationID station_id)
/* static */ ScriptCalendarDate *ScriptBaseStation::GetConstructionDate(StationID station_id)
{
if (!IsValidBaseStation(station_id)) return ScriptDate::DATE_INVALID;
if (!IsValidBaseStation(station_id)) return new ScriptCalendarDate();
return (ScriptDate::Date)::BaseStation::Get(station_id)->build_date.base();
return new ScriptCalendarDate(static_cast<ScriptCalendarDate::Date>(::BaseStation::Get(station_id)->build_date.base()));
}

View File

@ -78,7 +78,7 @@ public:
* @return The last calendar-date some part of this station was build.
* @see \ref ScriptCalendarTime
*/
static ScriptDate::Date GetConstructionDate(StationID station_id);
static ScriptCalendarDate *GetConstructionDate(StationID station_id);
};
#endif /* SCRIPT_BASESTATION_HPP */

View File

@ -46,9 +46,9 @@ static NetworkClientInfo *FindClientInfo(ScriptClient::ClientID client)
return ScriptCompany::ToScriptCompanyID(ci->client_playas);
}
/* static */ ScriptDate::Date ScriptClient::GetJoinDate(ScriptClient::ClientID client)
/* static */ ScriptEconomyDate *ScriptClient::GetJoinDate(ScriptClient::ClientID client)
{
NetworkClientInfo *ci = FindClientInfo(client);
if (ci == nullptr) return ScriptDate::DATE_INVALID;
return (ScriptDate::Date)ci->join_date.base();
if (ci == nullptr) return new ScriptEconomyDate();
return new ScriptEconomyDate(static_cast<ScriptEconomyDate::Date>(ci->join_date.base()));
}

View File

@ -62,7 +62,7 @@ public:
* @return The economy-date when client has joined.
* @see \ref ScriptEconomyTime
*/
static ScriptDate::Date GetJoinDate(ClientID client);
static ScriptEconomyDate *GetJoinDate(ClientID client);
};

View File

@ -1,68 +0,0 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file script_date.cpp Implementation of ScriptDate. */
#include "../../stdafx.h"
#include "script_date.hpp"
#include "../../timer/timer_game_economy.h"
#include <time.h>
#include "../../safeguards.h"
/* static */ bool ScriptDate::IsValidDate(Date date)
{
return date >= 0;
}
/* static */ ScriptDate::Date ScriptDate::GetCurrentDate()
{
return (ScriptDate::Date)TimerGameEconomy::date.base();
}
/* static */ SQInteger ScriptDate::GetYear(ScriptDate::Date date)
{
if (date < 0) return DATE_INVALID;
::TimerGameEconomy::YearMonthDay ymd = ::TimerGameEconomy::ConvertDateToYMD(::TimerGameEconomy::Date{date});
return ymd.year.base();
}
/* static */ SQInteger ScriptDate::GetMonth(ScriptDate::Date date)
{
if (date < 0) return DATE_INVALID;
::TimerGameEconomy::YearMonthDay ymd = ::TimerGameEconomy::ConvertDateToYMD(::TimerGameEconomy::Date{date});
return ymd.month + 1;
}
/* static */ SQInteger ScriptDate::GetDayOfMonth(ScriptDate::Date date)
{
if (date < 0) return DATE_INVALID;
::TimerGameEconomy::YearMonthDay ymd = ::TimerGameEconomy::ConvertDateToYMD(::TimerGameEconomy::Date{date});
return ymd.day;
}
/* static */ ScriptDate::Date ScriptDate::GetDate(SQInteger year, SQInteger month, SQInteger day_of_month)
{
if (month < 1 || month > 12) return DATE_INVALID;
if (day_of_month < 1 || day_of_month > 31) return DATE_INVALID;
::TimerGameEconomy::Year timer_year{ClampTo<int32_t>(year)};
if (timer_year < EconomyTime::MIN_YEAR || timer_year > EconomyTime::MAX_YEAR) return DATE_INVALID;
return static_cast<ScriptDate::Date>(::TimerGameEconomy::ConvertYMDToDate(timer_year, month - 1, day_of_month).base());
}
/* static */ SQInteger ScriptDate::GetSystemTime()
{
time_t t;
time(&t);
return t;
}

View File

@ -12,7 +12,175 @@
#include "script_object.hpp"
#include "../../timer/timer_game_economy.h"
#include "../squirrel_helper.hpp"
#ifndef DOXYGEN_API
template <size_t N>
struct StringLiteral {
constexpr StringLiteral(const char (&str)[N])
{
std::copy_n(str, N, this->value);
}
char value[N];
};
template <class Timer, class Time, StringLiteral Tag>
class ScriptDateBase : public ScriptObject {
public:
using YearMonthDay = Timer::YearMonthDay;
using Year = Timer::Year;
enum Date {
DATE_INVALID = Time::INVALID_DATE.base(),
};
ScriptDateBase(Date date = DATE_INVALID) : _date(date) {}
ScriptDateBase(HSQUIRRELVM vm) : _date(DATE_INVALID)
{
int nparam = sq_gettop(vm) - 1;
if (nparam >= 1) {
SQInteger date;
if (SQ_FAILED(sq_getinteger(vm, 2, &date))) {
throw sq_throwerror(vm, "Argument must be an integer");
}
this->_date = static_cast<Date>(date);
}
}
bool IsValid()
{
return this->_date > 0;
}
static ScriptDateBase *GetCurrentDate()
{
return new ScriptDateBase(static_cast<Date>(Timer::date.base()));
}
SQInteger GetYear()
{
if (!this->IsValid()) return DATE_INVALID;
YearMonthDay ymd = Timer::ConvertDateToYMD(static_cast<Timer::Date>(this->_date));
return ymd.year.base();
}
SQInteger GetMonth()
{
if (!this->IsValid()) return DATE_INVALID;
YearMonthDay ymd = Timer::ConvertDateToYMD(static_cast<Timer::Date>(this->_date));
return ymd.month + 1;
}
SQInteger GetDayOfMonth()
{
if (!this->IsValid()) return DATE_INVALID;
YearMonthDay ymd = Timer::ConvertDateToYMD(static_cast<Timer::Date>(this->_date));
return ymd.day;
}
static ScriptDateBase *GetDate(SQInteger year, SQInteger month, SQInteger day_of_month)
{
if (month < 1 || month > 12) return new ScriptDateBase();
if (day_of_month < 1 || day_of_month > 31) return new ScriptDateBase();
Year timer_year{ClampTo<int32_t>(year)};
if (timer_year < Time::MIN_YEAR || timer_year > Time::MAX_YEAR) return new ScriptDateBase();
return new ScriptDateBase(static_cast<Date>(Timer::ConvertYMDToDate(timer_year, month - 1, day_of_month).base()));
}
static SQInteger GetSystemTime()
{
time_t t;
time(&t);
return t;
}
Date date() { return this->_date; }
SQInteger _tostring(HSQUIRRELVM vm)
{
sq_pushstring(vm, fmt::format("{}", this->_date));
return 1;
}
SQInteger _add(HSQUIRRELVM vm)
{
SQInteger days = 0;
switch (sq_gettype(vm, 2)) {
case OT_INTEGER:
sq_getinteger(vm, 2, &days);
break;
case OT_INSTANCE: {
ScriptDateBase *other = static_cast<ScriptDateBase *>(Squirrel::GetRealInstance(vm, 2, Tag.value));
if (other == nullptr) return SQ_ERROR;
days = other->_date;
break;
}
default: return SQ_ERROR;
}
ScriptDateBase *res = new ScriptDateBase(static_cast<Date>(this->_date + days));
res->AddRef();
Squirrel::CreateClassInstanceVM(vm, Tag.value, res, nullptr, SQConvert::DefSQDestructorCallback<ScriptDateBase>, true);
return 1;
}
SQInteger _sub(HSQUIRRELVM vm)
{
SQInteger days = 0;
switch (sq_gettype(vm, 2)) {
case OT_INTEGER:
sq_getinteger(vm, 2, &days);
break;
case OT_INSTANCE: {
ScriptDateBase *other = static_cast<ScriptDateBase *>(Squirrel::GetRealInstance(vm, 2, Tag.value));
if (other == nullptr) return SQ_ERROR;
days = other->_date;
break;
}
default: return SQ_ERROR;
}
ScriptDateBase *res = new ScriptDateBase(static_cast<Date>(this->_date - days));
res->AddRef();
Squirrel::CreateClassInstanceVM(vm, Tag.value, res, nullptr, SQConvert::DefSQDestructorCallback<ScriptDateBase>, true);
return 1;
}
SQInteger _cmp(HSQUIRRELVM vm)
{
ScriptDateBase *other = static_cast<ScriptDateBase *>(Squirrel::GetRealInstance(vm, 2, Tag.value));
if (other == nullptr) return SQ_ERROR;
sq_pushinteger(vm, this->_date - other->_date);
return 1;
}
bool SaveObject(HSQUIRRELVM vm) override
{
sq_pushstring(vm, Tag.value);
sq_pushinteger(vm, this->_date);
return true;
}
bool LoadObject(HSQUIRRELVM vm) override
{
if (sq_gettype(vm, -1) != OT_INTEGER) return false;
SQInteger val;
sq_getinteger(vm, -1, &val);
this->_date = static_cast<Date>(val);
return true;
}
protected:
Date _date = DATE_INVALID;
};
using ScriptEconomyDate = ScriptDateBase<TimerGameEconomy, EconomyTime, "EconomyDate">;
using ScriptCalendarDate = ScriptDateBase<TimerGameCalendar, CalendarTime, "CalendarDate">;
#else
/**
* Class that handles all date related (calculation) functions.
* @api ai game
@ -48,22 +216,23 @@
* Economy-time will use a 360 day calendar (12 months with 30 days each), which runs at a constant speed of one economy-month per realtime-minute.
* Calendar-time will use a Gregorian calendar, which can be slowed to stopped via game settings.
*/
class ScriptDate : public ScriptObject {
class ScriptEconomyDate : public ScriptObject {
public:
/**
* Date data type is an integer value. Use ScriptDate::GetDate to
* Date data type is an integer value. Use ScriptEconomyDate::GetDate to
* compose valid date values for a known year, month and day.
*/
enum Date {
DATE_INVALID = ::EconomyTime::INVALID_DATE.base(), ///< A value representing an invalid date.
DATE_INVALID, ///< A value representing an invalid date.
};
ScriptEconomyDate(Date date = DATE_INVALID);
/**
* Validates if a date value represent a valid date.
* @param date The date to validate.
* @return True if the date is valid, otherwise false
*/
static bool IsValidDate(Date date);
bool IsValid();
/**
* Get the current date.
@ -72,28 +241,25 @@ public:
* 100 but not by 400.
* @return The current date.
*/
static Date GetCurrentDate();
static ScriptEconomyDate GetCurrentDate();
/**
* Get the year of the given date.
* @param date The date to get the year of.
* @return The year.
*/
static SQInteger GetYear(Date date);
SQInteger GetYear();
/**
* Get the month of the given date.
* @param date The date to get the month of.
* @return The month.
*/
static SQInteger GetMonth(Date date);
SQInteger GetMonth();
/**
* Get the day (of the month) of the given date.
* @param date The date to get the day of.
* @return The day.
*/
static SQInteger GetDayOfMonth(Date date);
SQInteger GetDayOfMonth();
/**
* Get the date given a year, month and day of month.
@ -102,7 +268,7 @@ public:
* @param day_of_month The day of month of the to-be determined date.
* @return The date.
*/
static Date GetDate(SQInteger year, SQInteger month, SQInteger day_of_month);
static ScriptEconomyDate GetDate(SQInteger year, SQInteger month, SQInteger day_of_month);
/**
* Get the time of the host system.
@ -111,6 +277,84 @@ public:
* @note This uses the clock of the host system, which can skew or be set back. Use with caution.
*/
static SQInteger GetSystemTime();
/**
* Get the date.
* @return The date.
*/
Date date();
};
class ScriptCalendarDate : public ScriptObject {
public:
/**
* Date data type is an integer value. Use ScriptCalendarDate::GetDate to
* compose valid date values for a known year, month and day.
*/
enum Date {
DATE_INVALID, ///< A value representing an invalid date.
};
ScriptCalendarDate(Date date = DATE_INVALID);
/**
* Validates if a date value represent a valid date.
* @return True if the date is valid, otherwise false
*/
bool IsValid();
/**
* Get the current date.
* This is the number of days since epoch under the assumption that
* there is a leap year every 4 years, except when dividable by
* 100 but not by 400.
* @return The current date.
*/
static ScriptCalendarDate GetCurrentDate();
/**
* Get the year of the given date.
* @return The year.
*/
SQInteger GetYear();
/**
* Get the month of the given date.
* @return The month.
*/
SQInteger GetMonth();
/**
* Get the day (of the month) of the given date.
* @return The day.
*/
SQInteger GetDayOfMonth();
/**
* Get the date given a year, month and day of month.
* @param year The year of the to-be determined date.
* @param month The month of the to-be determined date.
* @param day_of_month The day of month of the to-be determined date.
* @return The date.
*/
static ScriptCalendarDate GetDate(SQInteger year, SQInteger month, SQInteger day_of_month);
/**
* Get the time of the host system.
* @return The amount of seconds passed since 1 Jan 1970.
* @api -ai
* @note This uses the clock of the host system, which can skew or be set back. Use with caution.
*/
static SQInteger GetSystemTime();
/**
* Get the date.
* @return The date.
*/
Date date();
};
#endif /* DOXYGEN_API */
#endif /* SCRIPT_DATE_HPP */

View File

@ -169,11 +169,11 @@
return ::Engine::Get(engine_id)->GetDisplayMaxTractiveEffort() / 1000;
}
/* static */ ScriptDate::Date ScriptEngine::GetDesignDate(EngineID engine_id)
/* static */ ScriptCalendarDate *ScriptEngine::GetDesignDate(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return ScriptDate::DATE_INVALID;
if (!IsValidEngine(engine_id)) return new ScriptCalendarDate();
return (ScriptDate::Date)::Engine::Get(engine_id)->intro_date.base();
return new ScriptCalendarDate(static_cast<ScriptCalendarDate::Date>(::Engine::Get(engine_id)->intro_date.base()));
}
/* static */ ScriptVehicle::VehicleType ScriptEngine::GetVehicleType(EngineID engine_id)

View File

@ -173,7 +173,7 @@ public:
* @return The calendar-date this engine was designed.
* @see \ref ScriptCalendarTime
*/
static ScriptDate::Date GetDesignDate(EngineID engine_id);
static ScriptCalendarDate *GetDesignDate(EngineID engine_id);
/**
* Get the type of an engine.

View File

@ -49,11 +49,11 @@
return ::StrMakeValid(::GetString(STR_INDUSTRY_NAME, industry_id), {});
}
/* static */ ScriptDate::Date ScriptIndustry::GetConstructionDate(IndustryID industry_id)
/* static */ ScriptCalendarDate *ScriptIndustry::GetConstructionDate(IndustryID industry_id)
{
const Industry *i = Industry::GetIfValid(industry_id);
if (i == nullptr) return ScriptDate::DATE_INVALID;
return (ScriptDate::Date)i->construction_date.base();
if (i == nullptr) return new ScriptCalendarDate();
return new ScriptCalendarDate(static_cast<ScriptCalendarDate::Date>(i->construction_date.base()));
}
/* static */ bool ScriptIndustry::SetText(IndustryID industry_id, Text *text)
@ -226,18 +226,18 @@
return i->last_prod_year.base();
}
/* static */ ScriptDate::Date ScriptIndustry::GetCargoLastAcceptedDate(IndustryID industry_id, CargoType cargo_type)
/* static */ ScriptEconomyDate *ScriptIndustry::GetCargoLastAcceptedDate(IndustryID industry_id, CargoType cargo_type)
{
const Industry *i = Industry::GetIfValid(industry_id);
if (i == nullptr) return ScriptDate::DATE_INVALID;
if (i == nullptr) return new ScriptEconomyDate();
if (!::IsValidCargoType(cargo_type)) {
auto it = std::max_element(std::begin(i->accepted), std::end(i->accepted), [](const auto &a, const auto &b) { return a.last_accepted < b.last_accepted; });
return (ScriptDate::Date)it->last_accepted.base();
return new ScriptEconomyDate(static_cast<ScriptEconomyDate::Date>(it->last_accepted.base()));
} else {
auto it = i->GetCargoAccepted(cargo_type);
if (it == std::end(i->accepted)) return ScriptDate::DATE_INVALID;
return (ScriptDate::Date)it->last_accepted.base();
if (it == std::end(i->accepted)) return new ScriptEconomyDate();
return new ScriptEconomyDate(static_cast<ScriptEconomyDate::Date>(it->last_accepted.base()));
}
}

View File

@ -93,7 +93,7 @@ public:
* @see \ref ScriptCalendarTime
* @api -ai
*/
static ScriptDate::Date GetConstructionDate(IndustryID industry_id);
static ScriptCalendarDate *GetConstructionDate(IndustryID industry_id);
/**
* Set the custom text of an industry, shown in the GUI.
@ -265,11 +265,11 @@ public:
* @param cargo_type The cargo to query, or INVALID_CARGO to query latest of all accepted cargoes.
* @pre IsValidIndustry(industry_id).
* @pre IsValidCargo(cargo_type) || cargo_type == INVALID_CARGO.
* @return Economy-date the industry last received cargo from a delivery, or ScriptDate::DATE_INVALID on error.
* @return Economy-date the industry last received cargo from a delivery, ScriptEconomyDate::IsValid() returns false on error.
* @see \ref ScriptEconomyTime
* @api -ai
*/
static ScriptDate::Date GetCargoLastAcceptedDate(IndustryID industry_id, CargoType cargo_type);
static ScriptEconomyDate *GetCargoLastAcceptedDate(IndustryID industry_id, CargoType cargo_type);
/**
* Get the current control flags for an industry.

View File

@ -179,20 +179,21 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type)
return ScriptCompany::ToScriptCompanyID(StoryPage::Get(story_page_id)->company);
}
/* static */ ScriptDate::Date ScriptStoryPage::GetDate(StoryPageID story_page_id)
/* static */ ScriptCalendarDate *ScriptStoryPage::GetDate(StoryPageID story_page_id)
{
EnforcePrecondition(ScriptDate::DATE_INVALID, IsValidStoryPage(story_page_id));
EnforceDeityMode(ScriptDate::DATE_INVALID);
EnforcePrecondition(new ScriptCalendarDate(), IsValidStoryPage(story_page_id));
EnforceDeityMode(new ScriptCalendarDate());
return (ScriptDate::Date)StoryPage::Get(story_page_id)->date.base();
return new ScriptCalendarDate(static_cast<ScriptCalendarDate::Date>(StoryPage::Get(story_page_id)->date.base()));
}
/* static */ bool ScriptStoryPage::SetDate(StoryPageID story_page_id, ScriptDate::Date date)
/* static */ bool ScriptStoryPage::SetDate(StoryPageID story_page_id, ScriptCalendarDate *date)
{
EnforcePrecondition(false, IsValidStoryPage(story_page_id));
EnforceDeityMode(false);
if (date == nullptr) date = new ScriptCalendarDate();
return ScriptObject::Command<CMD_SET_STORY_PAGE_DATE>::Do(story_page_id, ::TimerGameCalendar::Date{date});
return ScriptObject::Command<CMD_SET_STORY_PAGE_DATE>::Do(story_page_id, ::TimerGameCalendar::Date{date->date()});
}

View File

@ -256,18 +256,18 @@ public:
* @pre IsValidStoryPage(story_page_id).
* @see \ref ScriptCalendarTime
*/
static ScriptDate::Date GetDate(StoryPageID story_page_id);
static ScriptCalendarDate *GetDate(StoryPageID story_page_id);
/**
* Update date of a story page. The date is shown in the top left of the page
* @param story_page_id The story page to set the date for.
* @param date Calendar-date to display at the top of story page or ScriptDate::DATE_INVALID to disable showing date on this page. (also, @see ScriptDate)
* @param date Calendar-date to display at the top of story page or null to disable showing date on this page. (also, @see ScriptCalendarDate)
* @return True if the action succeeded.
* @pre ScriptCompanyMode::IsDeity().
* @pre IsValidStoryPage(story_page_id).
* @see \ref ScriptCalendarTime
*/
static bool SetDate(StoryPageID story_page_id, ScriptDate::Date date);
static bool SetDate(StoryPageID story_page_id, ScriptCalendarDate *date);
/**
* Update title of a story page. The title is shown in the page selector drop down.

View File

@ -53,9 +53,9 @@
return ScriptCompany::ToScriptCompanyID(::Subsidy::Get(subsidy_id)->awarded);
}
/* static */ ScriptDate::Date ScriptSubsidy::GetExpireDate(SubsidyID subsidy_id)
/* static */ ScriptEconomyDate *ScriptSubsidy::GetExpireDate(SubsidyID subsidy_id)
{
if (!IsValidSubsidy(subsidy_id)) return ScriptDate::DATE_INVALID;
if (!IsValidSubsidy(subsidy_id)) return new ScriptEconomyDate();
TimerGameEconomy::YearMonthDay ymd = TimerGameEconomy::ConvertDateToYMD(TimerGameEconomy::date);
ymd.day = 1;
@ -63,7 +63,7 @@
ymd.month = m % 12;
ymd.year += TimerGameEconomy::Year{m / 12};
return (ScriptDate::Date)TimerGameEconomy::ConvertYMDToDate(ymd.year, ymd.month, ymd.day).base();
return ScriptEconomyDate::GetDate(ymd.year.base(), ymd.month + 1, ymd.day);
}
/* static */ CargoType ScriptSubsidy::GetCargoType(SubsidyID subsidy_id)

View File

@ -85,7 +85,7 @@ public:
* awarded.
* @see \ref ScriptEconomyTime
*/
static ScriptDate::Date GetExpireDate(SubsidyID subsidy_id);
static ScriptEconomyDate *GetExpireDate(SubsidyID subsidy_id);
/**
* Get the cargo type that has to be transported in order to be awarded this

View File

@ -0,0 +1,24 @@
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../script_date.hpp"
namespace SQConvert {
/* Allow ScriptEconomyDate to be used as Squirrel parameter */
template <> struct Param<ScriptEconomyDate *> { static inline ScriptEconomyDate *Get(HSQUIRRELVM vm, int index) { return static_cast<ScriptEconomyDate *>(sq_gettype(vm, index) == OT_NULL ? nullptr : Squirrel::GetRealInstance(vm, index, "EconomyDate")); } };
template <> struct Param<ScriptEconomyDate &> { static inline ScriptEconomyDate &Get(HSQUIRRELVM vm, int index) { return *static_cast<ScriptEconomyDate *>(Squirrel::GetRealInstance(vm, index, "EconomyDate")); } };
template <> struct Param<const ScriptEconomyDate *> { static inline const ScriptEconomyDate *Get(HSQUIRRELVM vm, int index) { return static_cast<ScriptEconomyDate *>(sq_gettype(vm, index) == OT_NULL ? nullptr : Squirrel::GetRealInstance(vm, index, "EconomyDate")); } };
template <> struct Param<const ScriptEconomyDate &> { static inline const ScriptEconomyDate &Get(HSQUIRRELVM vm, int index) { return *static_cast<ScriptEconomyDate *>(Squirrel::GetRealInstance(vm, index, "EconomyDate")); } };
template <> struct Return<ScriptEconomyDate *> { static inline int Set(HSQUIRRELVM vm, ScriptEconomyDate *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "EconomyDate", res, nullptr, DefSQDestructorCallback<ScriptEconomyDate>, true); return 1; } };
/* Allow ScriptCalendarDate to be used as Squirrel parameter */
template <> struct Param<ScriptCalendarDate *> { static inline ScriptCalendarDate *Get(HSQUIRRELVM vm, int index) { return static_cast<ScriptCalendarDate *>(sq_gettype(vm, index) == OT_NULL ? nullptr : Squirrel::GetRealInstance(vm, index, "CalendarDate")); } };
template <> struct Param<ScriptCalendarDate &> { static inline ScriptCalendarDate &Get(HSQUIRRELVM vm, int index) { return *static_cast<ScriptCalendarDate *>(Squirrel::GetRealInstance(vm, index, "CalendarDate")); } };
template <> struct Param<const ScriptCalendarDate *> { static inline const ScriptCalendarDate *Get(HSQUIRRELVM vm, int index) { return static_cast<ScriptCalendarDate *>(sq_gettype(vm, index) == OT_NULL ? nullptr : Squirrel::GetRealInstance(vm, index, "CalendarDate")); } };
template <> struct Param<const ScriptCalendarDate &> { static inline const ScriptCalendarDate &Get(HSQUIRRELVM vm, int index) { return *static_cast<ScriptCalendarDate *>(Squirrel::GetRealInstance(vm, index, "CalendarDate")); } };
template <> struct Return<ScriptCalendarDate *> { static inline int Set(HSQUIRRELVM vm, ScriptCalendarDate *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CalendarDate", res, nullptr, DefSQDestructorCallback<ScriptCalendarDate>, true); return 1; } };
} // namespace SQConvert