[wheybags] [0.17.9] Rich text tags can't be deleted

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
SupplyDepoo
Fast Inserter
Fast Inserter
Posts: 126
Joined: Sat Oct 29, 2016 8:42 pm
Contact:

[wheybags] [0.17.9] Rich text tags can't be deleted

Post by SupplyDepoo » Mon Mar 11, 2019 12:24 am

If I enter rich text tags like

Code: Select all

[img=item/assembling-machine-2] AP [font=default-small]1.5/s
for my blueprint name and later edit it and delete some tags, the tags don't go completely away. They're appended to whatever I change the name to.

You can see this by selecting all, copying and pasting in a text editor.

For example, my blueprint name is now:

Code: Select all

[img=item/assembling-machine-2] AP [font=default-small]1.5/s[font=default-small][font=default-large-bold][color=white][color=white][font=default][font=debug-mono][font=debug][color=0.5,0,][color=red]
I cannot remove the tags at the end and when I try to edit the title of the blueprint I get a "label is too large" error!

Even if I select all and delete, the formatting tags remain.
2019-03-11 01_58_06.gif
2019-03-11 01_58_06.gif (2.85 MiB) Viewed 614 times

billbo99
Inserter
Inserter
Posts: 22
Joined: Fri Nov 02, 2018 9:19 am
Contact:

Re: [0.17.9] Rich text tags can't be deleted

Post by billbo99 » Mon Mar 11, 2019 12:10 pm

Will the 200 character limit be increase on train stations? Its going to get used up fast with all the Rich Text people are starting to use.

User avatar
wheybags
Factorio Staff
Factorio Staff
Posts: 250
Joined: Fri Jun 02, 2017 1:50 pm
Contact:

Re: [wheybags] [0.17.9] Rich text tags can't be deleted

Post by wheybags » Tue Mar 12, 2019 3:09 pm

Thanks for the report. Fixed for the next release.

User avatar
VuiMuich
Inserter
Inserter
Posts: 21
Joined: Tue Jan 16, 2018 4:37 pm
Contact:

Re: [wheybags] [0.17.9] Rich text tags can't be deleted

Post by VuiMuich » Wed Mar 13, 2019 7:20 am

billbo99 wrote:
Mon Mar 11, 2019 12:10 pm
Will the 200 character limit be increase on train stations? Its going to get used up fast with all the Rich Text people are starting to use.
Maybe for rich text entity icons a conversion to to Unicode glyphs with use of the UTF+16 PUA could be a solution.
Iirc Unicode is implemented anyway for support of Kanji/Kana, Kyrilic, etc.
Or is it just UTF+8?
[ˈfʊɪ̯ mʊɪ̯ç]
Bavarian, translates to: Lots of Milk

User avatar
wheybags
Factorio Staff
Factorio Staff
Posts: 250
Joined: Fri Jun 02, 2017 1:50 pm
Contact:

Re: [wheybags] [0.17.9] Rich text tags can't be deleted

Post by wheybags » Wed Mar 13, 2019 8:12 am

Unfortunately, it is just utf-8 stored in an std::string, and we need to do all unicode manipulation manually :(
Personally, I would switch the whole thing to 32 bit wide chars, and use some special reserved unicode range to store ids which would map to our special text tags under the hood, so we could just cleanly iterate and process text, but to force support for that into our existing gui library, and onto the entire rest of the codebase would be literal hell.
Would have made things much easier to implement though, and saved a load of subtle byte-position-vs-unicode-index bugs.
Also, having in-line image tags count as 1 char for editing purposes would have been amazing (currently, we go to great lengths to fake that effect, by calculating where the cursor should actually move to when you hit right arrow with your cursor just before an img tag, and many many other edge cases).

User avatar
VuiMuich
Inserter
Inserter
Posts: 21
Joined: Tue Jan 16, 2018 4:37 pm
Contact:

Re: [wheybags] [0.17.9] Rich text tags can't be deleted

Post by VuiMuich » Wed Mar 13, 2019 11:00 am

Oh, then you probably need a capable intern to go through this hell :twisted:
It will be a good lesson for any upcoming developer.

If the urge for Mac developers wouldn’t be so big it also would be a good job application test ;)

And ofc it was actually to obvious that you implemented it the way it is after well consideration.
[ˈfʊɪ̯ mʊɪ̯ç]
Bavarian, translates to: Lots of Milk

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 293
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: [wheybags] [0.17.9] Rich text tags can't be deleted

Post by ownlyme » Mon Apr 22, 2019 12:33 pm

you should be able to mark the transition between the fonts and delete it, after your text there will appear the closing tags then
mods.factorio.com/user/ownlyme
My requests: Blueprint allies||Creeps forget command/ don't get removed||Grenade arc||Player Modifiers||Gui Root||textbox::selection||Better Heat IF||Singleplayer RCON||Serializing function refs in global table...

Post Reply

Return to “Resolved Problems and Bugs”

Who is online

Users browsing this forum: No registered users