mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-24 21:36:31 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into goto-home-bug
This commit is contained in:
commit
fd3e1fb320
11 changed files with 111 additions and 72 deletions
30
cmake/externals/LibOVR/CMakeLists.txt
vendored
30
cmake/externals/LibOVR/CMakeLists.txt
vendored
|
@ -12,34 +12,28 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
||||||
# 0.5 public
|
# 0.5 public
|
||||||
# URL http://static.oculus.com/sdk-downloads/ovr_sdk_win_0.5.0.1.zip
|
# URL http://static.oculus.com/sdk-downloads/ovr_sdk_win_0.5.0.1.zip
|
||||||
# URL_MD5 d3fc4c02db9be5ff08af4ef4c97b32f9
|
# URL_MD5 d3fc4c02db9be5ff08af4ef4c97b32f9
|
||||||
# 1.3 public
|
|
||||||
# URL http://hifi-public.s3.amazonaws.com/dependencies/ovr_sdk_win_1.3.0_public.zip
|
|
||||||
# URL_MD5 4d26faba0c1f35ff80bf674c96ed9259
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
${EXTERNAL_NAME}
|
${EXTERNAL_NAME}
|
||||||
URL https://hifi-public.s3.amazonaws.com/dependencies/ovr_sdk_win_1.8.0_public.zip
|
URL https://static.oculus.com/sdk-downloads/1.11.0/Public/1486063832/ovr_sdk_win_1.11.0_public.zip
|
||||||
URL_MD5 bea17e04acc1dd8cf7cabefa1b28cc3c
|
URL_MD5 ea484403757cbfdfa743b6577fb1f9d2
|
||||||
CONFIGURE_COMMAND ""
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||||
BUILD_COMMAND ""
|
PATCH_COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/LibOVRCMakeLists.txt" <SOURCE_DIR>/CMakeLists.txt
|
||||||
INSTALL_COMMAND ""
|
|
||||||
LOG_DOWNLOAD 1
|
LOG_DOWNLOAD 1
|
||||||
)
|
)
|
||||||
|
|
||||||
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
message("LIBOVR dir ${SOURCE_DIR}")
|
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
|
||||||
set(LIBOVR_DIR ${SOURCE_DIR}/LibOVR)
|
set(LIBOVR_DIR ${INSTALL_DIR})
|
||||||
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
|
||||||
set(LIBOVR_LIB_DIR ${LIBOVR_DIR}/Lib/Windows/x64/Release/VS2013 CACHE TYPE INTERNAL)
|
|
||||||
else()
|
|
||||||
set(LIBOVR_LIB_DIR ${LIBOVR_DIR}/Lib/Windows/Win32/Release/VS2013 CACHE TYPE INTERNAL)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${LIBOVR_DIR}/Include CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${LIBOVR_DIR}/Include CACHE TYPE INTERNAL)
|
||||||
message("LIBOVR include dir ${${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS}")
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG ${LIBOVR_DIR}/Lib/LibOVRd.lib CACHE TYPE INTERNAL)
|
||||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${LIBOVR_LIB_DIR}/LibOVR.lib CACHE TYPE INTERNAL)
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${LIBOVR_DIR}/Lib/LibOVR.lib CACHE TYPE INTERNAL)
|
||||||
|
include(SelectLibraryConfigurations)
|
||||||
|
select_library_configurations(LIBOVR)
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARIES} CACHE TYPE INTERNAL)
|
||||||
|
message("Libs ${EXTERNAL_NAME_UPPER}_LIBRARIES ${${EXTERNAL_NAME_UPPER}_LIBRARIES}")
|
||||||
|
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
|
|
||||||
|
|
14
cmake/externals/LibOVR/LibOVRCMakeLists.txt
vendored
Normal file
14
cmake/externals/LibOVR/LibOVRCMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
cmake_minimum_required(VERSION 3.2)
|
||||||
|
project(LibOVR)
|
||||||
|
|
||||||
|
include_directories(LibOVR/Include LibOVR/Src)
|
||||||
|
file(GLOB HEADER_FILES LibOVR/Include/*.h)
|
||||||
|
file(GLOB EXTRA_HEADER_FILES LibOVR/Include/Extras/*.h)
|
||||||
|
file(GLOB_RECURSE SOURCE_FILES LibOVR/Src/*.c LibOVR/Src/*.cpp)
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOVR_BUILD_DEBUG")
|
||||||
|
add_library(LibOVR STATIC ${SOURCE_FILES} ${HEADER_FILES} ${EXTRA_HEADER_FILES})
|
||||||
|
set_target_properties(LibOVR PROPERTIES DEBUG_POSTFIX "d")
|
||||||
|
|
||||||
|
install(TARGETS LibOVR DESTINATION Lib)
|
||||||
|
install(FILES ${HEADER_FILES} DESTINATION Include)
|
||||||
|
install(FILES ${EXTRA_HEADER_FILES} DESTINATION Include/Extras)
|
|
@ -2000,6 +2000,11 @@ void AvatarData::fromJson(const QJsonObject& json, bool useFrameSkeleton) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto currentBasis = getRecordingBasis();
|
||||||
|
if (!currentBasis) {
|
||||||
|
currentBasis = std::make_shared<Transform>(Transform::fromJson(json[JSON_AVATAR_BASIS]));
|
||||||
|
}
|
||||||
|
|
||||||
if (json.contains(JSON_AVATAR_RELATIVE)) {
|
if (json.contains(JSON_AVATAR_RELATIVE)) {
|
||||||
// During playback you can either have the recording basis set to the avatar current state
|
// During playback you can either have the recording basis set to the avatar current state
|
||||||
// meaning that all playback is relative to this avatars starting position, or
|
// meaning that all playback is relative to this avatars starting position, or
|
||||||
|
@ -2008,15 +2013,14 @@ void AvatarData::fromJson(const QJsonObject& json, bool useFrameSkeleton) {
|
||||||
// The first is more useful for playing back recordings on your own avatar, while
|
// The first is more useful for playing back recordings on your own avatar, while
|
||||||
// the latter is more useful for playing back other avatars within your scene.
|
// the latter is more useful for playing back other avatars within your scene.
|
||||||
|
|
||||||
auto currentBasis = getRecordingBasis();
|
|
||||||
if (!currentBasis) {
|
|
||||||
currentBasis = std::make_shared<Transform>(Transform::fromJson(json[JSON_AVATAR_BASIS]));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto relativeTransform = Transform::fromJson(json[JSON_AVATAR_RELATIVE]);
|
auto relativeTransform = Transform::fromJson(json[JSON_AVATAR_RELATIVE]);
|
||||||
auto worldTransform = currentBasis->worldTransform(relativeTransform);
|
auto worldTransform = currentBasis->worldTransform(relativeTransform);
|
||||||
setPosition(worldTransform.getTranslation());
|
setPosition(worldTransform.getTranslation());
|
||||||
setOrientation(worldTransform.getRotation());
|
setOrientation(worldTransform.getRotation());
|
||||||
|
} else {
|
||||||
|
// We still set the position in the case that there is no movement.
|
||||||
|
setPosition(currentBasis->getTranslation());
|
||||||
|
setOrientation(currentBasis->getRotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (json.contains(JSON_AVATAR_SCALE)) {
|
if (json.contains(JSON_AVATAR_SCALE)) {
|
||||||
|
|
|
@ -654,6 +654,11 @@ float OpenGLDisplayPlugin::presentRate() const {
|
||||||
return _presentRate.rate();
|
return _presentRate.rate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OpenGLDisplayPlugin::resetPresentRate() {
|
||||||
|
// FIXME
|
||||||
|
// _presentRate = RateCounter<100>();
|
||||||
|
}
|
||||||
|
|
||||||
float OpenGLDisplayPlugin::renderRate() const {
|
float OpenGLDisplayPlugin::renderRate() const {
|
||||||
return _renderRate.rate();
|
return _renderRate.rate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,8 @@ public:
|
||||||
|
|
||||||
float presentRate() const override;
|
float presentRate() const override;
|
||||||
|
|
||||||
|
void resetPresentRate() override;
|
||||||
|
|
||||||
float newFramePresentRate() const override;
|
float newFramePresentRate() const override;
|
||||||
|
|
||||||
float droppedFrameRate() const override;
|
float droppedFrameRate() const override;
|
||||||
|
|
|
@ -139,7 +139,7 @@ public:
|
||||||
/// By default, all HMDs are stereo
|
/// By default, all HMDs are stereo
|
||||||
virtual bool isStereo() const { return isHmd(); }
|
virtual bool isStereo() const { return isHmd(); }
|
||||||
virtual bool isThrottled() const { return false; }
|
virtual bool isThrottled() const { return false; }
|
||||||
virtual float getTargetFrameRate() const { return 0.0f; }
|
virtual float getTargetFrameRate() const { return 1.0f; }
|
||||||
virtual bool hasAsyncReprojection() const { return false; }
|
virtual bool hasAsyncReprojection() const { return false; }
|
||||||
|
|
||||||
/// Returns a boolean value indicating whether the display is currently visible
|
/// Returns a boolean value indicating whether the display is currently visible
|
||||||
|
@ -189,6 +189,11 @@ public:
|
||||||
virtual float renderRate() const { return -1.0f; }
|
virtual float renderRate() const { return -1.0f; }
|
||||||
// Rate at which we present to the display device
|
// Rate at which we present to the display device
|
||||||
virtual float presentRate() const { return -1.0f; }
|
virtual float presentRate() const { return -1.0f; }
|
||||||
|
// Reset the present rate tracking (useful for if the target frame rate changes as in ASW for Oculus)
|
||||||
|
virtual void resetPresentRate() {}
|
||||||
|
// Return the present rate as fraction of the target present rate (hopefully 0.0 and 1.0)
|
||||||
|
virtual float normalizedPresentRate() const { return presentRate() / getTargetFrameRate(); }
|
||||||
|
|
||||||
// Rate at which old frames are presented to the device display
|
// Rate at which old frames are presented to the device display
|
||||||
virtual float stutterRate() const { return -1.0f; }
|
virtual float stutterRate() const { return -1.0f; }
|
||||||
// Rate at which new frames are being presented to the display device
|
// Rate at which new frames are being presented to the display device
|
||||||
|
|
|
@ -28,6 +28,12 @@ OculusDisplayPlugin::OculusDisplayPlugin() {
|
||||||
_compositorDroppedFrames.store(0);
|
_compositorDroppedFrames.store(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float OculusDisplayPlugin::getTargetFrameRate() const {
|
||||||
|
if (_aswActive) {
|
||||||
|
return _hmdDesc.DisplayRefreshRate / 2.0f;
|
||||||
|
}
|
||||||
|
return _hmdDesc.DisplayRefreshRate;
|
||||||
|
}
|
||||||
|
|
||||||
bool OculusDisplayPlugin::internalActivate() {
|
bool OculusDisplayPlugin::internalActivate() {
|
||||||
bool result = Parent::internalActivate();
|
bool result = Parent::internalActivate();
|
||||||
|
@ -185,8 +191,6 @@ void OculusDisplayPlugin::hmdPresent() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!OVR_SUCCESS(result)) {
|
if (!OVR_SUCCESS(result)) {
|
||||||
logWarning("Failed to present");
|
logWarning("Failed to present");
|
||||||
}
|
}
|
||||||
|
@ -195,12 +199,20 @@ void OculusDisplayPlugin::hmdPresent() {
|
||||||
static int appDroppedFrames = 0;
|
static int appDroppedFrames = 0;
|
||||||
ovrPerfStats perfStats;
|
ovrPerfStats perfStats;
|
||||||
ovr_GetPerfStats(_session, &perfStats);
|
ovr_GetPerfStats(_session, &perfStats);
|
||||||
|
bool shouldResetPresentRate = false;
|
||||||
for (int i = 0; i < perfStats.FrameStatsCount; ++i) {
|
for (int i = 0; i < perfStats.FrameStatsCount; ++i) {
|
||||||
const auto& frameStats = perfStats.FrameStats[i];
|
const auto& frameStats = perfStats.FrameStats[i];
|
||||||
int delta = frameStats.CompositorDroppedFrameCount - compositorDroppedFrames;
|
int delta = frameStats.CompositorDroppedFrameCount - compositorDroppedFrames;
|
||||||
_stutterRate.increment(delta);
|
_stutterRate.increment(delta);
|
||||||
compositorDroppedFrames = frameStats.CompositorDroppedFrameCount;
|
compositorDroppedFrames = frameStats.CompositorDroppedFrameCount;
|
||||||
appDroppedFrames = frameStats.AppDroppedFrameCount;
|
appDroppedFrames = frameStats.AppDroppedFrameCount;
|
||||||
|
bool newAswState = ovrTrue == frameStats.AswIsActive;
|
||||||
|
if (_aswActive.exchange(newAswState) != newAswState) {
|
||||||
|
shouldResetPresentRate = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (shouldResetPresentRate) {
|
||||||
|
resetPresentRate();
|
||||||
}
|
}
|
||||||
_appDroppedFrames.store(appDroppedFrames);
|
_appDroppedFrames.store(appDroppedFrames);
|
||||||
_compositorDroppedFrames.store(compositorDroppedFrames);
|
_compositorDroppedFrames.store(compositorDroppedFrames);
|
||||||
|
@ -212,6 +224,7 @@ void OculusDisplayPlugin::hmdPresent() {
|
||||||
|
|
||||||
QJsonObject OculusDisplayPlugin::getHardwareStats() const {
|
QJsonObject OculusDisplayPlugin::getHardwareStats() const {
|
||||||
QJsonObject hardwareStats;
|
QJsonObject hardwareStats;
|
||||||
|
hardwareStats["asw_active"] = _aswActive.load();
|
||||||
hardwareStats["app_dropped_frame_count"] = _appDroppedFrames.load();
|
hardwareStats["app_dropped_frame_count"] = _appDroppedFrames.load();
|
||||||
hardwareStats["compositor_dropped_frame_count"] = _compositorDroppedFrames.load();
|
hardwareStats["compositor_dropped_frame_count"] = _compositorDroppedFrames.load();
|
||||||
hardwareStats["long_render_count"] = _longRenders.load();
|
hardwareStats["long_render_count"] = _longRenders.load();
|
||||||
|
|
|
@ -20,6 +20,7 @@ public:
|
||||||
|
|
||||||
QString getPreferredAudioInDevice() const override;
|
QString getPreferredAudioInDevice() const override;
|
||||||
QString getPreferredAudioOutDevice() const override;
|
QString getPreferredAudioOutDevice() const override;
|
||||||
|
float getTargetFrameRate() const override;
|
||||||
|
|
||||||
virtual QJsonObject getHardwareStats() const;
|
virtual QJsonObject getHardwareStats() const;
|
||||||
|
|
||||||
|
@ -39,6 +40,7 @@ private:
|
||||||
gpu::FramebufferPointer _outputFramebuffer;
|
gpu::FramebufferPointer _outputFramebuffer;
|
||||||
bool _customized { false };
|
bool _customized { false };
|
||||||
|
|
||||||
|
std::atomic_bool _aswActive;
|
||||||
std::atomic_int _compositorDroppedFrames;
|
std::atomic_int _compositorDroppedFrames;
|
||||||
std::atomic_int _appDroppedFrames;
|
std::atomic_int _appDroppedFrames;
|
||||||
std::atomic_int _longSubmits;
|
std::atomic_int _longSubmits;
|
||||||
|
|
|
@ -88,7 +88,11 @@ ovrSession acquireOculusSession() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!session) {
|
if (!session) {
|
||||||
if (!OVR_SUCCESS(ovr_Initialize(nullptr))) {
|
ovrInitParams initParams {
|
||||||
|
ovrInit_RequestVersion | ovrInit_MixedRendering, OVR_MINOR_VERSION, nullptr, 0, 0
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!OVR_SUCCESS(ovr_Initialize(&initParams))) {
|
||||||
logWarning("Failed to initialize Oculus SDK");
|
logWarning("Failed to initialize Oculus SDK");
|
||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,24 +310,24 @@ function getFingerWorldLocation(hand) {
|
||||||
|
|
||||||
// Object assign polyfill
|
// Object assign polyfill
|
||||||
if (typeof Object.assign != 'function') {
|
if (typeof Object.assign != 'function') {
|
||||||
Object.assign = function(target, varArgs) {
|
Object.assign = function(target, varArgs) {
|
||||||
'use strict';
|
'use strict';
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
throw new TypeError('Cannot convert undefined or null to object');
|
throw new TypeError('Cannot convert undefined or null to object');
|
||||||
}
|
|
||||||
var to = Object(target);
|
|
||||||
for (var index = 1; index < arguments.length; index++) {
|
|
||||||
var nextSource = arguments[index];
|
|
||||||
if (nextSource != null) {
|
|
||||||
for (var nextKey in nextSource) {
|
|
||||||
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
|
||||||
to[nextKey] = nextSource[nextKey];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
var to = Object(target);
|
||||||
}
|
for (var index = 1; index < arguments.length; index++) {
|
||||||
return to;
|
var nextSource = arguments[index];
|
||||||
};
|
if (nextSource != null) {
|
||||||
|
for (var nextKey in nextSource) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
||||||
|
to[nextKey] = nextSource[nextKey];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function distanceBetweenPointAndEntityBoundingBox(point, entityProps) {
|
function distanceBetweenPointAndEntityBoundingBox(point, entityProps) {
|
||||||
|
@ -1604,16 +1604,16 @@ function MyController(hand) {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
this.entityIsCloneable = function(entityID) {
|
this.entityIsCloneable = function(entityID) {
|
||||||
var entityProps = entityPropertiesCache.getGrabbableProps(entityID);
|
var entityProps = entityPropertiesCache.getGrabbableProps(entityID);
|
||||||
var props = entityPropertiesCache.getProps(entityID);
|
var props = entityPropertiesCache.getProps(entityID);
|
||||||
if (!props) {
|
if (!props) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entityProps.hasOwnProperty("cloneable")) {
|
if (entityProps.hasOwnProperty("cloneable")) {
|
||||||
return entityProps.cloneable;
|
return entityProps.cloneable;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.entityIsGrabbable = function(entityID) {
|
this.entityIsGrabbable = function(entityID) {
|
||||||
var grabbableProps = entityPropertiesCache.getGrabbableProps(entityID);
|
var grabbableProps = entityPropertiesCache.getGrabbableProps(entityID);
|
||||||
|
@ -2681,31 +2681,29 @@ function MyController(hand) {
|
||||||
var userData = JSON.parse(grabbedProperties.userData);
|
var userData = JSON.parse(grabbedProperties.userData);
|
||||||
var grabInfo = userData.grabbableKey;
|
var grabInfo = userData.grabbableKey;
|
||||||
if (grabInfo && grabInfo.cloneable) {
|
if (grabInfo && grabInfo.cloneable) {
|
||||||
// Check if
|
var worldEntities = Entities.findEntities(MyAvatar.position, 50);
|
||||||
var worldEntities = Entities.findEntitiesInBox(Vec3.subtract(MyAvatar.position, {x:25,y:25, z:25}), {x:50, y: 50, z: 50})
|
|
||||||
var count = 0;
|
var count = 0;
|
||||||
worldEntities.forEach(function(item) {
|
worldEntities.forEach(function(item) {
|
||||||
var item = Entities.getEntityProperties(item, ["name"]);
|
var item = Entities.getEntityProperties(item, ["name"]);
|
||||||
if (item.name === grabbedProperties.name) {
|
if (item.name.indexOf('-clone-' + grabbedProperties.id) !== -1) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var limit = grabInfo.cloneLimit ? grabInfo.cloneLimit : 0;
|
||||||
|
if (count >= limit && limit !== 0) {
|
||||||
|
delete limit;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var cloneableProps = Entities.getEntityProperties(grabbedProperties.id);
|
var cloneableProps = Entities.getEntityProperties(grabbedProperties.id);
|
||||||
|
cloneableProps.name = cloneableProps.name + '-clone-' + grabbedProperties.id;
|
||||||
var lifetime = grabInfo.cloneLifetime ? grabInfo.cloneLifetime : 300;
|
var lifetime = grabInfo.cloneLifetime ? grabInfo.cloneLifetime : 300;
|
||||||
var limit = grabInfo.cloneLimit ? grabInfo.cloneLimit : 10;
|
|
||||||
var dynamic = grabInfo.cloneDynamic ? grabInfo.cloneDynamic : false;
|
var dynamic = grabInfo.cloneDynamic ? grabInfo.cloneDynamic : false;
|
||||||
var cUserData = Object.assign({}, userData);
|
var cUserData = Object.assign({}, userData);
|
||||||
var cProperties = Object.assign({}, cloneableProps);
|
var cProperties = Object.assign({}, cloneableProps);
|
||||||
isClone = true;
|
isClone = true;
|
||||||
|
|
||||||
if (count > limit) {
|
|
||||||
delete cloneableProps;
|
|
||||||
delete lifetime;
|
|
||||||
delete cUserData;
|
|
||||||
delete cProperties;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete cUserData.grabbableKey.cloneLifetime;
|
delete cUserData.grabbableKey.cloneLifetime;
|
||||||
delete cUserData.grabbableKey.cloneable;
|
delete cUserData.grabbableKey.cloneable;
|
||||||
delete cUserData.grabbableKey.cloneDynamic;
|
delete cUserData.grabbableKey.cloneDynamic;
|
||||||
|
|
|
@ -879,7 +879,7 @@ function loaded() {
|
||||||
elCloneable.checked = false;
|
elCloneable.checked = false;
|
||||||
elCloneableDynamic.checked = false;
|
elCloneableDynamic.checked = false;
|
||||||
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
||||||
elCloneableLimit.value = 10;
|
elCloneableLimit.value = 0;
|
||||||
elCloneableLifetime.value = 300;
|
elCloneableLifetime.value = 300;
|
||||||
|
|
||||||
var parsedUserData = {}
|
var parsedUserData = {}
|
||||||
|
@ -899,8 +899,6 @@ function loaded() {
|
||||||
if ("cloneable" in parsedUserData["grabbableKey"]) {
|
if ("cloneable" in parsedUserData["grabbableKey"]) {
|
||||||
elCloneable.checked = parsedUserData["grabbableKey"].cloneable;
|
elCloneable.checked = parsedUserData["grabbableKey"].cloneable;
|
||||||
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
||||||
elCloneableLimit.value = elCloneable.checked ? 10: 0;
|
|
||||||
elCloneableLifetime.value = elCloneable.checked ? 300: 0;
|
|
||||||
elCloneableDynamic.checked = parsedUserData["grabbableKey"].cloneDynamic ? parsedUserData["grabbableKey"].cloneDynamic : properties.dynamic;
|
elCloneableDynamic.checked = parsedUserData["grabbableKey"].cloneDynamic ? parsedUserData["grabbableKey"].cloneDynamic : properties.dynamic;
|
||||||
elDynamic.checked = elCloneable.checked ? false: properties.dynamic;
|
elDynamic.checked = elCloneable.checked ? false: properties.dynamic;
|
||||||
if (elCloneable.checked) {
|
if (elCloneable.checked) {
|
||||||
|
@ -908,7 +906,7 @@ function loaded() {
|
||||||
elCloneableLifetime.value = parsedUserData["grabbableKey"].cloneLifetime ? parsedUserData["grabbableKey"].cloneLifetime : 300;
|
elCloneableLifetime.value = parsedUserData["grabbableKey"].cloneLifetime ? parsedUserData["grabbableKey"].cloneLifetime : 300;
|
||||||
}
|
}
|
||||||
if ("cloneLimit" in parsedUserData["grabbableKey"]) {
|
if ("cloneLimit" in parsedUserData["grabbableKey"]) {
|
||||||
elCloneableLimit.value = parsedUserData["grabbableKey"].cloneLimit ? parsedUserData["grabbableKey"].cloneLimit : 10;
|
elCloneableLimit.value = parsedUserData["grabbableKey"].cloneLimit ? parsedUserData["grabbableKey"].cloneLimit : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue