Ejemplo n.º 1
0
        void ModifyCode(XUPEMod mods)
        {
            //modify code
            Debug.Log("Modify code...");
            ArrayList codeList = mods.extCode;

            foreach (var code in codeList)
            {
                var    item   = (Hashtable)code;
                XClass xclass = new XClass(this.projectRootPath + item["file"]);
                if (item["type"].Equals("writeBelow"))
                {
                    xclass.WriteBelow((string)item["target"], (string)item["code"]);
                }
                else if (item["type"].Equals("writeHead"))
                {
                    xclass.WriteHead((string)item["code"]);
                }
                else if (item["type"].Equals("writeEnd"))
                {
                    xclass.WriteHead((string)item["code"]);
                }
                else if (item["type"].Equals("replace"))
                {
                    xclass.Replace((string)item["target"], (string)item["code"]);
                }
            }
        }
Ejemplo n.º 2
0
 void TranslateFiles(XUPEMod mods)
 {
     Debug.Log("TranslateFiles...");
     foreach (string files in mods.translate)
     {
         string targetFile = this.projectRootPath + "/" + files;
         if (File.Exists(targetFile))
         {
             XClass xc = new XClass(targetFile);
             foreach (string key in mods.vars.Keys)
             {
                 xc.Replace("${" + key + "}", mods.vars[key]);
             }
         }
     }
 }