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:
@@ -464,15 +464,15 @@ public class ModelDef
|
|||||||
String[] controllers = StringUtil.parseStringArray(
|
String[] controllers = StringUtil.parseStringArray(
|
||||||
props.getProperty("controllers", ""));
|
props.getProperty("controllers", ""));
|
||||||
for (int ii = 0; ii < controllers.length; ii++) {
|
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) {
|
if (target == null) {
|
||||||
Log.warning("Missing controller node [name=" +
|
Log.warning("Missing controller node [name=" + node + "].");
|
||||||
controllers[ii] + "].");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ModelController ctrl = createController(
|
ModelController ctrl = createController(subProps, target);
|
||||||
PropertiesUtil.getSubProperties(props, controllers[ii]),
|
|
||||||
target);
|
|
||||||
if (ctrl != null) {
|
if (ctrl != null) {
|
||||||
model.addController(ctrl);
|
model.addController(ctrl);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user