14 QVBoxLayout *layout =
new QVBoxLayout(
this);
16 QLabel *instructionLabel =
new QLabel(
"Select a folder to create a shader index file:",
this);
17 layout->addWidget(instructionLabel);
45 QHBoxLayout *buttonLayout =
new QHBoxLayout();
46 okButton =
new QPushButton(
"OK",
this);
54 layout->addLayout(buttonLayout);
57 setWindowTitle(
"Shader Library Folder Selector");
63 QSettings appSettings(
"LostSideDead");
64 QString lastDir = appSettings.value(
"lastLibraryDir",
"").toString();
65 QString folderPath = QFileDialog::getExistingDirectory(
this,
"Select Folder", lastDir);
66 if (!folderPath.isEmpty()) {
67 appSettings.setValue(
"lastLibraryDir", folderPath);
76uniform sampler2D samp;
79 color = texture(samp, tc);
85layout(location = 0) in vec2 tc;
86layout(location = 0) out vec4 color;
87layout(set = 0, binding = 0) uniform sampler2D samp;
90 color = texture(samp, tc);
97 if (folderPath.isEmpty()) {
98 QMessageBox::warning(
this,
"Warning",
"Please select a folder.");
102 QMessageBox::StandardButton reply = QMessageBox::question(
this,
"Confirm", QString(
"Do you want to create a shader library in the folder: %1?").arg(folderPath), QMessageBox::Yes | QMessageBox::No);
104 if (reply == QMessageBox::Yes) {
106 if (!dir.mkpath(folderPath)) {
107 QMessageBox::critical(
this,
"Error",
"Failed to create the shader library directory.");
113 QFile file(QDir(folderPath).filePath(defaultName));
114 if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
115 QMessageBox::critical(
this,
"Error", QString(
"Failed to create %1: %2").arg(defaultName, file.errorString()));
118 QTextStream out(&file);
127 QMessageBox::information(
this,
"Success",
"Shader library created successfully.");
141 QMessageBox::critical(
this,
"Error", error);
148 QMessageBox::critical(
this,
"Error", error);
void onBrowseButtonClicked()
QLineEdit * folderPathEdit
QCheckBox * createDefaultShaderCheckBox
void onCancelButtonClicked()
QCheckBox * createJsonManifestCheckBox
QPushButton * cancelButton
QString getShaderPath()
Return folder chosen for shader-library indexing.
bool createShaderManifest(const QString &folderPath)
LibraryWindow(acmx2::Backend backend, QWidget *parent=nullptr)
QPushButton * browseButton
bool create_acmxvk_source_manifest(const QString &rootDirectory, const QString &outputPath, AcmxvkSourceManifestResult &result, QString &error)
Scan an ACMXVK source tree and atomically generate its library.json.
void applyCustomStyleIfEnabled(QWidget *widget)
bool create_shader_manifest(const QString &directory, ShaderManifestFormat format, const QStringList &shaders, QString &error)
Create a new manifest in the requested format.
Optional JSON and legacy text shader-library manifests.
const char * defaultAcmxvkFile
Dialog for generating a shader index from a selected folder.