CivClassic / FactoryMod

Configurable factories for automating item production - Built for Paper 1.16.5
Other
2 stars 17 forks source link

The reset format code is not equal to no formatting #11

Closed Lodish closed 4 years ago

Lodish commented 4 years ago

When writing a book all text is in black, when this writing is converted onto a note via the printing press this text become light gray, this still works if there are no formatting codes, but if the reset code is ever used (§r) the text now become white. Within a book §r and no formatting are both black but once a note is printed the text after §r is white.

image

image

Because I used a §r code to remove the bold on 'Death:' the following text is white, I also used §r after the white ● to reset the colour to light gray.

old plates made before the 1.14 update create correct notes.

I have no idea how github works, let me know how I messed up.

Lodish commented 4 years ago

there's a 'more information needed' label, what information is needed?

Maxopoly commented 4 years ago

What is the expected behavior after a reset code?

Lodish commented 4 years ago

the expected behaviour is to remove formatting, it should be the same as having no format codes after the §r, for books this means the text is black either way, and that this black text becomes light gray text on notes. (as it did on devoted, realms and classics before the update)

Protonull commented 4 years ago

Reset returns the string to the default colour and formatting, but that default can apparently differ between bodies of text. We've taken for granted that the default for chat and item descriptions are white and unformatted, but for books the default is different. I think we should generally move away from using the reset code as much as possible in the future since it's the only code that isn't consistent.

For reference, colour codes cancel out formatting codes, thus:

<red><bold>Hello <white>World!

That "World!" will only be white, since it cancels out the red AND the bold.

Read more

Maxopoly commented 4 years ago

I still don't quite understand this issue, if you do you, could fix it?

Protonull commented 4 years ago

Yeah, it's an odd one as the issue itself is simple, that people are using §r when writing in books because of how it functions in books. But when they use a printing press to create a note, the book's text is quite literally copy and pasted in item lore, and the reset for items makes the text white. What's confusing me is how this is a new issue.. here's a commit from 2016 with the same code.

We can fix this fairly easily for new copies of a paper note by essentially copying this line and changing the replaceable from black to reset. I'm not sure what we ought to do for existing paper notes though.

Maxopoly commented 4 years ago

It's likely some underlying behavior changing, remember Diet already fixed some other stuff regarding color that changed behavior. Idk though :man_shrugging:

Protonull commented 4 years ago

@Lodish Would you be content with a fix for new prints?

Lodish commented 4 years ago

I would be content with a fix for new prints but I think this isn't the recipe that's broken, your links show the 'create note' recipe, it is the plate creation recipe that's broken @Protonull

old pre-update plates already work fine,the issue isn't making a note, old plates make correct notes it's the new plates that are wrong. for instance earlier the plates that made purple italic text of anything without formatting still did that after diet fixed it, you had to make new plates to do new notes,

changing the replaceable from black to reset

don't you need both? the point of the change to gray is black isn't allowed on notes as it's unreadable

Lodish commented 4 years ago

Ok it seems I was wrong, new notes from a plate made before the update aren't stacking with old notes even though no difference can be seen between the notes

Protonull commented 4 years ago

That's to be expected as there was a fix not too long ago that added to fix formatting issues.

Maxopoly commented 4 years ago

But shouldn't those produce the same meta if they are visually the same?

Protonull commented 4 years ago

Nope, format and colour codes are just as much part of the string as the text

Lodish commented 4 years ago

So right now a new plate made right now and an old plate made pre-update make notes that stack together, its just old notes from the old plate that can't stack

I'm just surprised fixing the issues didn't lead to the same formatting/colour data that the old notes had. I guess all my CivTCG cards from now on will just be 2nd edition

The cards all look how they're supposed to though so thank you

Maxopoly commented 4 years ago

Please report back whether this is fixed after the next restart @Lodish

Lodish commented 4 years ago

This is the card from pre update image

this is from the old design copy pasted into a new book, making a new plate and then printing new notes:

image

They unfortunately don't stack together but that was expected.

Seems to be fixed to me, thanks

Lodish commented 4 years ago

New cards from old plate Old cards from old plate New cards from new plate

these all produce identical looking cards, none of which stack. this isn't really a problem just thought it was worth noting.

Maxopoly commented 4 years ago

Ok, closing this then