Display name: the mod.json "name" when present, else the folder name with a leading '@' (the OFP convention) trimmed for readability.
| 66 | |
| 67 | // Display name: the mod.json "name" when present, else the folder name with a |
| 68 | // leading '@' (the OFP convention) trimmed for readability. |
| 69 | std::string ModDisplayName(const std::string& folder, const std::string& jsonName) |
| 70 | { |
| 71 | if (!jsonName.empty()) |
| 72 | return jsonName; |
| 73 | if (!folder.empty() && folder[0] == '@') |
| 74 | return folder.substr(1); |
| 75 | return folder; |
| 76 | } |
| 77 | |
| 78 | // Last path component, verbatim (keeps the '@' and case). Handles both '/' and '\' |
no test coverage detected