Compare commits

...

6 Commits

6 changed files with 12 additions and 8 deletions

View File

@ -18,7 +18,7 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
set(SAVETOOL_PROJECT_VERSION 1.4.1) set(SAVETOOL_PROJECT_VERSION 1.4.3)
find_package(Corrade REQUIRED Main Containers Utility) find_package(Corrade REQUIRED Main Containers Utility)
find_package(Magnum REQUIRED GL Sdl2Application) find_package(Magnum REQUIRED GL Sdl2Application)

View File

@ -458,6 +458,7 @@ auto Profile::setResource(Containers::StringView container, MaterialID id, Int a
if(!mats_prop) { if(!mats_prop) {
mats_prop = new ArrayProperty; mats_prop = new ArrayProperty;
mats_prop->name.emplace(container); mats_prop->name.emplace(container);
mats_prop->itemType = "StructProperty";
_profile.appendProperty(ArrayProperty::ptr{mats_prop}); _profile.appendProperty(ArrayProperty::ptr{mats_prop});
} }
@ -471,6 +472,9 @@ auto Profile::setResource(Containers::StringView container, MaterialID id, Int a
ResourceItemValue* res_prop; ResourceItemValue* res_prop;
if(it == mats_prop->items.end()) { if(it == mats_prop->items.end()) {
res_prop = new ResourceItemValue; res_prop = new ResourceItemValue;
if(mats_prop->items.isEmpty()) {
res_prop->name.emplace(container);
}
res_prop->id = id; res_prop->id = id;
ResourceItemValue::ptr prop{res_prop}; ResourceItemValue::ptr prop{res_prop};
arrayAppend(mats_prop->items, std::move(prop)); arrayAppend(mats_prop->items, std::move(prop));

View File

@ -51,7 +51,7 @@ SaveTool::SaveTool(const Arguments& arguments):
.setSize({960, 720})} .setSize({960, 720})}
{ {
#ifdef SAVETOOL_DEBUG_BUILD #ifdef SAVETOOL_DEBUG_BUILD
tweak.enable(""_s, "../../"_s); tweak.enable("", "../../");
#endif #endif
LOG_INFO("Configuring OpenGL renderer."); LOG_INFO("Configuring OpenGL renderer.");

View File

@ -48,7 +48,7 @@ void SaveTool::handleFileAction(efsw::WatchID watch_id,
return; return;
} // TODO: actually do something when config files will finally be handled } // TODO: actually do something when config files will finally be handled
if(!Utility::String::endsWith(filename, _currentProfile->account() + ".sav")) { if(!Utility::String::endsWith(filename, Utility::format("Profile{}.sav", _currentProfile->account()).data())) {
return; return;
} }
@ -61,7 +61,8 @@ void SaveTool::handleFileAction(efsw::WatchID watch_id,
} }
void SaveTool::fileUpdateEvent(SDL_Event& event) { void SaveTool::fileUpdateEvent(SDL_Event& event) {
Containers::String filename{static_cast<char*>(event.user.data1), std::strlen(static_cast<char*>(event.user.data1)), nullptr}; Containers::String filename{static_cast<char*>(event.user.data1),
std::strlen(static_cast<char*>(event.user.data1)), nullptr};
if((event.user.code & StagedUpdate) == StagedUpdate) { if((event.user.code & StagedUpdate) == StagedUpdate) {
_massManager->refreshStagedMass(filename); _massManager->refreshStagedMass(filename);

View File

@ -19,12 +19,11 @@
#include <Magnum/ImGuiIntegration/Integration.h> #include <Magnum/ImGuiIntegration/Integration.h>
#include "../FontAwesome/IconsFontAwesome5.h"
#include "../Maps/Accessories.h" #include "../Maps/Accessories.h"
#define STYLENAMES_DEFINITION #define STYLENAMES_DEFINITION
#include "../Maps/StyleNames.h" #include "../Maps/StyleNames.h"
#include "../FontAwesome/IconsFontAwesome5.h"
#include "SaveTool.h" #include "SaveTool.h"
void SaveTool::drawMassViewer() { void SaveTool::drawMassViewer() {

View File

@ -14,13 +14,13 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "SaveTool.h"
#include <Corrade/Utility/Path.h> #include <Corrade/Utility/Path.h>
#include "../FontAwesome/IconsFontAwesome5.h" #include "../FontAwesome/IconsFontAwesome5.h"
#include "../FontAwesome/IconsFontAwesome5Brands.h" #include "../FontAwesome/IconsFontAwesome5Brands.h"
#include "SaveTool.h"
void SaveTool::drawMainMenu() { void SaveTool::drawMainMenu() {
if(ImGui::BeginMainMenuBar()) { if(ImGui::BeginMainMenuBar()) {
if(ImGui::BeginMenu("Save Tool##SaveToolMenu")) { if(ImGui::BeginMenu("Save Tool##SaveToolMenu")) {