Archomeda / csl-ambient-sounds-tuner

Tune your ambient sounds volumes individually
http://steamcommunity.com/sharedfiles/filedetails/?id=455958878
MIT License
9 stars 4 forks source link

Error - evidenlty with new update #25

Closed gmnowels closed 8 years ago

gmnowels commented 8 years ago

Here is error info:

A Mod caused an error [System.Exception]

Details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[AudioManager+AmbientType,AmbientSoundsTuner.Configuration+Sound].get_Item (AmbientType key) [0x00000] in <filename unknown>:0 
  at AmbientSoundsTuner.UI.ModOptionsPanel.AddSoundRow[AmbientType] (SliderDef`1 slider, UIHelperBase helper) [0x00000] in <filename unknown>:0 
  at AmbientSoundsTuner.UI.ModOptionsPanel.AddTab[AmbientType] (ColossalFramework.UI.UITabstrip tabstrip, Single buttonWidth, System.String title, IDictionary`2 content) [0x00000] in <filename unknown>:0 
  at AmbientSoundsTuner.UI.ModOptionsPanel.PopulateUI () [0x00000] in <filename unknown>:0 
  at CommonShared.UI.ConfigPanelBase.PerformLayout () [0x00000] in <filename unknown>:0 
  at AmbientSoundsTuner.Mod.OnSettingsUI (UIHelperBase helper) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception
System.Exception: A Mod caused an error
Archomeda commented 8 years ago

I think this might be caused by some missing configuration entries. Did you install the mod before the update? Or did you freshly install it after the update? In any case, can you post the contents of your configuration? It's located in %LOCALAPPDATA%\Colossal Order\Cities_Skylines\Addons\Mods\AmbientSoundsTuner\AmbientSoundsTuner.xml.

Edit: I decided to try it myself and it appears I'm right. When some entries in the configuration file are missing, the mod fails to initialize the options panel. Apparently I forgot to add a conditional statement that checks this case when I changed the settings. I'll upload a new version within an hour.

Archomeda commented 8 years ago

Can you check if it works correctly now? If it doesn't, please let me know. Otherwise I'll assume it's fixed and will close this issue Friday next week.