Exemplo n.º 1
0
        private bool InjectGameLayout()
        {
            StreamReader sr = null;

            try
            {
                sr = File.OpenText(Path.Combine(BasePath, "content", "0010", "configuration_cafe.json"));
                Cll.JSON.SyntacticAnalyzer syn  = new Cll.JSON.SyntacticAnalyzer(sr);
                Cll.JSON.Element           json = syn.Run();
                sr.Close();

                Cll.JSON.Object config = (Cll.JSON.Object)json.Value.GetValue("configuration");

                if (DarkFilter)
                {
                    config.GetValue("Display").SetValue("Brightness", new Cll.JSON.Number(80));
                }
                else
                {
                    config.GetValue("Display").SetValue("Brightness", new Cll.JSON.Number(100));
                }

                string text = json.ToString("");
                File.WriteAllText(Path.Combine(BasePath, "content", "0010", "configuration_cafe.json"), text);

                return(true);
            }
            catch { }
            finally { if (sr != null)
                      {
                          sr.Close();
                      }
            }

            return(false);
        }