kopia lustrzana https://github.com/robhawkes/vizicities
Toggle info UI via options
rodzic
0682f20f95
commit
855ff74dd2
|
@ -8906,6 +8906,7 @@ if (typeof window === undefined) {
|
|||
VIZI.BlueprintOutput.call(self, options);
|
||||
|
||||
_.defaults(self.options, {
|
||||
infoUI: false,
|
||||
name: "Collada"
|
||||
});
|
||||
|
||||
|
@ -8931,7 +8932,9 @@ if (typeof window === undefined) {
|
|||
var self = this;
|
||||
|
||||
// Set up info UI
|
||||
self.infoUI = new VIZI.InfoUI2D(self.world);
|
||||
if (self.options.infoUI) {
|
||||
self.infoUI = new VIZI.InfoUI2D(self.world);
|
||||
}
|
||||
|
||||
self.emit("initialised");
|
||||
};
|
||||
|
@ -8981,7 +8984,9 @@ if (typeof window === undefined) {
|
|||
// Create info panel
|
||||
// TODO: Work out a way to pass in custom text for the info panel or
|
||||
// make it obvcious that you can only use the data avaiable.
|
||||
self.infoUI.addPanel(dae, dae.id);
|
||||
if (self.infoUI) {
|
||||
self.infoUI.addPanel(dae, dae.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -8992,17 +8997,25 @@ if (typeof window === undefined) {
|
|||
// Update panel positions
|
||||
// TODO: Work out how to remove the visible lag between panel position
|
||||
// and actual scene / camera position.
|
||||
self.infoUI.onChange();
|
||||
if (self.infoUI) {
|
||||
self.infoUI.onChange();
|
||||
}
|
||||
}
|
||||
|
||||
VIZI.BlueprintOutputCollada.prototype.onHide = function() {
|
||||
var self = this;
|
||||
self.infoUI.onHide();
|
||||
|
||||
if (self.infoUI) {
|
||||
self.infoUI.onHide();
|
||||
}
|
||||
};
|
||||
|
||||
VIZI.BlueprintOutputCollada.prototype.onShow = function() {
|
||||
var self = this;
|
||||
self.infoUI.onShow();
|
||||
|
||||
if (self.infoUI) {
|
||||
self.infoUI.onShow();
|
||||
}
|
||||
};
|
||||
|
||||
VIZI.BlueprintOutputCollada.prototype.onAdd = function(world) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -17,7 +17,8 @@ var colladaConfig = {
|
|||
output: {
|
||||
type: "BlueprintOutputCollada",
|
||||
options: {
|
||||
modelPathPrefix: "./data/"
|
||||
modelPathPrefix: "./data/",
|
||||
infoUI: true
|
||||
}
|
||||
},
|
||||
triggers: [{
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
VIZI.BlueprintOutput.call(self, options);
|
||||
|
||||
_.defaults(self.options, {
|
||||
infoUI: false,
|
||||
name: "Collada"
|
||||
});
|
||||
|
||||
|
@ -44,7 +45,9 @@
|
|||
var self = this;
|
||||
|
||||
// Set up info UI
|
||||
self.infoUI = new VIZI.InfoUI2D(self.world);
|
||||
if (self.options.infoUI) {
|
||||
self.infoUI = new VIZI.InfoUI2D(self.world);
|
||||
}
|
||||
|
||||
self.emit("initialised");
|
||||
};
|
||||
|
@ -94,7 +97,9 @@
|
|||
// Create info panel
|
||||
// TODO: Work out a way to pass in custom text for the info panel or
|
||||
// make it obvcious that you can only use the data avaiable.
|
||||
self.infoUI.addPanel(dae, dae.id);
|
||||
if (self.infoUI) {
|
||||
self.infoUI.addPanel(dae, dae.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -105,17 +110,25 @@
|
|||
// Update panel positions
|
||||
// TODO: Work out how to remove the visible lag between panel position
|
||||
// and actual scene / camera position.
|
||||
self.infoUI.onChange();
|
||||
if (self.infoUI) {
|
||||
self.infoUI.onChange();
|
||||
}
|
||||
}
|
||||
|
||||
VIZI.BlueprintOutputCollada.prototype.onHide = function() {
|
||||
var self = this;
|
||||
self.infoUI.onHide();
|
||||
|
||||
if (self.infoUI) {
|
||||
self.infoUI.onHide();
|
||||
}
|
||||
};
|
||||
|
||||
VIZI.BlueprintOutputCollada.prototype.onShow = function() {
|
||||
var self = this;
|
||||
self.infoUI.onShow();
|
||||
|
||||
if (self.infoUI) {
|
||||
self.infoUI.onShow();
|
||||
}
|
||||
};
|
||||
|
||||
VIZI.BlueprintOutputCollada.prototype.onAdd = function(world) {
|
||||
|
|
Ładowanie…
Reference in New Issue