File tree Expand file tree Collapse file tree 6 files changed +17
-10
lines changed Expand file tree Collapse file tree 6 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ public byte[] SaveData(ref bool success) {
309
309
/// Triggers a rebuild of the main menu (toolbar), adding/removing buttons
310
310
/// where applicable, and refreshing all translated text. Very slow.
311
311
/// </summary>
312
- internal static void RebuildMenu ( ) {
312
+ internal static void RebuildMenu ( bool languageChanged = false ) {
313
313
if ( TMPELifecycle . Instance . Deserializing || ModUI . Instance == null ) {
314
314
Log . _Debug ( "OptionsManager.RebuildMenu() - Ignoring; Deserialising or ModUI.Instance is null" ) ;
315
315
return ;
@@ -323,9 +323,11 @@ internal static void RebuildMenu() {
323
323
ModUI . Instance . MainMenuButton . UpdateButtonSkinAndTooltip ( ) ;
324
324
}
325
325
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
+ }
329
331
}
330
332
331
333
/// <summary>
Original file line number Diff line number Diff line change 82
82
2730687809;Network Extensions 3 - malware: https://github.com/CitiesSkylinesMods/TMPE/pull/1389
83
83
2733711176;CSM FIX
84
84
2749420751;Uninspected TM:PE clone
85
+ 2759913350;1632320836 Service Vehicles Manager 2.0
86
+ 2764576667;CSM
87
+ 2781822295;交通管理器 汉化版TMPE_V11_STABLE
88
+ 2782552305;CSM
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ private static void OnLanguageChanged(int newLanguageIndex) {
101
101
102
102
// TODO: Move this to the owner class and implement IObserver<ModUI.EventPublishers.LanguageChangeNotification>
103
103
Translation . SetCurrentLanguageToGameLanguage ( ) ;
104
- OptionsManager . RebuildMenu ( ) ;
104
+ OptionsManager . RebuildMenu ( true ) ;
105
105
} else if ( newLanguageIndex - 1 < Translation . AvailableLanguageCodes . Count ) {
106
106
// use tmpe language
107
107
string newLang = Translation . AvailableLanguageCodes [ newLanguageIndex - 1 ] ;
@@ -110,7 +110,7 @@ private static void OnLanguageChanged(int newLanguageIndex) {
110
110
111
111
// TODO: Move this to the owner class and implement IObserver<ModUI.EventPublishers.LanguageChangeNotification>
112
112
Translation . SetCurrentLanguageToTMPELanguage ( ) ;
113
- OptionsManager . RebuildMenu ( ) ;
113
+ OptionsManager . RebuildMenu ( true ) ;
114
114
} else {
115
115
Log . Warning ( $ "GeneralTab.LocalisationGroup.onLanguageChanged({ newLanguageIndex } ): Invalid language index") ;
116
116
return ;
Original file line number Diff line number Diff line change 916
916
<None Include =" packages.config" />
917
917
</ItemGroup >
918
918
<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" />
920
920
<Analyzer Include =" ..\packages\ReflectionIT.Analyzer.Structs.0.1.0\analyzers\dotnet\cs\ReflectionIT.Analyzer.Structs.dll" />
921
921
<Analyzer Include =" ..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
922
922
<Analyzer Include =" ..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
Original file line number Diff line number Diff line change @@ -146,8 +146,9 @@ internal void RebuildMenu() {
146
146
UnityEngine . Object . Destroy ( keyHandler ) ;
147
147
}
148
148
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 ) ;
151
152
MainMenu = null ;
152
153
MainMenuButton = null ;
153
154
#if DEBUG
Original file line number Diff line number Diff line change 2
2
<packages >
3
3
<package id =" CitiesHarmony.API" version =" 2.0.0" targetFramework =" net35" />
4
4
<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 " />
6
6
<package id =" ReflectionIT.Analyzer.Structs" version =" 0.1.0" targetFramework =" net35" />
7
7
<package id =" StyleCop.Analyzers" version =" 1.1.118" targetFramework =" net35" developmentDependency =" true" />
8
8
<package id =" UnifiedUILib" version =" 2.2.1" targetFramework =" net35" />
You can’t perform that action at this time.
0 commit comments