From b16a562aeb0ab46ac0a109a1ee8f9d93976a9f9e Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Wed, 11 Oct 2023 18:16:46 +0400 Subject: [PATCH] default author name --- src/engine/engine.cpp | 1 + src/gui/gui.h | 4 +++- src/gui/settings.cpp | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index b9209b9651..1467377c18 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -545,6 +545,7 @@ void DivEngine::initSongWithDesc(const char* description, bool inBase64, bool ol // extra attributes song.subsong[0]->hz=c.getDouble("tickRate",60.0); + song.author=getConfString("defaultAuthorName",""); } void DivEngine::createNew(const char* description, String sysName, bool inBase64) { diff --git a/src/gui/gui.h b/src/gui/gui.h index ccb81d4005..1f8af7497a 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1618,6 +1618,7 @@ class FurnaceGUI { String emptyLabel; String emptyLabel2; String sdlAudioDriver; + String defaultAuthorName; DivConfig initialSys; Settings(): @@ -1800,7 +1801,8 @@ class FurnaceGUI { macroRelLabel("REL"), emptyLabel("..."), emptyLabel2(".."), - sdlAudioDriver("") {} + sdlAudioDriver(""), + defaultAuthorName("") {} } settings; struct Tutorial { diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 0195c109c5..7325fb6144 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -438,6 +438,7 @@ void FurnaceGUI::drawSettings() { ImGui::SetTooltip("it is a bad idea to set this number higher than your CPU core count (%d)!",cpuCores); } } + if (ImGui::InputText("Default author name", &settings.defaultAuthorName)) settingsChanged=true; popWarningColor(); // SUBSECTION FILE @@ -3648,6 +3649,7 @@ void FurnaceGUI::syncSettings() { settings.showPool=e->getConfInt("showPool",0); settings.writeInsNames=e->getConfInt("writeInsNames",1); settings.readInsNames=e->getConfInt("readInsNames",1); + settings.defaultAuthorName=e->getConfString("defaultAuthorName",""); clampSetting(settings.mainFontSize,2,96); clampSetting(settings.headFontSize,2,96); @@ -4066,6 +4068,7 @@ void FurnaceGUI::commitSettings() { e->setConf("showPool",settings.showPool); e->setConf("writeInsNames",settings.writeInsNames); e->setConf("readInsNames",settings.readInsNames); + e->setConf("defaultAuthorName",settings.defaultAuthorName); // colors for (int i=0; i