}
private void createLogicEditor() {
fItem = "";
// Add settings
final DropDownMenu type = new DropDownMenu(new Minion<SelectionEvent>() {
@Override
public long run(Dispatcher<SelectionEvent> dispatcher, String t, SelectionEvent event) {
fType = ((DropDownMenu) event.source()).value();
try {
fSubType = JSONObject.getNames(fLogics.getJSONObject(fType))[0];
} catch (JSONException e) {
System.err.println("Can't parse subtype");
System.err.println(e.getMessage());
}
editLogic(null);
return Minion.CONTINUE;
}
});
for (String s: JSONObject.getNames(fLogics)) type.add(s);
type.select(fType);
type.resize(new Vector2f(155, 24));
addChild(type, 10);
final DropDownMenu subtype = new DropDownMenu(new Minion<SelectionEvent>() {
@Override
public long run(Dispatcher<SelectionEvent> dispatcher, String type, SelectionEvent event) {
fSubType = ((DropDownMenu) event.source()).value();
editLogic(null);
return Minion.CONTINUE;
}
});
subtype.position(new Vector2f(0, 26));
try {
for (String s: JSONObject.getNames(fLogics.getJSONObject(fType))) subtype.add(s);
} catch (JSONException e) {
System.err.println("Error parsing the editor preset logics");
System.err.println(e.getMessage());
}
subtype.select(fSubType);
subtype.resize(new Vector2f(155, 24));
addChild(subtype, 9);
fLogicPane = new LogicPane();
fLogicPane.position(new Vector2f(0, 56));
addChild(fLogicPane);