MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / assembleMapExportFileTypes

Method assembleMapExportFileTypes

libs/wxutil/FileChooser.cpp:109–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void FileChooser::assembleMapExportFileTypes()
110{
111 FileTypePatterns patterns = GlobalFiletypes().getPatternsForType(_fileType);
112
113 for (const auto& pattern : patterns)
114 {
115 auto formats = GlobalMapFormatManager().getMapFormatList(pattern.extension);
116
117 // Pre-select take the default map format for this game type
118 auto defaultFormat = GlobalMapFormatManager().getMapFormatForGameType(
119 GlobalGameManager().currentGame()->getKeyValue("type"), pattern.extension
120 );
121
122 for (const map::MapFormatPtr& format : formats)
123 {
124 FileFilter filter;
125
126 filter.caption = format->getMapFormatName() + " " + pattern.name + " (" + pattern.pattern + ")";
127 filter.filter = pattern.pattern;
128 filter.extension = pattern.extension;
129 filter.mapFormatName = format->getMapFormatName();
130
131 _fileFilters.push_back(filter);
132
133 if (format == defaultFormat)
134 {
135 filter.isDefaultFilter = true;
136 }
137 }
138 }
139}
140
141void FileChooser::assembleFileTypes()
142{

Callers

nothing calls this directly

Calls 6

getPatternsForTypeMethod · 0.80
getMapFormatListMethod · 0.80
getKeyValueMethod · 0.45
currentGameMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected