diff --git a/Intersect.Editor/Forms/FrmUploadToServer.Designer.cs b/Intersect.Editor/Forms/FrmUploadToServer.Designer.cs index 2189fa43d4..10a52eff4e 100644 --- a/Intersect.Editor/Forms/FrmUploadToServer.Designer.cs +++ b/Intersect.Editor/Forms/FrmUploadToServer.Designer.cs @@ -121,7 +121,7 @@ private void InitializeComponent() // this.lblStatus.AutoSize = true; this.lblStatus.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.lblStatus.Location = new System.Drawing.Point(12, 187); + this.lblStatus.Location = new System.Drawing.Point(12, 185); this.lblStatus.Name = "lblStatus"; this.lblStatus.Size = new System.Drawing.Size(0, 13); this.lblStatus.TabIndex = 8; @@ -138,7 +138,7 @@ private void InitializeComponent() // // btnLogin // - this.btnLogin.Location = new System.Drawing.Point(206, 240); + this.btnLogin.Location = new System.Drawing.Point(206, 215); this.btnLogin.Name = "btnLogin"; this.btnLogin.Padding = new System.Windows.Forms.Padding(5); this.btnLogin.Size = new System.Drawing.Size(85, 28); @@ -150,7 +150,7 @@ private void InitializeComponent() // btnUpload // this.btnUpload.Enabled = false; - this.btnUpload.Location = new System.Drawing.Point(297, 240); + this.btnUpload.Location = new System.Drawing.Point(297, 215); this.btnUpload.Name = "btnUpload"; this.btnUpload.Padding = new System.Windows.Forms.Padding(5); this.btnUpload.Size = new System.Drawing.Size(85, 28); @@ -161,7 +161,7 @@ private void InitializeComponent() // btnClose // this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnClose.Location = new System.Drawing.Point(388, 240); + this.btnClose.Location = new System.Drawing.Point(388, 215); this.btnClose.Name = "btnClose"; this.btnClose.Padding = new System.Windows.Forms.Padding(5); this.btnClose.Size = new System.Drawing.Size(84, 28); diff --git a/Intersect.Editor/Forms/FrmUploadToServer.cs b/Intersect.Editor/Forms/FrmUploadToServer.cs index 771ecdf80d..1260fd5679 100644 --- a/Intersect.Editor/Forms/FrmUploadToServer.cs +++ b/Intersect.Editor/Forms/FrmUploadToServer.cs @@ -443,7 +443,7 @@ private async void btnUpload_Click(object sender, EventArgs e) .Where(frameObject => frameObject.TryGetValue("filename", out _)) .Select(frameObject => frameObject["filename"]?.Value()) .Where(filename => !string.IsNullOrWhiteSpace(filename)) - .Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/').ToLower(CultureInfo.CurrentCulture)) + .Select(filename => filename!.Replace('\\', '/').ToLower(CultureInfo.CurrentCulture)) .OfType(); } catch @@ -598,7 +598,7 @@ private async void btnUpload_Click(object sender, EventArgs e) .Where(frameObject => frameObject.TryGetValue("filename", out _)) .Select(frameObject => frameObject["filename"]?.Value()) .Where(filename => !string.IsNullOrWhiteSpace(filename)) - .Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/').ToLower(CultureInfo.CurrentCulture)) + .Select(filename => filename!.Replace('\\', '/').ToLower(CultureInfo.CurrentCulture)) .OfType(); } catch diff --git a/Intersect.Editor/Forms/frmMain.cs b/Intersect.Editor/Forms/frmMain.cs index d41bfff53e..7bd671cf1d 100644 --- a/Intersect.Editor/Forms/frmMain.cs +++ b/Intersect.Editor/Forms/frmMain.cs @@ -1846,21 +1846,42 @@ public static void packAssets(string rootDirectory, Form parentForm = null) Globals.PackingProgressForm.SetProgress(Strings.AssetPacking.collecting, 20, false); Application.DoEvents(); var toPack = new HashSet(); - foreach (var tex in GameContentManager.TilesetTextures) - { - toPack.Add(tex); - } - foreach (var tex in GameContentManager.FogTextures) + // Scan all texture directories in the resources folder + var textureDirectories = new[] { - toPack.Add(tex); - } + "tilesets", "fogs", "gui", "paperdolls", "resources", "spells", + "faces", "items", "misc", "animations", "entities", "images", "updater" + }; + // Note: fonts directory is excluded because it contains only .xnb files, not PNG textures + // updater directory is included because it can contain PNG files like progressbar.png - foreach (var tex in GameContentManager.AllTextures) + foreach (var dir in textureDirectories) { - if (!toPack.Contains(tex)) + var dirPath = Path.Combine(resourcesDirectory, dir); + if (!Directory.Exists(dirPath)) { - toPack.Add(tex); + continue; + } + + var pngFiles = Directory.GetFiles(dirPath, "*.png", SearchOption.TopDirectoryOnly); + foreach (var pngFile in pngFiles) + { + try + { + // Use path relative to root directory matching old GameContentManager format + // Example: "resources/items/sword.png" + var relativePath = Path.GetRelativePath(rootDirectory, pngFile).Replace('\\', '/'); + var texture = new Texture(relativePath); + toPack.Add(texture); + } + catch (Exception ex) + { + Intersect.Core.ApplicationContext.Context.Value?.Logger.LogWarning( + ex, + $"Failed to load texture: {pngFile}" + ); + } } } @@ -1939,6 +1960,9 @@ public static void packAssets(string rootDirectory, Form parentForm = null) musicPackSize ); + // Note: Fonts and updater files are NOT packed because the client + // loads them directly from the file system and doesn't support unpacking them + Globals.PackingProgressForm.SetProgress(Strings.AssetPacking.done, 100, false); Application.DoEvents(); Thread.Sleep(1000);