Exemplo n.º 1
0
            /// <summary>
            /// remove things that aren't used by the core
            /// Normally won't do anything, but can be useful in case settings change
            /// </summary>
            public void Normalize(NymaSettingsInfo info)
            {
                var toRemove = new List <string>();

                foreach (var kvp in MednafenValues)
                {
                    if (!info.AllSettingsByKey.ContainsKey(kvp.Key))
                    {
                        toRemove.Add(kvp.Key);
                    }
                    else
                    {
                        var ovr = info.AllOverrides[kvp.Key];
                        if (ovr.Hide || !ovr.NonSync)
                        {
                            toRemove.Add(kvp.Key);
                        }
                    }
                }
                foreach (var key in toRemove)
                {
                    MednafenValues.Remove(key);
                }
                DisabledLayers = new HashSet <string>(DisabledLayers.Where(l => info.LayerNames.Contains(l)));
            }
Exemplo n.º 2
0
            /// <summary>
            /// remove things that aren't used by the core
            /// Normally won't do anything, but can be useful in case settings change
            /// </summary>
            public void Normalize(NymaSettingsInfo info)
            {
                var toRemove = new List <string>();

                foreach (var kvp in MednafenValues)
                {
                    if (!info.AllSettingsByKey.ContainsKey(kvp.Key))
                    {
                        toRemove.Add(kvp.Key);
                    }
                    else
                    {
                        var ovr = info.AllOverrides[kvp.Key];
                        if (ovr.Hide || ovr.NonSync)
                        {
                            toRemove.Add(kvp.Key);
                        }
                    }
                }
                foreach (var key in toRemove)
                {
                    MednafenValues.Remove(key);
                }
                var toRemovePort = new List <int>();

                foreach (var kvp in PortDevices)
                {
                    if (info.Ports.Count <= kvp.Key || info.Ports[kvp.Key].DefaultSettingsValue == kvp.Value)
                    {
                        toRemovePort.Add(kvp.Key);
                    }
                }
                foreach (var key in toRemovePort)
                {
                    PortDevices.Remove(key);
                }
            }