Skip to content

feat(items): the tooltip's item names come from the data (#815 step 5d-1) - #833

Open
ezequielzacca wants to merge 390 commits into
sven-n:mainfrom
ezequielzacca:feat/item-tooltip-names
Open

ezequielzacca wants to merge 390 commits into
sven-n:mainfrom
ezequielzacca:feat/item-tooltip-names

Conversation

@ezequielzacca

@ezequielzacca ezequielzacca commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

This step's own changes: compare with #830. The diff of this PR also holds every earlier step of #815, since a PR from a fork can only target this repository's branches.

Summary

Step 5d-1 of #815 (data-driven item tooltips; design). Stacked on #830 (→ #829 → … → #813): only the last commit, feat(items): the tooltip's item names come from the data, is this step.

The tooltip's first line, the item's name and its color, was a chain of about 50 item cases in RenderItemInfo, plus a color chain before it. Items now have name lines:

"nameLines": [
  {"text": "{name}", "color": "white", "levels": [0, 0], "colors": [{"when": ["level>=7"], "color": "yellow"}, {"when": ["hasOptions"], "color": "blue"}]},
  {"text": "{name} +{level}", "color": "white", "colors": [{"when": ["level>=7"], "color": "yellow"}, {"when": ["hasOptions"], "color": "blue"}]}
]

(the wings' and capes': no "Excellent", yellow from +7, else blue with options). The first line whose levels and when hold gives the name and the color. A line is written like a description line, and its text and color may be left out:

  • Without a text, the line keeps the standard name: the set's name for an ancient item, "Excellent" for an excellent one, " +level" above +0.
  • Without a color, it keeps the standard color: ancient, socket, excellent, +7, options, else white.

[{"color": "yellow"}] is a jewel's: the standard name, in yellow. Without name lines, an item gets the standard name and color.

What moved

157 items get name lines:

  • the names by level (Box of Luck, Heart, Rena, Wizard's Ring, Archangel weapon, chocolate boxes, siege potions, contracts, ...);
  • the Fruits' "{stat} Fruits" (from their levelValues);
  • the Orb of Summoning and the Transformation Ring;
  • the wings and capes, the Divine Archangel weapons, the Spirit, the Symbol of Kundun and the Lost Map;
  • the packed jewels ("Jewel of Bless +{levelPlusOne}");
  • the Horn of Fenrir's kinds ("when": ["excellentFlags=1"]);
  • and the yellow, violet, purple and white names of jewels, quest items, tickets, socket seeds and Fenrir's materials.

Nothing stays code.

New in the data

Tooltips that changed, on purpose

  • The Box of Luck +4 is the "Olive of Love", as the game's level names (ItemLevelTooltip_eng.bmd) have it. The chain had no case for +4 and printed an empty name. The tooltip stops drawing at an empty line, so this tooltip showed nothing at all.
  • The Spirit outside English reads "Geist (Dunkles Pferd)" instead of "Geist of Dunkles Pferd": the chain wrote the English "of" in every language.
  • The NPC shop's price line has the name's color. Before, it had the color from before the chain. For the items whose case recolored the name, the two differ, e.g. a +3 Rena's price was white and its name yellow.

The chain had no case either at some levels of other items: the Orb of Summoning above +6, the Siege Potion above +1, ... No such item exists, since the item definitions stop at the last named level. Those levels get the standard name, so the data has no gap there.

Every other name is unchanged for both heroes, in the test and in the game's tooltip-snapshot.

.resx

Two texts only the chain printed are gone from every language: "+Illusion" and "Kundun mark +%d level". "+Destroy" and "+Protect" stay, because the mix recipes name them. The Archangel weapons' names stay too: Lookup(710 + …) and Lookup(725 + …) can reach them.

GetItemName() (the ground labels, the trade and mix windows) still has its own copy of the chain. It moves onto the same data in 5d-2.

Screenshots

Before (#830) and after this PR, for a level 400 Dark Knight.

Box of Luck +4

The one change: +4 had no case in the chain, so the tooltip showed nothing. It is the "Olive of Love" in the game's level names (ItemLevelTooltip_eng.bmd).

Legacy theme Modern theme
Before
After
The item's name lines (English only)
{
  "number": 11,
  "name": "Box of Luck",
  "nameLines": [
    {
      "text": "{name}",
      "levels": [0, 0]
    },
    {
      "text": "Star of Sacred Birth",
      "levels": [1, 1]
    },
    {
      "text": "Firecracker",
      "levels": [2, 2]
    },
    {
      "text": "Heart of love",
      "levels": [3, 3]
    },
    {
      "text": "@oliveOfLove",
      "levels": [4, 4]
    },
    {
      "text": "Silver medal",
      "levels": [5, 5]
    },
    {
      "text": "Gold medal",
      "levels": [6, 6]
    },
    {
      "text": "Box of Heaven",
      "levels": [7, 7]
    },
    {
      "text": "Box of Kundun +1",
      "levels": [8, 8]
    },
    {
      "text": "Box of Kundun +2",
      "levels": [9, 9]
    },
    {
      "text": "Box of Kundun +3",
      "levels": [10, 10]
    },
    {
      "text": "Box of Kundun +4",
      "levels": [11, 11]
    },
    {
      "text": "Box of Kundun +5",
      "levels": [12, 12]
    },
    {
      "text": "Heart of Dark Lord",
      "levels": [13, 13]
    },
    {
      "text": "Blue lucky pouch",
      "levels": [14, 14]
    },
    {
      "text": "Red lucky pouch",
      "levels": [15, 15]
    }
  ]
}

Shared texts (English):

{
  "oliveOfLove": "Olive of love"
}

Orb of Summoning +3

Unchanged: the summon's name now comes from skillName:<skill>.

Legacy theme Modern theme
Before
After
The item's name lines (English only)
{
  "number": 11,
  "name": "Orb of Summoning",
  "nameLines": [
    {
      "text": "{skill} Jewel",
      "values": {
        "skill": "skillName:30"
      },
      "levels": [0, 0]
    },
    {
      "text": "{skill} Jewel",
      "values": {
        "skill": "skillName:31"
      },
      "levels": [1, 1]
    },
    {
      "text": "{skill} Jewel",
      "values": {
        "skill": "skillName:32"
      },
      "levels": [2, 2]
    },
    {
      "text": "{skill} Jewel",
      "values": {
        "skill": "skillName:33"
      },
      "levels": [3, 3]
    },
    {
      "text": "{skill} Jewel",
      "values": {
        "skill": "skillName:34"
      },
      "levels": [4, 4]
    },
    {
      "text": "{skill} Jewel",
      "values": {
        "skill": "skillName:35"
      },
      "levels": [5, 5]
    },
    {
      "text": "{skill} Jewel",
      "values": {
        "skill": "skillName:36"
      },
      "levels": [6, 6]
    }
  ]
}

Rena +3

Unchanged: a name by level, in yellow.

Legacy theme Modern theme
Before
After
The item's name lines (English only)
{
  "number": 21,
  "name": "Rena",
  "nameLines": [
    {
      "text": "{name}",
      "color": "yellow",
      "levels": [0, 0]
    },
    {
      "text": "Stone",
      "color": "yellow",
      "levels": [1, 1]
    },
    {
      "text": "Stone of Friendship",
      "color": "yellow",
      "levels": [2, 2]
    },
    {
      "text": "Sign of lord",
      "color": "yellow",
      "levels": [3, 3]
    },
    {
      "color": "yellow"
    }
  ]
}

Skeleton Transformation Ring

Unchanged: the monster's name now comes from monsterName:<monster>.

Legacy theme Modern theme
Before
After
The item's name lines (English only)
{
  "number": 10,
  "name": "Transformation Ring",
  "nameLines": [
    {
      "text": "{monster} Transformation Ring",
      "values": {
        "monster": "monsterName:2"
      },
      "levels": [0, 0]
    },
    {
      "text": "{monster} Transformation Ring",
      "values": {
        "monster": "monsterName:7"
      },
      "levels": [1, 1]
    },
    {
      "text": "{monster} Transformation Ring",
      "values": {
        "monster": "monsterName:14"
      },
      "levels": [2, 2]
    },
    {
      "text": "{monster} Transformation Ring",
      "values": {
        "monster": "monsterName:8"
      },
      "levels": [3, 3]
    },
    {
      "text": "{monster} Transformation Ring",
      "values": {
        "monster": "monsterName:9"
      },
      "levels": [4, 4]
    },
    {
      "text": "{monster} Transformation Ring",
      "values": {
        "monster": "monsterName:41"
      },
      "levels": [5, 5]
    }
  ]
}

Related issues

Step 5d-1 of #815. Builds on #830, #829, #828, #827, #825, #824, #823, #822, #821, #820, #819, #818, #817, #816 and #813.

Checklist

  • I have read and followed docs/CODING_RULES.md.
  • I have built the project locally (see docs/build/README.md).
    • Windows x64 Release: all 1013 tests pass, also as one run of the whole data test executable.
    • New test: "An item's name lines are kept through write and read, with or without a text and a color". The placeholder test now also covers name lines and the game data values.
    • Changed lines pass clang-format 21.1.8 as CI checks them.
    • In game: tooltip-snapshot of two heroes before and after, and the screenshots above in both themes.
  • Changes are focused on one concern; the diff is as small as it reasonably can be.

…m-tooltip-chain-texts

# Conflicts:
#	tests/data/test_item_database_files.cpp
…ooltip-durability

# Conflicts:
#	docs/item-data.md
…m-tooltip-shared-texts

# Conflicts:
#	docs/item-data.md
…em-tooltip-chain-values

# Conflicts:
#	docs/item-data.md
…tem-tooltip-third-chain

# Conflicts:
#	docs/item-data.md
…em-tooltip-names

# Conflicts:
#	docs/item-data.md
…at/item-tooltip-values-to-data

# Conflicts:
#	docs/item-data.md
#	src/source/Data/GameData/ItemData/ItemDataValidation.cpp
#	src/source/Data/GameData/ItemData/ItemDataValidation.h
…ooltip-values

# Conflicts:
#	docs/item-data.md
#	src/source/Data/GameData/ItemData/ItemDataValidation.cpp
#	tests/data/test_item_description_placeholders.cpp
…oltip-layouts

# Conflicts:
#	src/source/Data/GameData/ItemData/ItemDataValidation.cpp
…ooltip-durability

# Conflicts:
#	docs/item-data.md
…m-tooltip-shared-texts

# Conflicts:
#	src/bin/Data/Items/Group13_Helper.json
…tat words aren't the game's texts

The "i" of "%% increase" leaked into seven translations of "Damage +20% increase effect" ("iefecto", "infeito",
"inувеличение", ...). The level lines' test no longer compares the Fruits' stat words with the game's texts, which
keep the words this step corrects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants