Merge branch 'main/atys-live' into main/yubo-dev

main/yubo-dev
Nuno 3 years ago
commit 96c0da8efd

@ -41,8 +41,8 @@ OPTION(HUNTER_ENABLED "Enable Hunter package manager" OFF)
IF(HUNTER_ENABLED) IF(HUNTER_ENABLED)
INCLUDE("CMakeModules/HunterGate.cmake") INCLUDE("CMakeModules/HunterGate.cmake")
HunterGate( HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.317.tar.gz" URL "https://github.com/cpp-pm/hunter/archive/v0.23.321.tar.gz"
SHA1 "fbdd94b1966d351384e27b02c8d134915b1131d6" SHA1 "5e53cbb0429037ea8e2592bfd92704b8ff3ab492"
FILEPATH "${CMAKE_CURRENT_LIST_DIR}/CMakeModules/HunterConfig.cmake" FILEPATH "${CMAKE_CURRENT_LIST_DIR}/CMakeModules/HunterConfig.cmake"
) )

@ -6306,6 +6306,11 @@ void CCharacterCL::updateVisiblePostPos(const NLMISC::TTime &currentTimeInMs, CE
pos = (box().getMin() + box().getMax())/2; pos = (box().getMin() + box().getMax())/2;
pos.z = box().getMax().z; pos.z = box().getMax().z;
} }
CRaceStatsSheet *sheet = const_cast<CRaceStatsSheet*>(UserEntity->playerSheet());
float namePosZ = sheet->GenderInfos[UserEntity->getGender()].NamePosZNormal;
if (pos.z > box().getMin().z + namePosZ)
pos.z = box().getMin().z + namePosZ;
nlassert(isValidDouble(pos.x) && isValidDouble(pos.y) && isValidDouble(pos.z)); nlassert(isValidDouble(pos.x) && isValidDouble(pos.y) && isValidDouble(pos.z));
_CurrentBubble->Position = pos; _CurrentBubble->Position = pos;
} }

@ -309,7 +309,6 @@ CCtrlSheetInfo::CCtrlSheetInfo()
_InterfaceColor= true; _InterfaceColor= true;
_SheetSelectionGroup = -1; _SheetSelectionGroup = -1;
_UseQuality = true; _UseQuality = true;
_DisplayItemQuality = true;
_UseQuantity = true; _UseQuantity = true;
_DuplicateOnDrag = false; _DuplicateOnDrag = false;
_ItemSlot= SLOTTYPE::UNDEFINED; _ItemSlot= SLOTTYPE::UNDEFINED;
@ -1282,6 +1281,9 @@ void CDBCtrlSheet::setupItem ()
sint32 sheet = _SheetId.getSInt32(); sint32 sheet = _SheetId.getSInt32();
_DispQuality = -1;
_DispQuantity = -1;
// If this is the same sheet, need to resetup // If this is the same sheet, need to resetup
if (_LastSheetId != sheet || _NeedSetup) if (_LastSheetId != sheet || _NeedSetup)
{ {
@ -1295,13 +1297,6 @@ void CDBCtrlSheet::setupItem ()
{ {
_ItemSheet = (CItemSheet*)pES; _ItemSheet = (CItemSheet*)pES;
// Display the item quality?
_DisplayItemQuality= _UseQuality &&
_ItemSheet->Family != ITEMFAMILY::COSMETIC &&
_ItemSheet->Family != ITEMFAMILY::TELEPORT &&
_ItemSheet->Family != ITEMFAMILY::SERVICE
;
_DispSheetBmpId = rVR.getTextureIdFromName (_ItemSheet->getIconMain()); _DispSheetBmpId = rVR.getTextureIdFromName (_ItemSheet->getIconMain());
// if file not found or empty, replace by default icon // if file not found or empty, replace by default icon
if( _DispSheetBmpId == -1) if( _DispSheetBmpId == -1)
@ -1355,21 +1350,11 @@ void CDBCtrlSheet::setupItem ()
_DispQuantity = _Quantity.getSInt32(); _DispQuantity = _Quantity.getSInt32();
} }
} }
else
// do not display any number
_DispQuantity = -1;
} }
else _DispQuantity = -1;
// Setup quality // Setup quality
if(_DisplayItemQuality) if(_UseQuality)
{
_DispQuality= _Quality.getSInt32(); _DispQuality= _Quality.getSInt32();
}
else
{
_DispQuality= -1;
}
// special icon text // special icon text
if( _NeedSetup || _ItemSheet->getIconText() != _OptString ) if( _NeedSetup || _ItemSheet->getIconText() != _OptString )
@ -1408,7 +1393,7 @@ void CDBCtrlSheet::setupItem ()
} }
// update quality. NB: if quality change, the must updateItemCharacRequirement // update quality. NB: if quality change, the must updateItemCharacRequirement
if(_DisplayItemQuality) if(_UseQuality)
{ {
sint32 newQuality= _Quality.getSInt32(); sint32 newQuality= _Quality.getSInt32();
if(newQuality!=_DispQuality) if(newQuality!=_DispQuality)
@ -1417,10 +1402,6 @@ void CDBCtrlSheet::setupItem ()
updateItemCharacRequirement(_LastSheetId); updateItemCharacRequirement(_LastSheetId);
} }
} }
else
{
_DispQuality= -1;
}
// update armour color (if USER_COLOR db change comes after SHEET change) // update armour color (if USER_COLOR db change comes after SHEET change)
if(_ArmourColorFromDB && _UserColor) if(_ArmourColorFromDB && _UserColor)
@ -1433,6 +1414,31 @@ void CDBCtrlSheet::setupItem ()
} }
} }
if (_ItemSheet != NULL)
{
switch(_ItemSheet->Family)
{
case ITEMFAMILY::ARMOR:
case ITEMFAMILY::MELEE_WEAPON:
case ITEMFAMILY::RANGE_WEAPON:
case ITEMFAMILY::SHIELD:
case ITEMFAMILY::JEWELRY:
case ITEMFAMILY::CRAFTING_TOOL:
case ITEMFAMILY::HARVEST_TOOL:
case ITEMFAMILY::TAMING_TOOL:
case ITEMFAMILY::TRAINING_TOOL:
// hide 'x0' and 'x1' stack count for equipable items
if (_DispQuantity < 2)
_DispQuantity = -1;
break;
default:
// hide 'q0'and 'q1' quality for every other item
if (_DispQuality < 2)
_DispQuality = -1;
break;
}
}
// at each frame, must test for grayed. // at each frame, must test for grayed.
if(_AutoGrayed) if(_AutoGrayed)
{ {
@ -1898,8 +1904,6 @@ void CDBCtrlSheet::setupOutpostBuilding()
{ {
COutpostBuildingSheet *pOBSheet = (COutpostBuildingSheet*)pES; COutpostBuildingSheet *pOBSheet = (COutpostBuildingSheet*)pES;
_DisplayItemQuality = false;
_DispSheetBmpId = rVR.getTextureIdFromName (pOBSheet->getIconMain()); _DispSheetBmpId = rVR.getTextureIdFromName (pOBSheet->getIconMain());
// if file not found or empty, replace by default icon // if file not found or empty, replace by default icon
if( _DispSheetBmpId == -1) if( _DispSheetBmpId == -1)
@ -2540,7 +2544,7 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
sint32 hArea = (hSheet / 4); sint32 hArea = (hSheet / 4);
sint32 xIcon = x; sint32 xIcon = x;
// move buff icons up a row, quantity text is displayed on bottom-left corner // move buff icons up a row, quantity text is displayed on bottom-left corner
sint32 yIcon = y + hArea; sint32 yIcon = y + (_DispQuantity > 0 ? hArea : 0);
for (uint i = 0; i < _BuffIcons.size(); ++i) for (uint i = 0; i < _BuffIcons.size(); ++i)
{ {
sint32 wIcon = _BuffIcons[i].IconW; sint32 wIcon = _BuffIcons[i].IconW;

@ -164,7 +164,6 @@ public:
bool _UseQuantity : 1; // is the quantity read and displayed ? bool _UseQuantity : 1; // is the quantity read and displayed ?
bool _ReadQuantityFromSheet : 1; // Read quantity from sheet rather than from database bool _ReadQuantityFromSheet : 1; // Read quantity from sheet rather than from database
bool _UseQuality : 1; // is the quality read and displayed ? bool _UseQuality : 1; // is the quality read and displayed ?
bool _DisplayItemQuality : 1; // Do we have to display the quality for the item (false for Cosmetics and Teleport and if _UseQuality==fasle)?
bool _DuplicateOnDrag : 1; // when dragged, the item is shown twice : one version at the mouse position. bool _DuplicateOnDrag : 1; // when dragged, the item is shown twice : one version at the mouse position.
// and another in the source slot. Useful for items to buy that are in infinite quantity. // and another in the source slot. Useful for items to buy that are in infinite quantity.
bool _AutoGrayed : 1; // if true then gray the ctrlSheeet if: 1/ Items: Is the Item Locked. 2/ Bricks: is the brick Latent. bool _AutoGrayed : 1; // if true then gray the ctrlSheeet if: 1/ Items: Is the Item Locked. 2/ Bricks: is the brick Latent.

Loading…
Cancel
Save