From 7ea3e8267afaf626256c84a9a3dc61e2954fc6a2 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 10 Apr 2014 00:18:27 -0300 Subject: -Fixed a few bugs in Viewport -Made a few demos using Viewport to show it's true power! -Fixed some start-up error messages. --- core/object_type_db.cpp | 2 +- core/variant.cpp | 13 +++++++++++++ core/variant_call.cpp | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'core') 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])); -- cgit v1.2.3