PathOfBuildingCommunity / PathOfBuilding

Offline build planner for Path of Exile.
https://pathofbuilding.community
Other
3.63k stars 2k forks source link

Fix fallout from SimpleGraphic upgrade with wider Unicode support #7586

Open zao opened 2 months ago

zao commented 2 months ago

Description of the problem being solved:

In https://github.com/PathOfBuildingCommunity/PathOfBuilding-SimpleGraphic/pull/59 there were significant foundational improvements for users installing Path of Building into paths with characters that cannot be expressed in their codepage.

There is also a companion PR for the Launcher in https://github.com/PathOfBuildingCommunity/PathOfBuilding-Launcher/pull/6.

In short:

This means that Lua code that touches things like the full build path or the script path may need to adapt to process UTF-8 correctly with string operations.

In order to help with that, the SimpleGraphic update also features luautf8, a Lua extension that provides UTF-8 analogues of many string operations like gsub, match, etc.

This change leverages that extension via local utf8 = require('lua-utf8') to correctly move the text caret with the cursor keys in edit controls, and also showcases its use to handle (hypothetical) Unicode decimal and thousands separators.

The runtime also lost the vestigial ability to process GIF and BLP image formats, some existing assets were stealth GIFs with PNG extensions and have here been converted lossless to PNG.

The update check logic has been adapted to generate relative paths in the op-files to make its limited interpreter work correctly in exotic install locations.

Steps taken to verify a working solution:

Install location:

Build path:

Build name:

Numeric separators:

Link to a build that showcases this PR:

n/a

After screenshot:

image image