private void InstallLocalization()
{
if (sm_localizationInitialized)
return;
Logger.LogInfo("Updating Localization.");
try
{
// Localization
Locale locale = (Locale)typeof(LocaleManager).GetFieldByName("m_Locale").GetValue(SingletonLite<LocaleManager>.instance);
if (locale == null)
throw new KeyNotFoundException("Locale is null");
// Road Customizer Tool Advisor
Locale.Key k = new Locale.Key()
{
m_Identifier = "TUTORIAL_ADVISER_TITLE",
m_Key = "RoadCustomizer"
};
locale.AddLocalizedString(k, "Road Customizer Tool");
k = new Locale.Key()
{
m_Identifier = "TUTORIAL_ADVISER",
m_Key = "RoadCustomizer"
};
locale.AddLocalizedString(k, "Vehicle and Speed Restrictions:\n\n" +
"1. Hover over roads to display their lanes\n" +
"2. Left-click to toggle selection of lane(s), right-click clears current selection(s)\n" +
"3. With lanes selected, set vehicle and speed restrictions using the menu icons\n\n\n" +
"Lane Changer:\n\n" +
"1. Hover over roads and find an intersection (circle appears), then click to edit it\n" +
"2. Entry points will be shown, click one to select it (right-click goes back to step 1)\n" +
"3. Click the exit routes you wish to allow (right-click goes back to step 2)" +
"\n\nUse PageUp/PageDown to toggle Underground View.");
sm_localizationInitialized = true;
}
catch (ArgumentException e)
{
Logger.LogInfo("Unexpected " + e.GetType().Name + " updating localization: " + e.Message + "\n" + e.StackTrace + "\n");
}
Logger.LogInfo("Localization successfully updated.");
}
}