mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Fixed simplifiedNametag
This commit is contained in:
parent
716a02495e
commit
80e5f2430f
3 changed files with 6 additions and 7 deletions
|
@ -1217,8 +1217,6 @@ public:
|
|||
* @function MyAvatar.getTargetAvatar
|
||||
* @returns {ScriptAvatar} Information on the avatar being looked at, <code>null</code> if no avatar is being looked at.
|
||||
*/
|
||||
// FIXME: The return type doesn't have a conversion to a script value so the function always returns undefined in
|
||||
// JavaScript. Note: When fixed, JSDoc is needed for the return type.
|
||||
Q_INVOKABLE ScriptAvatarData* getTargetAvatar() const;
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ bool avatarDataFromScriptValue(const ScriptValue& object, ScriptAvatarData*& out
|
|||
STATIC_SCRIPT_TYPES_INITIALIZER((+[](ScriptManager* manager) {
|
||||
auto scriptEngine = manager->engine().get();
|
||||
|
||||
scriptRegisterMetaType<ScriptAvatarData*, avatarDataToScriptValue, avatarDataFromScriptValue>(scriptEngine);
|
||||
scriptRegisterMetaType<ScriptAvatarData*, avatarDataToScriptValue, avatarDataFromScriptValue>(scriptEngine, "ScriptAvatarData*");
|
||||
}));
|
||||
|
||||
ScriptAvatarData::ScriptAvatarData(AvatarSharedPointer avatarData) :
|
||||
|
|
|
@ -148,8 +148,9 @@ function getAvatarData(uuid) {
|
|||
var avatarInfo = avatar.avatarInfo;
|
||||
|
||||
var newAvatarInfo = AvatarManager.getAvatar(uuid);
|
||||
|
||||
// Save the username so it doesn't get overwritten when grabbing new avatarData
|
||||
var combinedAvatarInfo = Object.assign({}, newAvatarInfo, {
|
||||
var combinedAvatarInfo = Object.assign({}, {avatarData: newAvatarInfo}, {
|
||||
username: avatarInfo === null ? null : avatarInfo.username
|
||||
});
|
||||
|
||||
|
@ -168,7 +169,7 @@ function getDistance(uuid, checkAvatar, shouldSave) {
|
|||
var avatar = _this.avatars[uuid];
|
||||
var avatarInfo = avatar.avatarInfo;
|
||||
|
||||
var target = avatarInfo.position;
|
||||
var target = avatarInfo.avatarData.position;
|
||||
|
||||
var currentDistance = Vec3.distance(target, eye);
|
||||
|
||||
|
@ -304,7 +305,7 @@ function getCorrectName(uuid) {
|
|||
var avatar = _this.avatars[uuid];
|
||||
var avatarInfo = avatar.avatarInfo;
|
||||
|
||||
var displayNameToUse = avatarInfo.displayName.trim();
|
||||
var displayNameToUse = avatarInfo.avatarData.displayName.trim();
|
||||
|
||||
if (displayNameToUse === "") {
|
||||
displayNameToUse = "anonymous";
|
||||
|
@ -744,4 +745,4 @@ nameTagListManager.prototype = {
|
|||
};
|
||||
|
||||
|
||||
module.exports = nameTagListManager;
|
||||
module.exports = nameTagListManager;
|
||||
|
|
Loading…
Reference in a new issue