Ejemplo n.º 1
0
        private void loadSettings()
        {
            ConfigNode settings = ConfigNode.Load(SETTINGS_FILE) ?? new ConfigNode();

            if (settings.HasNode("ambience"))
            {
                ConfigNode   ambienceNode = settings.GetNode("ambience");
                ConfigNode[] settingNodes = ambienceNode.GetNodes("setting");
                if (settingNodes.Length >= 1)
                {
                    setting = AmbienceSetting.create(settingNodes[0]);
                }
                if (settingNodes.Length >= 2)
                {
                    secondSetting = AmbienceSetting.create(settingNodes[1]);
                }
            }
        }
Ejemplo n.º 2
0
        private void loadSettings()
        {
            ConfigNode settings = ConfigNode.Load(SETTINGS_FILE) ?? new ConfigNode();

            if (settings.HasNode("ambience"))
            {
                ConfigNode   ambienceNode = settings.GetNode("ambience");
                ConfigNode[] settingNodes = ambienceNode.GetNodes("setting");
                if (settingNodes.Length >= 1)
                {
                    setting = AmbienceSetting.create(settingNodes[0]);
                }
                if (settingNodes.Length >= 2)
                {
                    secondSetting = AmbienceSetting.create(settingNodes[1]);
                }
                if (button == null)
                {
                    //Log.warn("Unable to load position settings as button is null");
                }
                else
                {
                    if (!settings.HasNode("position"))
                    {
                        //Log.warn("Button is not null, but settings node[" + settings + "] has no position node");
                    }
                    else
                    {
                        ConfigNode positionNode = settings.GetNode("position");

                        //Log.warn("Button is not null and settings has position node[" + positionNode + "]");
                        button.Load(positionNode);
                    }
                }
            }
        }