VGM export: include song comments

also show song comments on mobile
This commit is contained in:
tildearrow 2024-08-23 17:46:09 -05:00
parent d0f3e0fa58
commit 99ae6a2b38
4 changed files with 18 additions and 8 deletions

View file

@ -2679,7 +2679,8 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
w->writeWString(ws,false); // japanese author name
w->writeS(0); // date
w->writeWString(L"Furnace (chiptune tracker)",false); // ripper
w->writeS(0); // notes
ws=utf8To16(song.notes.c_str());
w->writeWString(ws,false); // notes
int gd3Len=w->tell()-gd3Off-12;

View file

@ -508,7 +508,7 @@ void FurnaceGUI::drawMobileControls() {
mobileMenuOpen=false;
doAction(GUI_ACTION_SAVE_AS);
}
ImGui::SameLine();
if (ImGui::Button(_("Export"))) {
doAction(GUI_ACTION_EXPORT);
}
@ -533,6 +533,10 @@ void FurnaceGUI::drawMobileControls() {
drawSpeed(true);
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem(_("Comments"))) {
drawNotes(true);
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
break;

View file

@ -2832,7 +2832,7 @@ class FurnaceGUI {
void drawMemory();
void drawCompatFlags();
void drawPiano();
void drawNotes();
void drawNotes(bool asChild=false);
void drawChannels();
void drawPatManager();
void drawSysManager();

View file

@ -22,18 +22,23 @@
// NOTE: please don't ask me to enable text wrap.
// Dear ImGui doesn't have that feature. D:
void FurnaceGUI::drawNotes() {
void FurnaceGUI::drawNotes(bool asChild) {
if (nextWindow==GUI_WINDOW_NOTES) {
notesOpen=true;
ImGui::SetNextWindowFocus();
nextWindow=GUI_WINDOW_NOTHING;
}
if (!notesOpen) return;
if (ImGui::Begin("Song Comments",&notesOpen,globalWinFlags,_("Song Comments"))) {
if (!notesOpen && !asChild) return;
bool began=asChild?ImGui::BeginChild("Song Info##Song Information"):ImGui::Begin("Song Comments",&notesOpen,globalWinFlags,_("Song Comments"));
if (began) {
if (ImGui::InputTextMultiline("##SongNotes",&e->song.notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo)) {
MARK_MODIFIED;
}
}
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_NOTES;
if (!asChild && ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_NOTES;
if (asChild) {
ImGui::EndChild();
} else {
ImGui::End();
}
}