Compare commits

...

12 Commits

Author SHA1 Message Date
Nuno Gonçalves (Ulukyn) 7df9b2f255 Merge branch '58-add-rotz-roty-and-dist-reflect-lua-to-3dcamera-of-a-scene' into 'main/gingo-test'
Resolve "Add rotz roty and dist reflect lua to 3DCamera of a scene"

See merge request ryzom/ryzom-core!48
3 years ago
Nuno Gonçalves (Ulukyn) 8697553956 Resolve "Add rotz roty and dist reflect lua to 3DCamera of a scene" 3 years ago
nimetu d2508c8b15 Update hunter to 0.23.321 3 years ago
Nuno Gonçalves (Ulukyn) d385dedabc Merge branch '56-message-bubble-is-very-high-on-fh-alarm-plants' into 'main/gingo-test'
Resolve "Message bubble is very high on FH alarm plants"

See merge request ryzom/ryzom-core!45
3 years ago
Nuno Gonçalves (Ulukyn) ae33eb99bf Resolve "Message bubble is very high on FH alarm plants" 3 years ago
Nuno Gonçalves (Ulukyn) 2b88fd66ba Merge branch '46-rework-item-buff-icon-placement' into 'main/gingo-test'
Hide 1x quantity for equipable items, dynamic buff icon placement

See merge request ryzom/ryzom-core!43
3 years ago
Ben Saine be5bfd992c Hide 1x quantity for equipable items, dynamic buff icon placement 3 years ago
Nuno Gonçalves (Ulukyn) 9a24e7557f Merge branch '54-improve-the-way-to-reskin-ryzhome-items-and-preview' into 'main/gingo-test'
Resolve "Improve the way to reskin ryzhome items and preview"

See merge request ryzom/ryzom-core!44
3 years ago
Nuno Gonçalves (Ulukyn) 8708fd74c6 Resolve "Improve the way to reskin ryzhome items and preview" 3 years ago
Nuno db86219eab Added NL_NO_ASSERT to remove asserts in server 3 years ago
Nuno Gonçalves (Ulukyn) c6ec8a8d7d Merge branch '40-dragging-from-player-trade-to-inventory-takes-two-tries' into 'main/gingo-test'
Resolve "Dragging from player trade to inventory takes two tries"

See merge request ryzom/ryzom-core!39
3 years ago
Ben Saine 357934fcde Resolve "Dragging from player trade to inventory takes two tries" 3 years ago

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

@ -380,7 +380,7 @@ extern bool _assertex_stop_1(bool &ignoreNextTime);
#define nlassume(exp) do { } while (0)
#endif
#ifdef NL_NO_DEBUG
#ifdef NL_NO_ASSERT
# define nlassert(exp) nlassume(exp)
# define nlassertonce(exp) nlassume(exp)
# define nlassertex(exp, str) nlassume(exp)

@ -274,7 +274,7 @@
//#define NL_NO_DEBUG
#undef NL_NO_DEBUG
#define NL_NO_ASSERT
// Standard types

@ -6274,6 +6274,11 @@ void CCharacterCL::updateVisiblePostPos(const NLMISC::TTime &currentTimeInMs, CE
pos = (box().getMin() + box().getMax())/2;
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));
_CurrentBubble->Position = pos;
}

@ -747,6 +747,10 @@ public:
CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src);
CDBCtrlSheet *pCSSrc = dynamic_cast<CDBCtrlSheet*>(pElt);
CDBCtrlSheet *pCSDst = dynamic_cast<CDBCtrlSheet*>(pCaller);
// end drag
getInventory().endDrag();
if ((pCSSrc == NULL) || (pCSDst == NULL)) return;
if (pCSSrc->getType() == CCtrlSheetInfo::SheetType_Item)

@ -309,7 +309,6 @@ CCtrlSheetInfo::CCtrlSheetInfo()
_InterfaceColor= true;
_SheetSelectionGroup = -1;
_UseQuality = true;
_DisplayItemQuality = true;
_UseQuantity = true;
_DuplicateOnDrag = false;
_ItemSlot= SLOTTYPE::UNDEFINED;
@ -1277,6 +1276,9 @@ void CDBCtrlSheet::setupItem ()
sint32 sheet = _SheetId.getSInt32();
_DispQuality = -1;
_DispQuantity = -1;
// If this is the same sheet, need to resetup
if (_LastSheetId != sheet || _NeedSetup)
{
@ -1290,13 +1292,6 @@ void CDBCtrlSheet::setupItem ()
{
_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());
// if file not found or empty, replace by default icon
if( _DispSheetBmpId == -1)
@ -1350,21 +1345,11 @@ void CDBCtrlSheet::setupItem ()
_DispQuantity = _Quantity.getSInt32();
}
}
else
// do not display any number
_DispQuantity = -1;
}
else _DispQuantity = -1;
// Setup quality
if(_DisplayItemQuality)
{
if(_UseQuality)
_DispQuality= _Quality.getSInt32();
}
else
{
_DispQuality= -1;
}
// special icon text
if( _NeedSetup || _ItemSheet->getIconText() != _OptString )
@ -1403,7 +1388,7 @@ void CDBCtrlSheet::setupItem ()
}
// update quality. NB: if quality change, the must updateItemCharacRequirement
if(_DisplayItemQuality)
if(_UseQuality)
{
sint32 newQuality= _Quality.getSInt32();
if(newQuality!=_DispQuality)
@ -1412,10 +1397,6 @@ void CDBCtrlSheet::setupItem ()
updateItemCharacRequirement(_LastSheetId);
}
}
else
{
_DispQuality= -1;
}
// update armour color (if USER_COLOR db change comes after SHEET change)
if(_ArmourColorFromDB && _UserColor)
@ -1428,6 +1409,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.
if(_AutoGrayed)
{
@ -1893,8 +1899,6 @@ void CDBCtrlSheet::setupOutpostBuilding()
{
COutpostBuildingSheet *pOBSheet = (COutpostBuildingSheet*)pES;
_DisplayItemQuality = false;
_DispSheetBmpId = rVR.getTextureIdFromName (pOBSheet->getIconMain());
// if file not found or empty, replace by default icon
if( _DispSheetBmpId == -1)
@ -2535,7 +2539,7 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
sint32 hArea = (hSheet / 4);
sint32 xIcon = x;
// 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)
{
sint32 wIcon = _BuffIcons[i].IconW;

@ -164,7 +164,6 @@ public:
bool _UseQuantity : 1; // is the quantity read and displayed ?
bool _ReadQuantityFromSheet : 1; // Read quantity from sheet rather than from database
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.
// 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.

@ -1437,6 +1437,34 @@ void CInterface3DShape::setName (const std::string &ht)
}
}
std::string CInterface3DShape::getTextures() const
{
return _Textures;
}
void CInterface3DShape::setTextures(const std::string &textures)
{
if (textures.empty())
return;
_Textures = textures;
vector<string> texList;
splitString(textures, " ", texList);
for(uint j=0;j<_Instance.getNumMaterials();j++)
{
sint numStages = _Instance.getMaterial(j).getLastTextureStage() + 1;
for(sint l = 0; l < numStages; l++)
{
if (_Instance.getMaterial(j).isTextureFile((uint) l))
{
_Instance.getMaterial(j).setTextureFileName(texList[std::min((int)j, (int)texList.size()-1)], (uint) l);
}
}
}
}
// ----------------------------------------------------------------------------
// CInterface3DCamera
// ----------------------------------------------------------------------------

@ -265,11 +265,15 @@ public:
std::string getName() const;
void setName (const std::string &ht);
std::string getTextures() const;
void setTextures (const std::string &textures);
float getBBoxSizeX () const;
float getBBoxSizeY () const;
float getBBoxSizeZ () const;
REFLECT_EXPORT_START(CInterface3DShape, CInterfaceElement)
REFLECT_FLOAT("getBBoxSizeX", getBBoxSizeX, setPosX);
REFLECT_FLOAT("getBBoxSizeY", getBBoxSizeY, setPosX);
@ -281,6 +285,7 @@ public:
REFLECT_FLOAT ("roty", getRotY, setRotY);
REFLECT_FLOAT ("rotz", getRotZ, setRotZ);
REFLECT_STRING ("name", getName, setName);
REFLECT_STRING("textures", getTextures, setTextures);
REFLECT_EXPORT_END
protected:
@ -289,6 +294,7 @@ protected:
NLMISC::CVector _Pos;
NLMISC::CVector _Rot;
std::string _Name;
std::string _Textures;
};
/**
@ -397,6 +403,15 @@ public:
float getTgtY() const { return _Target.y; }
float getTgtZ() const { return _Target.z; }
float getRotZ() const { return _Rot.z; }
void setRotZ(float f) { _Rot.z = f; }
float getRotY() const { return _Rot.y; }
void setRotY(float f) { _Rot.y = f; }
float getDist() const { return _Dist; }
void setDist(float f) { _Dist = f; }
REFLECT_EXPORT_START(CInterface3DCamera, CInterfaceElement)
REFLECT_FLOAT ("posx", getPosX, setPosX);
REFLECT_FLOAT ("posy", getPosY, setPosY);
@ -404,19 +419,13 @@ public:
REFLECT_FLOAT ("tgtx", getTgtX, setTgtX);
REFLECT_FLOAT ("tgty", getTgtY, setTgtY);
REFLECT_FLOAT ("tgtz", getTgtZ, setTgtZ);
REFLECT_FLOAT ("rotz", getRotZ, setRotZ);
REFLECT_FLOAT ("roty", getRotY, setRotY);
REFLECT_FLOAT ("dist", getDist, setDist);
REFLECT_FLOAT ("fov", getFOV, setFOV);
REFLECT_FLOAT ("roll", getRoll, setRoll);
REFLECT_EXPORT_END
float getRotZ() const { return _Rot.z; }
void setRotZ(float f) { _Rot.z = f; }
float getRotY() const { return _Rot.y; }
void setRotY(float f) { _Rot.y = f; }
float getDist() const { return _Dist; }
void setDist(float f) { _Dist = f; }
void reset(); // Reset user interaction
protected:

@ -2420,15 +2420,13 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
texture = "";
}
std::vector<string>texList;
if (!texture.empty())
splitString(texture, " ", texList);
for(uint j=0;j<instance.getNumMaterials();j++)
{
if (!highlight)
{
/*instance.getMaterial(j).setAmbient(CRGBA(0,0,0,255));
instance.getMaterial(j).setEmissive(CRGBA(255,255,255,255));
instance.getMaterial(j).setShininess(10.0f);*/
}
else
if (highlight)
{
instance.getMaterial(j).setAmbient(CRGBA(0,0,0,255));
instance.getMaterial(j).setEmissive(CRGBA(255,0,0,255));
@ -2441,9 +2439,7 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
for(sint l = 0; l < numStages; l++)
{
if (instance.getMaterial(j).isTextureFile((uint) l))
{
instance.getMaterial(j).setTextureFileName(texture, (uint) l);
}
instance.getMaterial(j).setTextureFileName(texList[std::min((int)j, (int)texList.size()-1)], (uint) l);
}
}
}

Loading…
Cancel
Save