Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Intersect.Editor/Forms/FrmUploadToServer.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Intersect.Editor/Forms/FrmUploadToServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ private async void btnUpload_Click(object sender, EventArgs e)
.Where(frameObject => frameObject.TryGetValue("filename", out _))
.Select(frameObject => frameObject["filename"]?.Value<string>())
.Where(filename => !string.IsNullOrWhiteSpace(filename))
.Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/').ToLower(CultureInfo.CurrentCulture))
.Select(filename => filename!.Replace('\\', '/').ToLower(CultureInfo.CurrentCulture))
.OfType<string>();
}
catch
Expand Down Expand Up @@ -598,7 +598,7 @@ private async void btnUpload_Click(object sender, EventArgs e)
.Where(frameObject => frameObject.TryGetValue("filename", out _))
.Select(frameObject => frameObject["filename"]?.Value<string>())
.Where(filename => !string.IsNullOrWhiteSpace(filename))
.Select(filename => Path.Combine(resourcesDirectoryName, filename!).Replace('\\', '/').ToLower(CultureInfo.CurrentCulture))
.Select(filename => filename!.Replace('\\', '/').ToLower(CultureInfo.CurrentCulture))
.OfType<string>();
}
catch
Expand Down
44 changes: 34 additions & 10 deletions Intersect.Editor/Forms/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1846,21 +1846,42 @@
Globals.PackingProgressForm.SetProgress(Strings.AssetPacking.collecting, 20, false);
Application.DoEvents();
var toPack = new HashSet<Texture>();
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(

Check failure on line 1880 in Intersect.Editor/Forms/frmMain.cs

View workflow job for this annotation

GitHub Actions / build

'ILogger' does not contain a definition for 'LogWarning' and no accessible extension method 'LogWarning' accepting a first argument of type 'ILogger' could be found (are you missing a using directive or an assembly reference?)
ex,
$"Failed to load texture: {pngFile}"
);
}
}
}

Expand Down Expand Up @@ -1939,6 +1960,9 @@
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);
Expand Down
Loading