Compare commits

..

11 commits

Author SHA1 Message Date
2ec415f2b5 CMakeLists: we're working on 1.5 now. 2022-12-13 21:15:06 +01:00
274d8ce014 CMakeLists: change how defines are handled. 2022-12-13 21:11:54 +01:00
267226a386 Profile,SaveTool: change how materials are handled. 2022-12-13 21:11:54 +01:00
d21e2cbabb SaveTool: update a TextUnformatted() call. 2022-12-13 21:11:54 +01:00
457bb5e89f Update coding style.
Magnum's type names are fine, but I'd rather limit what depends on
Magnum as much as possible. Vector types are still allowed, though. No
way I'll write my own.
2022-12-13 21:11:54 +01:00
5144121812 Match the new coding style I use. 2022-12-13 21:11:53 +01:00
cf69d3396f Configuration: add missing licence text. 2022-12-13 21:11:53 +01:00
3403feb668 SaveTool: move the configuration to its own class. 2022-12-13 21:11:53 +01:00
6450572f97 SaveTool: add a wrapper over ImGui::Checkbox().
This way, I can make it work like radio buttons or selectables.
2022-12-13 21:11:53 +01:00
81b35476a0 CMakeLists: bump version number. 2022-12-13 21:08:30 +01:00
b909f0ac13 Profile: fix bug in material saving when array doesn't exist. 2022-12-13 21:03:43 +01:00

View file

@ -264,6 +264,7 @@ Profile::setMaterial(MaterialID id, std::int32_t amount) {
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});
} }
@ -277,6 +278,9 @@ Profile::setMaterial(MaterialID id, std::int32_t amount) {
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("ResourceMaterial");
}
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));