mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 17:56:15 +02:00
Update TabletAssetServer
This commit is contained in:
parent
acb0bf8d20
commit
dda715e171
2 changed files with 156 additions and 24 deletions
|
@ -952,10 +952,9 @@ ScrollingWindow {
|
||||||
text: "In progress..."
|
text: "In progress..."
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ import Qt.labs.settings 1.0
|
||||||
import "../../styles-uit"
|
import "../../styles-uit"
|
||||||
import "../../controls-uit" as HifiControls
|
import "../../controls-uit" as HifiControls
|
||||||
import "../../windows"
|
import "../../windows"
|
||||||
|
import ".."
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
@ -58,6 +59,14 @@ Rectangle {
|
||||||
assetMappingsModel.autoRefreshEnabled = false;
|
assetMappingsModel.autoRefreshEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function letterbox(headerGlyph, headerText, message) {
|
||||||
|
letterboxMessage.headerGlyph = headerGlyph;
|
||||||
|
letterboxMessage.headerText = headerText;
|
||||||
|
letterboxMessage.text = message;
|
||||||
|
letterboxMessage.visible = true;
|
||||||
|
letterboxMessage.popupRadius = 0;
|
||||||
|
}
|
||||||
|
|
||||||
function doDeleteFile(path) {
|
function doDeleteFile(path) {
|
||||||
console.log("Deleting " + path);
|
console.log("Deleting " + path);
|
||||||
|
|
||||||
|
@ -154,10 +163,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleGetMappingsError(errorString) {
|
function handleGetMappingsError(errorString) {
|
||||||
errorMessageBox(
|
errorMessageBox("There was a problem retreiving the list of assets from your Asset Server.\n" + errorString);
|
||||||
"There was a problem retreiving the list of assets from your Asset Server.\n"
|
|
||||||
+ errorString
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToWorld() {
|
function addToWorld() {
|
||||||
|
@ -477,7 +483,7 @@ Rectangle {
|
||||||
|
|
||||||
HifiControls.Button {
|
HifiControls.Button {
|
||||||
text: "Add To World"
|
text: "Add To World"
|
||||||
color: hifi.buttons.black
|
color: hifi.buttons.blue
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
width: 120
|
width: 120
|
||||||
|
|
||||||
|
@ -583,8 +589,24 @@ Rectangle {
|
||||||
? (styleData.selected ? hifi.colors.black : hifi.colors.baseGrayHighlight)
|
? (styleData.selected ? hifi.colors.black : hifi.colors.baseGrayHighlight)
|
||||||
: (styleData.selected ? hifi.colors.black : hifi.colors.lightGrayText)
|
: (styleData.selected ? hifi.colors.black : hifi.colors.lightGrayText)
|
||||||
|
|
||||||
elide: Text.ElideRight
|
|
||||||
horizontalAlignment: styleData.column === 1 ? TextInput.AlignHCenter : TextInput.AlignLeft
|
horizontalAlignment: styleData.column === 1 ? TextInput.AlignHCenter : TextInput.AlignLeft
|
||||||
|
|
||||||
|
elide: Text.ElideMiddle
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
acceptedButtons: Qt.NoButton
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
|
onEntered: {
|
||||||
|
if (parent.truncated) {
|
||||||
|
treeLabelToolTip.show(parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onExited: treeLabelToolTip.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component {
|
Component {
|
||||||
|
@ -667,6 +689,42 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: treeLabelToolTip
|
||||||
|
visible: false
|
||||||
|
z: 100 // Render on top
|
||||||
|
|
||||||
|
width: toolTipText.width + 2 * hifi.dimensions.textPadding
|
||||||
|
height: hifi.dimensions.tableRowHeight
|
||||||
|
color: colorScheme == hifi.colorSchemes.light ? hifi.colors.tableRowLightOdd : hifi.colors.tableRowDarkOdd
|
||||||
|
border.color: colorScheme == hifi.colorSchemes.light ? hifi.colors.black : hifi.colors.lightGrayText
|
||||||
|
|
||||||
|
FiraSansSemiBold {
|
||||||
|
id: toolTipText
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
size: hifi.fontSizes.tableText
|
||||||
|
color: colorScheme == hifi.colorSchemes.light ? hifi.colors.black : hifi.colors.lightGrayText
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: showTimer
|
||||||
|
interval: 1000
|
||||||
|
onTriggered: { treeLabelToolTip.visible = true; }
|
||||||
|
}
|
||||||
|
function show(item) {
|
||||||
|
var coord = item.mapToItem(parent, item.x, item.y);
|
||||||
|
|
||||||
|
toolTipText.text = item.text;
|
||||||
|
treeLabelToolTip.x = coord.x - hifi.dimensions.textPadding;
|
||||||
|
treeLabelToolTip.y = coord.y;
|
||||||
|
showTimer.start();
|
||||||
|
}
|
||||||
|
function hide() {
|
||||||
|
showTimer.stop();
|
||||||
|
treeLabelToolTip.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
|
@ -715,26 +773,36 @@ Rectangle {
|
||||||
id: infoRow
|
id: infoRow
|
||||||
anchors.left: treeView.left
|
anchors.left: treeView.left
|
||||||
anchors.right: treeView.right
|
anchors.right: treeView.right
|
||||||
anchors.bottomMargin: hifi.dimensions.contentSpacing.y
|
anchors.topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
spacing: hifi.dimensions.contentSpacing.x
|
anchors.bottomMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||||
|
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
function makeText() {
|
||||||
|
var pendingBakes = assetMappingsModel.bakesPendingCount;
|
||||||
|
if (selectedItems > 1 || pendingBakes === 0) {
|
||||||
|
return selectedItems + " items selected";
|
||||||
|
} else {
|
||||||
|
return pendingBakes + " bakes pending"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
size: hifi.fontSizes.sectionName
|
size: hifi.fontSizes.sectionName
|
||||||
font.capitalization: Font.AllUppercase
|
font.capitalization: Font.AllUppercase
|
||||||
text: selectedItems + " items selected"
|
text: makeText()
|
||||||
color: hifi.colors.lightGrayText
|
color: hifi.colors.lightGrayText
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiControls.CheckBox {
|
HifiControls.CheckBox {
|
||||||
function isChecked() {
|
id: bakingCheckbox
|
||||||
var status = assetProxyModel.data(treeView.selection.currentIndex, 0x105);
|
anchors.left: treeInfo.right
|
||||||
var bakingDisabled = (status === "Not Baked" || status === "--");
|
anchors.leftMargin: 2 * hifi.dimensions.contentSpacing.x
|
||||||
return selectedItems === 1 && !bakingDisabled;
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
|
||||||
|
|
||||||
text: "Use baked (optimized) versions"
|
text: " Use baked version"
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
enabled: selectedItems === 1 && assetProxyModel.data(treeView.selection.currentIndex, 0x105) !== "--"
|
enabled: isEnabled()
|
||||||
checked: isChecked()
|
checked: isChecked()
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var mappings = [];
|
var mappings = [];
|
||||||
|
@ -750,6 +818,71 @@ Rectangle {
|
||||||
|
|
||||||
checked = Qt.binding(isChecked);
|
checked = Qt.binding(isChecked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isEnabled() {
|
||||||
|
if (!treeView.selection.hasSelection) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var status = assetProxyModel.data(treeView.selection.currentIndex, 0x105);
|
||||||
|
if (status === "--") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var bakingEnabled = status !== "Not Baked";
|
||||||
|
|
||||||
|
for (var i in treeView.selection.selectedIndexes) {
|
||||||
|
var thisStatus = assetProxyModel.data(treeView.selection.selectedIndexes[i], 0x105);
|
||||||
|
if (thisStatus === "--") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var thisBakingEnalbed = (thisStatus !== "Not Baked");
|
||||||
|
|
||||||
|
if (bakingEnabled !== thisBakingEnalbed) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function isChecked() {
|
||||||
|
if (!treeView.selection.hasSelection) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var status = assetProxyModel.data(treeView.selection.currentIndex, 0x105);
|
||||||
|
return isEnabled() && status !== "Not Baked";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
anchors.left: bakingCheckbox.right
|
||||||
|
anchors.leftMargin: hifi.dimensions.contentSpacing.x
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: infoGlyph.size;
|
||||||
|
height: infoGlyph.size;
|
||||||
|
|
||||||
|
HiFiGlyphs {
|
||||||
|
id: infoGlyph;
|
||||||
|
anchors.fill: parent;
|
||||||
|
horizontalAlignment: Text.AlignHCenter;
|
||||||
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
text: hifi.glyphs.question;
|
||||||
|
size: 35;
|
||||||
|
color: hifi.colors.lightGrayText;
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent;
|
||||||
|
hoverEnabled: true;
|
||||||
|
onEntered: infoGlyph.color = hifi.colors.blueHighlight;
|
||||||
|
onExited: infoGlyph.color = hifi.colors.lightGrayText;
|
||||||
|
onClicked: letterbox(hifi.glyphs.question,
|
||||||
|
"What is baking?",
|
||||||
|
"Baking is a process we use to compress geometric meshes and textures.<br>" +
|
||||||
|
"We do this for efficient storage and transmission of models.<br>" +
|
||||||
|
"In some cases, we have been able to achieve 60% compression of original models.<br><br>" +
|
||||||
|
"We highly recommend you leave baking on to enable faster transmission decode of models" +
|
||||||
|
"in interface resulting in better experience for users visiting your domain.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue