Example #1
0
        /// <summary>
        /// Post the build in the users data directory to their inbox
        /// <summary>
        public void BuildPost()
        {
            MOG_ControllerSyncData gameDataHandle = MOG_ControllerProject.GetCurrentSyncDataController();

            try
            {
                string ProjectName     = gameDataHandle.GetProjectName();
                string ProjectDir      = gameDataHandle.GetSyncDirectory();
                string ProjectPlatform = gameDataHandle.GetPlatformName();
                string ImportName      = string.Concat(MOG_ControllerProject.GetProjectName(), ".Build.Release.", ProjectName, ".", ProjectPlatform);
                string command         = string.Concat(MOG_ControllerProject.GetProject().GetProjectToolsPath(), "\\MOG_UserBless.bat");
                string output          = "";

                // Make sure the tool we need exits
                if (DosUtils.FileExist(command))
                {
                    guiCommandLine.ShellSpawn(command, string.Concat(ProjectName, " ", ProjectDir, " ", ProjectPlatform, " ", ImportName), ProcessWindowStyle.Normal, ref output);
                }
                else
                {
                    MOG_Prompt.PromptMessage("Tool", string.Concat("This tool(", command, ") is missing."), Environment.StackTrace);
                }
            }
            catch (Exception e)
            {
                MOG_Prompt.PromptMessage("Build Post", "Could not perform post due to error:\n\n" + e.Message, e.StackTrace);
            }
        }
Example #2
0
        public void LatentInitialize()
        {
            mainForm.AssetManagerInboxListView.ContextMenuStrip  = mInboxContextMenu.InitializeContextMenu("{Inbox}");
            mainForm.AssetManagerDraftsListView.ContextMenuStrip = mDraftsContextMenu.InitializeContextMenu("{Inbox}");
            mainForm.AssetManagerSentListView.ContextMenuStrip   = mOutboxContextMenu.InitializeContextMenu("{Outbox}");
            mainForm.AssetManagerTrashListView.ContextMenuStrip  = mTrashContextMenu.InitializeContextMenu("{Trash}");

            if (!MOG_ControllerProject.IsProject() || !MOG_ControllerProject.IsUser())
            {
                return;
            }

            RefreshAllWindows();

            guiUserPrefs.LoadDynamic_LayoutPrefs("AssetManager", mainForm);

            mLocal.InitialiseLocalView();

            mainForm.AssetManagerLocalDataExplorerSplitter.SplitPosition = mLocalExplorer.Width;
            mainForm.myLocalExplorerToolStripMenuItem.Checked            = mLocalExplorer.Opened;

            mainForm.AssetManagerTasksSplitter.SplitPosition = mToDo.Width;

            MainMenuViewClass.bChangeLocalBranchRightPanelWidth  = true;
            mainForm.AssetManagerLocalDataSplitter.SplitPosition = mTools.Width;

            MainMenuViewClass.bChangeLocalBranchRightPanelWidth = false;
            mainForm.myToolboxToolStripMenuItem.Checked         = mTools.Opened;


            // Initialize our users toolBox
            MOG_ControllerSyncData sync = MOG_ControllerProject.GetCurrentSyncDataController();

            if (sync != null)
            {
                // Initialize the local tools window
                mainForm.CustomToolsBox.Initialize(sync.GetPlatformName());                     // DVC
            }
            else
            {
                mainForm.CustomToolsBox.Visible = false;
            }

            mInitialized = true;
        }
Example #3
0
        private void LocateNonMogAssets_Worker(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;
            string           path   = e.Argument as string;

            // Determin our workspaceDirectory and platformName
            string workspaceDirectory = "";
            string relativePath       = "";
            string platformName       = "";

            // Check if this is a library path?
            if (MOG_ControllerLibrary.GetWorkingDirectory().Length > 0 &&
                path.StartsWith(MOG_ControllerLibrary.GetWorkingDirectory(), StringComparison.CurrentCultureIgnoreCase))
            {
                // Determin proper settings for the library
                workspaceDirectory = MOG_ControllerLibrary.GetWorkingDirectory();
                relativePath       = path.Substring(workspaceDirectory.Length).Trim("\\".ToCharArray());
                platformName       = "All";

                // Get the list of known MOG files within the workspace
                string    classification  = MOG_ControllerLibrary.ConstructLibraryClassificationFromPath(path);
                ArrayList containedAssets = MOG_DBAssetAPI.GetAllAssetsByParentClassification(classification);
                foreach (MOG_Filename thisAsset in containedAssets)
                {
                    string thisPath     = MOG_ControllerLibrary.ConstructPathFromLibraryClassification(thisAsset.GetAssetClassification());
                    string thisFilename = Path.Combine(thisPath, thisAsset.GetAssetLabel());
                    mKnownSyncFiles.Add(thisFilename, thisFilename);
                    mKnownSyncFiles_ArrayList.Add(thisFilename);
                }
            }
            // Check if this is a workspace path?
            else
            {
                workspaceDirectory = MOG_ControllerSyncData.DetectWorkspaceRoot(path);
                if (workspaceDirectory.Length > 0)
                {
                    relativePath = path.Substring(workspaceDirectory.Length).Trim("\\".ToCharArray());
                    MOG_ControllerSyncData sync = MOG_ControllerProject.GetCurrentSyncDataController();
                    if (sync != null)
                    {
                        platformName = sync.GetPlatformName();

                        // Get the list of known MOG files within the workspace
                        ArrayList allFiles = MOG_DBAssetAPI.GetAllProjectSyncTargetFilesForPlatform(platformName);
                        foreach (string thisFile in allFiles)
                        {
                            // Trim thisFile just in case it has an extra '\' at the beginning (Needed for BioWare's formulaic sync target booboo)
                            string tempFile = thisFile.Trim("\\".ToCharArray());
                            // Check if this relative directory matches?
                            if (tempFile.StartsWith(relativePath, StringComparison.CurrentCultureIgnoreCase))
                            {
                                string filename = Path.Combine(workspaceDirectory, tempFile);
                                mKnownSyncFiles[filename] = filename;
                                mKnownSyncFiles_ArrayList.Add(filename);
                            }
                        }
                    }
                }
            }

            // Continue as long as we got at least one asset from the database
            ArrayList rogueFiles = new ArrayList();

            LocateNonMogAssetsScanFiles(worker, path, rogueFiles, mKnownSyncFiles, path, null);
            e.Result = rogueFiles;
        }
        private ArrayList GetAllProjectSyncTargetFileForDirectory(MOG_ControllerSyncData targetGameData, string path)
        {
            try
            {
                ArrayList fileList = MOG_DBAssetAPI.GetAllProjectSyncTargetFilesForDirectory(targetGameData.GetSyncDirectory(), path, targetGameData.GetPlatformName());

                string targetDir = path.ToLower().Replace(targetGameData.GetSyncDirectory().ToLower(), "");
                int    depth     = DosUtils.DirectoryDepth(targetDir);

                SortedSet directories = new SortedSet();
                foreach (string file in fileList)
                {
                    if (targetDir.Length == 0)
                    {
                        directories.Add(targetGameData.GetSyncDirectory() + "\\" + DosUtils.DirectoryGetAtDepth(file, depth));
                    }
                    else if (file.ToLower().IndexOf(targetDir.ToLower()) != -1)
                    {
                        directories.Add(targetGameData.GetSyncDirectory() + "\\" + DosUtils.DirectoryGetAtDepth(file, depth));
                    }
                    else
                    {
                        directories.Add(targetGameData.GetSyncDirectory() + "\\" + DosUtils.DirectoryGetAtDepth(file, depth));
                    }
                }

                ArrayList finalFileList = new ArrayList();
                foreach (string dir in directories)
                {
                    finalFileList.Add(dir);
                }

                return(finalFileList);
            }
            catch
            {
                return(new ArrayList());
            }
        }