public void btnOpenScriptDir_Click()
 {
     lock (GameBase.lockObj)
     {
         DevForm form         = (DevForm)DiagManager.Instance.DevEditor;
         string  mapscriptdir = LuaEngine.MakeMapScriptPath(Path.GetFileNameWithoutExtension(((GroundEditViewModel)form.GroundEditForm.DataContext).CurrentFile));
         mapscriptdir = Path.GetFullPath(mapscriptdir);
         Process.Start("explorer.exe", mapscriptdir);
     }
 }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string file = (string)value;

            if (file == "")
            {
                return("Script Data [Map not yet saved]");
            }
            string mapscriptdir = LuaEngine.MakeMapScriptPath(Path.GetFileNameWithoutExtension(file));

            return(String.Format("Script Data [{0}]", Path.GetFullPath(mapscriptdir)));
        }
 /// <summary>
 /// Returns the script package path for the currently loaded level
 /// </summary>
 /// <returns></returns>
 public string CurrentScriptDir()
 {
     //We can get the path 3 ways.
     if (ZoneManager.Instance.CurrentGround != null)
     {
         return(LuaEngine.MakeMapScriptPath(ZoneManager.Instance.CurrentGround.AssetName));
     }
     else if (ZoneManager.Instance.CurrentMap != null)
     {
         return(LuaEngine.MakeDungeonMapScriptPath(ZoneManager.Instance.CurrentMap.AssetName));
     }
     else
     {
         throw new Exception("ScriptServices.CurrentScriptDir(): No map lua package currently loaded! And no map currently loaded either! Cannot assemble the current package path!");
     }
 }