mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
MTROPOLIS: Add width/height read attribs, fix up some error messages
This commit is contained in:
parent
5e9f44d731
commit
d966b988b7
@ -1261,13 +1261,13 @@ MiniscriptInstructionOutcome GetChild::execute(MiniscriptThread *thread) const {
|
||||
if (indexableValueSlot.value.getType() == DynamicValueTypes::kObject) {
|
||||
Common::SharedPtr<RuntimeObject> obj = indexableValueSlot.value.getObject().object.lock();
|
||||
if (!obj) {
|
||||
thread->error("Tried to read '" + attrib + "' to an invalid object reference");
|
||||
thread->error("Tried to indirect '" + attrib + "' using an invalid object reference");
|
||||
return kMiniscriptInstructionOutcomeFailed;
|
||||
}
|
||||
|
||||
DynamicValueWriteProxy writeProxy;
|
||||
if (!obj->writeRefAttribute(thread, writeProxy, attrib)) {
|
||||
thread->error("Failed to read attribute '" + attrib + "'");
|
||||
thread->error("Failed to get a writeable reference to attribute '" + attrib + "'");
|
||||
return kMiniscriptInstructionOutcomeFailed;
|
||||
}
|
||||
|
||||
|
@ -4330,6 +4330,12 @@ bool VisualElement::readAttribute(MiniscriptThread *thread, DynamicValue &result
|
||||
} else if (attrib == "position") {
|
||||
result.setPoint(Point16::create(_rect.left, _rect.top));
|
||||
return true;
|
||||
} else if (attrib == "width") {
|
||||
result.setInt(_rect.right - _rect.left);
|
||||
return true;
|
||||
} else if (attrib == "height") {
|
||||
result.setInt(_rect.bottom - _rect.top);
|
||||
return true;
|
||||
}
|
||||
|
||||
return Element::readAttribute(thread, result, attrib);
|
||||
|
Loading…
x
Reference in New Issue
Block a user