MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / selectFileAt

Method selectFileAt

apps/tools/Studio/StudioApp.cpp:84–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84void StudioApp::selectFileAt(int index)
85{
86 if (index < 0 || index >= (int)filteredFiles.size())
87 return;
88 selectedIndex = index;
89 const auto& f = filteredFiles[index];
90 selectedFile = f.name;
91 selectedEntry = f;
92 currentPreview = PreviewType::None;
93 previewInfo.clear();
94 clearPreviewTexture();
95 stopSound();
96 cachedInfoFile.clear();
97 cachedInfoText.clear();
98 modelPreviewKey.clear();
99 textureZoom = 1.0f;
100 texturePanOffset = {0, 0};
101 texturePanning = false;
102 textureMipLevel = 0;
103 modelLodIndex = 0;
104 modelView = "front";
105 assetUses.clear();
106 if (usedByScanKey != f.name)
107 {
108 std::lock_guard<std::mutex> lk(usedByMutex);
109 assetUsedBy.clear();
110 usedByScanKey.clear();
111 }
112 configFile.reset();
113 configFilePath.clear();
114 configSearchActive = false;
115 memset(configSearch, 0, sizeof(configSearch));
116 configSearchResults.clear();
117
118 std::string ext = f.extension;
119 std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
120 currentPreview = previewTypeFromExtension(ext);
121
122 log("Selected: " + f.name);
123}
124
125void StudioApp::selectSingleFile(const std::string& absPath)
126{

Callers

nothing calls this directly

Calls 4

logFunction · 0.85
sizeMethod · 0.80
clearMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected