Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        public void Outline(DevConForm devcon)
        {
            var descList = assets
                           .OrderBy(c0 => c0.AssetPath)
                           .OrderByDescending(c1 => c1.AssetPath.Count(ch => ch == '\\' || ch == '/'))
                           .ThenBy(c3 => c3.AssetPath)
                           .Select(c => new KeyValuePair <string, Asset>(c.AssetPath, c))
                           .ToList();

            devcon.AddBranch("Content", new[] { '/', '\\' }, descList, false);
        }
Esempio n. 2
0
        /// <summary>
        /// 
        /// </summary>
        public ContentBuilder( string contentProject, string targetDirectory, DevConForm devcon, Game game )
        {
            Modified				=	false;
            this.developerConsole	=	devcon;
            this.game				=	game;

            this.contentProject		=	Path.GetFullPath( contentProject );
            this.sourceDirectory	=	Path.GetFullPath( Path.GetDirectoryName( contentProject ) );
            this.targetDirectory	=	targetDirectory;

            assets				=	new AssetCollection();
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        public ContentBuilder(string contentProject, string targetDirectory, DevConForm devcon, Game game)
        {
            Modified = false;
            this.developerConsole = devcon;
            this.game             = game;

            this.contentProject  = Path.GetFullPath(contentProject);
            this.sourceDirectory = Path.GetFullPath(Path.GetDirectoryName(contentProject));
            this.targetDirectory = targetDirectory;

            assets = new AssetCollection();
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="game"></param>
        public static void Show(Game game)
        {
            if (!prepared)
            {
                Log.Warning("DevCon.Prepare() required.");
                return;
            }

            if (devcon == null || devcon.IsDisposed)
            {
                devcon = new DevConForm(game, savedContentProjectPath, savedTargetDirectory, false);
            }

            devcon.Show();
            devcon.BringToFront();
            devcon.Focus();
        }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="game"></param>
        /// <param name="modal"></param>
        /// <param name="buttonText"></param>
        /// <param name="messageText"></param>
        internal DevConForm(Game game, string contentPath, string targetDirectory, bool modal)
        {
            formTraceListener = new FormTraceListener(this);
            Trace.Listeners.Add(formTraceListener);

            Instance  = this;
            uiThread  = Thread.CurrentThread;
            this.game = game;

            game.Reloading += game_Reloading;

            InitializeComponent();

            mainPropertyGrid.PropertySort = PropertySort.Categorized;

            mainTreeView.PathSeparator = "/";


            //
            //	setup content project:
            //
            contentProject = new ContentBuilder(contentPath, targetDirectory, this, game);
            contentProject.Load();

            RefreshConsole(true);


            if (modal)
            {
                launchButton.Text   = "Launch";
                launchButton.Click += launchButton_ClickLaunch;
                //messageTextBox.Text		=	MakeLaunchString();
                Activated += (s, e) => launchButton.Focus();
            }
            else
            {
                launchButton.Visible = false;
                //messageTextBox.Text		=	MakeLaunchString();
                Activated += (s, e) => textBox1.Focus();
            }

            this.FormClosed += (s, e) => Trace.Listeners.Remove(formTraceListener);
        }
Esempio n. 6
0
        //static ContentBuilder builder;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="contentPath"></param>
        /// <returns></returns>
        public static bool Prepare( Game game, string contentProjectPath, string targetDirectory )
        {
            prepared				=	true;
            savedContentProjectPath	=	contentProjectPath;
            savedTargetDirectory	=	targetDirectory;

            sourceDirectory			=	Path.GetFullPath( Path.GetDirectoryName( contentProjectPath ) );

            var devcon = new DevConForm( game, contentProjectPath, targetDirectory, true );
            var r = devcon.ShowDialog();

            game.Exiting += game_Exiting;

            if ( r == System.Windows.Forms.DialogResult.OK ) {
                return true;
            } else {
                return false;
            }
        }
Esempio n. 7
0
        //static ContentBuilder builder;

        /// <summary>
        ///
        /// </summary>
        /// <param name="contentPath"></param>
        /// <returns></returns>
        public static bool Prepare(Game game, string contentProjectPath, string targetDirectory)
        {
            prepared = true;
            savedContentProjectPath = contentProjectPath;
            savedTargetDirectory    = targetDirectory;

            sourceDirectory = Path.GetFullPath(Path.GetDirectoryName(contentProjectPath));


            var devcon = new DevConForm(game, contentProjectPath, targetDirectory, true);
            var r      = devcon.ShowDialog();

            game.Exiting += game_Exiting;

            if (r == System.Windows.Forms.DialogResult.OK)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 
        /// </summary>
        public void Outline( DevConForm devcon )
        {
            var descList = assets
                .OrderBy( c0 => c0.AssetPath )
                .OrderByDescending( c1 => c1.AssetPath.Count( ch => ch=='\\' || ch=='/' ) )
                .ThenBy( c3 => c3.AssetPath )
                .Select( c => new KeyValuePair<string,Asset>( c.AssetPath, c ) )
                .ToList();

            devcon.AddBranch( "Content", new[]{'/', '\\'}, descList, false );
        }
Esempio n. 9
0
 public FormTraceListener(DevConForm devConForm)
 {
     this.devConForm = devConForm;
 }
Esempio n. 10
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="game"></param>
        public static void Show( Game game )
        {
            if (!prepared) {
                Log.Warning("DevCon.Prepare() required.");
                return;
            }

            if (devcon==null || devcon.IsDisposed) {
                devcon = new DevConForm( game, savedContentProjectPath, savedTargetDirectory, false );
            }

            devcon.Show();
            devcon.BringToFront();
            devcon.Focus();
        }