FTBTeam / FTB-Mods-Issues

Any mod issues, be it FTB Teams, Quests or any other of our mods can be reported here!
21 stars 1 forks source link

[Feature Request]: Improvements to the better text formatting in quests #695

Open aaronhowser1 opened 1 year ago

aaronhowser1 commented 1 year ago

Mod

FTB Quests

Description

["","This is an example paragraph. These two sentances are unformatted. But if you click ",{"text":"this","color":"light_purple","clickEvent":{"action":"run_command","value":"/say hi"},"hoverEvent":{"action":"show_text","contents":["Say hi!"]}},", it says hi in chat."]

image

This is perfectly fine if we aren't bothering with translations. But, to my knowledge, using translation keys in quests is either required or highly highly recommended. This is how you'd do the same thing using translation keys:

["",{"translate":"modpack.questname.desc1.1"},{"translate":"modpack.questname.desc1.2","clickEvent":{"action":"run_command","value":"/say hi"},"hoverEvent":{"action":"show_text","contents":[{"translate":"modpack.questname.desc1.2text"}]}},{"translate":"modpack.questname.desc1.3"}]

While the en_us.json would have

{
    "modpack.questname.desc1.1":"This is an example paragraph. These two sentances are unformatted. But if you click ",
    "modpack.questname.desc1.2":"this",
    "modpack.questname.desc1.2text":"Say hi!",
    "modpack.questname.desc1.3":", it says hi in chat."
}

This makes it much harder to write, and also probably makes it impossible to translate into certain languages.

Describe the solution you'd like

My ideal version would be similar to Patchouli, where there's a different folder for each language and that's what that page uses.

An example page location: en_us/entries/arbitrary_folder/arbitrary_folder/page_name.json, where arbitrary_folder is the name of the category the page goes in.

The above paragraph would be written like so:

{
    "name": "whatever",
    "icon": "modname:itemname"
    "category": "modpackname:arbitrary_folder/arbitrary_folder",
    "pages": [
        {
            "type":"patchouli:text",
            "text":"This is an example paragraph. These two sentences are unformatted. But if you click $(d)$(c:/say hi)this$(), it says hi in chat."
        }
    ]
}

And if anyone wanted to translate it, they would just copy the entire contents of the en_us folder into like en_pt and change it. They'd be able to change all text, not just on a paragraph by paragraph basis.

The quest would just point towards a json or snbt or even a txt, and use that for its text. Instead of having a quest's description looking like this:

{university.dynamictank.desc1}

["",{"translate":"university.dynamictank.desc2.1"},{"translate":"university.dynamictank.desc2.2","color":"light_purple","clickEvent":{"action":"run_command","value":"/create ponder mekanism:dynamic_tank"},"hoverEvent":{"action":"show_text","contents":[":three_button_mouse: /create ponder mekanism:dynamic_tank"]}},{"translate":"university.dynamictank.desc2.3"}]

{university.dynamictank.desc3}

it would just have like ftbuniversity:quests/mekanism/dynamic_tank.txt, which points to a /kubejs/assets/ftbuniversity/quests/mekanism/dynamic_tank.txt which looks like

&bDynamic Tanks&r are freeform multiblock fluid/chemical containers.

We've added a Ponder to teach how to build the Dynamic Tank. Either Ponder on the item, or $(d)$(t: :three_button_mouse: /create ponder mekanism:dynamic_tank)$(c:/create ponder mekanism:dynamic_tank)click here$() instead.

Describe alternatives you've considered

Each quest could also have a designated text json per language, like

{
    "title":"Quest title",
    "subtitle":"Quest subtitle",
    "description":[
        "paragraph 1",
        "&bformatting included&r, and tellraw format if needed",
        "[\"\",{\"translate\":\"university.dynamictank.desc2.1\"},{\"translate\":\"university.dynamictank.desc2.2\",\"color\":\"light_purple\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/create ponder mekanism:dynamic_tank\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\":three_button_mouse: /create ponder mekanism:dynamic_tank\"]}},{\"translate\":\"university.dynamictank.desc2.3\"}]"
    ]
}

If title etc is missing from the json, it's just unset like normal. Tasks having their own lang key separate is fine imo, I can't think of an elegant solution for those.

aaronhowser1 commented 1 year ago

Every quest having its own text file separated by language was something Lat and I were trying to figure out before he left. He never got around to it unfortunately.

aaronhowser1 commented 1 year ago

https://user-images.githubusercontent.com/15698722/220556306-72c8dc5f-de3f-4cdf-aecf-0167fae5e1d0.mp4

This is the workflow for creating tellraw paragraphs, not including writing it.

(The reason it didn't work the first time was because I'd copied the space at the start)