mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:37:49 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into skin
This commit is contained in:
commit
72c362f7b0
6 changed files with 101 additions and 57 deletions
|
@ -241,7 +241,7 @@ void DomainServerSettingsManager::setupConfigMap(const QStringList& argumentList
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QHash<QString, NodePermissionsPointer>> permissionsSets;
|
QList<QHash<QString, NodePermissionsPointer>> permissionsSets;
|
||||||
permissionsSets << _standardAgentPermissions << _agentPermissions;
|
permissionsSets << _standardAgentPermissions.get() << _agentPermissions.get();
|
||||||
foreach (auto permissionsSet, permissionsSets) {
|
foreach (auto permissionsSet, permissionsSets) {
|
||||||
foreach (QString userName, permissionsSet.keys()) {
|
foreach (QString userName, permissionsSet.keys()) {
|
||||||
if (onlyEditorsAreRezzers) {
|
if (onlyEditorsAreRezzers) {
|
||||||
|
@ -267,7 +267,7 @@ void DomainServerSettingsManager::setupConfigMap(const QStringList& argumentList
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainServerSettingsManager::packPermissionsForMap(QString mapName,
|
void DomainServerSettingsManager::packPermissionsForMap(QString mapName,
|
||||||
QHash<QString, NodePermissionsPointer> agentPermissions,
|
NodePermissionsMap& agentPermissions,
|
||||||
QString keyPath) {
|
QString keyPath) {
|
||||||
QVariant* security = valueForKeyPath(_configMap.getUserConfig(), "security");
|
QVariant* security = valueForKeyPath(_configMap.getUserConfig(), "security");
|
||||||
if (!security || !security->canConvert(QMetaType::QVariantMap)) {
|
if (!security || !security->canConvert(QMetaType::QVariantMap)) {
|
||||||
|
@ -378,7 +378,7 @@ void DomainServerSettingsManager::unpackPermissions() {
|
||||||
#ifdef WANT_DEBUG
|
#ifdef WANT_DEBUG
|
||||||
qDebug() << "--------------- permissions ---------------------";
|
qDebug() << "--------------- permissions ---------------------";
|
||||||
QList<QHash<QString, NodePermissionsPointer>> permissionsSets;
|
QList<QHash<QString, NodePermissionsPointer>> permissionsSets;
|
||||||
permissionsSets << _standardAgentPermissions << _agentPermissions;
|
permissionsSets << _standardAgentPermissions.get() << _agentPermissions.get();
|
||||||
foreach (auto permissionSet, permissionsSets) {
|
foreach (auto permissionSet, permissionsSets) {
|
||||||
QHashIterator<QString, NodePermissionsPointer> i(permissionSet);
|
QHashIterator<QString, NodePermissionsPointer> i(permissionSet);
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
|
|
|
@ -72,11 +72,11 @@ private:
|
||||||
|
|
||||||
friend class DomainServer;
|
friend class DomainServer;
|
||||||
|
|
||||||
void packPermissionsForMap(QString mapName, QHash<QString, NodePermissionsPointer> agentPermissions, QString keyPath);
|
void packPermissionsForMap(QString mapName, NodePermissionsMap& agentPermissions, QString keyPath);
|
||||||
void packPermissions();
|
void packPermissions();
|
||||||
void unpackPermissions();
|
void unpackPermissions();
|
||||||
QHash<QString, NodePermissionsPointer> _standardAgentPermissions; // anonymous, logged-in, localhost
|
NodePermissionsMap _standardAgentPermissions; // anonymous, logged-in, localhost
|
||||||
QHash<QString, NodePermissionsPointer> _agentPermissions; // specific account-names
|
NodePermissionsMap _agentPermissions; // specific account-names
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_DomainServerSettingsManager_h
|
#endif // hifi_DomainServerSettingsManager_h
|
||||||
|
|
|
@ -614,12 +614,6 @@ ModalWindow {
|
||||||
readOnly: !root.saveDialog
|
readOnly: !root.saveDialog
|
||||||
activeFocusOnTab: !readOnly
|
activeFocusOnTab: !readOnly
|
||||||
onActiveFocusChanged: if (activeFocus) { selectAll(); }
|
onActiveFocusChanged: if (activeFocus) { selectAll(); }
|
||||||
onTextChanged: {
|
|
||||||
if (root.saveDialog && text !== "") {
|
|
||||||
fileTableView.selection.clear();
|
|
||||||
fileTableView.currentRow = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onAccepted: okAction.trigger();
|
onAccepted: okAction.trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,9 @@ using NodePermissionsPointer = std::shared_ptr<NodePermissions>;
|
||||||
class NodePermissions {
|
class NodePermissions {
|
||||||
public:
|
public:
|
||||||
NodePermissions() { _id = QUuid::createUuid().toString(); }
|
NodePermissions() { _id = QUuid::createUuid().toString(); }
|
||||||
NodePermissions(const QString& name) { _id = name; }
|
NodePermissions(const QString& name) { _id = name.toLower(); }
|
||||||
NodePermissions(QMap<QString, QVariant> perms) {
|
NodePermissions(QMap<QString, QVariant> perms) {
|
||||||
_id = perms["permissions_id"].toString();
|
_id = perms["permissions_id"].toString().toLower();
|
||||||
canConnectToDomain = perms["id_can_connect"].toBool();
|
canConnectToDomain = perms["id_can_connect"].toBool();
|
||||||
canAdjustLocks = perms["id_can_adjust_locks"].toBool();
|
canAdjustLocks = perms["id_can_adjust_locks"].toBool();
|
||||||
canRezPermanentEntities = perms["id_can_rez"].toBool();
|
canRezPermanentEntities = perms["id_can_rez"].toBool();
|
||||||
|
@ -38,7 +38,7 @@ public:
|
||||||
QString getID() const { return _id; }
|
QString getID() const { return _id; }
|
||||||
|
|
||||||
// the _id member isn't authenticated and _username is.
|
// the _id member isn't authenticated and _username is.
|
||||||
void setUserName(QString userName) { _userName = userName; }
|
void setUserName(QString userName) { _userName = userName.toLower(); }
|
||||||
QString getUserName() { return _userName; }
|
QString getUserName() { return _userName; }
|
||||||
|
|
||||||
bool isAssignment { false };
|
bool isAssignment { false };
|
||||||
|
@ -88,6 +88,23 @@ protected:
|
||||||
QString _userName;
|
QString _userName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// wrap QHash in a class that forces all keys to be lowercase
|
||||||
|
class NodePermissionsMap {
|
||||||
|
public:
|
||||||
|
NodePermissionsMap() { }
|
||||||
|
NodePermissionsPointer& operator[](const QString& key) { return _data[key.toLower()]; }
|
||||||
|
NodePermissionsPointer operator[](const QString& key) const { return _data.value(key.toLower()); }
|
||||||
|
bool contains(const QString& key) const { return _data.contains(key.toLower()); }
|
||||||
|
QList<QString> keys() const { return _data.keys(); }
|
||||||
|
QHash<QString, NodePermissionsPointer> get() { return _data; }
|
||||||
|
void clear() { _data.clear(); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
QHash<QString, NodePermissionsPointer> _data;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const NodePermissions DEFAULT_AGENT_PERMISSIONS;
|
const NodePermissions DEFAULT_AGENT_PERMISSIONS;
|
||||||
|
|
||||||
QDebug operator<<(QDebug debug, const NodePermissions& perms);
|
QDebug operator<<(QDebug debug, const NodePermissions& perms);
|
||||||
|
|
|
@ -452,6 +452,7 @@
|
||||||
var elTextText = document.getElementById("property-text-text");
|
var elTextText = document.getElementById("property-text-text");
|
||||||
var elTextLineHeight = document.getElementById("property-text-line-height");
|
var elTextLineHeight = document.getElementById("property-text-line-height");
|
||||||
var elTextTextColor = document.getElementById("property-text-text-color");
|
var elTextTextColor = document.getElementById("property-text-text-color");
|
||||||
|
var elTextFaceCamera = document.getElementById("property-text-face-camera");
|
||||||
var elTextTextColorRed = document.getElementById("property-text-text-color-red");
|
var elTextTextColorRed = document.getElementById("property-text-text-color-red");
|
||||||
var elTextTextColorGreen = document.getElementById("property-text-text-color-green");
|
var elTextTextColorGreen = document.getElementById("property-text-text-color-green");
|
||||||
var elTextTextColorBlue = document.getElementById("property-text-text-color-blue");
|
var elTextTextColorBlue = document.getElementById("property-text-text-color-blue");
|
||||||
|
@ -726,6 +727,7 @@
|
||||||
|
|
||||||
elTextText.value = properties.text;
|
elTextText.value = properties.text;
|
||||||
elTextLineHeight.value = properties.lineHeight.toFixed(4);
|
elTextLineHeight.value = properties.lineHeight.toFixed(4);
|
||||||
|
elTextFaceCamera = properties.faceCamera;
|
||||||
elTextTextColor.style.backgroundColor = "rgb(" + properties.textColor.red + "," + properties.textColor.green + "," + properties.textColor.blue + ")";
|
elTextTextColor.style.backgroundColor = "rgb(" + properties.textColor.red + "," + properties.textColor.green + "," + properties.textColor.blue + ")";
|
||||||
elTextTextColorRed.value = properties.textColor.red;
|
elTextTextColorRed.value = properties.textColor.red;
|
||||||
elTextTextColorGreen.value = properties.textColor.green;
|
elTextTextColorGreen.value = properties.textColor.green;
|
||||||
|
@ -988,8 +990,8 @@
|
||||||
elModelTextures.addEventListener('change', createEmitTextPropertyUpdateFunction('textures'));
|
elModelTextures.addEventListener('change', createEmitTextPropertyUpdateFunction('textures'));
|
||||||
|
|
||||||
elTextText.addEventListener('change', createEmitTextPropertyUpdateFunction('text'));
|
elTextText.addEventListener('change', createEmitTextPropertyUpdateFunction('text'));
|
||||||
|
elTextFaceCamera.addEventListener('change', createEmitCheckedPropertyUpdateFunction('faceCamera'));
|
||||||
elTextLineHeight.addEventListener('change', createEmitNumberPropertyUpdateFunction('lineHeight'));
|
elTextLineHeight.addEventListener('change', createEmitNumberPropertyUpdateFunction('lineHeight'));
|
||||||
|
|
||||||
var textTextColorChangeFunction = createEmitColorPropertyUpdateFunction(
|
var textTextColorChangeFunction = createEmitColorPropertyUpdateFunction(
|
||||||
'textColor', elTextTextColorRed, elTextTextColorGreen, elTextTextColorBlue);
|
'textColor', elTextTextColorRed, elTextTextColorGreen, elTextTextColorBlue);
|
||||||
elTextTextColorRed.addEventListener('change', textTextColorChangeFunction);
|
elTextTextColorRed.addEventListener('change', textTextColorChangeFunction);
|
||||||
|
@ -1707,6 +1709,10 @@
|
||||||
<label for="property-text-text">Text content</label>
|
<label for="property-text-text">Text content</label>
|
||||||
<input type="text" id="property-text-text">
|
<input type="text" id="property-text-text">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-group text-section property checkbox">
|
||||||
|
<input type="checkbox" id="property-text-face-camera">
|
||||||
|
<label for="property-text-face-camera"> Face Camera</label>
|
||||||
|
</div>
|
||||||
<div class="text-group text-section property number">
|
<div class="text-group text-section property number">
|
||||||
<label>Line height <span class="unit">m</span></label>
|
<label>Line height <span class="unit">m</span></label>
|
||||||
<input type="number" id="property-text-line-height" min="0" step="0.005">
|
<input type="number" id="property-text-line-height" min="0" step="0.005">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
var PopUpMenu = function (properties) {
|
var PopUpMenu = function(properties) {
|
||||||
var value = properties.value,
|
var value = properties.value,
|
||||||
promptOverlay,
|
promptOverlay,
|
||||||
valueOverlay,
|
valueOverlay,
|
||||||
|
@ -217,7 +217,7 @@ var PopUpMenu = function (properties) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
var usersWindow = (function () {
|
var usersWindow = (function() {
|
||||||
|
|
||||||
var baseURL = Script.resolvePath("assets/images/tools/"),
|
var baseURL = Script.resolvePath("assets/images/tools/"),
|
||||||
WINDOW_WIDTH = 260,
|
WINDOW_WIDTH = 260,
|
||||||
|
@ -253,7 +253,11 @@ var usersWindow = (function () {
|
||||||
WINDOW_BORDER_BOTTOM_MARGIN = WINDOW_BASE_MARGIN,
|
WINDOW_BORDER_BOTTOM_MARGIN = WINDOW_BASE_MARGIN,
|
||||||
WINDOW_BORDER_LEFT_MARGIN = WINDOW_BASE_MARGIN,
|
WINDOW_BORDER_LEFT_MARGIN = WINDOW_BASE_MARGIN,
|
||||||
WINDOW_BORDER_RADIUS = 4,
|
WINDOW_BORDER_RADIUS = 4,
|
||||||
WINDOW_BORDER_COLOR = { red: 255, green: 255, blue: 255 },
|
WINDOW_BORDER_COLOR = {
|
||||||
|
red: 255,
|
||||||
|
green: 255,
|
||||||
|
blue: 255
|
||||||
|
},
|
||||||
WINDOW_BORDER_ALPHA = 0.5,
|
WINDOW_BORDER_ALPHA = 0.5,
|
||||||
windowBorder,
|
windowBorder,
|
||||||
|
|
||||||
|
@ -377,9 +381,12 @@ var usersWindow = (function () {
|
||||||
isMirrorDisplay = false,
|
isMirrorDisplay = false,
|
||||||
isFullscreenMirror = false,
|
isFullscreenMirror = false,
|
||||||
|
|
||||||
windowPosition = { }, // Bottom left corner of window pane.
|
windowPosition = {}, // Bottom left corner of window pane.
|
||||||
isMovingWindow = false,
|
isMovingWindow = false,
|
||||||
movingClickOffset = { x: 0, y: 0 },
|
movingClickOffset = {
|
||||||
|
x: 0,
|
||||||
|
y: 0
|
||||||
|
},
|
||||||
|
|
||||||
isUsingScrollbars = false,
|
isUsingScrollbars = false,
|
||||||
isMovingScrollbar = false,
|
isMovingScrollbar = false,
|
||||||
|
@ -401,9 +408,7 @@ var usersWindow = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reserve space for title, friends button, and option controls
|
// Reserve space for title, friends button, and option controls
|
||||||
nonUsersHeight = WINDOW_MARGIN + windowLineHeight + FRIENDS_BUTTON_SPACER + FRIENDS_BUTTON_HEIGHT + DISPLAY_SPACER
|
nonUsersHeight = WINDOW_MARGIN + windowLineHeight + FRIENDS_BUTTON_SPACER + FRIENDS_BUTTON_HEIGHT + DISPLAY_SPACER + windowLineHeight + VISIBILITY_SPACER + windowLineHeight + WINDOW_BASE_MARGIN;
|
||||||
+ windowLineHeight + VISIBILITY_SPACER
|
|
||||||
+ windowLineHeight + WINDOW_BASE_MARGIN;
|
|
||||||
|
|
||||||
// Limit window to height of viewport above window position minus VU meter and mirror if displayed
|
// Limit window to height of viewport above window position minus VU meter and mirror if displayed
|
||||||
windowHeight = linesOfUsers.length * windowLineHeight - windowLineSpacing + nonUsersHeight;
|
windowHeight = linesOfUsers.length * windowLineHeight - windowLineSpacing + nonUsersHeight;
|
||||||
|
@ -456,17 +461,14 @@ var usersWindow = (function () {
|
||||||
x: scrollbarBackgroundPosition.x,
|
x: scrollbarBackgroundPosition.x,
|
||||||
y: scrollbarBackgroundPosition.y
|
y: scrollbarBackgroundPosition.y
|
||||||
});
|
});
|
||||||
scrollbarBarPosition.y = scrollbarBackgroundPosition.y + 1
|
scrollbarBarPosition.y = scrollbarBackgroundPosition.y + 1 + scrollbarValue * (scrollbarBackgroundHeight - scrollbarBarHeight - 2);
|
||||||
+ scrollbarValue * (scrollbarBackgroundHeight - scrollbarBarHeight - 2);
|
|
||||||
Overlays.editOverlay(scrollbarBar, {
|
Overlays.editOverlay(scrollbarBar, {
|
||||||
x: scrollbarBackgroundPosition.x + 1,
|
x: scrollbarBackgroundPosition.x + 1,
|
||||||
y: scrollbarBarPosition.y
|
y: scrollbarBarPosition.y
|
||||||
});
|
});
|
||||||
|
|
||||||
x = windowLeft + WINDOW_MARGIN;
|
x = windowLeft + WINDOW_MARGIN;
|
||||||
y = windowPosition.y - FRIENDS_BUTTON_HEIGHT - DISPLAY_SPACER
|
y = windowPosition.y - FRIENDS_BUTTON_HEIGHT - DISPLAY_SPACER - windowLineHeight - VISIBILITY_SPACER - windowLineHeight - WINDOW_BASE_MARGIN;
|
||||||
- windowLineHeight - VISIBILITY_SPACER
|
|
||||||
- windowLineHeight - WINDOW_BASE_MARGIN;
|
|
||||||
Overlays.editOverlay(friendsButton, {
|
Overlays.editOverlay(friendsButton, {
|
||||||
x: x,
|
x: x,
|
||||||
y: y
|
y: y
|
||||||
|
@ -554,9 +556,36 @@ var usersWindow = (function () {
|
||||||
usersRequest.ontimeout = pollUsersTimedOut;
|
usersRequest.ontimeout = pollUsersTimedOut;
|
||||||
usersRequest.onreadystatechange = processUsers;
|
usersRequest.onreadystatechange = processUsers;
|
||||||
usersRequest.send();
|
usersRequest.send();
|
||||||
|
checkLoggedIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
processUsers = function () {
|
var loggedIn = false;
|
||||||
|
|
||||||
|
function checkLoggedIn() {
|
||||||
|
loggedIn = Account.isLoggedIn();
|
||||||
|
if (loggedIn === false) {
|
||||||
|
Overlays.editOverlay(friendsButton, {
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
visibilityControl.setVisible(false);
|
||||||
|
displayControl.setVisible(false);
|
||||||
|
} else {
|
||||||
|
if (isMinimized === true) {
|
||||||
|
loggedIn = true;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Overlays.editOverlay(friendsButton, {
|
||||||
|
visible: true
|
||||||
|
});
|
||||||
|
visibilityControl.setVisible(true);
|
||||||
|
displayControl.setVisible(true);
|
||||||
|
loggedIn = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
processUsers = function() {
|
||||||
var response,
|
var response,
|
||||||
myUsername,
|
myUsername,
|
||||||
user,
|
user,
|
||||||
|
@ -609,7 +638,7 @@ var usersWindow = (function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
pollUsersTimedOut = function () {
|
pollUsersTimedOut = function() {
|
||||||
print("Error: Request for users status timed out");
|
print("Error: Request for users status timed out");
|
||||||
usersTimer = Script.setTimeout(pollUsers, HTTP_GET_TIMEOUT); // Try again after a longer delay.
|
usersTimer = Script.setTimeout(pollUsers, HTTP_GET_TIMEOUT); // Try again after a longer delay.
|
||||||
};
|
};
|
||||||
|
@ -633,11 +662,15 @@ var usersWindow = (function () {
|
||||||
Overlays.editOverlay(scrollbarBar, {
|
Overlays.editOverlay(scrollbarBar, {
|
||||||
visible: isVisible && isUsingScrollbars && !isMinimized
|
visible: isVisible && isUsingScrollbars && !isMinimized
|
||||||
});
|
});
|
||||||
Overlays.editOverlay(friendsButton, {
|
|
||||||
visible: isVisible && !isMinimized
|
if (loggedIn === true) {
|
||||||
});
|
Overlays.editOverlay(friendsButton, {
|
||||||
displayControl.setVisible(isVisible && !isMinimized);
|
visible: isVisible && !isMinimized
|
||||||
visibilityControl.setVisible(isVisible && !isMinimized);
|
});
|
||||||
|
displayControl.setVisible(isVisible && !isMinimized);
|
||||||
|
visibilityControl.setVisible(isVisible && !isMinimized);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setVisible(visible) {
|
function setVisible(visible) {
|
||||||
|
@ -730,9 +763,7 @@ var usersWindow = (function () {
|
||||||
|
|
||||||
userClicked = firstUserToDisplay + lineClicked;
|
userClicked = firstUserToDisplay + lineClicked;
|
||||||
|
|
||||||
if (0 <= userClicked && userClicked < linesOfUsers.length && 0 <= overlayX
|
if (0 <= userClicked && userClicked < linesOfUsers.length && 0 <= overlayX && overlayX <= usersOnline[linesOfUsers[userClicked]].textWidth) {
|
||||||
&& overlayX <= usersOnline[linesOfUsers[userClicked]].textWidth) {
|
|
||||||
//print("Go to " + usersOnline[linesOfUsers[userClicked]].username);
|
|
||||||
location.goToUser(usersOnline[linesOfUsers[userClicked]].username);
|
location.goToUser(usersOnline[linesOfUsers[userClicked]].username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -800,12 +831,8 @@ var usersWindow = (function () {
|
||||||
var isVisible;
|
var isVisible;
|
||||||
|
|
||||||
if (isMovingScrollbar) {
|
if (isMovingScrollbar) {
|
||||||
if (scrollbarBackgroundPosition.x - WINDOW_MARGIN <= event.x
|
if (scrollbarBackgroundPosition.x - WINDOW_MARGIN <= event.x && event.x <= scrollbarBackgroundPosition.x + SCROLLBAR_BACKGROUND_WIDTH + WINDOW_MARGIN && scrollbarBackgroundPosition.y - WINDOW_MARGIN <= event.y && event.y <= scrollbarBackgroundPosition.y + scrollbarBackgroundHeight + WINDOW_MARGIN) {
|
||||||
&& event.x <= scrollbarBackgroundPosition.x + SCROLLBAR_BACKGROUND_WIDTH + WINDOW_MARGIN
|
scrollbarValue = (event.y - scrollbarBarClickedAt * scrollbarBarHeight - scrollbarBackgroundPosition.y) / (scrollbarBackgroundHeight - scrollbarBarHeight - 2);
|
||||||
&& scrollbarBackgroundPosition.y - WINDOW_MARGIN <= event.y
|
|
||||||
&& event.y <= scrollbarBackgroundPosition.y + scrollbarBackgroundHeight + WINDOW_MARGIN) {
|
|
||||||
scrollbarValue = (event.y - scrollbarBarClickedAt * scrollbarBarHeight - scrollbarBackgroundPosition.y)
|
|
||||||
/ (scrollbarBackgroundHeight - scrollbarBarHeight - 2);
|
|
||||||
scrollbarValue = Math.min(Math.max(scrollbarValue, 0.0), 1.0);
|
scrollbarValue = Math.min(Math.max(scrollbarValue, 0.0), 1.0);
|
||||||
firstUserToDisplay = Math.floor(scrollbarValue * (linesOfUsers.length - numUsersToDisplay));
|
firstUserToDisplay = Math.floor(scrollbarValue * (linesOfUsers.length - numUsersToDisplay));
|
||||||
updateOverlayPositions();
|
updateOverlayPositions();
|
||||||
|
@ -831,13 +858,9 @@ var usersWindow = (function () {
|
||||||
|
|
||||||
isVisible = isBorderVisible;
|
isVisible = isBorderVisible;
|
||||||
if (isVisible) {
|
if (isVisible) {
|
||||||
isVisible = windowPosition.x - WINDOW_BORDER_LEFT_MARGIN <= event.x
|
isVisible = windowPosition.x - WINDOW_BORDER_LEFT_MARGIN <= event.x && event.x <= windowPosition.x - WINDOW_BORDER_LEFT_MARGIN + WINDOW_BORDER_WIDTH && windowPosition.y - windowHeight - WINDOW_BORDER_TOP_MARGIN <= event.y && event.y <= windowPosition.y + WINDOW_BORDER_BOTTOM_MARGIN;
|
||||||
&& event.x <= windowPosition.x - WINDOW_BORDER_LEFT_MARGIN + WINDOW_BORDER_WIDTH
|
|
||||||
&& windowPosition.y - windowHeight - WINDOW_BORDER_TOP_MARGIN <= event.y
|
|
||||||
&& event.y <= windowPosition.y + WINDOW_BORDER_BOTTOM_MARGIN;
|
|
||||||
} else {
|
} else {
|
||||||
isVisible = windowPosition.x <= event.x && event.x <= windowPosition.x + WINDOW_WIDTH
|
isVisible = windowPosition.x <= event.x && event.x <= windowPosition.x + WINDOW_WIDTH && windowPosition.y - windowHeight <= event.y && event.y <= windowPosition.y;
|
||||||
&& windowPosition.y - windowHeight <= event.y && event.y <= windowPosition.y;
|
|
||||||
}
|
}
|
||||||
if (isVisible !== isBorderVisible) {
|
if (isVisible !== isBorderVisible) {
|
||||||
isBorderVisible = isVisible;
|
isBorderVisible = isVisible;
|
||||||
|
@ -878,8 +901,7 @@ var usersWindow = (function () {
|
||||||
isMirrorDisplay = Menu.isOptionChecked(MIRROR_MENU_ITEM);
|
isMirrorDisplay = Menu.isOptionChecked(MIRROR_MENU_ITEM);
|
||||||
isFullscreenMirror = Menu.isOptionChecked(FULLSCREEN_MIRROR_MENU_ITEM);
|
isFullscreenMirror = Menu.isOptionChecked(FULLSCREEN_MIRROR_MENU_ITEM);
|
||||||
|
|
||||||
if (viewport.y !== oldViewport.y || isMirrorDisplay !== oldIsMirrorDisplay
|
if (viewport.y !== oldViewport.y || isMirrorDisplay !== oldIsMirrorDisplay || isFullscreenMirror !== oldIsFullscreenMirror) {
|
||||||
|| isFullscreenMirror !== oldIsFullscreenMirror) {
|
|
||||||
calculateWindowHeight();
|
calculateWindowHeight();
|
||||||
updateUsersDisplay();
|
updateUsersDisplay();
|
||||||
}
|
}
|
||||||
|
@ -929,8 +951,8 @@ var usersWindow = (function () {
|
||||||
} else {
|
} else {
|
||||||
hmdViewport = Controller.getRecommendedOverlayRect();
|
hmdViewport = Controller.getRecommendedOverlayRect();
|
||||||
windowPosition = {
|
windowPosition = {
|
||||||
x: (viewport.x - hmdViewport.width) / 2, // HMD viewport is narrower than screen.
|
x: (viewport.x - hmdViewport.width) / 2, // HMD viewport is narrower than screen.
|
||||||
y: hmdViewport.height // HMD viewport starts at top of screen but only extends down so far.
|
y: hmdViewport.height // HMD viewport starts at top of screen but only extends down so far.
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -938,7 +960,7 @@ var usersWindow = (function () {
|
||||||
|
|
||||||
windowBorder = Overlays.addOverlay("rectangle", {
|
windowBorder = Overlays.addOverlay("rectangle", {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: viewport.y, // Start up off-screen
|
y: viewport.y, // Start up off-screen
|
||||||
width: WINDOW_BORDER_WIDTH,
|
width: WINDOW_BORDER_WIDTH,
|
||||||
height: windowBorderHeight,
|
height: windowBorderHeight,
|
||||||
radius: WINDOW_BORDER_RADIUS,
|
radius: WINDOW_BORDER_RADIUS,
|
||||||
|
@ -1101,6 +1123,11 @@ var usersWindow = (function () {
|
||||||
visible: isVisible && !isMinimized
|
visible: isVisible && !isMinimized
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Script.setTimeout(function() {
|
||||||
|
checkLoggedIn()
|
||||||
|
}, 0);
|
||||||
|
|
||||||
Controller.mousePressEvent.connect(onMousePressEvent);
|
Controller.mousePressEvent.connect(onMousePressEvent);
|
||||||
Controller.mouseMoveEvent.connect(onMouseMoveEvent);
|
Controller.mouseMoveEvent.connect(onMouseMoveEvent);
|
||||||
Controller.mouseReleaseEvent.connect(onMouseReleaseEvent);
|
Controller.mouseReleaseEvent.connect(onMouseReleaseEvent);
|
||||||
|
@ -1143,4 +1170,4 @@ var usersWindow = (function () {
|
||||||
|
|
||||||
setUp();
|
setUp();
|
||||||
Script.scriptEnding.connect(tearDown);
|
Script.scriptEnding.connect(tearDown);
|
||||||
}());
|
}());
|
Loading…
Reference in a new issue