public void CreateAllExtantClasses() { foreach (classTreeNode ctn in this.tvClassifications.Nodes) { CreateAllExtantClasses_Helper(MOG_ControllerProject.GetProject(), ctn); } }
private void CopyIcon(string platformName) { string iconSourcePath = MOG.CONTROLLER.CONTROLLERSYSTEM.MOG_ControllerSystem.LocateInstallItem("SystemImages\\Platforms"); string iconDestPath = MOG_ControllerProject.GetProject().GetProjectToolsPath() + "\\Images\\Platforms"; if (!Directory.Exists(iconSourcePath)) { return; } string sourceFilename = iconSourcePath + "\\" + platformName + ".bmp"; string destFilename = iconDestPath + "\\" + platformName + ".bmp"; if (!File.Exists(sourceFilename)) { sourceFilename = iconSourcePath + "\\platform.bmp"; destFilename = iconDestPath + "\\platform.bmp"; } if (!Directory.Exists(iconDestPath)) { Directory.CreateDirectory(iconDestPath); } if (File.Exists(sourceFilename) && !File.Exists(destFilename)) { File.Copy(sourceFilename, destFilename, true); } }
public void SaveChanges() { MOG_Project proj = MOG_ControllerProject.GetProject(); if (proj != null) { // removed nodes foreach (classTreeNode tn in this.removedClasses) { proj.ClassificationRemove(tn.props.Classification); } this.removedClasses.Clear(); // new nodes foreach (classTreeNode tn in this.newClasses) { if (!tn.IsAssetFilenameNode) { tn.props.Classification = tn.FullPath; proj.ClassificationAdd(tn.FullPath); } } this.newClasses.Clear(); SaveConfigTree(this.tvClassifications.Nodes, proj); } }
public void AssetPopulate(MOG_Properties asset) { mProperties = asset; this.AssetDescriptionTextBox.Text = mProperties.GetDescription(); this.AssetFormatTextBox.Text = mProperties.GetGameDataPath(); this.AssetRipperTextBox.Text = mProperties.GetAssetRipper(); this.AssetRipTaskerTextBox.Text = mProperties.GetAssetRipTasker(); this.AssetNameTextBox.Text = mProperties.GetClassification(); this.AssetIconTextBox.Text = mProperties.GetAssetIcon(); if (DosUtils.FileExist(string.Concat(MOG_ControllerProject.GetProject().GetProjectToolsPath(), "\\", mProperties.GetAssetIcon()))) { this.AssetIconPictureBox.Image = Image.FromFile(string.Concat(MOG_ControllerProject.GetProject().GetProjectToolsPath(), "\\", mProperties.GetAssetIcon())); } switch (mProperties.GetPackagedAsset().ToLower()) { case "true": this.AssetPackageCheckBox.Checked = true; break; case "false": this.AssetPackageCheckBox.Checked = false; break; default: MessageBox.Show(this, "This asset has an invalid package value"); break; } }
private void PropertyNameWizardPage_ShowFromNext(object sender, EventArgs e) { // Always reset our tree TreeNode root = PropertyContextMenuTreeView.Nodes[0]; root.Nodes.Clear(); // We need to initialize any previously existing menu if (mProperties.PropertyMenu.Length != 0) { string PropertyMenuFullName = MOG_Tokens.GetFormattedString(mProperties.PropertyMenu, MOG_Tokens.GetProjectTokenSeeds(MOG_ControllerProject.GetProject())); // Make sure we got a filename with a full path, if we didn't it is probably a relational path if (!Path.IsPathRooted(PropertyMenuFullName)) { PropertyMenuFullName = MOG_ControllerProject.GetProject().GetProjectToolsPath() + "\\" + PropertyMenuFullName; } // Find and open the menu if (DosUtils.FileExist(PropertyMenuFullName)) { MOG_PropertiesIni ripMenu = new MOG_PropertiesIni(PropertyMenuFullName); if (ripMenu.SectionExist("Property.Menu")) { string property = ""; // Create the sub menu CreateChangePropertiesSubMenu(property, PropertyContextMenuTreeView.Nodes[0], "Property.Menu", ripMenu); } } } }
public PackageCreator() { InitializeComponent(); // Make sure we are not in the designer / DesignMode //if (GetService(typeof(System.ComponentModel.Design.IDesignerHost)) == null) if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime) { MOG_Project project = MOG_ControllerProject.GetProject(); if (project != null) { PlatformCombo.Items.Add("All"); PlatformCombo.SelectedIndex = 0; foreach (MOG_Platform platform in project.GetPlatforms()) { PlatformCombo.Items.Add(platform.mPlatformName); } PlatformCombo.Items.Add(MOG_ControllerProject.GetAllPlatformsString()); ClassificationTreeView.Initialize(DrillToClassification); SyncTargetTreeView.InitializeVirtual(Platform); PlatformCombo.BackColor = Color.PaleGreen; } } IsTextBoxValid(this.PackageNameTextBox); IsTextBoxValid(this.SyncTargetTextBox); IsTextBoxValid(this.ClassificationTextBox); }
public void CreateAssetConfigs() { RaiseAssetImport_Begin(); try { MOG_Project proj = MOG_ControllerProject.GetProject(); if (proj != null) { ProgressDialog progress = new ProgressDialog("Importing Assets", "Please wait while the Assets are imported into the Project's Repository.", CreateAssetConfigs_Worker, null, true); progress.ShowDialog(); // Post the projects new assets skipping the PostScanProcess MOG_ControllerProject.PostAssets(MOG_ControllerProject.GetProjectName(), MOG_ControllerProject.GetBranchName(), MOG_ControllerProject.GetProjectName(), true); } } catch (Exception e) { MOG_Report.ReportMessage("Unable to import asset", e.Message, e.StackTrace, MOG.PROMPT.MOG_ALERT_LEVEL.CRITICAL); } finally { RaiseAssetImport_Finish(); } }
private void BuildAssetTree() { TreeView tree = ProjectTreeView; // Clear the tree tree.Nodes.Clear(); // Create the root and get its first round of children TreeNode root = new TreeNode(MOG_ControllerProject.GetProject().GetProjectName()); root.Tag = ""; PopulateClassificationChildren(root); tree.Nodes.Add(root); // Expand the current projects tree foreach (TreeNode node in tree.Nodes) { if (string.Compare(MOG_ControllerProject.GetProject().GetProjectKey(), node.Text, true) == 0) { ExpandTreeDown(tree, node); node.Expand(); } } }
private void UserOkButton_Click(object sender, System.EventArgs e) { UserUpdate(); MOG_ControllerProject.GetProject().Load(); this.Close(); }
protected override void ExpandTreeDown(TreeNode node) { Cursor = Cursors.WaitCursor; // Check if this is the first time we are expanding this tree node if (node != null && node.Nodes.Count == 1 && node.Nodes[0].Text == Blank_Node_Text) { // Clean out the temp(s) node.Nodes.Clear(); // If we are down to the Asset/Package level and we are allowed to expand Assets... if (IsAtAssetLevel(node) && (ExpandAssets || ExpandPackageGroups)) { // Expand our Asset/Package nodes base.ExpandTreeDown(node); } else { // If we have a valid project (mostly for the designer purposes...) if (MOG_ControllerProject.GetProject() != null) { // Get the children of the node we are expanding ExpandPropertyTreeDown(node); } } } Cursor = Cursors.Default; }
private string UpdateGetActiveButton() { string activeTag = ""; // Make sure there is a current 'ActiveTag'? if (MOG_ControllerProject.GetProject().GetConfigFile().KeyExist("Project", "ActiveTag")) { // Get the current 'ActiveTag' activeTag = MOG_ControllerProject.GetProject().GetConfigFile().GetString("Project", "ActiveTag"); // Update the ToolStripButton's text GetActiveToolStripButton.Text = "Get (" + activeTag + ")"; GetActiveToolStripButton.Tag = activeTag; } // Only show the ToolStripButton if we have an 'ActiveTag'specified if (activeTag.Length > 0) { // Show the active tag button GetActiveToolStripButton.Visible = true; // We have an active tag so hide the advanced button unless they always want it GetLatestToolStripButton.Visible = mainForm.alwaysDisplayAdvancedGetLatestToolStripMenuItem.Checked; } else { // No active tag so only show the Advanced button GetActiveToolStripButton.Visible = false; GetLatestToolStripButton.Visible = true; } GetActiveToolStripButton.Visible = (activeTag.Length > 0) ? true : false; GetLatestToolStripButton.Visible = !(activeTag.Length > 0) || mainForm.alwaysDisplayAdvancedGetLatestToolStripMenuItem.Checked; return(activeTag); }
private void PopulateClassNode(classTreeNode ctn) { if (!ctn.FilledIn) { // fill it in // get rid of dummy node ctn.Nodes.Clear(); // fill in children foreach (string subClassName in MOG_ControllerProject.GetProject().GetSubClassificationNames(ctn.FullPath)) { // create subnode and add it to the parent node classTreeNode subNode = new classTreeNode(subClassName); ctn.Nodes.Add(subNode); // add dummy if needs be ArrayList subClassNames = MOG_ControllerProject.GetProject().GetSubClassificationNames(subNode.FullPath); if (subClassNames != null && subClassNames.Count > 0) { subNode.Nodes.Add(new classTreeNode("DUMMY_NODE")); } } ctn.FilledIn = true; } }
/// <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); } }
static public List <string> GetPlatforms(string project) { List <string> platformNames = new List <string>(); MOG_Project projectPtr; if (project.Length != 0) { projectPtr = MOG_ControllerSystem.GetSystem().GetProject(project); } else { projectPtr = MOG_ControllerProject.GetProject(); } // Make sure we have an active project if (projectPtr != null) { ArrayList platforms = MOG_ControllerProject.GetProject().GetPlatforms(); // Add a comboBox item for every platform foreach (MOG_Platform platform in platforms) { platformNames.Add(platform.mPlatformName); } } return(platformNames); }
private void removeToolStripMenuItem_Click(object sender, EventArgs e) { if (WebTabTabsListView.SelectedItems != null) { MOG_PropertiesIni project = MOG_ControllerProject.GetProject().GetConfigFile(); if (project != null) { foreach (ListViewItem item in WebTabTabsListView.SelectedItems) { project.RemoveString("WebTabs", item.Text); project.RemoveString("WebTab_" + item.Text, "Title"); project.RemoveString("WebTab_" + item.Text, "URL"); project.RemoveString("WebTab_" + item.Text, "Position"); // Only remove the section if it is now empty if (project.CountKeys("WebTab_" + item.Text) == 0) { project.RemoveSection("WebTab_" + item.Text); } item.Remove(); } SavePositionSettings(project); } } }
private void InitializeTags() { TagsListView.Items.Clear(); ArrayList Branches = MOG_DBProjectAPI.GetAllBranchNames(); if (Branches != null) { string activeTag = ""; if (MOG_ControllerProject.GetProject().GetConfigFile().KeyExist("Project", "ActiveTag")) { activeTag = MOG_ControllerProject.GetProject().GetConfigFile().GetString("Project", "ActiveTag"); } foreach (MOG_DBBranchInfo branch in Branches) { // Is this a tag? or // Is this 'Current'? if (branch.mTag || string.Compare(branch.mBranchName, "Current", true) == 0) { AddTagListViewItem(branch, (string.Compare(branch.mBranchName, activeTag, true) == 0)); } } } }
public bool AddPlatform(string platformName) { if (platformName == "") { // add a new blank platform ListViewItem newItem = new ListViewItem("NewPlatform"); this.Items.Add(newItem); newItem.ImageIndex = DEFAULT_INDEX; newItem.StateImageIndex = DEFAULT_INDEX; MOG_Platform plat = new MOG_Platform("NewPlatform"); MOG_ControllerProject.GetProject().PlatformAdd(plat); CopyIcon("platform"); newItem.BeginEdit(); return(true); } else { MOG_Platform plat = new MOG_Platform(platformName); if (MOG_ControllerProject.GetProject().PlatformAdd(plat)) { CopyIcon(platformName); ListViewItem newItem = new ListViewItem(platformName); this.Items.Add(newItem); newItem.ImageIndex = DEFAULT_INDEX; newItem.StateImageIndex = DEFAULT_INDEX; return(true); } return(false); } }
public void UserPopulate(MOG_User user) { mUser = user; this.UserNameTextBox.Text = user.GetUserName(); this.UserClassComboBox.Text = user.GetUserCategory(); this.UserBlessTargetComboBox.Text = user.GetBlessTarget(); SortedSet categories = new SortedSet(); foreach (MOG_User userHandle in MOG_ControllerProject.GetProject().GetUsers()) { // categories.Add(userHandle.GetUserCategory()); this.UserBlessTargetComboBox.Items.Add(userHandle.GetUserName()); } foreach (MOG_UserCategory userCat in MOG_ControllerProject.GetProject().GetUserCategories()) { categories.Add(userCat.mCategoryName); } this.UserBlessTargetComboBox.Items.Add("MasterData"); foreach (string name in categories) { this.UserClassComboBox.Items.Add(name); } }
/// <summary> /// Add group or object to the database /// </summary> private bool AddGroupToDatabase(string addCandidate, MOG_Filename packageAsset) { // Are we platform generic? bool success = true; if (packageAsset.GetAssetPlatform() == "All") { string packageVersion = MOG_DBAssetAPI.GetAssetVersion(packageAsset); if (packageVersion.Length > 0) { success = MOG_DBPackageAPI.AddPackageGroupName(packageAsset, packageVersion, addCandidate, MOG_ControllerProject.GetUser().GetUserName()); } } // We are platform generic, loop through all platforms then ArrayList platforms = MOG_ControllerProject.GetProject().GetPlatforms(); for (int p = 0; p < platforms.Count && success; p++) { MOG_Platform platform = (MOG_Platform)platforms[p]; // Set this package to be platform specific for this platform name packageAsset = MOG_Filename.CreateAssetName(packageAsset.GetAssetClassification(), platform.mPlatformName, packageAsset.GetAssetLabel()); string packageVersion = MOG_DBAssetAPI.GetAssetVersion(packageAsset); if (packageVersion.Length > 0) { // Add to the database success &= MOG_DBPackageAPI.AddPackageGroupName(packageAsset, packageVersion, addCandidate, MOG_ControllerProject.GetUser().GetUserName()); } } return success; }
private void OKButton_Click(object sender, System.EventArgs e) { if (this.NewClassificationTextBox.Text == null || this.NewClassificationTextBox.Text.Length < 1) { MessageBox.Show(this, "Please enter a valid classification name, or click 'Cancel' " + "to close the dialog.", "No classification name found!", MessageBoxButtons.OK); return; } if (this.FullClassificationNameTextBox.Text.IndexOf("{") > -1 || this.FullClassificationNameTextBox.Text.IndexOf("}") > -1) { MessageBox.Show(this, "Invalid character (for Classification), '{' and/or '}', detected.\r\n\r\n" + "Classification name:\r\n" + this.FullClassificationNameTextBox.Text, "Invalid Character(s) for Classification Name Found!", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.CurrentClassificationTextBox.Text = this.CurrentClassificationTextBox.Text.Replace("{", ""); this.CurrentClassificationTextBox.Text = this.CurrentClassificationTextBox.Text.Replace("}", ""); this.FullClassificationNameTextBox.Text = this.FullClassificationNameTextBox.Text.Replace("{", ""); this.FullClassificationNameTextBox.Text = this.FullClassificationNameTextBox.Text.Replace("}", ""); return; } MOG_Project project = MOG_ControllerProject.GetProject(); project.ClassificationAdd(FullClassificationNameTextBox.Text); this.DialogResult = DialogResult.OK; this.Close(); }
private string GetFormattedString(string formatedSource) { string seeds = ""; if (MOG_ControllerProject.GetUser() != null) { seeds = MOG_Tokens.AppendTokenSeeds(seeds, MOG_Tokens.GetPackageTokenSeeds("Game~Packages{All}PackageFile.Pak", "All", "", "", "Packages\\PackageFile.Pak")); } if (MOG_ControllerProject.GetProject() != null) { seeds = MOG_Tokens.AppendTokenSeeds(seeds, MOG_Tokens.GetProjectTokenSeeds(MOG_ControllerProject.GetProject())); } if (mAssetFilename != null) { seeds = MOG_Tokens.AppendTokenSeeds(seeds, MOG_Tokens.GetFilenameTokenSeeds(mAssetFilename)); seeds = MOG_Tokens.AppendTokenSeeds(seeds, MOG_Tokens.GetRipperTokenSeeds(mAssetFilename.GetEncodedFilename() + "\\Files.Imported", "*.*", mAssetFilename.GetEncodedFilename() + "\\Files.All")); } seeds = MOG_Tokens.AppendTokenSeeds(seeds, MOG_Tokens.GetSystemTokenSeeds()); seeds = MOG_Tokens.AppendTokenSeeds(seeds, MOG_Tokens.GetOSTokenSeeds()); seeds = MOG_Tokens.AppendTokenSeeds(seeds, MOG_Tokens.GetTimeTokenSeeds(new MOG_Time())); return(MOG_Tokens.GetFormattedString(formatedSource, seeds)); }
private void AddNewClasses_Worker(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; TreeNodeCollection nodes = e.Argument as TreeNodeCollection; int classificationTotal = CountClassifications_Recursive(nodes); MOG_Project project = MOG_ControllerProject.GetProject(); AddNewClasses(worker, 0, classificationTotal, project, nodes); }
private void AssetOkButton_Click(object sender, System.EventArgs e) { // Save our ini AssetSave(); // Reload the ini MOG_ControllerProject.GetProject().Load(); this.Close(); }
private void InitializeArchivalList() { try { if (mArchivalList == null) { mArchivalList = new SortedList(); } mArchivalList.Clear(); // Get all our Assets ArrayList assets = MOG.DATABASE.MOG_DBAssetAPI.GetAllArchivedAssets(); // Get all classifications (to start with, that is) ArrayList classifications = MOG_ControllerProject.GetProject().GetArchivedSubClassifications(mProjectName); // If we found classifications... if (classifications != null && classifications.Count > 0) { foreach (string classificationName in classifications) { // If we don't already have this classification, add it. if (!mArchivalList.Contains(classificationName)) { ArrayList assetsList = new ArrayList(); mArchivalList.Add(classificationName, assetsList); } } } // If we got assets if (assets != null && assets.Count > 0) { foreach (MOG_Filename package in assets) { // If we do not already have this classification... if (!mArchivalList.Contains(package.GetAssetClassification())) { // Add classification ArrayList assetsList = new ArrayList(); assetsList.Add(package.GetEncodedFilename()); mArchivalList.Add(package.GetAssetClassification(), assetsList); } // Else, we have this classification, so add this asset to it... else { ArrayList assetsList = (ArrayList)mArchivalList.GetByIndex(mArchivalList.IndexOfKey(package.GetAssetClassification())); assetsList.Add(package.GetEncodedFilename()); } } } } catch (Exception e) { e.ToString(); } }
/// <summary> /// Edit the ripper in notepad /// </summary> private void EditRipper() { if (this.PropertiesList.Length > 0) { MOG_Properties properties = PropertiesList[0] as MOG_Properties; // Get the assigned ripper information string ripper = properties.AssetRipper; string tool = DosUtils.FileStripArguments(properties.AssetRipper); string args = DosUtils.FileGetArguments(properties.AssetRipper); // Do we have a ripper to edit? if (ripper.Length > 0) { // Locate the ripper ripper = MOG_ControllerSystem.LocateTool("", tool); if (ripper.Length > 0) { // Edit the ripper guiCommandLine.ShellSpawn("Notepad.exe", ripper); } else { // If not, do we want to create one? if (MOG_Prompt.PromptResponse("No Ripper Found", "This appears to be a new ripper.\n" + "RIPPER: " + tool + "\n\n" + "Would you like to create a new one for editing?", MOGPromptButtons.YesNo) == MOGPromptResult.Yes) { // Create a new one using the user's specified name string defaultRipperName = tool; ripper = Path.Combine(MOG_ControllerProject.GetProject().GetProjectToolsPath(), defaultRipperName); // Do we want to start from the template? if (MOG_Prompt.PromptResponse("Use Ripper Template", "Would you like to base the new ripper from MOG's ripper template?", MOGPromptButtons.YesNo) == MOGPromptResult.Yes) { // If so, copy the template to this new ripper string template = MOG_ControllerSystem.GetSystemRepositoryPath() + "\\Tools\\Rippers\\TemplateComplex_ripper.bat"; DosUtils.CopyFast(template, ripper, false); } // Launch the editor string output = ""; guiCommandLine.ShellExecute("Notepad.exe", ripper, System.Diagnostics.ProcessWindowStyle.Normal, ref output); // Now, set this new ripper as the ripper assigned to this asset restoring the users args properties.AssetRipper = ripper + " " + args; this.PropertiesRippingRipperComboBox.Text = properties.AssetRipper; } } } else { MOG_Prompt.PromptMessage("Edit Ripper", "There is no ripper to edit."); } } }
private void AssetIconBrowseButton_Click(object sender, System.EventArgs e) { AssetIconOpenFileDialog.InitialDirectory = string.Concat(MOG_ControllerProject.GetProject().GetProjectToolsPath(), "\\Images"); if (AssetIconOpenFileDialog.ShowDialog(this) == DialogResult.OK) { this.AssetIconTextBox.Text = AssetIconOpenFileDialog.FileName; this.AssetIconPictureBox.Image = Image.FromFile(AssetIconOpenFileDialog.FileName); } }
public void RemoveSelected() { foreach (ListViewItem item in this.SelectedItems) { // remove from database MOG_ControllerProject.GetProject().PlatformRemove(item.Text); item.Remove(); } }
private void clearActiveTagToolStripMenuItem_Click(object sender, EventArgs e) { if (TagsListView != null && TagsListView.SelectedItems != null) { MOG_ControllerProject.GetProject().GetConfigFile().RemoveString("Project", "ActiveTag"); MOG_ControllerProject.GetProject().GetConfigFile().Save(); SetActiveTagItem(null); TagsListView.Refresh(); } }
public void SetActiveUser(string name) { // Set active users department MOG_User user = MOG_ControllerProject.GetProject().GetUser(name); if (user != null) { mainForm.AssetManagerActiveUserDepartmentsComboBox.Text = user.GetUserDepartment(); } GetActiveUsersControl().Text = name; }
private void InitializePlatformComboBox() { RenameNewPlatformComboBox.Items.Clear(); RenameNewPlatformComboBox.Items.Add("All"); // Add all the platforms System.Collections.IEnumerator myEnumerator = MOG_ControllerProject.GetProject().GetPlatforms().GetEnumerator(); while (myEnumerator.MoveNext()) { RenameNewPlatformComboBox.Items.Add(((MOG_Platform)myEnumerator.Current).mPlatformName); } }