MCPcopy Create free account
hub / github.com/MrDrElliot/LuminaEngine / EditorToolLayoutCopy

Method EditorToolLayoutCopy

Engine/Editor/Source/UI/EditorUI.cpp:1214–1266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1212
1213 ImGui::Spacing();
1214 const float BtnH = 34.0f;
1215 const float ListH = ImGui::GetContentRegionAvail().y - BtnH - ImGui::GetStyle().ItemSpacing.y * 2.0f;
1216 if (ImGui::BeginChild("##ReadOnlyFiles", ImVec2(0.0f, Math::Max(ListH, 40.0f)), ImGuiChildFlags_Borders))
1217 {
1218 for (const FString& Path : ReadOnly)
1219 {
1220 ImGui::TextUnformatted(*Path);
1221 }
1222 }
1223 ImGui::EndChild();
1224
1225 ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 4.0f);
1226 const float Gap = 8.0f;
1227 const float BtnW = (ImGui::GetContentRegionAvail().x - Gap) * 0.5f;
1228
1229 bool bShouldClose = false;
1230 if (SchemeButton("Cancel", ImVec2(BtnW, BtnH), kButtonNeutral))
1231 {
1232 bShouldClose = true;
1233 }
1234 ImGui::SameLine(0.0f, Gap);
1235 if (SchemeButton(bSaves ? LE_ICON_LOCK_OPEN_VARIANT " Make Writable and Save" : LE_ICON_LOCK_OPEN_VARIANT " Make Writable", ImVec2(BtnW, BtnH), kButtonDanger))
1236 {
1237 for (const FString& Path : ReadOnly)
1238 {
1239 if (!VFS::MakeWritable(FStringView(*Path, Path.Len())))
1240 {
1241 ImGuiX::Notifications::NotifyError("Could not make \"{0}\" writable.", *Path);
1242 }
1243 }
1244 // Saving can open tools and modals of its own, which must not happen inside this popup.
1245 if (Then)
1246 {
1247 MainThread::Enqueue(Move(Then));
1248 }
1249 bShouldClose = true;
1250 }
1251 ImGui::PopStyleVar();
1252 return bShouldClose;
1253 });
1254 return false;
1255 }
1256
1257 namespace
1258 {
1259 // Resolve devenv.exe for a VS major-version range via vswhere; canonical Microsoft recipe.
1260 FString FindDevEnv(const char* VersionRange)
1261 {
1262 const char* VsWhereCandidates[] =
1263 {
1264 R"(C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe)",
1265 R"(C:\Program Files\Microsoft Visual Studio\Installer\vswhere.exe)",
1266 };
1267
1268 for (const char* Candidate : VsWhereCandidates)
1269 {

Callers

nothing calls this directly

Calls 6

GetToolWindowNameFunction · 0.85
GetCurrentContextFunction · 0.85
BuildPointerArrayMethod · 0.80
c_strMethod · 0.45
AddEntryMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected