169{
170 ImGui::Checkbox(("Enabled##GMSK" + uid).c_str(), &enabled);
171
172 if (ImGui::BeginCombo("Masking Mode##GMSK", generator_mask_type_names[type]))
173 {
174 for (int n = 0; n < IM_ARRAYSIZE(generator_mask_type_names); n++)
175 {
176 bool is_selected = (type == n);
177
178 if (ImGui::Selectable(generator_mask_type_names[n], is_selected))
179 {
180 type = (GeneratorMaskType)n;
181 }
182
183 if (is_selected)
184 {
185 ImGui::SetItemDefaultFocus();
186 }
187 }
188
189 ImGui::EndCombo();
190 }
191
192 for(int i=0; i<masks.size(); i++)
193 {
194 if(ImGui::CollapsingHeader(("Custom Base Mask Layer " + std::to_string(i) + "##GMSK" + uid).c_str()))
195 {
196 if(masks[i].type == MASK_LAYER_HILL)
197 {
198 ShowHillMaskSettingS(&masks[i], uid + std::to_string(i));
199 }
200
201 else if(masks[i].type == MASK_LAYER_CRATOR)
202 {
203 ShowCratorMaskSettingS(&masks[i], uid + std::to_string(i));
204 }
205
206 else if(masks[i].type == MASK_LAYER_CLIFF)
207 {
208 ShowCliffMaskSettingS(&masks[i], uid + std::to_string(i));
209 }
210
211 if(ImGui::Button(("Delete##GMSK" + std::to_string(i) + uid).c_str()))
212 {
213 while(appState->states.remeshing);
214
215 masks.erase(masks.begin() + i);
216 break;
217 }
218 }
219
220 ImGui::Separator();
221 }
222
223 if(ImGui::Button(("Add##GMSK" + uid).c_str()))
224 {
225 ImGui::OpenPopup(("AddMaskLayer##GMSK" + uid).c_str());
226 }
227
228 if(ImGui::BeginPopup(("AddMaskLayer##GMSK" + uid).c_str()))
229 {
230 if(ImGui::Button(("Hill##GMSK" + uid).c_str()))
231 {
233 masks.back().type = MASK_LAYER_HILL;
234 masks.back().d1[0] = masks.back().d1[1] = masks.back().d1[2] = 1.0f;
235 gmcount++;
236 ImGui::CloseCurrentPopup();
237 }
238
239 if(ImGui::Button(("Crater##GMSK" + uid).c_str()))
240 {
242 masks.back().type = MASK_LAYER_CRATOR;
243 masks.back().d1[0] = masks.back().d3[0] = masks.back().d3[1] = 1.0f;
244 gmcount++;
245 ImGui::CloseCurrentPopup();
246 }
247
248 if(ImGui::Button(("Cliff##GMSK" + uid).c_str()))
249 {
251 masks.back().type = MASK_LAYER_CLIFF;
252 masks.back().d1[2] = masks.back().d1[1] = 1.0f;
253 gmcount++;
254 ImGui::CloseCurrentPopup();
255 }
256
257 ImGui::EndPopup();
258 }
259}