if (e.getParameters().size() < 6) {
e.getParameters().add(RubyFixnum.one(e.getObject().getRuntime()));
}
// add type
final FormComboBox c = new FormComboBox(I18N.t("Type"), new String[] { "0", "1" }, new String[] { "Single", "Multi" });
c.selectField(RubyHelper.toInt(e.getParameters().get(0)) == RubyHelper.toInt(e.getParameters().get(1)) ? "0" : "1");
f.getHeader("basic").setColumn(4);
f.addElement("basic.type", c.setSorting(-1));
f.addElement("basic.type2", new FormEmpty().setSorting(-1));
// add switch
f.addElement("basic.v1", new FormSwitchVarSelector(e.getYecl().getProject(), I18N.t("Setze"), e.getParameters(), 0, Type.VARIABLE)
.addChangeListener(new FormElementChangeListener() {
@Override
public void stateChanged(FormElement form) {
if (c.getContentAsString().equals("0")) {
RubyHelper.setNum(e.getParameters(), 1, c.getContentAsString());
}
}
}));
// add 2. switch
f.addElement("basic.v2", FormHelper.setEnabeldWhenRightElementSelect(c,
new FormSwitchVarSelector(e.getYecl().getProject(), I18N.t("bis"), e.getParameters(), 1, Type.VARIABLE), "1"));
c.addChangeListener(new FormElementChangeListener() {
@Override
public void stateChanged(FormElement form) {
if (c.getContentAsString().equals("0")) {
RubyHelper.setNum(e.getParameters(), 1, RubyHelper.toInt(e.getParameters().get(0)));
}
}
});
// add operator
f.addElement("basic.operator", RubyForm.getComboBoxNum(I18N.t("Operator"), JavaHelper.numAry(5), oTit, e.getParameters(), 2).setSorting(1));
// add values
f.addHeader("value", new FormHeader("Value", "variable").setColumn(4));
// selector
FormComboBox fcb = RubyForm.getComboBoxNum(I18N.t("Typ"), JavaHelper.numAry(7),
new String[] { "Value", "Variable", "Random", RGSS1Helper.getName(Type.ITEM), "Actor", "Enemy", "Spirit", "Other" }, e.getParameters(), 3);
f.addElement("value.atyp", fcb);
f.addElement("value.atyp1", new FormEmpty());
// value
f.addElement("value.bvalue", FormHelper.setEnabeldWhenRightElementSelect(fcb, RubyForm.getNumber(I18N.t("Wert"), e.getParameters(), 4), "0"));
// variable
f.addElement("value.bvar", FormHelper.setEnabeldWhenRightElementSelect(fcb,
new FormSwitchVarSelector(e.getYecl().getProject(), I18N.t("Variable"), e.getParameters(), 4, Type.VARIABLE), "1"));
// random
f.addElement("value.crand", FormHelper.setEnabeldWhenRightElementSelect(fcb, RubyForm.getNumber(I18N.t("Random"), e.getParameters(), 4), "2"));
f.addElement("value.crand2", FormHelper.setEnabeldWhenRightElementSelect(fcb, RubyForm.getNumber(I18N.t("-"), e.getParameters(), 5), "2"));
// item
f.addElement("value.ditem", FormHelper.setEnabeldWhenRightElementSelect(fcb, new FormDBComboBox(RGSS1Helper.getName(Type.ITEM), e.getYecl()
.getProject(), Type.ITEM, e.getParameters(), 4, false).setInfoTxt(I18N.t("Anzahl des Gegenstandes im Inventar der Party")), "3"));
f.addElement("value.ditem2", new FormEmpty());
// actor
f.addElement("value.eactor", FormHelper.setEnabeldWhenRightElementSelect(fcb, new FormDBComboBox(I18N.t("Actor"), e.getYecl().getProject(), Type.ACTOR,
e.getParameters(), 4, false), "4"));
f.addElement("value.eactor2",
FormHelper.setEnabeldWhenRightElementSelect(fcb, RubyForm.getComboBoxNum(I18N.t(""), JavaHelper.numAry(13), tActor, e.getParameters(), 5), "4"));
// enemy
f.addElement(
"value.fenemy",
FormHelper.setEnabeldWhenRightElementSelect(fcb,
RubyForm.getComboBoxNum(I18N.t("Enemy"), JavaHelper.numAry(7), JavaHelper.numAry(7), e.getParameters(), 4), "5"));
f.addElement("value.fenemy2",
FormHelper.setEnabeldWhenRightElementSelect(fcb, RubyForm.getComboBoxNum(I18N.t(""), JavaHelper.numAry(11), tEnemy, e.getParameters(), 4), "5")); // FUNF
// enemy
f.addElement("value.gsprite",
FormHelper.setEnabeldWhenRightElementSelect(fcb, RubyForm.getEventSelector("Event", e.getYecl().getMap(), e.getParameters(), 4), "6"));
f.addElement("value.gsprite2",
FormHelper.setEnabeldWhenRightElementSelect(fcb, RubyForm.getComboBoxNum(I18N.t(""), JavaHelper.numAry(5), tSprite, e.getParameters(), 5), "6"));
// other
f.addElement("value.hother", FormHelper.setEnabeldWhenRightElementSelect(fcb,
RubyForm.getComboBoxNum(I18N.t("Other"), JavaHelper.numAry(6), tOther, e.getParameters(), 5), "7"));
// disable wrong elements
fcb.informListeners();
c.informListeners();
}