Compare commits
4 commits
0c4ef35ac7
...
9d72d7f47a
Author | SHA1 | Date | |
---|---|---|---|
9d72d7f47a | |||
6d733e82d4 | |||
0ca65b1306 | |||
c7b9e873ee |
8 changed files with 25 additions and 2 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);
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@ std::shared_ptr<DataModel> DataModel::LoadFromFile(std::string path) {
|
|||
newModel->services[className] = std::dynamic_pointer_cast<Service>(service);
|
||||
}
|
||||
|
||||
newModel->currentFile = path;
|
||||
newModel->Init();
|
||||
|
||||
return newModel;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -162,6 +162,7 @@ static int g_print(lua_State* L) {
|
|||
const char* str = lua_tostring(L, -1); // convert result into c-string
|
||||
lua_pop(L, 1); // pop result
|
||||
|
||||
if (i > 1) buf += '\t';
|
||||
buf += str;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "panic.h"
|
||||
|
||||
// GNU/Linux implementation
|
||||
#if defined(_POSIX_VERSION) || defined(__linux) || defined(__linux__)
|
||||
#if defined(_POSIX_VERSION) || defined(__linux) || defined(__linux__) || defined(__unix__)
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
|
|
@ -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.....
|
||||
|
|
|
@ -125,7 +125,7 @@ ScriptDocument::ScriptDocument(std::shared_ptr<Script> script, QWidget* parent):
|
|||
|
||||
QFrame* frame = new QFrame;
|
||||
QVBoxLayout* frameLayout = new QVBoxLayout;
|
||||
frameLayout->setMargin(0);
|
||||
frameLayout->setContentsMargins({0, 0, 0, 0});
|
||||
frame->setLayout(frameLayout);
|
||||
scintilla = new QsciScintilla(this);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue