fix(misc): more compatibility changes
This commit is contained in:
parent
c7b9e873ee
commit
0ca65b1306
4 changed files with 21 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "logger.h"
|
||||
#include "panic.h"
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
|
@ -182,10 +183,12 @@ void Instance::OnWorkspaceRemoved(std::shared_ptr<Workspace> oldWorkspace) {
|
|||
// Properties
|
||||
|
||||
result<Variant, MemberNotFound> Instance::GetPropertyValue(std::string name) {
|
||||
name[0] = toupper(name[0]); // Ignore case of first character
|
||||
return InternalGetPropertyValue(name);
|
||||
}
|
||||
|
||||
fallible<MemberNotFound, AssignToReadOnlyMember> Instance::SetPropertyValue(std::string name, Variant value, bool sendUpdateEvent) {
|
||||
name[0] = toupper(name[0]); // Ignore case of first character
|
||||
auto result = InternalSetPropertyValue(name, value);
|
||||
if (result.isSuccess() && sendUpdateEvent) {
|
||||
InternalUpdateProperty(name);
|
||||
|
@ -195,6 +198,7 @@ fallible<MemberNotFound, AssignToReadOnlyMember> Instance::SetPropertyValue(std:
|
|||
}
|
||||
|
||||
result<PropertyMeta, MemberNotFound> Instance::GetPropertyMeta(std::string name) {
|
||||
name[0] = toupper(name[0]); // Ignore case of first character
|
||||
return InternalGetPropertyMeta(name);
|
||||
}
|
||||
|
||||
|
@ -272,6 +276,15 @@ void Instance::Serialize(pugi::xml_node parent, RefStateSerialize state) {
|
|||
PropertyMeta meta = GetPropertyMeta(name).expect("Meta of declared property is missing");
|
||||
if (meta.flags & (PROP_NOSAVE | PROP_READONLY)) continue; // This property should not be serialized. Skip...
|
||||
|
||||
#if 1
|
||||
// Special consideration for Part.Size
|
||||
// It should be serialized as "size" to be compatible with rbxl files
|
||||
// This is optional, as they can still be opened otherwise, but I opted
|
||||
// to keep this enabled
|
||||
if (IsA("Part") && name == "Size")
|
||||
name = "size";
|
||||
#endif
|
||||
|
||||
pugi::xml_node propertyNode = propertiesNode.append_child(meta.type.descriptor->name);
|
||||
propertyNode.append_attribute("name").set_value(name);
|
||||
|
||||
|
|
|
@ -58,6 +58,8 @@ public:
|
|||
CFrame cframe;
|
||||
|
||||
DEF_PROP_CATEGORY(PART)
|
||||
// Special compatibility changes for this property were made in
|
||||
// Instance::Serialize
|
||||
DEF_PROP_(on_update=onUpdated) Vector3 size;
|
||||
|
||||
DEF_PROP_CATEGORY(APPEARANCE)
|
||||
|
|
|
@ -32,6 +32,9 @@ void Script::Run() {
|
|||
|
||||
// Initialize script globals
|
||||
lua_getglobal(Lt, "_G");
|
||||
|
||||
InstanceRef(shared_from_this()).PushLuaValue(Lt);
|
||||
lua_setfield(Lt, -2, "script");
|
||||
|
||||
InstanceRef(dataModel().value()).PushLuaValue(Lt);
|
||||
lua_setfield(Lt, -2, "game");
|
||||
|
|
|
@ -270,6 +270,9 @@ static CFrame XYZToZXY(glm::vec3(0, 0, 0), -glm::vec3(1, 0, 0), glm::vec3(0, 0,
|
|||
void renderHandles() {
|
||||
if (!editorToolHandles.active) return;
|
||||
|
||||
auto assembly = PartAssembly::FromSelection();
|
||||
if (assembly.bounds() == Vector3::ZERO) return;
|
||||
|
||||
glDepthMask(GL_TRUE);
|
||||
glCullFace(GL_BACK);
|
||||
glFrontFace(GL_CCW); // This is right... Probably.....
|
||||
|
|
Loading…
Add table
Reference in a new issue