From 5c843ebcc747e2b396abdeef159919d5d7f40496 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Wed, 7 Mar 2007 22:31:02 +0000 Subject: [PATCH] Added level properties "contact" and "license" SVN-Revision: 4931 --- src/level.cpp | 9 +++++++++ src/level.hpp | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/level.cpp b/src/level.cpp index 8aaba2024..4b222bb8a 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -71,6 +71,9 @@ Level::load(const std::string& filepath) return; } + contact = ""; + license = ""; + lisp::ListIterator iter(level); while(iter.next()) { const std::string& token = iter.item(); @@ -83,6 +86,10 @@ Level::load(const std::string& filepath) iter.value()->get(name); } else if(token == "author") { iter.value()->get(author); + } else if(token == "contact") { + iter.value()->get(contact); + } else if(token == "license") { + iter.value()->get(license); } else if(token == "on-menukey-script") { iter.value()->get(on_menukey_script); } else if(token == "sector") { @@ -94,6 +101,8 @@ Level::load(const std::string& filepath) } } + if (license == "") log_warning << "The level author did not specify a license for this level. You might not be allowed to share it." << std::endl; + } catch(std::exception& e) { std::stringstream msg; msg << "Problem when reading level '" << filepath << "': " << e.what(); diff --git a/src/level.hpp b/src/level.hpp index 1ab744890..da2fdf450 100644 --- a/src/level.hpp +++ b/src/level.hpp @@ -35,6 +35,8 @@ class Level public: std::string name; std::string author; + std::string contact; + std::string license; std::string on_menukey_script; typedef std::vector Sectors; Sectors sectors; -- 2.11.0