mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Make more types (Callable, Signal) conversion to String explicit.
This commit is contained in:
parent
ca1e4785b2
commit
d2f9d31270
5 changed files with 8 additions and 6 deletions
|
|
@ -123,7 +123,7 @@ public:
|
|||
|
||||
void operator=(const Callable &p_callable);
|
||||
|
||||
operator String() const;
|
||||
explicit operator String() const;
|
||||
|
||||
static Callable create(const Variant &p_variant, const StringName &p_method);
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ public:
|
|||
bool operator!=(const Signal &p_signal) const;
|
||||
bool operator<(const Signal &p_signal) const;
|
||||
|
||||
operator String() const;
|
||||
explicit operator String() const;
|
||||
|
||||
Error emit(const Variant **p_arguments, int p_argcount) const;
|
||||
Error connect(const Callable &p_callable, uint32_t p_flags = 0);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ struct PtrToArgStringConvertByReference {
|
|||
// No EncodeT because direct pointer conversion not possible.
|
||||
_FORCE_INLINE_ static void encode(const T &p_vec, void *p_ptr) {
|
||||
String *arr = reinterpret_cast<String *>(p_ptr);
|
||||
*arr = p_vec;
|
||||
*arr = String(p_vec);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1725,11 +1725,11 @@ String Variant::stringify(int recursion_count) const {
|
|||
}
|
||||
case CALLABLE: {
|
||||
const Callable &c = *reinterpret_cast<const Callable *>(_data._mem);
|
||||
return c;
|
||||
return String(c);
|
||||
}
|
||||
case SIGNAL: {
|
||||
const Signal &s = *reinterpret_cast<const Signal *>(_data._mem);
|
||||
return s;
|
||||
return String(s);
|
||||
}
|
||||
case RID: {
|
||||
const ::RID &s = *reinterpret_cast<const ::RID *>(_data._mem);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue