// load system
final RubyObject system = RGSS1Helper.get(project, Type.SYSTEM).get(0).getObject();
final RubyObject words = (RubyObject) system.getInstanceVariable("@words");
// add basics
eles.add(new SplitActionListElement(I18N.t("Basics"), I18N.t("Verwaltet die Grundlagen des Spiels"), "game") {
@Override
protected Component getComponent(Project p) {
final FormBuilder form = new FormBuilder("game.basic");
form.getHeader("basic").setTitle(I18N.t("Grundlegenes")).setIcon("info").setColumn(4);
// add basics
final FormTextField ftf = new FormTextField(I18N.t("Name"), RGSSProjectHelper.getGameIni(project).get("Title"));
form.addElement("basic.name", ftf);
// build rtp
// RTP.
form.addElement("basic.button", new FormButton(I18N.t("In Game.ini speichern"), "disk", new AE() {
@Override
public void run() {
FileReader f = null;
try {
// load it
f = new FileReader(RGSSProjectHelper.getGameIniFile(project));
// build game ini
Ini ini = new Ini();
ini.load();
Ini.Section section = ini.get("Game");
// add it
section.add("Title", ftf.getContentAsString());
section.add("RTP1", ftf.getContentAsString());
section.add("RTP2", ftf.getContentAsString());
section.add("RTP3", ftf.getContentAsString());
// save
ini.store(RGSSProjectHelper.getGameIniFile(project));
} catch (Throwable t) {
YEx.info("Can not save " + RGSSProjectHelper.getGameIniFile(project), t);
} finally {
if (f != null) {
try {
f.close();
} catch (IOException e) {
YEx.info("Can not close " + f, e);
}
}
}
}
}).setSorting(2));
// add party
form.addHeader("party", new FormHeader(I18N.t("Party"), "hero"));
form.addElement("party.hero", new FormDBList(project, Type.ACTOR, system.getInstanceVariable("@party_members"),
I18N.t("Wähle die Helden für die Party aus")));
// add map
form.addElement(
"party.pos",
new FormButton(I18N.t(I18N.t("Start Position {0} - {1}/{2}", RubyHelper.toInt(system, "@start_map_id"),
RubyHelper.toInt(system, "@start_x"), RubyHelper.toInt(system, "@start_y"))), "map", new AE() {
@Override
public void run() {
// load
YMapView map = new YMapView(RubyHelper.toInt(system, "@start_map_id"), project);
map.installClickSupport();
map.setSelectX(RubyHelper.toInt(system, "@start_x"));
map.setSelectY(RubyHelper.toInt(system, "@start_y"));
map.installMapChance();
// show
if (YDialog.show(I18N.t("Start Position"), "map", map, true)) {
//
RubyHelper.setNum(system, "@start_x", map.getSelectX());
RubyHelper.setNum(system, "@start_y", map.getSelectY());
RubyHelper.setNum(system, "@start_map_id", map.getMapID());
}
((JButton) form.getElement("party.pos").getElement()).setText(I18N.t(
"Start Position {0} - {1}/{2}", RubyHelper.toInt(system, "@start_map_id"),
RubyHelper.toInt(system, "@start_x"), RubyHelper.toInt(system, "@start_y")));
}
}));
// build objects
// ExtentionManagement.work("project.game_setting.basic",
// JavaHelper.createHashStringObj("project",
// project,"form",
// form,"system", system));
return form.getPanel(true);
}
});
// vocab
eles.add(new SplitActionListElement(I18N.t("Vocabulary"), I18N.t("Übersetzt die Hauptelemente des Spiels"), "vocab") {
@Override
protected Component getComponent(Project p) {
FormBuilder form = new FormBuilder("game.voc");
// add it
form.addHeader("help", new FormHeader(I18N.t("Info"), "help"));
form.addElement("help.more",
new FormInfo("", I18N.t("You will find more Vocabulary directly in the script section")));
form.addHeader("basic", new FormHeader(I18N.t("Basics"), "vocab"));
form.addElement("basic.gold", RubyForm.getString(I18N.t("Gold"), "@gold", words));
form.addElement("basic.hp", RubyForm.getString(I18N.t("HP"), "@hp", words));
form.addElement("basic.sp", RubyForm.getString(I18N.t("SP"), "@sp", words));
form.addElement("basic.str", RubyForm.getString(I18N.t("Strength"), "@str", words));
form.addElement("basic.dex", RubyForm.getString(I18N.t("Dexterity"), "@dex", words));
form.addElement("basic.agi", RubyForm.getString(I18N.t("Agility"), "@agi", words));
form.addElement("basic.int", RubyForm.getString(I18N.t("Intelligence"), "@int", words));
form.addElement("basic.att", RubyForm.getString(I18N.t("Attack Power"), "@atk", words));
form.addElement("basic.phy", RubyForm.getString(I18N.t("Physical Defense"), "@pdef", words));
form.addElement("basic.mag", RubyForm.getString(I18N.t("Magic Defense"), "@mdef", words));
form.addHeader("fight", new FormHeader(I18N.t("Fight"), "weapon"));
form.addElement("fight.weapon", RubyForm.getString(I18N.t("Weapon"), "@weapon", words));
form.addElement("fight.armor", RubyForm.getString(I18N.t("Shield"), "@armor1", words));
form.addElement("fight.helm", RubyForm.getString(I18N.t("Helmet"), "@armor2", words));
form.addElement("fight.body", RubyForm.getString(I18N.t("Body armor"), "@armor3", words));
form.addElement("fight.acc", RubyForm.getString(I18N.t("Accessory"), "@armor4", words));
form.addElement("fight.att", RubyForm.getString(I18N.t("Attack"), "@attack", words));
form.addElement("fight.skill", RubyForm.getString(I18N.t("Skill"), "@skill", words));
form.addElement("fight.def", RubyForm.getString(I18N.t("Defense"), "@guard", words));
form.addElement("fight.item", RubyForm.getString(I18N.t("Item"), "@item", words));
form.addElement("fight.equ", RubyForm.getString(I18N.t("Equip"), "@equip", words));
form.setColumn(6);
// get it
return form.getPanel(true);
}
});
// graphics & audio
eles.add(new SplitActionListElement(I18N.t("Backgrounds & Music"), I18N.t("Set Options for Title, Gameover, .."),
"graphic_audio") {
@Override
protected Component getComponent(Project p) {
FormBuilder form = new FormBuilder("game.graph");