Skip to content

Commit

Permalink
Merge pull request #1669 from NyakoFox/fix-importgraphics
Browse files Browse the repository at this point in the history
Fix sprite_0_0 not importing as frame 1 of sprite_0
  • Loading branch information
Jacky720 authored Feb 25, 2024
2 parents 09ce2cb + 4e24fa5 commit 7ff22ae
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ EnsureDataLoaded();

bool importAsSprite = false;

// TODO: see if this can be reimplemented using substring instead of regex?
// "(.+?)" - match everything; "?" = match as few characters as possible.
// "(?:_(-*\d+))*" - an underscore + (optional minus + several digits);
// "?:" = don't make a separate group for the whole part, "*" = make this part optional.
Regex sprFrameRegex = new(@"^(.+?)(?:_(-*\d+))*$", RegexOptions.Compiled);
// "(?:_(\d+))" - an underscore followed by digits;
// "?:" = don't make a separate group for the whole part
Regex sprFrameRegex = new(@"^(.+?)(?:_(\d+))$", RegexOptions.Compiled);
string importFolder = CheckValidity();

string packDir = Path.Combine(ExePath, "Packager");
Expand Down

0 comments on commit 7ff22ae

Please sign in to comment.