GUI: prepare to improve pattern manager

This commit is contained in:
tildearrow 2024-02-21 18:05:39 -05:00
parent b972e54a7e
commit aae9aad4f6
3 changed files with 25 additions and 1 deletions

View file

@ -57,6 +57,12 @@ void DivSubSong::rearrangePatterns() {
}
}
void DivSubSong::sortOrders() {
}
void DivSubSong::makePatUnique() {
}
void DivSong::clearSongData() {
for (DivSubSong* i: subsong) {
i->clearData();

View file

@ -175,6 +175,8 @@ struct DivSubSong {
void clearData();
void optimizePatterns();
void rearrangePatterns();
void sortOrders();
void makePatUnique();
DivSubSong():
hilightA(4),

View file

@ -33,7 +33,9 @@ void FurnaceGUI::drawPatManager() {
unsigned char isUsed[DIV_MAX_PATTERNS];
bool isNull[DIV_MAX_PATTERNS];
if (ImGui::Begin("Pattern Manager",&patManagerOpen,globalWinFlags)) {
ImGui::Text("Global Tasks");
ImGui::Text("Global Tasks:");
ImGui::SameLine();
if (ImGui::Button("De-duplicate patterns")) {
e->lockEngine([this]() {
@ -48,6 +50,20 @@ void FurnaceGUI::drawPatManager() {
});
MARK_MODIFIED;
}
ImGui::SameLine();
if (ImGui::Button("Sort orders")) {
e->lockEngine([this]() {
e->curSubSong->sortOrders();
});
MARK_MODIFIED;
}
ImGui::SameLine();
if (ImGui::Button("Make patterns unique")) {
e->lockEngine([this]() {
e->curSubSong->makePatUnique();
});
MARK_MODIFIED;
}
if (ImGui::BeginTable("PatManTable",257,ImGuiTableFlags_ScrollX|ImGuiTableFlags_SizingFixedFit)) {
ImGui::PushFont(patFont);