Skip to content

Commit 5f478a3

Browse files
committed
Merge branch 'master' into theme/chinese-signs; Fix for bad merge
2 parents c58e35c + 82d73bb commit 5f478a3

File tree

6 files changed

+17
-10
lines changed

6 files changed

+17
-10
lines changed

TLM/TLM/Manager/Impl/OptionsManager.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public byte[] SaveData(ref bool success) {
309309
/// Triggers a rebuild of the main menu (toolbar), adding/removing buttons
310310
/// where applicable, and refreshing all translated text. Very slow.
311311
/// </summary>
312-
internal static void RebuildMenu() {
312+
internal static void RebuildMenu(bool languageChanged = false) {
313313
if (TMPELifecycle.Instance.Deserializing || ModUI.Instance == null) {
314314
Log._Debug("OptionsManager.RebuildMenu() - Ignoring; Deserialising or ModUI.Instance is null");
315315
return;
@@ -323,9 +323,11 @@ internal static void RebuildMenu() {
323323
ModUI.Instance.MainMenuButton.UpdateButtonSkinAndTooltip();
324324
}
325325

326-
TrafficLightTextures.Instance.ReloadTexturesWithTranslation();
327-
TMPELifecycle.Instance.TranslationDatabase.ReloadTutorialTranslations();
328-
TMPELifecycle.Instance.TranslationDatabase.ReloadGuideTranslations();
326+
if (languageChanged) {
327+
TrafficLightTextures.Instance.ReloadTexturesWithTranslation();
328+
TMPELifecycle.Instance.TranslationDatabase.ReloadTutorialTranslations();
329+
TMPELifecycle.Instance.TranslationDatabase.ReloadGuideTranslations();
330+
}
329331
}
330332

331333
/// <summary>

TLM/TLM/Resources/incompatible_mods.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,7 @@
8282
2730687809;Network Extensions 3 - malware: https://github.com/CitiesSkylinesMods/TMPE/pull/1389
8383
2733711176;CSM FIX
8484
2749420751;Uninspected TM:PE clone
85+
2759913350;1632320836 Service Vehicles Manager 2.0
86+
2764576667;CSM
87+
2781822295;交通管理器 汉化版TMPE_V11_STABLE
88+
2782552305;CSM

TLM/TLM/State/OptionsTabs/GeneralTab_LocalisationGroup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private static void OnLanguageChanged(int newLanguageIndex) {
101101

102102
// TODO: Move this to the owner class and implement IObserver<ModUI.EventPublishers.LanguageChangeNotification>
103103
Translation.SetCurrentLanguageToGameLanguage();
104-
OptionsManager.RebuildMenu();
104+
OptionsManager.RebuildMenu(true);
105105
} else if (newLanguageIndex - 1 < Translation.AvailableLanguageCodes.Count) {
106106
// use tmpe language
107107
string newLang = Translation.AvailableLanguageCodes[newLanguageIndex - 1];
@@ -110,7 +110,7 @@ private static void OnLanguageChanged(int newLanguageIndex) {
110110

111111
// TODO: Move this to the owner class and implement IObserver<ModUI.EventPublishers.LanguageChangeNotification>
112112
Translation.SetCurrentLanguageToTMPELanguage();
113-
OptionsManager.RebuildMenu();
113+
OptionsManager.RebuildMenu(true);
114114
} else {
115115
Log.Warning($"GeneralTab.LocalisationGroup.onLanguageChanged({newLanguageIndex}): Invalid language index");
116116
return;

TLM/TLM/TLM.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@
916916
<None Include="packages.config" />
917917
</ItemGroup>
918918
<ItemGroup>
919-
<Analyzer Include="..\packages\Microsoft.Unity.Analyzers.1.7.0\analyzers\dotnet\cs\Microsoft.Unity.Analyzers.dll" />
919+
<Analyzer Include="..\packages\Microsoft.Unity.Analyzers.1.13.0\analyzers\dotnet\cs\Microsoft.Unity.Analyzers.dll" />
920920
<Analyzer Include="..\packages\ReflectionIT.Analyzer.Structs.0.1.0\analyzers\dotnet\cs\ReflectionIT.Analyzer.Structs.dll" />
921921
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
922922
<Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />

TLM/TLM/UI/ModUI.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ internal void RebuildMenu() {
146146
UnityEngine.Object.Destroy(keyHandler);
147147
}
148148

149-
UnityEngine.Object.Destroy(MainMenu);
150-
UnityEngine.Object.Destroy(MainMenuButton);
149+
// intentionally DestroyImmediate() - normal Destroy() is delayed
150+
UnityEngine.Object.DestroyImmediate(MainMenu);
151+
UnityEngine.Object.DestroyImmediate(MainMenuButton);
151152
MainMenu = null;
152153
MainMenuButton = null;
153154
#if DEBUG

TLM/TLM/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="CitiesHarmony.API" version="2.0.0" targetFramework="net35" />
44
<package id="CitiesHarmony.Harmony" version="2.0.4" targetFramework="net35" developmentDependency="true" />
5-
<package id="Microsoft.Unity.Analyzers" version="1.7.0" targetFramework="net35" />
5+
<package id="Microsoft.Unity.Analyzers" version="1.13.0" targetFramework="net35" developmentDependency="true" />
66
<package id="ReflectionIT.Analyzer.Structs" version="0.1.0" targetFramework="net35" />
77
<package id="StyleCop.Analyzers" version="1.1.118" targetFramework="net35" developmentDependency="true" />
88
<package id="UnifiedUILib" version="2.2.1" targetFramework="net35" />

0 commit comments

Comments
 (0)