diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/ArrayProperty.h b/libsave/include/SatisfactorySave/GameTypes/Properties/ArrayProperty.h index 2e4d64c4..e216a15a 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/ArrayProperty.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/ArrayProperty.h @@ -15,8 +15,8 @@ namespace SatisfactorySave { void accept(PropertyVisitor& v) override; - [[nodiscard]] const FName& arrayType() const { - return Tag.InnerType; + [[nodiscard]] inline FName& arrayType() { + return tag_.InnerType; } [[nodiscard]] const std::unique_ptr& array() const { diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/Base/Property.h b/libsave/include/SatisfactorySave/GameTypes/Properties/Base/Property.h index 24fdfaec..c99d7d5a 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/Base/Property.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/Base/Property.h @@ -16,6 +16,7 @@ namespace SatisfactorySave { public: static std::unique_ptr create(IStreamArchive& ar, const std::string& parentClassName); + explicit Property(FName type); explicit Property(PropertyTag tag); virtual ~Property() = default; @@ -25,10 +26,33 @@ namespace SatisfactorySave { Property(Property&&) = default; Property& operator=(Property&&) = default; + [[nodiscard]] inline FName& name() { + return tag_.Name; + } + + [[nodiscard]] inline const FName& type() const { + return tag_.Type; + } + + [[nodiscard]] inline int32_t& arrayIndex() { + return tag_.ArrayIndex; + } + + [[nodiscard]] inline uint8_t& hasPropertyGuid() { + return tag_.HasPropertyGuid; + } + + [[nodiscard]] inline FGuid& propertyGuid() { + return tag_.PropertyGuid; + } + virtual void serialize(Archive& ar) = 0; virtual void accept(PropertyVisitor& v) = 0; - PropertyTag Tag; + protected: + PropertyTag tag_; + + friend class PropertyList; }; } // namespace SatisfactorySave diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/Base/PropertyImpl.h b/libsave/include/SatisfactorySave/GameTypes/Properties/Base/PropertyImpl.h index 9c766b70..607171b8 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/Base/PropertyImpl.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/Base/PropertyImpl.h @@ -8,7 +8,8 @@ namespace SatisfactorySave { template class PropertyImpl : public Property { public: - using Property::Property; + PropertyImpl() : Property(FName(std::string(Impl::TypeName))) {} + explicit PropertyImpl(PropertyTag tag) : Property(std::move(tag)) {} void serialize(Archive& ar) override { ar << Value; diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/Base/PropertyList.h b/libsave/include/SatisfactorySave/GameTypes/Properties/Base/PropertyList.h index 70a634dc..e15ea0cf 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/Base/PropertyList.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/Base/PropertyList.h @@ -66,10 +66,10 @@ namespace SatisfactorySave { } template - inline const T& get(const std::string& name) const { + inline T& get(const std::string& name) const { for (const auto& p : properties_) { - if (p->Tag.Name == name) { - const T* property = dynamic_cast(p.get()); + if (p->name() == name) { + T* property = dynamic_cast(p.get()); if (property != nullptr) { return *property; } diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/BoolProperty.h b/libsave/include/SatisfactorySave/GameTypes/Properties/BoolProperty.h index 899261b6..405f5230 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/BoolProperty.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/BoolProperty.h @@ -14,8 +14,12 @@ namespace SatisfactorySave { void accept(PropertyVisitor& v) override; - [[nodiscard]] uint8_t value() const { - return Tag.BoolVal; + [[nodiscard]] inline bool getValue() const { + return !!tag_.BoolVal; + } + + inline void setValue(bool v) { + tag_.BoolVal = v ? 1 : 0; } }; } // namespace SatisfactorySave diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/ByteProperty.h b/libsave/include/SatisfactorySave/GameTypes/Properties/ByteProperty.h index 1f40ddcb..ad7dac3a 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/ByteProperty.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/ByteProperty.h @@ -16,8 +16,8 @@ namespace SatisfactorySave { void accept(PropertyVisitor& v) override; - [[nodiscard]] const FName& byteType() const { - return Tag.EnumName; + [[nodiscard]] inline FName& enumName() { + return tag_.EnumName; } [[nodiscard]] const FName& valueName() const { diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/EnumProperty.h b/libsave/include/SatisfactorySave/GameTypes/Properties/EnumProperty.h index 25a78e6b..f7c4de1c 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/EnumProperty.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/EnumProperty.h @@ -11,8 +11,8 @@ namespace SatisfactorySave { using PropertyImpl::PropertyImpl; - [[nodiscard]] const FName& enumType() const { - return Tag.EnumName; + [[nodiscard]] inline FName& enumName() { + return tag_.EnumName; } }; } // namespace SatisfactorySave diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/MapProperty.h b/libsave/include/SatisfactorySave/GameTypes/Properties/MapProperty.h index ff7ea1dd..af160b7e 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/MapProperty.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/MapProperty.h @@ -17,12 +17,12 @@ namespace SatisfactorySave { void accept(PropertyVisitor& v) override; - [[nodiscard]] const FName& keyType() const { - return Tag.InnerType; + [[nodiscard]] inline FName& keyType() { + return tag_.InnerType; } - [[nodiscard]] const FName& valueType() const { - return Tag.ValueType; + [[nodiscard]] inline FName& valueType() { + return tag_.ValueType; } [[nodiscard]] const std::unique_ptr& keys() const { diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/SetProperty.h b/libsave/include/SatisfactorySave/GameTypes/Properties/SetProperty.h index d1a84dbd..9ed0bf18 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/SetProperty.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/SetProperty.h @@ -15,8 +15,8 @@ namespace SatisfactorySave { void accept(PropertyVisitor& v) override; - [[nodiscard]] const FName& setType() const { - return Tag.InnerType; + [[nodiscard]] inline FName& setType() { + return tag_.InnerType; } [[nodiscard]] const std::unique_ptr& set() const { diff --git a/libsave/include/SatisfactorySave/GameTypes/Properties/StructProperty.h b/libsave/include/SatisfactorySave/GameTypes/Properties/StructProperty.h index 93e4756d..438f87d4 100644 --- a/libsave/include/SatisfactorySave/GameTypes/Properties/StructProperty.h +++ b/libsave/include/SatisfactorySave/GameTypes/Properties/StructProperty.h @@ -18,12 +18,12 @@ namespace SatisfactorySave { void accept(PropertyVisitor& v) override; - [[nodiscard]] const std::string& structName() const { - return Tag.StructName.Name; + [[nodiscard]] inline FName& structName() { + return tag_.StructName; } - [[nodiscard]] const FGuid& guid() const { - return Tag.StructGuid; + [[nodiscard]] inline FGuid& structGuid() { + return tag_.StructGuid; } [[nodiscard]] const std::unique_ptr& value() const { diff --git a/libsave/include/SatisfactorySave/GameTypes/UE/UObject/Name.h b/libsave/include/SatisfactorySave/GameTypes/UE/UObject/Name.h index 5c0b66b9..84398ddd 100644 --- a/libsave/include/SatisfactorySave/GameTypes/UE/UObject/Name.h +++ b/libsave/include/SatisfactorySave/GameTypes/UE/UObject/Name.h @@ -3,6 +3,7 @@ #include #include #include +#include #include "satisfactorysave_export.h" @@ -14,6 +15,9 @@ namespace SatisfactorySave { std::string Name; uint32_t Number = 0; + FName() = default; + explicit FName(std::string Name, uint32_t Number = 0) : Name(std::move(Name)), Number(Number) {} + FName& operator=(const std::string& s) { Name = s; Number = 0; diff --git a/libsave/src/GameTypes/Properties/ArrayProperty.cpp b/libsave/src/GameTypes/Properties/ArrayProperty.cpp index bc86a999..d951df19 100644 --- a/libsave/src/GameTypes/Properties/ArrayProperty.cpp +++ b/libsave/src/GameTypes/Properties/ArrayProperty.cpp @@ -4,7 +4,7 @@ void SatisfactorySave::ArrayProperty::serialize(SatisfactorySave::Archive& ar) { if (ar.isIArchive()) { - array_ = Array::create(Tag.InnerType, ar); + array_ = Array::create(arrayType(), ar); } else { ar << *array_; } diff --git a/libsave/src/GameTypes/Properties/Base/Property.cpp b/libsave/src/GameTypes/Properties/Base/Property.cpp index 21b857bd..bcf581d5 100644 --- a/libsave/src/GameTypes/Properties/Base/Property.cpp +++ b/libsave/src/GameTypes/Properties/Base/Property.cpp @@ -64,7 +64,7 @@ std::unique_ptr SatisfactorySave::Property::create(S } auto pos_before = ar.tell(); - ar.pushReadLimit(property->Tag.Size); + ar.pushReadLimit(property->tag_.Size); static int recursion_depth = 0; // Count recursion depth for better debug logging. recursion_depth++; try { @@ -72,7 +72,7 @@ std::unique_ptr SatisfactorySave::Property::create(S recursion_depth--; } catch (const std::exception& ex) { recursion_depth--; - PropertyTag tagCopy = property->Tag; + PropertyTag tagCopy = property->tag_; spdlog::error("Error parsing property {} (Type: {}, Class: {}) in recursion depth {}: {}", tagCopy.Name.toString(), tagCopy.Type.toString(), parentClassName, recursion_depth, ex.what()); @@ -92,12 +92,16 @@ std::unique_ptr SatisfactorySave::Property::create(S } ar.popReadLimit(); auto pos_after = ar.tell(); - if (pos_after - pos_before != property->Tag.Size) { + if (pos_after - pos_before != property->tag_.Size) { throw std::runtime_error( - std::string("Invalid Property size!\nName: ") + property->Tag.Name + "\nType: " + property->Tag.Type); + std::string("Invalid Property size!\nName: ") + property->tag_.Name + "\nType: " + property->tag_.Type); } return property; } -SatisfactorySave::Property::Property(SatisfactorySave::PropertyTag tag) : Tag(std::move(tag)) {} +SatisfactorySave::Property::Property(SatisfactorySave::FName type) { + tag_.Type = std::move(type); +} + +SatisfactorySave::Property::Property(SatisfactorySave::PropertyTag tag) : tag_(std::move(tag)) {} diff --git a/libsave/src/GameTypes/Properties/Base/PropertyList.cpp b/libsave/src/GameTypes/Properties/Base/PropertyList.cpp index e955ac86..2c9b1d53 100644 --- a/libsave/src/GameTypes/Properties/Base/PropertyList.cpp +++ b/libsave/src/GameTypes/Properties/Base/PropertyList.cpp @@ -20,7 +20,7 @@ void SatisfactorySave::PropertyList::serialize(SatisfactorySave::Archive& ar) { auto& outAr = dynamic_cast(ar); for (const auto& p : properties_) { - outAr << p->Tag; + outAr << p->tag_; auto pos_before = outAr.tell(); @@ -28,9 +28,9 @@ void SatisfactorySave::PropertyList::serialize(SatisfactorySave::Archive& ar) { auto pos_after = outAr.tell(); - p->Tag.Size = static_cast(pos_after - pos_before); - outAr.seek(p->Tag.SizeOffset); - outAr << p->Tag.Size; + p->tag_.Size = static_cast(pos_after - pos_before); + outAr.seek(p->tag_.SizeOffset); + outAr << p->tag_.Size; outAr.seek(pos_after); } // None property to terminate property list diff --git a/libsave/src/GameTypes/Properties/ByteProperty.cpp b/libsave/src/GameTypes/Properties/ByteProperty.cpp index dc25b792..2a9ff59b 100644 --- a/libsave/src/GameTypes/Properties/ByteProperty.cpp +++ b/libsave/src/GameTypes/Properties/ByteProperty.cpp @@ -3,7 +3,7 @@ #include "GameTypes/Properties/Base/PropertyVisitor.h" void SatisfactorySave::ByteProperty::serialize(Archive& ar) { - if (Tag.EnumName == "None") { + if (enumName() == "None") { ar << value_byte_; } else { ar << value_name_; diff --git a/libsave/src/GameTypes/Properties/MapProperty.cpp b/libsave/src/GameTypes/Properties/MapProperty.cpp index 00d1186e..865b73ff 100644 --- a/libsave/src/GameTypes/Properties/MapProperty.cpp +++ b/libsave/src/GameTypes/Properties/MapProperty.cpp @@ -24,8 +24,8 @@ void SatisfactorySave::MapProperty::serialize(Archive& ar) { auto count = inAr.read(); - keys_ = MapTypeList::create(Tag.InnerType, Tag.Name, parentClassName_, true); - values_ = MapTypeList::create(Tag.ValueType, Tag.Name, parentClassName_, false); + keys_ = MapTypeList::create(keyType(), name(), parentClassName_, true); + values_ = MapTypeList::create(valueType(), name(), parentClassName_, false); keys_->resize(count); values_->resize(count); diff --git a/libsave/src/GameTypes/Properties/SetProperty.cpp b/libsave/src/GameTypes/Properties/SetProperty.cpp index e430cba2..fd70aa95 100644 --- a/libsave/src/GameTypes/Properties/SetProperty.cpp +++ b/libsave/src/GameTypes/Properties/SetProperty.cpp @@ -17,7 +17,7 @@ void SatisfactorySave::SetProperty::serialize(Archive& ar) { } if (ar.isIArchive()) { - set_ = Set::create(Tag.InnerType, Tag.Name, parentClassName_, ar); + set_ = Set::create(setType(), name(), parentClassName_, ar); } else { ar << *set_; } diff --git a/libsave/src/GameTypes/Properties/StructProperty.cpp b/libsave/src/GameTypes/Properties/StructProperty.cpp index 6fa55cc8..e6aa261e 100644 --- a/libsave/src/GameTypes/Properties/StructProperty.cpp +++ b/libsave/src/GameTypes/Properties/StructProperty.cpp @@ -4,7 +4,7 @@ void SatisfactorySave::StructProperty::serialize(Archive& ar) { if (ar.isIArchive()) { - struct_ = Struct::create(Tag.StructName, ar); + struct_ = Struct::create(structName(), ar); } else { ar << *struct_; } diff --git a/libsave/src/GameTypes/Properties/UnknownProperty.cpp b/libsave/src/GameTypes/Properties/UnknownProperty.cpp index f86e1b09..41b89698 100644 --- a/libsave/src/GameTypes/Properties/UnknownProperty.cpp +++ b/libsave/src/GameTypes/Properties/UnknownProperty.cpp @@ -3,8 +3,8 @@ #include "GameTypes/Properties/Base/PropertyVisitor.h" void SatisfactorySave::UnknownProperty::serialize(Archive& ar) { - value_.resize(Tag.Size); - ar.serializeRaw(value_.data(), Tag.Size); + value_.resize(tag_.Size); + ar.serializeRaw(value_.data(), tag_.Size); } void SatisfactorySave::UnknownProperty::accept(SatisfactorySave::PropertyVisitor& v) { diff --git a/libsave/src/Utils/SaveTextExporter.cpp b/libsave/src/Utils/SaveTextExporter.cpp index deeba6aa..e5bd5306 100644 --- a/libsave/src/Utils/SaveTextExporter.cpp +++ b/libsave/src/Utils/SaveTextExporter.cpp @@ -20,12 +20,12 @@ namespace { } void visit(SatisfactorySave::BoolProperty& p) override { - file_ << " " << static_cast(p.value()); + file_ << " " << static_cast(p.getValue()); } void visit(SatisfactorySave::ByteProperty& p) override { - file_ << " ByteType: " << p.byteType() << " "; - if (p.byteType() == "None") { + file_ << " ByteType: " << p.enumName() << " "; + if (p.enumName() == "None") { file_ << static_cast(p.valueByte()); } else { file_ << p.valueName(); @@ -37,7 +37,7 @@ namespace { } void visit(SatisfactorySave::EnumProperty& p) override { - file_ << " EnumType: " << p.enumType() << " " << p.Value; + file_ << " EnumType: " << p.enumName() << " " << p.Value; } void visit(SatisfactorySave::FloatProperty& p) override { @@ -88,7 +88,7 @@ namespace { } void visit(SatisfactorySave::StructProperty& p) override { - file_ << " " << p.structName() << " " << p.guid().toString(); + file_ << " " << p.structName() << " " << p.structGuid().toString(); // TODO values } @@ -105,7 +105,7 @@ namespace { } void visit(SatisfactorySave::UnknownProperty& p) override { - file_ << " [UnknownProperty] " << p.Tag.Type; + file_ << " [UnknownProperty] " << p.type(); } }; @@ -119,7 +119,7 @@ namespace { << std::endl; for (const auto& p : obj->Properties) { - file << " " << p->Tag.Name << " " << p->Tag.Type; + file << " " << p->name() << " " << p->type(); PropertyValueWriter w(file); p->accept(w); file << std::endl; diff --git a/libsavepy/GameTypes/Properties.cpp b/libsavepy/GameTypes/Properties.cpp index 6f4987e0..15c61577 100644 --- a/libsavepy/GameTypes/Properties.cpp +++ b/libsavepy/GameTypes/Properties.cpp @@ -42,8 +42,20 @@ void init_GameTypes_Properties(py::module_& m) { .def_readwrite("PropertyGuid", &s::PropertyTag::PropertyGuid); py::class_(m, "Property") - .def(py::init()) - .def_readwrite("Tag", &s::Property::Tag); + .def_property("Name", + [](PyProperty& p) -> const s::FName& { return p.name(); }, + [](PyProperty& p, const s::FName& v) { p.name() = v; }) + .def_property_readonly("Type", + [](PyProperty& p) -> const s::FName& { return p.type(); }) + .def_property("ArrayIndex", + [](PyProperty& p) -> int32_t { return p.arrayIndex(); }, + [](PyProperty& p, int32_t v) { p.arrayIndex() = v; }) + .def_property("HasPropertyGuid", + [](PyProperty& p) -> uint8_t { return p.hasPropertyGuid(); }, + [](PyProperty& p, uint8_t v) { p.hasPropertyGuid() = v; }) + .def_property("PropertyGuid", + [](PyProperty& p) -> const s::FGuid& { return p.propertyGuid(); }, + [](PyProperty& p, const s::FGuid& v) { p.propertyGuid() = v; }); py::class_(m, "PropertyList") //.def("properties", &s::PropertyList::properties) // TODO @@ -58,37 +70,37 @@ void init_GameTypes_Properties(py::module_& m) { py::class_(m, "BoolProperty") .def(py::init()) - .def("value", &s::BoolProperty::value); + .def_property("Value", &s::BoolProperty::getValue, &s::BoolProperty::setValue); py::class_(m, "ByteProperty") .def(py::init()) - .def("byteType", &s::ByteProperty::byteType) + .def("enumName", &s::ByteProperty::enumName) .def("valueName", &s::ByteProperty::valueName) .def("valueByte", &s::ByteProperty::valueByte); py::class_(m, "DoubleProperty") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::DoubleProperty::Value); py::class_(m, "EnumProperty") .def(py::init()) .def_readwrite("Value", &s::EnumProperty::Value) - .def("enumType", &s::EnumProperty::enumType); + .def("enumName", &s::EnumProperty::enumName); py::class_(m, "FloatProperty") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::FloatProperty::Value); py::class_(m, "Int8Property") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::Int8Property::Value); py::class_(m, "Int64Property") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::Int64Property::Value); py::class_(m, "IntProperty") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::IntProperty::Value); py::class_(m, "MapProperty") @@ -105,11 +117,11 @@ void init_GameTypes_Properties(py::module_& m) { ; py::class_(m, "NameProperty") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::NameProperty::Value); py::class_(m, "ObjectProperty") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::ObjectProperty::Value); py::class_(m, "SetProperty") @@ -123,7 +135,7 @@ void init_GameTypes_Properties(py::module_& m) { ; py::class_(m, "StrProperty") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::StrProperty::Value); py::class_(m, "StructProperty") @@ -132,15 +144,15 @@ void init_GameTypes_Properties(py::module_& m) { ; py::class_(m, "TextProperty") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::TextProperty::Value); py::class_(m, "UInt32Property") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::UInt32Property::Value); py::class_(m, "UInt64Property") - .def(py::init()) + .def(py::init<>()) .def_readwrite("Value", &s::UInt64Property::Value); py::class_(m, "UnknownProperty") diff --git a/map/src/MapWindow/DataView/SplineData.cpp b/map/src/MapWindow/DataView/SplineData.cpp index b9fae1c4..47aac841 100644 --- a/map/src/MapWindow/DataView/SplineData.cpp +++ b/map/src/MapWindow/DataView/SplineData.cpp @@ -17,7 +17,7 @@ namespace { SatisfactorySave::ArrayProperty& getSplineDataProperty(const SatisfactorySave::PropertyList& properties) { for (const auto& p : properties) { - if (p->Tag.Name == "mSplineData" && p->Tag.Type == SatisfactorySave::ArrayProperty::TypeName) { + if (p->name() == "mSplineData" && p->type() == SatisfactorySave::ArrayProperty::TypeName) { return dynamic_cast(*p); } } diff --git a/map/src/MapWindow/UI/PropertyTableGuiRenderer.cpp b/map/src/MapWindow/UI/PropertyTableGuiRenderer.cpp index f4948f01..987f0ca9 100644 --- a/map/src/MapWindow/UI/PropertyTableGuiRenderer.cpp +++ b/map/src/MapWindow/UI/PropertyTableGuiRenderer.cpp @@ -364,12 +364,12 @@ namespace { } void visit(SatisfactorySave::BoolProperty& p) override { - ImGui::Text("%i", p.value()); + ImGui::Text("%i", p.getValue()); } void visit(SatisfactorySave::ByteProperty& p) override { - ImGui::TextDisabled("ByteType: %s", p.byteType().toString().c_str()); - if (p.byteType() == "None") { + ImGui::TextDisabled("EnumName: %s", p.enumName().toString().c_str()); + if (p.enumName() == "None") { ImGui::Text("%i", p.valueByte()); } else { ImGui::Text("%s", p.valueName().toString().c_str()); @@ -381,7 +381,7 @@ namespace { } void visit(SatisfactorySave::EnumProperty& p) override { - ImGui::TextDisabled("EnumType: %s", p.enumType().toString().c_str()); + ImGui::TextDisabled("EnumType: %s", p.enumName().toString().c_str()); ImGui::Text("%s", p.Value.toString().c_str()); } @@ -476,8 +476,8 @@ namespace { void visit(SatisfactorySave::StructProperty& p) override { ImGui::TextDisabled("StructName:"); ImGui::SameLine(); - ImGui::Text("%s", p.structName().c_str()); - ImGui::TextDisabled("%s", p.guid().toString().c_str()); + ImGui::Text("%s", p.structName().toString().c_str()); + ImGui::TextDisabled("%s", p.structGuid().toString().c_str()); StructValueGuiRenderer s(callback_); p.value()->accept(s); } @@ -495,8 +495,8 @@ namespace { } void visit(SatisfactorySave::UnknownProperty& p) override { - ImGui::Text("[UnknownProperty] %s, size: %zu", p.Tag.Type.toString().c_str(), p.value().size()); - if (ImGui::SmallButton(("Copy Hex##" + p.Tag.Name.toString()).c_str())) { + ImGui::Text("[UnknownProperty] %s, size: %zu", p.type().toString().c_str(), p.value().size()); + if (ImGui::SmallButton(("Copy Hex##" + p.name().toString()).c_str())) { std::stringstream stream; for (const auto& c : p.value()) { stream << std::setfill('0') << std::setw(2) << std::hex @@ -518,8 +518,8 @@ void Satisfactory3DMap::PropertyTableGuiRenderer::renderGui(const SatisfactorySa for (const auto& p : properties) { ImGui::TableNextRow(); ImGui::TableNextColumn(); - ImGui::Text("%s", p->Tag.Name.toString().c_str()); - ImGui::TextDisabled("%s", p->Tag.Type.toString().c_str()); + ImGui::Text("%s", p->name().toString().c_str()); + ImGui::TextDisabled("%s", p->type().toString().c_str()); ImGui::TableNextColumn(); PropertyValueGuiRenderer r(callback); p->accept(r);