92 constexpr const char* kPopupId =
"##new_project_dialog";
94 ImGui::OpenPopup(kPopupId);
98 ImGui::SetNextWindowSize(ImVec2(560, 0), ImGuiCond_Appearing);
99 if (!ImGui::BeginPopupModal(kPopupId,
nullptr,
100 ImGuiWindowFlags_AlwaysAutoResize |
101 ImGuiWindowFlags_NoSavedSettings)) {
113 "Pick a template, point at the ROM it should build on, and give the "
114 "project a name. The project file will be saved in your configured "
121 ImGui::TextUnformatted(
"Template");
123 ImGui::SetNextItemWidth(-1);
124 if (ImGui::BeginCombo(
"##template_combo", combo_preview)) {
125 for (
int i = 0; i < kTemplateCount; ++i) {
127 const std::string label =
128 absl::StrFormat(
"%s %s", kTemplates[i].icon, kTemplates[i].name);
129 if (ImGui::Selectable(label.c_str(), selected)) {
133 ImGui::SetItemDefaultFocus();
144 ImGui::TextWrapped(
"%s Effect: %s",
ICON_MD_EDIT, tmpl.what_changes);
145 const char* skill_tag = tmpl.skill_level == 1 ?
"Beginner"
146 : tmpl.skill_level == 2 ?
"Intermediate"
148 ImGui::TextWrapped(
"%s Skill: %s",
ICON_MD_INFO, skill_tag);
154 ImGui::TextUnformatted(
"Source ROM");
155 const float browse_width = ImGui::CalcTextSize(
" Browse…").x +
157 ImGui::GetStyle().FramePadding.x * 2.0f + 8.0f;
158 ImGui::SetNextItemWidth(-browse_width - ImGui::GetStyle().ItemSpacing.x);
164 if (!picked.empty()) {
174 ImGui::TextUnformatted(
"Project name");
175 ImGui::SetNextItemWidth(-1);
181 "Used as the project display name and to derive the project filename. "
182 "Spaces are replaced with underscores.");
192 const bool rom_valid = !rom_path.empty() && std::filesystem::exists(rom_path);
193 const bool name_valid = !project_name.empty();
194 const bool can_create = rom_valid && name_valid;
197 ImGui::BeginDisabled();
203 ImGui::CloseCurrentPopup();
209 ImGui::EndDisabled();
212 if (ImGui::Button(
ICON_MD_CLOSE " Cancel", ImVec2(100, 0)) ||
213 ImGui::IsKeyPressed(ImGuiKey_Escape,
false)) {
214 ImGui::CloseCurrentPopup();
226 if (!rom_valid && rom_path.empty()) {
228 }
else if (!rom_valid) {
230 }
else if (!name_valid) {