summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-04-10 00:18:27 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-04-10 00:18:27 -0300
commit7ea3e8267afaf626256c84a9a3dc61e2954fc6a2 (patch)
tree0aa7588918b814d1781fc94e8b518c7095a0bab7 /core
parentb4969373b3475799d6b24cdffeda4659c37f0b8a (diff)
-Fixed a few bugs in Viewport
-Made a few demos using Viewport to show it's true power! -Fixed some start-up error messages.
Diffstat (limited to 'core')
-rw-r--r--core/object_type_db.cpp2
-rw-r--r--core/variant.cpp13
-rw-r--r--core/variant_call.cpp2
3 files changed, 15 insertions, 2 deletions
diff --git a/core/object_type_db.cpp b/core/object_type_db.cpp
index 289706334a..18878007a6 100644
--- a/core/object_type_db.cpp
+++ b/core/object_type_db.cpp
@@ -408,7 +408,7 @@ void ObjectTypeDB::add_signal(StringName p_type,const MethodInfo& p_signal) {
while(check) {
if (check->signal_map.has(sname)) {
- ERR_EXPLAIN("Type already has signal");
+ ERR_EXPLAIN("Type "+String(p_type)+" already has signal: "+String(sname));
ERR_FAIL();
}
check=check->inherits_ptr;
diff --git a/core/variant.cpp b/core/variant.cpp
index e02c9c33a1..6b3b25a103 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -298,6 +298,19 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) {
valid_types=valid;
} break;
+
+ case COLOR: {
+
+ static const Type valid[] = {
+ STRING,
+ INT,
+ NIL,
+ };
+
+ valid_types = valid;
+
+ } break;
+
case _RID: {
static const Type valid[]={
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 6ab33b7bcc..63d0fcec3a 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -977,7 +977,7 @@ Variant Variant::construct(const Variant::Type p_type,const Variant** p_args,int
case TRANSFORM: return (Transform(p_args[0]->operator Transform()));
// misc types
- case COLOR: return (Color(*p_args[0]));
+ case COLOR: return p_args[0]->type == Variant::STRING ? Color::html(*p_args[0]) : Color::hex(*p_args[0]);
case IMAGE: return (Image(*p_args[0]));
case NODE_PATH: return (NodePath(p_args[0]->operator NodePath())); // 15
case _RID: return (RID(*p_args[0]));