*
* @see de.yaams.packandgo.programm.tabs.YaTab#getContent()
*/
public void buildForm(FormBuilder form, int id) {
// get page
RubyObject page = elements.get(id).getObject();
// build
form.addHeader("basic", new FormHeader(I18N.t("Grundlegenes"), "event"));
form.addElement(
"basic.trigger",
RubyForm.getComboBoxNum(I18N.t("Trigger"), new String[] { "0", "1", "2", "3", "4" }, new String[] { "action button",
"contact with player", "contact with event", "autorun", "parallel processing" }, page, "@trigger"));
// animation
form.addHeader("animation", new FormHeader(I18N.t("Animation"), "animation").setColumn(10).setCollapsed(true));
form.addElement("animation.ani", RubyForm.getBoolean("Moving Animation", page, "@walk_anime"));
form.addElement("animation.stop", RubyForm.getBoolean("Stopped Animation", page, "@step_anime"));
form.addElement("animation.fix", RubyForm.getBoolean("Fixed Direction", page, "@direction_fix"));
form.addElement("animation.move", RubyForm.getBoolean("Move Through", page, "@through"));
form.addElement("animation.top", RubyForm.getBoolean("Always On Top", page, "@always_on_top"));
// animation
form.addHeader("move", new FormHeader(I18N.t("Bewegung"), "animation").setColumn(6));
form.addElement(
"move.typ",
RubyForm.getComboBoxNum(I18N.t("Type"), new String[] { "0", "1", "2", "3" }, new String[] { "Fixed", "Random", "Approach",
"Custom" }, page, "@move_type"));
form.addElement(
"move.speed",
RubyForm.getComboBoxNum(I18N.t("Speed"), new String[] { "1", "2", "3", "4", "5", "6" }, new String[] { "slowest", "slower",
"slow", "fast", "faster", "fastest" }, page, "@move_speed"));
form.addElement(
"move.freq",
RubyForm.getComboBoxNum(I18N.t("Frequency"), new String[] { "1", "2", "3", "4", "5", "6" }, new String[] { "lowest",
"lower", "low", "high", "higher", "highest" }, page, "@move_frequency"));
// add contition
RubyObject cond = (RubyObject) page.getInstanceVariable("@condition");
form.addHeader("cond", new FormHeader(I18N.t("Bedingung"), "if").setColumn(8).setCollapsed(true));
// add local switch
FormCheckbox v = RubyForm.getBoolean("Local Switch", cond, "@self_switch_valid");
form.addElement("cond.ls", v);
form.addElement(
"cond.ls2",
FormHelper.setEnabeldWhenRightElementSelect(
v,
RubyForm.getComboBox("", new String[] { "A", "B", "C", "D" }, new String[] { "A", "B", "C", "D" },
cond.getInstanceVariable("@self_switch_ch")), "true"));
v.informListeners();
// add switch 1
v = RubyForm.getBoolean("Switch 1", cond, "@switch1_valid");
form.addElement("cond.s1", v);
form.addElement("cond.s12", FormHelper.setEnabeldWhenRightElementSelect(v, new FormSwitchVarSelector(project, "", cond,
"@switch1_id", Type.SWITCH), "true"));
v.informListeners();
// add switch 2
v = RubyForm.getBoolean("Switch 2", cond, "@switch2_valid");
form.addElement("cond.s2", new FormEmpty());
form.addElement("cond.s23", new FormEmpty());
form.addElement("cond.s24", v);
form.addElement("cond.s25", FormHelper.setEnabeldWhenRightElementSelect(v, new FormSwitchVarSelector(project, "", cond,
"@switch2_id", Type.SWITCH), "true"));
v.informListeners();
// add variable
v = RubyForm.getBoolean("Variable", cond, "@variable_valid");
form.addElement("cond.v3", v);
form.addElement("cond.v4", FormHelper.setEnabeldWhenRightElementSelect(v, new FormSwitchVarSelector(project, "", cond,
"@variable_id", Type.VARIABLE), "true"));
form.addElement("cond.v5",
FormHelper.setEnabeldWhenRightElementSelect(v, RubyForm.getNumber(">=", cond, "@variable_value"), "true"));
v.informListeners();
// graphic
RubyObject graph = (RubyObject) page.getInstanceVariable("@graphic");
form.addHeader("graphic", new FormHeader(I18N.t("Graphic"), "graphic").setColumn(4).setCollapsed(true));
// add select
FormComboBox gS = new FormComboBox(I18N.t("Typ"), new String[] { "1", "0" }, new String[] { "Tile", "Character" });
gS.selectField(RubyHelper.toInt(graph.getInstanceVariable("@tile_id")) == 0 ? "1" : "0");
form.addElement("graphic.typ", gS.setSorting(-2));
// add tile
form.addElement("graphic.tile",
FormHelper.setEnabeldWhenRightElementSelect(gS, RubyForm.getNumber(I18N.t("Tile"), graph, "@tile_id").setSorting(-1), "1"));