summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2016-09-04 12:58:04 +0000
committeralberth <alberth@openttd.org>2016-09-04 12:58:04 +0000
commit6f201ce4a8db0143ba0664aabdd04dc733adc243 (patch)
treea368495e00682bf58a0270ab1fe63d79e934a530 /src/saveload
parent597380e099688652e31fd1f406b53dee6b65da90 (diff)
downloadopenttd-6f201ce4a8db0143ba0664aabdd04dc733adc243.tar.xz
(svn r27651) -Codechange: Introduce methods for setting the name and title of _file_to_saveload.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/saveload.cpp18
-rw-r--r--src/saveload/saveload.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 4dd8a4c7b..b78171e60 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -2932,6 +2932,24 @@ void FileToSaveLoad::SetMode(FileOperation fop, AbstractFileType aft, DetailedFi
this->abstract_ftype = aft;
}
+/**
+ * Set the name of the file.
+ * @param name Name of the file.
+ */
+void FileToSaveLoad::SetName(const char *name)
+{
+ strecpy(this->name, name, lastof(this->name));
+}
+
+/**
+ * Set the title of the file.
+ * @param title Title of the file.
+ */
+void FileToSaveLoad::SetTitle(const char *title)
+{
+ strecpy(this->title, title, lastof(this->title));
+}
+
#if 0
/**
* Function to get the type of the savegame by looking at the file header.
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index 7b0ae8f48..b25e91e2c 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -32,6 +32,8 @@ struct FileToSaveLoad {
void SetMode(FiosType ft);
void SetMode(FileOperation fop, AbstractFileType aft, DetailedFileType dft);
+ void SetName(const char *name);
+ void SetTitle(const char *title);
};
/** Types of save games. */