OpenDreamProject / OpenDream

A project for running games made in the DM programming language
MIT License
208 stars 112 forks source link

Implement replacetextEx_char, reimplement Splittext to match new 515 behavior #1921

Open MyNameIsRomayne opened 3 months ago

MyNameIsRomayne commented 3 months ago

Very simple one-liner piggybacking off jointext and spltitext, with an update to Splittext so that it functions properly.

Basically, splittext has been updated in 515 to include the start and end of the string, so the current implementation of Splittext now remembers that and pre/appends those parts to the first/last elements.

The splittext unit tests were updated based off the output from DM for 515: image

Originally this was just going to be a one-liner for replacetextEx_char, but after being informed of the changes needed to Splittext I decided to go ahead and do that too, so that this works.

MyNameIsRomayne commented 3 months ago

Drafting due to a new test I added failing, going to resolve that (Empty strings should be splitting on every char, but instead dont split at all)

MyNameIsRomayne commented 3 months ago

image Reopening because I am genuinely unable to fix this without worsening the code quality beyond the review-necessary state it is in. Please advise on this

github-actions[bot] commented 2 months ago

This pull request has conflicts, please resolve those before we can evaluate the pull request.