FixPath() 공개 정적인 메소드

public static FixPath ( string path ) : string
path string
리턴 string
예제 #1
0
 void ProcessWeapons()
 {
     WeaponExplosions = new Dictionary <string, string>();
     WeaponFiles      = new Dictionary <string, string>();
     foreach (var filePath in Directory.GetFiles(ModFolder + "/weapons"))
     {
         var text = File.ReadAllText(filePath);
         foreach (dynamic returValue in GetTdfTableFromString(L, text))
         {
             if (returValue is LuaTable)
             {
                 foreach (var kvp in returValue.Values)
                 {
                     string weaponName = kvp.Key.Value;
                     WeaponFiles.Add(weaponName, FilesFinder.FixPath(filePath));
                     if (kvp.Value.GetField("explosiongenerator") is LuaString)
                     {
                         string explosionGenerator = kvp.Value.GetField("explosiongenerator").Value;
                         if (explosionGenerator.StartsWith("custom:"))
                         {
                             WeaponExplosions.Add(weaponName, explosionGenerator.Substring(7, explosionGenerator.Length - 7).ToLower());
                         }
                     }
                 }
             }
         }
     }
 }
예제 #2
0
        public ModInfo(string modFolder)
        {
            this.ModFolder = FilesFinder.FixPath(modFolder);
            L = Lua.luaL_newstate();
            Lua.luaL_openlibs(L);
            CLua.TraceDoString(L, 0, Resources.luastuff);

            ProcessResources();
            ProcessExplosions();
            ProcessWeapons();
        }
예제 #3
0
        void ProcessResources()
        {
            var     resourcesPath = ModFolder + "\\gamedata\\resources.lua";
            dynamic resources     = CLua.TraceDoString(L, 1, File.ReadAllText(resourcesPath))[0];

            ProjectileTextures = new Dictionary <string, string>();
            var textures = resources.GetField("graphics").GetField("projectiletextures");

            foreach (var kvp in textures.Values)
            {
                ProjectileTextures.Add(kvp.Key.Value, FilesFinder.FixPath(ModFolder + "/bitmaps/" + textures.GetField(kvp.Key.Value).Value));
            }
        }