예제 #1
0
void
EditorLevelsetMenu::initialize() {

  levelset_type = world->m_is_levelset ? 1 : 0;

  add_label(_("Level subset properties"));
  add_hl();
  add_textfield(_("Name"), &(world->m_title));
  add_textfield(_("Description"), &(world->m_description));
  add_string_select(1, _("Type"), &levelset_type, {_("Worldmap"), _("Levelset")});
  add_hl();
  add_back(_("OK"));
}
예제 #2
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"));
}
void
EditorLevelsetMenu::initialize() {
  add_label(_("Level subset properties"));
  add_hl();
  add_textfield(_("Name"), &(world->m_title));
  add_textfield(_("Description"), &(world->m_description));

  std::string worldmap_file = FileSystem::join(world->get_basedir(), "worldmap.stwm");
  if (PHYSFS_exists(worldmap_file.c_str())) {
    add_toggle(-1, _("Do not use worldmap"), &(world->m_is_levelset));
    add_entry(MNID_EDITWORLDMAP, _("Edit worldmap"));
  } else {
    add_entry(MNID_NEWWORLDMAP, _("Create worldmap"));
  }
  add_hl();
  add_back(_("OK"));
}
예제 #4
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"));
}