diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index 59e1af1ba..e64384c0d 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -8306,10 +8306,53 @@ std::string CCharacterCL::currentAnimationSetName(TAnimationType animType) const //--------------------------------------------------- std::string CCharacterCL::shapeFromItem(const CItemSheet &itemSheet) const { - if(_Gender == GSGENDER::female && !itemSheet.getShapeFemale().empty()) - return itemSheet.getShapeFemale(); + string sheet = ""; + + if(_Gender == GSGENDER::male) + { + if(_Sheet) + switch(_Sheet->Race) + { + case EGSPD::CPeople::Fyros: + sheet = itemSheet.getShapeFyros(); + break; + case EGSPD::CPeople::Matis: + sheet = itemSheet.getShapeMatis(); + break; + case EGSPD::CPeople::Tryker: + sheet = itemSheet.getShapeTryker(); + break; + case EGSPD::CPeople::Zorai: + sheet = itemSheet.getShapeZorai(); + break; + } + } else - return itemSheet.getShape(); + { + if(_Sheet) + switch(_Sheet->Race) + { + case EGSPD::CPeople::Fyros: + sheet = itemSheet.getShapeFyrosFemale(); + break; + case EGSPD::CPeople::Matis: + sheet = itemSheet.getShapeMatisFemale(); + break; + case EGSPD::CPeople::Tryker: + sheet = itemSheet.getShapeTrykerFemale(); + break; + case EGSPD::CPeople::Zorai: + sheet = itemSheet.getShapeZoraiFemale(); + break; + } + if (sheet.empty()) + sheet = itemSheet.getShapeFemale(); + } + if (sheet.empty()) + sheet = itemSheet.getShape(); + + return sheet; + }// shapeFromItem // diff --git a/code/ryzom/client/src/client_sheets/item_sheet.cpp b/code/ryzom/client/src/client_sheets/item_sheet.cpp index e13d8e267..7ac2376c4 100644 --- a/code/ryzom/client/src/client_sheets/item_sheet.cpp +++ b/code/ryzom/client/src/client_sheets/item_sheet.cpp @@ -75,6 +75,15 @@ CItemSheet::CItemSheet() { IdShape = 0; IdShapeFemale = 0; + IdShapeFyros = 0; + IdShapeFyrosFemale = 0; + IdShapeMatis = 0; + IdShapeMatisFemale = 0; + IdShapeTryker = 0; + IdShapeTrykerFemale = 0; + IdShapeZorai = 0; + IdShapeZoraiFemale = 0; + MapVariant = 0; ItemType = ITEM_TYPE::UNDEFINED; Family = ITEMFAMILY::UNDEFINED; @@ -173,6 +182,57 @@ void CItemSheet::build(const NLGEORGES::UFormElm &item) debug("key '3d.shape_female' not found."); IdShapeFemale = ClientSheetsStrings.add(ShapeFemale); + // Load the name fyros. + string ShapeFyros; + if(!item.getValueByName(ShapeFyros, "3d.shape_fyros")) + debug("key '3d.shape_fyros' not found."); + IdShapeFyros = ClientSheetsStrings.add(ShapeFyros); + + // Load the name fyros . + string ShapeFyrosFemale; + if(!item.getValueByName(ShapeFyrosFemale, "3d.shape_fyros_female")) + debug("key '3d.shape_fyros_female' not found."); + IdShapeFyrosFemale = ClientSheetsStrings.add(ShapeFyrosFemale); + + // Load the name matis. + string ShapeMatis; + if(!item.getValueByName(ShapeMatis, "3d.shape_matis")) + debug("key '3d.shape_matis' not found."); + IdShapeMatis = ClientSheetsStrings.add(ShapeMatis); + + // Load the name matis . + string ShapeMatisFemale; + if(!item.getValueByName(ShapeMatisFemale, "3d.shape_matis_female")) + debug("key '3d.shape_matis_female' not found."); + IdShapeMatisFemale = ClientSheetsStrings.add(ShapeMatisFemale); + + + // Load the name tryker. + string ShapeTryker; + if(!item.getValueByName(ShapeTryker, "3d.shape_tryker")) + debug("key '3d.shape_tryker' not found."); + IdShapeTryker = ClientSheetsStrings.add(ShapeTryker); + + // Load the name tryker . + string ShapeTrykerFemale; + if(!item.getValueByName(ShapeTrykerFemale, "3d.shape_tryker_female")) + debug("key '3d.shape_tryker_female' not found."); + IdShapeTrykerFemale = ClientSheetsStrings.add(ShapeTrykerFemale); + + + // Load the name zorai. + string ShapeZorai; + if(!item.getValueByName(ShapeZorai, "3d.shape_zorai")) + debug("key '3d.shape_zorai' not found."); + IdShapeZorai = ClientSheetsStrings.add(ShapeZorai); + + // Load the name zorai . + string ShapeZoraiFemale; + if(!item.getValueByName(ShapeZoraiFemale, "3d.shape_zorai_female")) + debug("key '3d.shape_zorai_female' not found."); + IdShapeZoraiFemale = ClientSheetsStrings.add(ShapeZoraiFemale); + + // Get the icon associated. string IconMain; if(!item.getValueByName (IconMain, "3d.icon")) @@ -615,6 +675,14 @@ void CItemSheet::serial(NLMISC::IStream &f) { ClientSheetsStrings.serial(f, IdShape); ClientSheetsStrings.serial(f, IdShapeFemale); + ClientSheetsStrings.serial(f, IdShapeFyros); + ClientSheetsStrings.serial(f, IdShapeFyrosFemale); + ClientSheetsStrings.serial(f, IdShapeMatis); + ClientSheetsStrings.serial(f, IdShapeMatisFemale); + ClientSheetsStrings.serial(f, IdShapeTryker); + ClientSheetsStrings.serial(f, IdShapeTrykerFemale); + ClientSheetsStrings.serial(f, IdShapeZorai); + ClientSheetsStrings.serial(f, IdShapeZoraiFemale); f.serial(SlotBF); // Serialize Slots used. f.serial(MapVariant); // Serialize Map Variant. f.serialEnum(Family); // Serialize Family. diff --git a/code/ryzom/client/src/client_sheets/item_sheet.h b/code/ryzom/client/src/client_sheets/item_sheet.h index c363c9756..6bea55fbc 100644 --- a/code/ryzom/client/src/client_sheets/item_sheet.h +++ b/code/ryzom/client/src/client_sheets/item_sheet.h @@ -288,6 +288,22 @@ public: NLMISC::TSStringId IdShape; /// Female shape file name NLMISC::TSStringId IdShapeFemale; + /// shape file name for fyros + NLMISC::TSStringId IdShapeFyros; + /// Female shape file name for fyros + NLMISC::TSStringId IdShapeFyrosFemale; + /// shape file name for matis + NLMISC::TSStringId IdShapeMatis; + /// Female shape file name for matis + NLMISC::TSStringId IdShapeMatisFemale; + /// shape file name for tryker + NLMISC::TSStringId IdShapeTryker; + /// Female shape file name for tryker + NLMISC::TSStringId IdShapeTrykerFemale; + /// shape file name for zorai + NLMISC::TSStringId IdShapeZorai; + /// Female shape file name for zorai + NLMISC::TSStringId IdShapeZoraiFemale; /// Equipment slot. This is a bitField matching each bit to SLOTTYPE::TSlotType uint64 SlotBF; /// texture variant. @@ -385,6 +401,14 @@ public: std::string getShape() const { return ClientSheetsStrings.get(IdShape); } std::string getShapeFemale() const { return ClientSheetsStrings.get(IdShapeFemale); } + std::string getShapeFyros() const { return ClientSheetsStrings.get(IdShapeFyros); } + std::string getShapeFyrosFemale() const { return ClientSheetsStrings.get(IdShapeFyrosFemale); } + std::string getShapeMatis() const { return ClientSheetsStrings.get(IdShapeMatis); } + std::string getShapeMatisFemale() const { return ClientSheetsStrings.get(IdShapeMatisFemale); } + std::string getShapeTryker() const { return ClientSheetsStrings.get(IdShapeTryker); } + std::string getShapeTrykerFemale() const { return ClientSheetsStrings.get(IdShapeTrykerFemale); } + std::string getShapeZorai() const { return ClientSheetsStrings.get(IdShapeZorai); } + std::string getShapeZoraiFemale() const { return ClientSheetsStrings.get(IdShapeZoraiFemale); } std::string getIconBack() const { return ClientSheetsStrings.get(IdIconBack); } std::string getIconMain() const { return ClientSheetsStrings.get(IdIconMain); } std::string getIconOver() const { return ClientSheetsStrings.get(IdIconOver); } diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index 5f56c5ab6..07d84461c 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -1386,7 +1386,7 @@ NLMISC_COMMAND(setItemName, "set name of items, sbrick, etc.."," 2) desc.fromUtf8(args[2]); - if (args.size() > 2) + if (args.size() > 3) desc2.fromUtf8(args[3]); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); diff --git a/code/ryzom/client/src/interface_v3/character_3d.cpp b/code/ryzom/client/src/interface_v3/character_3d.cpp index c01760115..9a688c6b1 100644 --- a/code/ryzom/client/src/interface_v3/character_3d.cpp +++ b/code/ryzom/client/src/interface_v3/character_3d.cpp @@ -436,9 +436,45 @@ void SCharacter3DSetup::setupFromCS_ModelCol (SLOTTYPE::EVisualSlot s, sint32 mo Parts[part].Quality = item->MapVariant; if (Male) - Parts[part].Name = item->getShape(); + { + switch(People) + { + case EGSPD::CPeople::Fyros: + Parts[part].Name = item->getShapeFyros(); + break; + case EGSPD::CPeople::Matis: + Parts[part].Name = item->getShapeMatis(); + break; + case EGSPD::CPeople::Tryker: + Parts[part].Name = item->getShapeTryker(); + break; + case EGSPD::CPeople::Zorai: + Parts[part].Name = item->getShapeZorai(); + break; + } + if (Parts[part].Name.empty()) + Parts[part].Name = item->getShape(); + } else - Parts[part].Name = item->getShapeFemale(); + { + switch(People) + { + case EGSPD::CPeople::Fyros: + Parts[part].Name = item->getShapeFyrosFemale(); + break; + case EGSPD::CPeople::Matis: + Parts[part].Name = item->getShapeMatisFemale(); + break; + case EGSPD::CPeople::Tryker: + Parts[part].Name = item->getShapeTrykerFemale(); + break; + case EGSPD::CPeople::Zorai: + Parts[part].Name = item->getShapeZoraiFemale(); + break; + } + if (Parts[part].Name.empty()) + Parts[part].Name = item->getShapeFemale(); + } // use the right type of boots if wearing a caster dress if ((s == SLOTTYPE::FEET_SLOT) && (item->ItemType == ITEM_TYPE::LIGHT_BOOTS || item->ItemType == ITEM_TYPE::MEDIUM_BOOTS || item->ItemType == ITEM_TYPE::HEAVY_BOOTS)) diff --git a/code/ryzom/client/src/player_cl.cpp b/code/ryzom/client/src/player_cl.cpp index e29a0a06e..45dcf7c48 100644 --- a/code/ryzom/client/src/player_cl.cpp +++ b/code/ryzom/client/src/player_cl.cpp @@ -540,7 +540,48 @@ void CPlayerCL::equip(SLOTTYPE::EVisualSlot slot, uint index, uint color) { const CItemSheet *item = _Items[slot].Sheet; - std::string shapeName = _Gender == GSGENDER::female ? item->getShapeFemale():item->getShape(); + std::string shapeName = ""; + if(_Gender == GSGENDER::male) + { + switch(_PlayerSheet->People) + { + case EGSPD::CPeople::Fyros: + shapeName = item->getShapeFyros(); + break; + case EGSPD::CPeople::Matis: + shapeName = item->getShapeMatis(); + break; + case EGSPD::CPeople::Tryker: + shapeName = item->getShapeTryker(); + break; + case EGSPD::CPeople::Zorai: + shapeName = item->getShapeZorai(); + break; + } + } + else + { + switch(_PlayerSheet->People) + { + case EGSPD::CPeople::Fyros: + shapeName = item->getShapeFyrosFemale(); + break; + case EGSPD::CPeople::Matis: + shapeName = item->getShapeMatisFemale(); + break; + case EGSPD::CPeople::Tryker: + shapeName = item->getShapeTrykerFemale(); + break; + case EGSPD::CPeople::Zorai: + shapeName = item->getShapeZoraiFemale(); + break; + } + if (shapeName.empty()) + shapeName = item->getShapeFemale(); + } + if (shapeName.empty()) + shapeName = item->getShape(); + // use the right type of boots if wearing a caster dress if ((slot == SLOTTYPE::FEET_SLOT) && (item->ItemType == ITEM_TYPE::LIGHT_BOOTS || item->ItemType == ITEM_TYPE::MEDIUM_BOOTS || item->ItemType == ITEM_TYPE::HEAVY_BOOTS))