fix(dbc): runtime detection for ItemDisplayInfo texture field indices

Revert static JSON layout changes (15-22 back to 14-21) since WotLK
loads the Classic 23-field DBC. Add getItemDisplayInfoTextureFields()
helper that detects field count at runtime and adjusts the texture
base index accordingly (14 for 23-field, 15 for 25-field).
This commit is contained in:
Kelsi 2026-04-03 22:05:38 -07:00
parent 3111fa50e8
commit 1379e74c40
6 changed files with 51 additions and 70 deletions

View file

@ -3910,18 +3910,8 @@ void GameScreen::updateCharacterTextures(game::Inventory& inventory) {
if (!displayInfoDbc) return;
const auto* idiL = pipeline::getActiveDBCLayout()
? pipeline::getActiveDBCLayout()->getLayout("ItemDisplayInfo") : nullptr;
// Texture component region fields (8 regions: ArmUpper..Foot)
// Binary DBC (23 fields) has textures at 14+
const uint32_t texRegionFields[8] = {
idiL ? (*idiL)["TextureArmUpper"] : 14u,
idiL ? (*idiL)["TextureArmLower"] : 15u,
idiL ? (*idiL)["TextureHand"] : 16u,
idiL ? (*idiL)["TextureTorsoUpper"]: 17u,
idiL ? (*idiL)["TextureTorsoLower"]: 18u,
idiL ? (*idiL)["TextureLegUpper"] : 19u,
idiL ? (*idiL)["TextureLegLower"] : 20u,
idiL ? (*idiL)["TextureFoot"] : 21u,
};
uint32_t texRegionFields[8];
pipeline::getItemDisplayInfoTextureFields(*displayInfoDbc, idiL, texRegionFields);
// Collect equipment texture regions from all equipped items
std::vector<std::pair<int, std::string>> regionLayers;