Example #1
0
        public void Start()
        {
            tech_window  = new TechUpdateWindow();
            tech_checked = false;

            if (!tech_checked)
            {
                ConfigNode tech_nodes     = PluginHelper.getTechTreeFile();
                ConfigNode new_tech_nodes = PluginHelper.getNewTechTreeFile();

                if (tech_nodes != null)
                {
                    if (tech_nodes.HasNode("VERSION"))
                    {
                        ConfigNode version_node = tech_nodes.GetNode("VERSION");
                        if (version_node.HasValue("id"))
                        {
                            installed_tech_tree_version_id = Convert.ToInt32(version_node.GetValue("id"));
                        }
                    }
                }
                if (new_tech_nodes != null)
                {
                    if (new_tech_nodes.HasNode("VERSION"))
                    {
                        ConfigNode version_node2 = new_tech_nodes.GetNode("VERSION");
                        if (version_node2.HasValue("id"))
                        {
                            new_tech_tree_version_id = Convert.ToInt32(version_node2.GetValue("id"));
                        }
                    }
                }
                if (new_tech_tree_version_id > installed_tech_tree_version_id)
                {
                    tech_window.Show();
                    tech_window.UpdateTechTree();
                }

                tech_checked = true;
            }
        }
Example #2
0
        public void Start() {
            tech_window = new TechUpdateWindow();
            tech_checked = false;

            if (!tech_checked) {
                ConfigNode tech_nodes = PluginHelper.getTechTreeFile();
                ConfigNode new_tech_nodes = PluginHelper.getNewTechTreeFile();

                if (tech_nodes != null) {
                    if (tech_nodes.HasNode("VERSION")) {
                        ConfigNode version_node = tech_nodes.GetNode("VERSION");
                        if (version_node.HasValue("id")) {
                            installed_tech_tree_version_id = Convert.ToInt32(version_node.GetValue("id"));
                        }
                    }
                }
                if (new_tech_nodes != null) {
                    if (new_tech_nodes.HasNode("VERSION")) {
                        ConfigNode version_node2 = new_tech_nodes.GetNode("VERSION");
                        if (version_node2.HasValue("id")) {
                            new_tech_tree_version_id = Convert.ToInt32(version_node2.GetValue("id"));
                        }
                    }
                }
                if (new_tech_tree_version_id > installed_tech_tree_version_id) {
                    tech_window.Show();
                    tech_window.UpdateTechTree();
                }

                tech_checked = true;
            }
        }