Allow controllers to specify the name of the node they will attach to,

by default use the same name as the controller


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@8 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Mark Johnson
2006-06-27 20:50:08 +00:00
parent 56a74d5f0e
commit ade2d7b79b
@@ -464,15 +464,15 @@ public class ModelDef
String[] controllers = StringUtil.parseStringArray(
props.getProperty("controllers", ""));
for (int ii = 0; ii < controllers.length; ii++) {
Spatial target = nodes.get(controllers[ii]);
Properties subProps =
PropertiesUtil.getSubProperties(props, controllers[ii]);
String node = subProps.getProperty("node", controllers[ii]);
Spatial target = nodes.get(node);
if (target == null) {
Log.warning("Missing controller node [name=" +
controllers[ii] + "].");
Log.warning("Missing controller node [name=" + node + "].");
continue;
}
ModelController ctrl = createController(
PropertiesUtil.getSubProperties(props, controllers[ii]),
target);
ModelController ctrl = createController(subProps, target);
if (ctrl != null) {
model.addController(ctrl);
}