StoryScreenContinueButton(StoryScreenComponent* arg_story_comp)
   : GUI::SurfaceButton(Display::get_width()/2 + 220, Display::get_height()/2 + 160,
                        ResDescriptor("core/misc/next"),
                        ResDescriptor("core/misc/next"),
                        ResDescriptor("core/misc/next_hover")),
     story_comp(arg_story_comp)
 {
 }
Beispiel #2
0
void
WorldObjRenderer::process(const FileReader& reader)
{
  // FIXME: does not handle sprite alignment
  // FIXME: does not handle remove groundpieces
  // FIXME: does not handle liquid
  if (reader.get_name() == "surface-background" ||
      reader.get_name() == "starfield-background" ||
      reader.get_name() == "solidcolor-background" ||
      reader.get_name() == "snow-generator" ||
      reader.get_name() == "rain-generator")
  {
    // ignore
  }
  else if (reader.get_name() == "groundpiece" ||
           reader.get_name() == "liquid" ||
           reader.get_name() == "exit" ||
           reader.get_name() == "hotspot")
  {
    process_object_with_surface(reader);
  }
  else if (reader.get_name() == "entrance")
  {
    Vector3f pos;
    reader.read_vector("position", pos);
    render_sprite(ResDescriptor("entrances/generic"), pos);
  }
  else if (reader.get_name() == "spike")
  {
    Vector3f pos;
    reader.read_vector("position", pos);
    render_surface(ResDescriptor("traps/spike_editor"), pos);
  }
  else if (reader.get_name() == "switchdoor-switch")
  {
    Vector3f pos;
    reader.read_vector("position", pos);
    render_surface(ResDescriptor("worldobjs/switchdoor_switch"), pos);
  }
  else if (reader.get_name() == "switchdoor-door")
  {
    Vector3f pos;
    reader.read_vector("position", pos);
    render_surface(ResDescriptor("worldobjs/switchdoor_box"), pos);
  }
  else if (reader.get_name() == "group")
  {
    FileReader objects = reader.read_section("objects");
    process(objects.get_sections());
  }
  else if (reader.get_name() == "prefab")
  {
    std::string name;
    if (!reader.read_string("name", name))
    {
      log_error("'name' tag missing for prefab");
    }
    else
    {
      PrefabFile prefab = PrefabFile::from_resource(name);

      Vector3f position;
      reader.read_vector("position", position);
      push_translate(static_cast<int>(position.x),
                     static_cast<int>(position.y));
      process(prefab.get_objects());
      pop_translate();
    }
  }
  else
  {
    log_error("unknown object type: %1%", reader.get_name());
  }
}
 StoryScreenSkipButton(StoryScreenComponent* arg_story_comp)
   : GUI::SurfaceButton(Display::get_width() - 4, Display::get_height() - 26,
                        ResDescriptor(), ResDescriptor(), ResDescriptor()),
     story_comp(arg_story_comp)
 {
 }
Beispiel #4
0
 /** Retrieve the object's resource name */
 ResDescriptor get_res_desc() const { return ResDescriptor(); }
Beispiel #5
0
Surface
Resource::load_surface(const std::string& res_name)
{
  return load_surface(ResDescriptor(res_name));
}