Better cohtml values parsing

This commit is contained in:
SDraw 2024-04-27 19:53:36 +03:00
parent 85925a7072
commit d91fe1515e
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
10 changed files with 94 additions and 95 deletions

View file

@ -66,19 +66,19 @@ namespace ml_asl
{
try
{
if(Enum.TryParse(p_name, out ModSetting l_setting))
if(Enum.TryParse(p_name, out ModSetting l_setting) && bool.TryParse(p_value, out bool l_value))
{
switch(l_setting)
{
case ModSetting.Enabled:
{
Enabled = bool.Parse(p_value);
Enabled = l_value;
OnEnabledChanged.Invoke(Enabled);
}
break;
}
ms_entries[(int)l_setting].BoxedValue = bool.Parse(p_value);
ms_entries[(int)l_setting].BoxedValue = l_value;
}
}
catch(Exception e)