Skip to main content

Theming the quest book

Firstly: Themes are just a .txt file that tells quests how to look. Most components will use this for their styling. If they don't. Please let us know! Not many people use this system

Secondly: Themes are handled by placing a ftbquests/ftb_quests_theme.txt file in your resource pack (KubeJS works here)

The fun stuff

Properties

Colour

  • color: A colour property is an RGBA colour code, but it supports a bunch of things, so here goes
    • "#00A8FF" (Hex codes are supported)
    • "#FF00A8FF" (Alpha supported (First 2) hex codes are supported)
    • Then the following presets are supported: transparent, black, dark_gray, gray, white, red, green, blue, light_red, light_green, light_blue

Icon

  • icon: Another fun one, this can be handled using the following:
    • An icon is a string value like the following item:minecraft:diamond
    • But an icon and support many different types (Not just items)
      • color:{value} (See above)
      • bullet:{color_value} is a simple bullet-point icon (drawn in code, rather than as a bullet texture)
      • http, https, file: Loads a resource from disk or a remote location.
        • All of these take a value like https://example.com, file://C:/Location
      • hollow_rectangle:{color} The name says it all, it makes a hollow rectangle
      • part:{icon} is used for drawing nine-sliced widgets using an existing texture and corner-size definition
      • builtin indicates that the icon is drawn by the mod using an internal class to do the work
      • Finally, if you do not provide one of these keywords, and instead do something like ftbranks:textures/gui/something.png it will just try to do a normal asset icon
  • But now! Here is the fun stuff...
    • Properties: Using a ; you can signify that an icon has specific properties. These are as follows (I'll show an example at the end btw)
      • padding={int_value} Icon padding (all directions (left, right, up, down))
      • border={color_value} see colour description above.
        • You can give this rounded corners by adding border_round_edges=true
      • color={color_value} See above for colours, but this will give the icon a standard colour under all the other options
      • tint={color_value} See above again. But this adds an overall tint to the icon
      • The distinction between color and tint is subtle, and the effect often depends on the specific icon type. If in doubt, experiment!
      • Finally, these are added together using a ; meaning a full example might look like this
        • icon:minecraft:diamond;padding=5;border=#00A8FF;border_round_edges=true;color=blue;tint=#A8FFFFFF
  • double: This one is simple. It's just a double (1.0D)
  • int: (See above)
  • string: (See above)

Well! Wasn't that fun. Now we know all about properties. As you can tell, the colour and icon properties are pretty powerful!

Now we get onto the fun stuff. How do you use this in quests? Well, as we said above, it's all configured in the ftb_quests_theme.txt

As of right now, the quest themes system supports the following values

Overall

Widgets

Widgets are most of the UI containers (IIRC)

Icons

  • check_icon: {icon_prop} This defaults to builtin - using the CheckIcon class in FTB Quests
  • add_icon: {icon_prop} This defaults to builtin - using a complex render but uses the symbol_in and symbol_out colours

Overall quest book icons

Task specific

Quest window

Tagging

You may have noticed a [*] line at the very top of the ftb_quests_theme.txt file. Lines like this act as filters, limiting which quests that theming should be applied to. The default filter, a *, indicates that anything below this should apply to all quests, so this is the fallback behaviour.

You can add more [...] lines if you like. Between the [] brackets, put either a quest ID (the long hex ID you can get by right-clicking a quest and selecting "Copy ID"), or a quest tag. Quest tags are just free form strings, which you can add to quests via the "Edit" context menu action - see the "Tags" list property in the edit screen.

Example:

[bluequests]
quest_not_started_color: #FF0000FF

[redquests]
quest_not_started_color: #FFFF0000

Now, adding the "bluequests" tag to any quest will make it render blue when it hasn't yet been started, and similarly for the "redquests" tag. Every other theming property is inherited from the [*] defaults.

In general, it's better to use tags than literal quest ID's, just because tags are a lot more flexible.

Custom Shapes

You can have custom quest shapes if the built-in shapes aren't sufficient for your needs. To do this:

  • Pick a shape name (free form text, keep it short and meaningful, one word) and add it to the comma-separated list in extra_quest_shapes
  • Place three texture files for your new shape name in your resource pack, accessible as:
  • Add a translation for your shape in a language file: "ftbquests.quest.shape.<shapename>": "New Shape"

Side notes

Finally, there are a couple of side notes to this system

At any point in your .txt file, if you use {{ NAME }} in the value, it will assume you want to use the value of a different property. So this might look like the following: quest_completed_color: {{rewards_text_color}}

It's important to note that these need to be the same (or compatible) property types for a replacement to be successful.

Some of the above values have a min and max. You should check here: https://github.com/FTBTeam/FTB-Quests/blob/main/common/src/main/java/dev/ftb/mods/ftbquests/quest/theme/property/ThemeProperties.java for those min and max values