checkboxes working

This commit is contained in:
ericrius1 2016-02-17 11:59:14 -08:00
parent f85916e808
commit 94fdf6b091
2 changed files with 11 additions and 3 deletions

View file

@ -501,7 +501,7 @@
elDynamic.checked = properties.dynamic;
console.log('STARTCHECK', properties.collidesWith)
elCollideStatic.checked = properties.collidesWith.indexOf("static") > -1;
elCollideKinematic.checked = properties.collidesWith.indexOf("kinematic") > -1;
elCollideDynamic.checked = properties.collidesWith.indexOf("dynamic") > -1;
@ -743,17 +743,20 @@
propertyValue = propertyValue.replace(subPropertyString + ",", "");
}
var _properties ={}
_properties[propertyName] = propertyValue;
EventBridge.emitWebEvent(
JSON.stringify({
type: "update",
properties: {propertyName: propertyValue}
properties: _properties
})
);
}
elCollideDynamic.addEventListener('change', function() {
console.log("CHANGE!")
updateCheckedSubProperty("collidesWith", properties.collidesWith, elCollideDynamic, 'dynamic');
});

View file

@ -8,12 +8,16 @@ EntityListTool = function(opts) {
title: 'Entities', source: url, toolWindow: true
});
var searchRadius = 100;
var visible = false;
webView.setVisible(visible);
that.webView = webView;
that.setVisible = function(newVisible) {
visible = newVisible;
webView.setVisible(visible);
@ -71,6 +75,7 @@ EntityListTool = function(opts) {
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
}
webView.eventBridge.webEventReceived.connect(function(data) {
data = JSON.parse(data);
if (data.type == "selectionUpdate") {