huderlem / poryscript

High-level scripting language for gen 3 pokemon decompilation projects
https://www.huderlem.com/poryscript-playground/
MIT License
191 stars 21 forks source link

Versatile Text Length for the `format` directive #31

Closed SBird1337 closed 4 years ago

SBird1337 commented 4 years ago

Allows to specify the maximal text width (in pixels) to the format directive granted the font id was specified as the second argument.

Example as taken from the README:

text MyText {
    format("Hello, are you the real-live legendary {PLAYER} that everyone talks about?\pAmazing!\pSo glad to meet you!", "1_latin", 100)
}

Becomes:

.string "Hello, are you the\n"
.string "real-live\l"
.string "legendary\l"
.string "{PLAYER} that\l"
.string "everyone talks\l"
.string "about?\p"
.string "Amazing!\p"
.string "So glad to meet\n"
.string "you!$"
codecov-commenter commented 4 years ago

Codecov Report

Merging #31 into master will increase coverage by 0.07%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #31      +/-   ##
==========================================
+ Coverage   92.17%   92.25%   +0.07%     
==========================================
  Files           6        6              
  Lines        1981     2000      +19     
==========================================
+ Hits         1826     1845      +19     
  Misses         98       98              
  Partials       57       57              
Impacted Files Coverage Δ
parser/parser.go 90.48% <100.00%> (+0.17%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e5d0b16...3771070. Read the comment docs.

SBird1337 commented 4 years ago

I added the remaining test cases to test for errors in the new diff, this should be ready now - I can squash the history if you want :>