mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +02:00
setting up properties page (not complete)
This commit is contained in:
parent
6f76650789
commit
c9c55af661
4 changed files with 37 additions and 3 deletions
|
@ -79,7 +79,6 @@ void ImageEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
|
|||
|
||||
bool successPropertyFits = true;
|
||||
// Using "Quad" shape as defined in ShapeEntityItem.cpp
|
||||
APPEND_ENTITY_PROPERTY(PROP_SHAPE, "Quad");
|
||||
APPEND_ENTITY_PROPERTY(PROP_IMAGE_URL, _imageURL);
|
||||
}
|
||||
|
||||
|
@ -96,7 +95,7 @@ int ImageEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
|||
return bytesRead;
|
||||
}
|
||||
|
||||
/*void ShapeEntityItem::setUnscaledDimensions(const glm::vec3& value) {
|
||||
void ImageEntityItem::setUnscaledDimensions(const glm::vec3& value) {
|
||||
const float MAX_FLAT_DIMENSION = 0.0001f;
|
||||
if (value.y > MAX_FLAT_DIMENSION) {
|
||||
// enforce flatness in Y
|
||||
|
@ -106,7 +105,7 @@ int ImageEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
|||
} else {
|
||||
EntityItem::setUnscaledDimensions(value);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void ImageEntityItem::setImageURL(const QString& value) {
|
||||
withWriteLock([&] {
|
||||
|
@ -128,3 +127,14 @@ QString ImageEntityItem::getImageURL() const {
|
|||
});
|
||||
}
|
||||
|
||||
/*void ImageEntityItem::computeShapeInfo(ShapeInfo& info) {
|
||||
// This will be called whenever DIRTY_SHAPE flag (set by dimension change, etc)
|
||||
// is set.
|
||||
|
||||
EntityItem::computeShapeInfo(info);
|
||||
}*/
|
||||
|
||||
// This value specifies how the shape should be treated by physics calculations.
|
||||
ShapeType ImageEntityItem::getShapeType() const {
|
||||
return _collisionShapeType;
|
||||
}
|
||||
|
|
|
@ -42,11 +42,15 @@ public:
|
|||
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
||||
bool& somethingChanged) override;
|
||||
|
||||
void setUnscaledDimensions(const glm::vec3& value) override;
|
||||
|
||||
static const QString DEFAULT_IMAGE_URL;
|
||||
virtual void setImageURL(const QString& value);
|
||||
QString getImageURL() const;
|
||||
|
||||
//virtual void computeShapeInfo(ShapeInfo& info) override;
|
||||
virtual ShapeType getShapeType() const override;
|
||||
|
||||
protected:
|
||||
QString _imageURL;
|
||||
|
||||
|
|
|
@ -714,6 +714,15 @@
|
|||
</fieldset>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="image" class="major">
|
||||
<legend class="section-header image-group image-section">
|
||||
Image<span>M</span>
|
||||
</legend>
|
||||
<div class="image-group image-section property url ">
|
||||
<label for="property-image-url">Image URL</label>
|
||||
<input type="text" id="property-image-url">
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="web" class="major">
|
||||
<legend class="section-header web-group web-section">
|
||||
|
|
|
@ -133,6 +133,11 @@ function createEmitGroupNumberPropertyUpdateFunction(group, propertyName) {
|
|||
};
|
||||
}
|
||||
|
||||
function createImageURLUpdateFunction(propertyName) {
|
||||
return function() {
|
||||
updateProperty(propertyName, this.value);
|
||||
}
|
||||
}
|
||||
|
||||
function createEmitTextPropertyUpdateFunction(propertyName) {
|
||||
return function() {
|
||||
|
@ -621,6 +626,8 @@ function loaded() {
|
|||
var elModelTextures = document.getElementById("property-model-textures");
|
||||
var elModelOriginalTextures = document.getElementById("property-model-original-textures");
|
||||
|
||||
var elImageURL = document.getElementById("property-image-url");
|
||||
|
||||
var elWebSourceURL = document.getElementById("property-web-source-url");
|
||||
var elWebDPI = document.getElementById("property-web-dpi");
|
||||
|
||||
|
@ -985,6 +992,8 @@ function loaded() {
|
|||
} else if (properties.type === "Web") {
|
||||
elWebSourceURL.value = properties.sourceUrl;
|
||||
elWebDPI.value = properties.dpi;
|
||||
} else if (properties.type === "Image") {
|
||||
elImageURL.value = properties.imageURL;
|
||||
} else if (properties.type === "Text") {
|
||||
elTextText.value = properties.text;
|
||||
elTextLineHeight.value = properties.lineHeight.toFixed(4);
|
||||
|
@ -1352,6 +1361,8 @@ function loaded() {
|
|||
|
||||
elShape.addEventListener('change', createEmitTextPropertyUpdateFunction('shape'));
|
||||
|
||||
elImageURL.addEventListener('change', createImageURLUpdateFunction('imageURL'));
|
||||
|
||||
elWebSourceURL.addEventListener('change', createEmitTextPropertyUpdateFunction('sourceUrl'));
|
||||
elWebDPI.addEventListener('change', createEmitNumberPropertyUpdateFunction('dpi', 0));
|
||||
|
||||
|
|
Loading…
Reference in a new issue