private void changeSetting(object sender, string key, object val)
{
settingsHash["MainWindow"][key].Value = val;
switch (key)
{
case "Animation":
bool animVal = (bool)val;
onItem.Checked = animVal;
offItem.Checked = !animVal;
if ((bool)val)
MapViewPanel.Start();
else
MapViewPanel.Stop();
break;
case "Doors":
if (MapViewPanel.Instance.Map != null)
{
if ((bool)val)
foreach (XCTile t in MapViewPanel.Instance.Map.Tiles)
{
if (t.Info.UFODoor || t.Info.HumanDoor)
t.MakeAnimate();
}
else
foreach (XCTile t in MapViewPanel.Instance.Map.Tiles)
if (t.Info.UFODoor || t.Info.HumanDoor)
t.StopAnimate();
}
break;
case "SaveWindowPositions": PathsEditor.SaveRegistry = (bool)val; break;
case "UseGrid": MapViewPanel.Instance.View.UseGrid = (bool)val; break;
case "GridColor": MapViewPanel.Instance.View.GridColor = (Color)val; break;
case "GridLineColor": MapViewPanel.Instance.View.GridLineColor = (Color)val; break;
case "GridLineWidth": MapViewPanel.Instance.View.GridLineWidth = (int)val; break;
}
}