From 1d029662f6c75fe961db643bca560f6d20afd7b7 Mon Sep 17 00:00:00 2001 From: Bitl Date: Sun, 29 Aug 2021 18:53:40 -0700 Subject: [PATCH] Added the optional ability to replace existing item icons. If a character customization window is open, it will now close the window and open a new one to update the view. --- .../Forms/SDK/ItemCreationSDK.cs | 81 +++++++++++-------- changelog.txt | 17 ++++ 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/Novetus/NovetusLauncher/Forms/SDK/ItemCreationSDK.cs b/Novetus/NovetusLauncher/Forms/SDK/ItemCreationSDK.cs index 8f981b5..61ec917 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ItemCreationSDK.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ItemCreationSDK.cs @@ -1,12 +1,7 @@ #region Usings using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; using System.IO; -using System.Linq; -using System.Text; using System.Windows.Forms; #endregion @@ -53,39 +48,41 @@ public partial class ItemCreationSDK : Form { string previconpath = SDKFuncs.GetPathForType(type) + "\\" + ItemNameBox.Text.Replace(" ", "") + ".png"; - if (!File.Exists(previconpath)) + if (File.Exists(previconpath)) { - IconLoader icon = new IconLoader(); - icon.CopyToItemDir = true; - icon.ItemDir = SDKFuncs.GetPathForType(type); - icon.ItemName = ItemNameBox.Text; - try - { - icon.LoadImage(); - } - catch (Exception) - { - } - - if (!string.IsNullOrWhiteSpace(icon.getInstallOutcome())) - { - MessageBox.Show(icon.getInstallOutcome(), "Novetus Item Creation SDK - Icon Copy Completed", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - - Image icon1 = GlobalFuncs.LoadImage(icon.ItemDir + "\\" + icon.ItemName.Replace(" ", "") + ".png", ""); - ItemIcon.Image = icon1; - - if (type == RobloxFileType.TShirt || type == RobloxFileType.Face) - { - Option1Path = icon.ItemPath; - if (Option1TextBox.ReadOnly) Option1TextBox.ReadOnly = false; - Option1TextBox.Text = Path.GetFileName(Option1Path); - if (!Option1TextBox.ReadOnly) Option1TextBox.ReadOnly = true; - } + DialogResult result = MessageBox.Show("An icon with this item's name already exists. Would you like to replace it?", "Novetus Item Creation SDK - Icon already exists", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (result == DialogResult.No) + { + return; + } } - else + + IconLoader icon = new IconLoader(); + icon.CopyToItemDir = true; + icon.ItemDir = SDKFuncs.GetPathForType(type); + icon.ItemName = ItemNameBox.Text; + try { - MessageBox.Show("An icon with this item's name already exists. Please change the item's name.", "Novetus Item Creation SDK - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + icon.LoadImage(); + } + catch (Exception) + { + } + + if (!string.IsNullOrWhiteSpace(icon.getInstallOutcome())) + { + MessageBox.Show(icon.getInstallOutcome(), "Novetus Item Creation SDK - Icon Copy Completed", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + Image icon1 = GlobalFuncs.LoadImage(icon.ItemDir + "\\" + icon.ItemName.Replace(" ", "") + ".png", ""); + ItemIcon.Image = icon1; + + if (type == RobloxFileType.TShirt || type == RobloxFileType.Face) + { + Option1Path = icon.ItemPath; + if (Option1TextBox.ReadOnly) Option1TextBox.ReadOnly = false; + Option1TextBox.Text = Path.GetFileName(Option1Path); + if (!Option1TextBox.ReadOnly) Option1TextBox.ReadOnly = true; } } } @@ -232,6 +229,20 @@ public partial class ItemCreationSDK : Form if (LaunchCharCustom == DialogResult.Yes) { + //https://stackoverflow.com/questions/9029351/close-all-open-forms-except-the-main-menu-in-c-sharp + FormCollection fc = Application.OpenForms; + + foreach (Form frm in fc) + { + //iterate through + if (frm.Name == "CharacterCustomizationExtended" || + frm.Name == "CharacterCustomizationCompact") + { + frm.Close(); + break; + } + } + switch (GlobalVars.UserConfiguration.LauncherStyle) { case Settings.UIOptions.Style.Extended: diff --git a/changelog.txt b/changelog.txt index b4ee960..2fb7ab4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -16,6 +16,8 @@ - Added more body colors. - You can add more body colors by editing the config/PartColors.xml file! - Fixed an error that occured when loading multiple instances of the Character Customization window. +- Item Creation SDK: If a character customization window is open, it will now close the window and open a new one to update the view. +- Item Creation SDK: Added the optional ability to replace existing item icons. Added the following T-Shirts: Blue Ring of Fire Ring of Fire @@ -27,6 +29,21 @@ Bombastic Suit Crystal Shirt Darkseed Suit Novetus Guest Shirt +Domino Suit +Foil Shirt +Wood Shirt +The Golden Finoob +Gold Robot Arm +Hoodie of Passive Pwnage +JJx5 Suit +Robes of Pure Silver +Robes of Sacred Burn +Robes of Sheer Thaw +Robes of Toxicity +sandwich +Shiny Shirt +White Hoodie +Thaw Wizard Robes ---------------------------------------------------------------------------- 1.3 Pre-Release 2 1.3: