Allow text inside the <range><choice> and <toggle> tags to contain

the tooltip for a game configuration.
- Removed ident translation of _ to ' ' for display purposes. Just use
 a nice name.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@246 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Ray Greenwell
2007-03-14 03:48:42 +00:00
parent 227de3603e
commit caf3f40dff
@@ -79,13 +79,17 @@ public class EZGameConfigurator extends FlexGameConfigurator
/** /**
* Add a control that came from parsing our custom option XML. * Add a control that came from parsing our custom option XML.
*/ */
protected function addXMLControl (ident :String, control :UIComponent) :void protected function addXMLControl (spec :XML, control :UIComponent) :void
{ {
var name :String = ident.replace("_", " "); var ident :String = String(spec.@ident);
var lbl :Label = new Label(); var tip :String = StringUtil.trim(String(spec.text()));
lbl.text = name + ":";
addControl(lbl, control);
var lbl :Label = new Label();
lbl.text = ident + ":";
lbl.toolTip = tip;
control.toolTip = tip;
addControl(lbl, control);
_customConfigs.push(ident, control); _customConfigs.push(ident, control);
} }
@@ -111,7 +115,7 @@ public class EZGameConfigurator extends FlexGameConfigurator
slider.liveDragging = true; slider.liveDragging = true;
slider.snapInterval = 1; slider.snapInterval = 1;
addXMLControl(spec.@ident, new LabeledSlider(slider)); addXMLControl(spec, new LabeledSlider(slider));
} }
/** /**
@@ -141,7 +145,7 @@ public class EZGameConfigurator extends FlexGameConfigurator
box.dataProvider = choices; box.dataProvider = choices;
box.selectedIndex = startDex; box.selectedIndex = startDex;
addXMLControl(spec.@ident, box); addXMLControl(spec, box);
} }
/** /**
@@ -161,7 +165,7 @@ public class EZGameConfigurator extends FlexGameConfigurator
var box :CheckBox = new CheckBox(); var box :CheckBox = new CheckBox();
box.selected = ("true" == startStr); box.selected = ("true" == startStr);
addXMLControl(spec.@ident, box); addXMLControl(spec, box);
} }
override protected function flushGameConfig () :void override protected function flushGameConfig () :void