MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetInitialDirectoryByType

Function GetInitialDirectoryByType

src/openrct2-ui/interface/FileBrowser.cpp:148–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 }
147
148 u8string GetInitialDirectoryByType(const LoadSaveType type)
149 {
150 std::optional<DirId> subdir = std::nullopt;
151 switch (type)
152 {
153 case LoadSaveType::park:
154 subdir = DirId::saves;
155 break;
156
157 case LoadSaveType::landscape:
158 subdir = DirId::landscapes;
159 break;
160
161 case LoadSaveType::scenario:
162 subdir = DirId::scenarios;
163 break;
164
165 case LoadSaveType::track:
166 subdir = DirId::trackDesigns;
167 break;
168
169 case LoadSaveType::heightmap:
170 subdir = DirId::heightmaps;
171 break;
172 }
173
174 auto& env = GetContext()->GetPlatformEnvironment();
175 if (subdir.has_value())
176 return env.GetDirectoryPath(DirBase::user, subdir.value());
177 else
178 return env.GetDirectoryPath(DirBase::user);
179 }
180
181 u8string GetFilterPatternByType(const LoadSaveType type, const bool isSave, const TrackDesign* trackDesign)
182 {

Callers 2

GetDirFunction · 0.85
onMouseUpMethod · 0.85

Calls 3

GetContextFunction · 0.85
GetDirectoryPathMethod · 0.80
valueMethod · 0.80

Tested by

no test coverage detected