Ejemplo n.º 1
0
EditorSectorMenu::EditorSectorMenu() :
  sector(Editor::current()->currentsector),
  sector_name_ptr(sector->get_name_ptr()),
  original_name(*sector_name_ptr),
  size(sector->get_editor_size()),
  new_size(size)
{
  add_label(_("Sector") + " " + sector->get_name());
  add_hl();
  add_textfield(_("Name"), sector_name_ptr);
  add_script(_("Initialization script"), sector->get_init_script_ptr());
  add_color(_("Ambient light"), sector->get_ambient_light_ptr());
  add_numfield(_("Gravity"), &sector->gravity);

  std::vector<std::string> music_formats;
  music_formats.push_back(".ogg");
  music_formats.push_back(".music");
  add_file(_("Music"), &sector->music, music_formats);

  add_hl();
  add_intfield(_("Width"), &(new_size.width));
  add_intfield(_("Height"), &(new_size.height));
  add_entry(MNID_RESIZESECTOR, _("Resize"));

  add_hl();
  add_back(_("OK"));
}
Ejemplo n.º 2
0
EditorLevelMenu::EditorLevelMenu() :
  old_tileset(Editor::current()->get_level()->m_tileset)
{
  bool worldmap = Editor::current()->get_worldmap_mode();
  auto level = Editor::current()->get_level();

  add_label(worldmap ? _("Worldmap properties") :_("Level properties"));
  add_hl();
  add_textfield(_("Name"), &(level->m_name));
  add_textfield(_("Author"), &(level->m_author));
  add_textfield(_("Contact"), &(level->m_contact));
  add_textfield(_("License"), &(level->m_license));
  add_file(_("Tileset"), &(level->m_tileset), std::vector<std::string>(1, ".strf"));

  if (!worldmap) {
    add_numfield(_("Target time"), &(level->m_target_time));
  }

  add_hl();
  add_back(_("OK"));
}