File tree 8 files changed +21
-4
lines changed
8 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,9 @@ Subfolders with names starting with `_` or `.` are ignored.
256
256
If a subfolder contains a media file with the same name as a media file
257
257
in one of its parents, the parent's file is used.
258
258
259
+ Although it is discouraged, a mod can overwrite a media file of any mod that it
260
+ depends on by supplying a file with an equal name.
261
+
259
262
Naming conventions
260
263
------------------
261
264
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+
2
+ The dirt_with_grass folder is for testing loading textures from subfolders.
3
+ If it works correctly, the default_grass_side.png file in the folder is used but
4
+ default_grass.png is not overwritten by the file in the folder.
5
+
6
+ default_dirt.png should be overwritten by the default_dirt.png in the unittests
7
+ mod which depends on basenodes.
Original file line number Diff line number Diff line change 1
1
name = unittests
2
2
description = Adds automated unit tests for the engine
3
+ depends = basenodes
Original file line number Diff line number Diff line change @@ -98,7 +98,8 @@ void ServerModManager::getModNames(std::vector<std::string> &modlist) const
98
98
99
99
void ServerModManager::getModsMediaPaths (std::vector<std::string> &paths) const
100
100
{
101
- for (const ModSpec &spec : m_sorted_mods) {
101
+ for (auto it = m_sorted_mods.crbegin (); it != m_sorted_mods.crend (); it++) {
102
+ const ModSpec &spec = *it;
102
103
fs::GetRecursiveDirs (paths, spec.path + DIR_DELIM + " textures" );
103
104
fs::GetRecursiveDirs (paths, spec.path + DIR_DELIM + " sounds" );
104
105
fs::GetRecursiveDirs (paths, spec.path + DIR_DELIM + " media" );
Original file line number Diff line number Diff line change @@ -42,5 +42,13 @@ class ServerModManager : public ModConfiguration
42
42
void loadMods (ServerScripting *script);
43
43
const ModSpec *getModSpec (const std::string &modname) const ;
44
44
void getModNames (std::vector<std::string> &modlist) const ;
45
+ /* *
46
+ * Recursively gets all paths of mod folders that can contain media files.
47
+ *
48
+ * Result is ordered in descending priority, ie. files from an earlier path
49
+ * should not be replaced by files from a latter one.
50
+ *
51
+ * @param paths result vector
52
+ */
45
53
void getModsMediaPaths (std::vector<std::string> &paths) const ;
46
54
};
You can’t perform that action at this time.
0 commit comments