Commit 04e55999 authored by S520's avatar S520

Change: Rename OpenBveApi.Interface.Interface to OpenBveApi.Interface.Translations

parent 81262566
......@@ -3,6 +3,7 @@ using System.IO;
using System.Windows.Forms;
using OpenTK;
using OpenTK.Audio.OpenAL;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -92,18 +93,18 @@ namespace OpenBve
}
catch
{
MessageBox.Show(OpenBveApi.Interface.Interface.GetInterfaceString("errors_sound_openal_version"), OpenBveApi.Interface.Interface.GetInterfaceString("program_title"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
MessageBox.Show(Translations.GetInterfaceString("errors_sound_openal_version"), Translations.GetInterfaceString("program_title"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
AL.DistanceModel(ALDistanceModel.None);
return;
}
Alc.CloseDevice(OpenAlDevice);
OpenAlDevice = IntPtr.Zero;
MessageBox.Show(OpenBveApi.Interface.Interface.GetInterfaceString("errors_sound_openal_context"), OpenBveApi.Interface.Interface.GetInterfaceString("program_title"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
MessageBox.Show(Translations.GetInterfaceString("errors_sound_openal_context"), Translations.GetInterfaceString("program_title"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
return;
}
OpenAlContext = ContextHandle.Zero;
MessageBox.Show(OpenBveApi.Interface.Interface.GetInterfaceString("errors_sound_openal_device"), OpenBveApi.Interface.Interface.GetInterfaceString("program_title"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
MessageBox.Show(Translations.GetInterfaceString("errors_sound_openal_device"), Translations.GetInterfaceString("program_title"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
/// <summary>Deinitializes audio.</summary>
......
using OpenBveApi.Colors;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -115,11 +116,11 @@ namespace OpenBve
{
if (Train.CurrentSectionLimit == 0.0 && Game.MinimalisticSimulation == false)
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_signal_stop"), MessageManager.MessageDependency.PassedRedSignal, Interface.GameMode.Normal, MessageColor.Red, double.PositiveInfinity, null);
Game.AddMessage(Translations.GetInterfaceString("message_signal_stop"), MessageManager.MessageDependency.PassedRedSignal, Interface.GameMode.Normal, MessageColor.Red, double.PositiveInfinity, null);
}
else if (Train.Specs.CurrentAverageSpeed > Train.CurrentSectionLimit)
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_signal_overspeed"), MessageManager.MessageDependency.SectionLimit, Interface.GameMode.Normal, MessageColor.Orange, double.PositiveInfinity, null);
Game.AddMessage(Translations.GetInterfaceString("message_signal_overspeed"), MessageManager.MessageDependency.SectionLimit, Interface.GameMode.Normal, MessageColor.Orange, double.PositiveInfinity, null);
}
}
}
......
using System;
using OpenBveApi.Colors;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -69,7 +70,7 @@ namespace OpenBve
}
if (Train.Specs.CurrentAverageSpeed > this.NextSpeedLimit)
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_route_overspeed"), MessageManager.MessageDependency.RouteLimit, Interface.GameMode.Normal, MessageColor.Orange, double.PositiveInfinity, null);
Game.AddMessage(Translations.GetInterfaceString("message_route_overspeed"), MessageManager.MessageDependency.RouteLimit, Interface.GameMode.Normal, MessageColor.Orange, double.PositiveInfinity, null);
}
}
else if (TriggerType == EventTriggerType.RearCarRearAxle)
......
using OpenBveApi.Colors;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -140,13 +141,13 @@ namespace OpenBve
{
if (Game.PlayerStopsAtStation(StationIndex) & TrainManager.PlayerTrain.StationState == TrainManager.TrainStopState.Pending)
{
string s = OpenBveApi.Interface.Interface.GetInterfaceString("message_station_passed");
string s = Translations.GetInterfaceString("message_station_passed");
s = s.Replace("[name]", Game.Stations[StationIndex].Name);
Game.AddMessage(s, MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.Orange, Game.SecondsSinceMidnight + 10.0, null);
}
else if (Game.PlayerStopsAtStation(StationIndex) & TrainManager.PlayerTrain.StationState == TrainManager.TrainStopState.Boarding)
{
string s = OpenBveApi.Interface.Interface.GetInterfaceString("message_station_passed_boarding");
string s = Translations.GetInterfaceString("message_station_passed_boarding");
s = s.Replace("[name]", Game.Stations[StationIndex].Name);
Game.AddMessage(s, MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.Red, Game.SecondsSinceMidnight + 10.0, null);
}
......
This diff is collapsed.
......@@ -2,6 +2,7 @@
using OpenTK.Graphics.OpenGL;
using System.Drawing;
using OpenBveApi.Textures;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -49,10 +50,10 @@ namespace OpenBve
//
/// <summary>Processes commands.</summary>
/// <returns><c>true</c>, if command was processed, <c>false</c> otherwise.</returns>
/// <param name="command">The OpenBveApi.Interface.Interface.Command command to process.</param>
internal bool ProcessCommand(OpenBveApi.Interface.Interface.Command command)
/// <param name="command">The Translations.Command command to process.</param>
internal bool ProcessCommand(Translations.Command command)
{
if (command != OpenBveApi.Interface.Interface.Command.RouteInformation) // only accept RouteInformation command
if (command != Translations.Command.RouteInformation) // only accept RouteInformation command
return false;
// cycle through available state
setState( (state)((int)(currentState + 1) % (int)state.numOf) );
......
......@@ -2,6 +2,7 @@
using OpenBveApi.Colors;
using OpenBveApi.Math;
using OpenBveApi.Runtime;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -284,11 +285,11 @@ namespace OpenBve
double y = (double)this.CurrentValue / (double)Maximum;
if (y < 0.0) y = 0.0;
if (y > 1.0) y = 1.0;
int k = (int)Math.Floor(y * (double)OpenBveApi.Interface.Interface.RatingsCount);
if (k >= OpenBveApi.Interface.Interface.RatingsCount) k = OpenBveApi.Interface.Interface.RatingsCount - 1;
int k = (int)Math.Floor(y * (double)Translations.RatingsCount);
if (k >= Translations.RatingsCount) k = Translations.RatingsCount - 1;
System.Globalization.CultureInfo Culture = System.Globalization.CultureInfo.InvariantCulture;
AddScore(OpenBveApi.Interface.Interface.GetInterfaceString("score_rating"), 20.0);
AddScore(OpenBveApi.Interface.Interface.GetInterfaceString("rating_" + k.ToString(Culture)) + " (" + (100.0 * y).ToString("0.00", Culture) + "%)", 20.0);
AddScore(Translations.GetInterfaceString("score_rating"), 20.0);
AddScore(Translations.GetInterfaceString("rating_" + k.ToString(Culture)) + " (" + (100.0 * y).ToString("0.00", Culture) + "%)", 20.0);
}
}
}
......
......@@ -3,6 +3,7 @@ using System.Drawing;
using OpenBveApi;
using OpenBveApi.Runtime;
using OpenBveApi.Textures;
using OpenBveApi.Interface;
namespace OpenBve {
internal static class Timetable {
......@@ -210,7 +211,7 @@ namespace OpenBve {
y0 += descriptionheight + 2;
}
// highest speed
t = OpenBveApi.Interface.Interface.GetInterfaceString("timetable_highestspeed");
t = Translations.GetInterfaceString("timetable_highestspeed");
s = g.MeasureString(t, fs);
g.DrawString(t, fs, Brushes.Black, x0, y0);
float y0a = y0 + s.Height + 2;
......@@ -225,7 +226,7 @@ namespace OpenBve {
}
g.DrawLine(Pens.LightGray, new PointF(x1 - 2, 4 + descriptionheight), new PointF(x1 - 2, y0a + 18 * Table.Tracks.Length - 1));
// driving time
t = OpenBveApi.Interface.Interface.GetInterfaceString("timetable_drivingtime");
t = Translations.GetInterfaceString("timetable_drivingtime");
s = g.MeasureString(t, fs);
g.DrawString(t, fs, Brushes.Black, x1, y0);
float x2 = x1 + s.Width + 4;
......@@ -260,7 +261,7 @@ namespace OpenBve {
g.DrawLine(Pens.LightGray, new PointF(x2 - 2, 4 + descriptionheight), new PointF(x2 - 2, y0a + 18 * Table.Tracks.Length - 1));
// station name
float y2 = y0;
t = OpenBveApi.Interface.Interface.GetInterfaceString("timetable_stationname");
t = Translations.GetInterfaceString("timetable_stationname");
s = g.MeasureString(t, f);
g.DrawString(t, f, Brushes.Black, x2, y2);
float x3 = x2 + s.Width + 4;
......@@ -295,7 +296,7 @@ namespace OpenBve {
stationnamewidth = x3 - x2 - 6;
}
// arrival time
t = OpenBveApi.Interface.Interface.GetInterfaceString("timetable_arrivaltime");
t = Translations.GetInterfaceString("timetable_arrivaltime");
s = g.MeasureString(t, f);
g.DrawString(t, f, Brushes.Black, x3, y2);
float x4 = x3 + s.Width + 4;
......@@ -330,7 +331,7 @@ namespace OpenBve {
}
g.DrawLine(Pens.LightGray, new PointF(x4 - 2, 4 + descriptionheight), new PointF(x4 - 2, y0 + 18 * (Table.Stations.Length + 1)));
// departure time
t = OpenBveApi.Interface.Interface.GetInterfaceString("timetable_departuretime");
t = Translations.GetInterfaceString("timetable_departuretime");
s = g.MeasureString(t, f);
g.DrawString(t, f, Brushes.Black, x4, y2);
float x5 = x4 + s.Width + 4;
......
......@@ -3,6 +3,7 @@ using System.Drawing;
using OpenBveApi.Colors;
using OpenBveApi.Graphics;
using OpenBveApi.Textures;
using OpenBveApi.Interface;
using OpenTK.Graphics.OpenGL;
namespace OpenBve {
......@@ -155,7 +156,7 @@ namespace OpenBve {
double routeProgress = Math.Max(0.0, Math.Min(1.0, Loading.RouteProgress));
double trainProgress = Math.Max(0.0, Math.Min(1.0, Loading.TrainProgress));
// draw progress message right above the second division
string text = OpenBveApi.Interface.Interface.GetInterfaceString(
string text = Translations.GetInterfaceString(
routeProgress < 1.0 ? "loading_loading_route" :
(trainProgress < 1.0 ? "loading_loading_train" : "message_loading") );
DrawString(Fonts.SmallFont, text, new Point(halfWidth, progressTop - fontHeight - 6),
......
using System;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -32,46 +33,46 @@ namespace OpenBve
this.Text = null;
break;
case LampType.Ats:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_ats");
this.Text = Translations.GetInterfaceString("lamps_ats");
break;
case LampType.AtsOperation:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atsoperation");
this.Text = Translations.GetInterfaceString("lamps_atsoperation");
break;
case LampType.AtsPPower:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atsppower");
this.Text = Translations.GetInterfaceString("lamps_atsppower");
break;
case LampType.AtsPPattern:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atsppattern");
this.Text = Translations.GetInterfaceString("lamps_atsppattern");
break;
case LampType.AtsPBrakeOverride:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atspbrakeoverride");
this.Text = Translations.GetInterfaceString("lamps_atspbrakeoverride");
break;
case LampType.AtsPBrakeOperation:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atspbrakeoperation");
this.Text = Translations.GetInterfaceString("lamps_atspbrakeoperation");
break;
case LampType.AtsP:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atsp");
this.Text = Translations.GetInterfaceString("lamps_atsp");
break;
case LampType.AtsPFailure:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atspfailure");
this.Text = Translations.GetInterfaceString("lamps_atspfailure");
break;
case LampType.Atc:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atc");
this.Text = Translations.GetInterfaceString("lamps_atc");
break;
case LampType.AtcPower:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atcpower");
this.Text = Translations.GetInterfaceString("lamps_atcpower");
break;
case LampType.AtcUse:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atcuse");
this.Text = Translations.GetInterfaceString("lamps_atcuse");
break;
case LampType.AtcEmergency:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_atcemergency");
this.Text = Translations.GetInterfaceString("lamps_atcemergency");
break;
case LampType.Eb:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_eb");
this.Text = Translations.GetInterfaceString("lamps_eb");
break;
case LampType.ConstSpeed:
this.Text = OpenBveApi.Interface.Interface.GetInterfaceString("lamps_constspeed");
this.Text = Translations.GetInterfaceString("lamps_constspeed");
break;
default:
this.Text = "TEXT";
......
......@@ -2,6 +2,7 @@
using OpenBveApi.Colors;
using OpenBveApi.Graphics;
using OpenBveApi.Textures;
using OpenBveApi.Interface;
using OpenTK.Graphics.OpenGL;
namespace OpenBve
......@@ -55,7 +56,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleBackward;
t = Translations.QuickReferences.HandleBackward;
}
}
else if (TrainManager.PlayerTrain.Handles.Reverser.Driver > 0)
......@@ -67,7 +68,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleForward;
t = Translations.QuickReferences.HandleForward;
}
}
else
......@@ -79,7 +80,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleNeutral;
t = Translations.QuickReferences.HandleNeutral;
}
}
Element.TransitionState = 0.0;
......@@ -98,7 +99,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandlePowerNull;
t = Translations.QuickReferences.HandlePowerNull;
}
}
else
......@@ -110,7 +111,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandlePower + TrainManager.PlayerTrain.Handles.Power.Driver.ToString(Culture);
t = Translations.QuickReferences.HandlePower + TrainManager.PlayerTrain.Handles.Power.Driver.ToString(Culture);
}
}
......@@ -132,7 +133,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleEmergency;
t = Translations.QuickReferences.HandleEmergency;
}
}
else if (TrainManager.PlayerTrain.Handles.Brake.Driver == (int)TrainManager.AirBrakeHandleState.Release)
......@@ -144,7 +145,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleRelease;
t = Translations.QuickReferences.HandleRelease;
}
}
else if (TrainManager.PlayerTrain.Handles.Brake.Driver == (int)TrainManager.AirBrakeHandleState.Lap)
......@@ -156,7 +157,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleLap;
t = Translations.QuickReferences.HandleLap;
}
}
else
......@@ -168,7 +169,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleService;
t = Translations.QuickReferences.HandleService;
}
}
......@@ -184,7 +185,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleEmergency;
t = Translations.QuickReferences.HandleEmergency;
}
}
else if (TrainManager.PlayerTrain.Handles.HoldBrake.Driver)
......@@ -196,7 +197,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleHoldBrake;
t = Translations.QuickReferences.HandleHoldBrake;
}
}
else if (TrainManager.PlayerTrain.Handles.Brake.Driver == 0)
......@@ -208,7 +209,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleBrakeNull;
t = Translations.QuickReferences.HandleBrakeNull;
}
}
else
......@@ -220,7 +221,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleBrake + TrainManager.PlayerTrain.Handles.Brake.Driver.ToString(Culture);
t = Translations.QuickReferences.HandleBrake + TrainManager.PlayerTrain.Handles.Brake.Driver.ToString(Culture);
}
}
......@@ -244,7 +245,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleRelease;
t = Translations.QuickReferences.HandleRelease;
}
}
else if (TrainManager.PlayerTrain.Handles.LocoBrake.Driver == (int)TrainManager.AirBrakeHandleState.Lap)
......@@ -256,7 +257,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleLap;
t = Translations.QuickReferences.HandleLap;
}
}
else
......@@ -268,7 +269,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleService;
t = Translations.QuickReferences.HandleService;
}
}
......@@ -284,7 +285,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleBrakeNull;
t = Translations.QuickReferences.HandleBrakeNull;
}
}
else
......@@ -296,7 +297,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleLocoBrake + TrainManager.PlayerTrain.Handles.LocoBrake.Driver.ToString(Culture);
t = Translations.QuickReferences.HandleLocoBrake + TrainManager.PlayerTrain.Handles.LocoBrake.Driver.ToString(Culture);
}
}
......@@ -317,7 +318,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleEmergency;
t = Translations.QuickReferences.HandleEmergency;
}
}
else if (TrainManager.PlayerTrain.Handles.HoldBrake.Driver)
......@@ -329,7 +330,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleHoldBrake;
t = Translations.QuickReferences.HandleHoldBrake;
}
}
else if (TrainManager.PlayerTrain.Handles.Brake.Driver > 0)
......@@ -341,7 +342,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandleBrake + TrainManager.PlayerTrain.Handles.Brake.Driver.ToString(Culture);
t = Translations.QuickReferences.HandleBrake + TrainManager.PlayerTrain.Handles.Brake.Driver.ToString(Culture);
}
}
else if (TrainManager.PlayerTrain.Handles.Power.Driver > 0)
......@@ -353,7 +354,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandlePower + TrainManager.PlayerTrain.Handles.Power.Driver.ToString(Culture);
t = Translations.QuickReferences.HandlePower + TrainManager.PlayerTrain.Handles.Power.Driver.ToString(Culture);
}
}
else
......@@ -365,7 +366,7 @@ namespace OpenBve
}
else
{
t = OpenBveApi.Interface.Interface.QuickReferences.HandlePowerNull;
t = Translations.QuickReferences.HandlePowerNull;
}
}
Element.TransitionState = 0.0;
......@@ -400,7 +401,7 @@ namespace OpenBve
{
sc = MessageColor.Blue;
}
t = Command == "doorsleft" ? OpenBveApi.Interface.Interface.QuickReferences.DoorsLeft : OpenBveApi.Interface.Interface.QuickReferences.DoorsRight;
t = Command == "doorsleft" ? Translations.QuickReferences.DoorsLeft : Translations.QuickReferences.DoorsRight;
} break;
case "stopleft":
case "stopright":
......
......@@ -4,6 +4,7 @@ using System.Windows.Forms;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenBveApi.Interface;
namespace OpenBve
......@@ -179,8 +180,8 @@ namespace OpenBve
System.Threading.Thread.Sleep(20);
if (Program.currentGameWindow.WindowState != WindowState.Fullscreen)
{
MessageBox.Show(OpenBveApi.Interface.Interface.GetInterfaceString("errors_fullscreen_switch1") + System.Environment.NewLine +
OpenBveApi.Interface.Interface.GetInterfaceString("errors_fullscreen_switch2"), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
MessageBox.Show(Translations.GetInterfaceString("errors_fullscreen_switch1") + System.Environment.NewLine +
Translations.GetInterfaceString("errors_fullscreen_switch2"), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
Fullscreen = false;
}
}
......
using System;
using System.Windows.Forms;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -57,7 +58,7 @@ namespace OpenBve
}
catch
{
var currentError = OpenBveApi.Interface.Interface.GetInterfaceString("errors_critical_file");
var currentError = Translations.GetInterfaceString("errors_critical_file");
currentError = currentError.Replace("[file]", "panel.animated");
MessageBox.Show(currentError, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
Program.RestartArguments = " ";
......@@ -97,7 +98,7 @@ namespace OpenBve
}
catch
{
var currentError = OpenBveApi.Interface.Interface.GetInterfaceString("errors_critical_file");
var currentError = Translations.GetInterfaceString("errors_critical_file");
currentError = currentError.Replace("[file]", Panel2 == true ? "panel2.cfg" : "panel.cfg");
MessageBox.Show(currentError, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand);
Program.RestartArguments = " ";
......
......@@ -4,6 +4,7 @@ using OpenBveApi.Colors;
using OpenBveApi.Math;
using OpenBveApi.Runtime;
using OpenBveApi.World;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -19,7 +20,7 @@ namespace OpenBve
{
if (freeObjCount == 0 && railtypeCount == 0)
{
throw new Exception(OpenBveApi.Interface.Interface.GetInterfaceString("errors_route_corrupt_noobjects"));
throw new Exception(Translations.GetInterfaceString("errors_route_corrupt_noobjects"));
}
}
string SignalPath, LimitPath, LimitGraphicsPath, TransponderPath;
......
using System;
using OpenBveApi.Colors;
using OpenBveApi.Runtime;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -149,32 +150,32 @@ namespace OpenBve
string s;
if (early < -1.0)
{
s = OpenBveApi.Interface.Interface.GetInterfaceString("message_station_arrival_late");
s = Translations.GetInterfaceString("message_station_arrival_late");
}
else if (early > 1.0)
{
s = OpenBveApi.Interface.Interface.GetInterfaceString("message_station_arrival_early");
s = Translations.GetInterfaceString("message_station_arrival_early");
}
else
{
s = OpenBveApi.Interface.Interface.GetInterfaceString("message_station_arrival");
s = Translations.GetInterfaceString("message_station_arrival");
}
System.Globalization.CultureInfo Culture = System.Globalization.CultureInfo.InvariantCulture;
TimeSpan a = TimeSpan.FromSeconds(Math.Abs(early));
string b = a.Hours.ToString("00", Culture) + ":" + a.Minutes.ToString("00", Culture) + ":" + a.Seconds.ToString("00", Culture);
if (Train.StationDistanceToStopPoint < -0.1)
{
s += OpenBveApi.Interface.Interface.GetInterfaceString("message_delimiter") + OpenBveApi.Interface.Interface.GetInterfaceString("message_station_overrun");
s += Translations.GetInterfaceString("message_delimiter") + Translations.GetInterfaceString("message_station_overrun");
}
else if (Train.StationDistanceToStopPoint > 0.1)
{
s += OpenBveApi.Interface.Interface.GetInterfaceString("message_delimiter") + OpenBveApi.Interface.Interface.GetInterfaceString("message_station_underrun");
s += Translations.GetInterfaceString("message_delimiter") + Translations.GetInterfaceString("message_station_underrun");
}
double d = Math.Abs(Train.StationDistanceToStopPoint);
string c = d.ToString("0.0", Culture);
if (Game.Stations[i].Type == StationType.Terminal)
{
s += OpenBveApi.Interface.Interface.GetInterfaceString("message_delimiter") + OpenBveApi.Interface.Interface.GetInterfaceString("message_station_terminal");
s += Translations.GetInterfaceString("message_delimiter") + Translations.GetInterfaceString("message_station_terminal");
}
s = s.Replace("[name]", Game.Stations[i].Name);
s = s.Replace("[time]", b);
......@@ -182,7 +183,7 @@ namespace OpenBve
Game.AddMessage(s, MessageManager.MessageDependency.StationArrival, Interface.GameMode.Normal, MessageColor.White, Game.SecondsSinceMidnight + 10.0, null);
if (Game.Stations[i].Type == StationType.Normal)
{
s = OpenBveApi.Interface.Interface.GetInterfaceString("message_station_deadline");
s = Translations.GetInterfaceString("message_station_deadline");
Game.AddMessage(s, MessageManager.MessageDependency.StationDeparture, Interface.GameMode.Normal, MessageColor.White, double.PositiveInfinity, null);
}
Timetable.UpdateCustomTimetable(Game.Stations[i].TimetableDaytimeTexture, Game.Stations[i].TimetableNighttimeTexture);
......@@ -229,7 +230,7 @@ namespace OpenBve
}
if (Train == TrainManager.PlayerTrain)
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_station_correct"), MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.Orange, Game.SecondsSinceMidnight + 5.0, null);
Game.AddMessage(Translations.GetInterfaceString("message_station_correct"), MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.Orange, Game.SecondsSinceMidnight + 5.0, null);
}
Train.StationAdjust = true;
}
......@@ -411,11 +412,11 @@ namespace OpenBve
{
if (!Game.Stations[i].OpenLeftDoors & !Game.Stations[i].OpenRightDoors | Train.Specs.DoorCloseMode != DoorMode.Manual)
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_station_depart"), MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.White, Game.SecondsSinceMidnight + 5.0, null);
Game.AddMessage(Translations.GetInterfaceString("message_station_depart"), MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.White, Game.SecondsSinceMidnight + 5.0, null);
}
else
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_station_depart_closedoors"), MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.White, Game.SecondsSinceMidnight + 5.0, null);
Game.AddMessage(Translations.GetInterfaceString("message_station_depart_closedoors"), MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.White, Game.SecondsSinceMidnight + 5.0, null);
}
}
else if (Game.Stations[i].Type == StationType.ChangeEnds)
......@@ -447,7 +448,7 @@ namespace OpenBve
Train.StationState = TrainStopState.Completed;
if (Train == PlayerTrain & Game.Stations[i].Type == StationType.Normal)
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_station_depart"), MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.White, Game.SecondsSinceMidnight + 5.0, null);
Game.AddMessage(Translations.GetInterfaceString("message_station_depart"), MessageManager.MessageDependency.None, Interface.GameMode.Normal, MessageColor.White, Game.SecondsSinceMidnight + 5.0, null);
}
}
}
......
......@@ -3,6 +3,7 @@ using OpenBve.BrakeSystems;
using OpenBveApi.Colors;
using OpenBveApi.Runtime;
using OpenBveApi.Math;
using OpenBveApi.Interface;
namespace OpenBve
{
......@@ -203,15 +204,15 @@ namespace OpenBve
{
if (Specs.CurrentAverageSpeed > CurrentRouteLimit)
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_route_overspeed"), MessageManager.MessageDependency.RouteLimit, Interface.GameMode.Arcade, MessageColor.Orange, Double.PositiveInfinity, null);
Game.AddMessage(Translations.GetInterfaceString("message_route_overspeed"), MessageManager.MessageDependency.RouteLimit, Interface.GameMode.Arcade, MessageColor.Orange, Double.PositiveInfinity, null);
}
if (CurrentSectionLimit == 0.0)
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_signal_stop"), MessageManager.MessageDependency.PassedRedSignal, Interface.GameMode.Normal, MessageColor.Red, double.PositiveInfinity, null);
Game.AddMessage(Translations.GetInterfaceString("message_signal_stop"), MessageManager.MessageDependency.PassedRedSignal, Interface.GameMode.Normal, MessageColor.Red, double.PositiveInfinity, null);
}
else if (Specs.CurrentAverageSpeed > CurrentSectionLimit)
{
Game.AddMessage(OpenBveApi.Interface.Interface.GetInterfaceString("message_signal_overspeed"), MessageManager.MessageDependency.SectionLimit, Interface.GameMode.Normal, MessageColor.Orange, Double.PositiveInfinity, null);
Game.AddMessage(Translations.GetInterfaceString("message_signal_overspeed"), MessageManager.MessageDependency.SectionLimit, Interface.GameMode.Normal, MessageColor.Orange, Double.PositiveInfinity, null);
}
}
if (AI != null)
......@@ -318,7 +319,7 @@ namespace OpenBve
CurrentSectionLimit = 6.94444444444444;
if (this == PlayerTrain)
{
string s = OpenBveApi.Interface.Interface.GetInterfaceString("message_signal_proceed");
string s = Translations.GetInterfaceString("message_signal_proceed");
double a = (3.6 * CurrentSectionLimit) * Game.SpeedConversionFactor;
s = s.Replace("[speed]", a.ToString("0", CultureInfo.InvariantCulture));
s = s.Replace("[unit]", Game.UnitOfSpeed);
......