From 8d95d24ee079443fa90d92d602a02a4e9f65bd01 Mon Sep 17 00:00:00 2001 From: dogeFu <609075410@qq.com> Date: Tue, 18 Apr 2023 09:44:11 +0800 Subject: [PATCH] fix: support tooltips in effect for native scene (#14812) --- .../cocos/bindings/manual/jsb_conversions_spec.cpp | 12 ++++++++++++ native/cocos/bindings/manual/jsb_conversions_spec.h | 2 +- native/cocos/core/assets/EffectAsset.h | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/native/cocos/bindings/manual/jsb_conversions_spec.cpp b/native/cocos/bindings/manual/jsb_conversions_spec.cpp index 3a6ee9a4a3..930d7d34b1 100644 --- a/native/cocos/bindings/manual/jsb_conversions_spec.cpp +++ b/native/cocos/bindings/manual/jsb_conversions_spec.cpp @@ -1013,6 +1013,18 @@ bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Objec return true; } +// NOLINTNEXTLINE(readability-identifier-naming) +bool sevalue_to_native(const se::Value &from, ccstd::variant *to, se::Object * /*ctx*/) { + if (from.isBoolean()) { + *to = from.toBoolean(); + } else if (from.isString()) { + *to = from.toString(); + } else { + CC_ASSERT(false); + } + return true; +} + // NOLINTNEXTLINE(readability-identifier-naming) bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*ctx*/) { if (from.isNullOrUndefined()) { diff --git a/native/cocos/bindings/manual/jsb_conversions_spec.h b/native/cocos/bindings/manual/jsb_conversions_spec.h index f288f86248..60ec9449ee 100644 --- a/native/cocos/bindings/manual/jsb_conversions_spec.h +++ b/native/cocos/bindings/manual/jsb_conversions_spec.h @@ -373,7 +373,7 @@ inline bool sevalue_to_native(const se::Value &from, ccstd::string **to, se::Obj bool sevalue_to_native(const se::Value &from, cc::ValueMap *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) - +bool sevalue_to_native(const se::Value &from, ccstd::variant *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) bool sevalue_to_native(const se::Value &from, ccstd::vector *to, se::Object * /*ctx*/); // NOLINT(readability-identifier-naming) bool sevalue_to_native(const se::Value &from, cc::IPropertyValue *to, se::Object *ctx); // NOLINT(readability-identifier-naming) inline bool sevalue_to_native(const se::Value & /*from*/, ccstd::monostate * /*to*/, se::Object * /*ctx*/) { // NOLINT(readability-identifier-naming) diff --git a/native/cocos/core/assets/EffectAsset.h b/native/cocos/core/assets/EffectAsset.h index f78846df99..8d111e51b6 100644 --- a/native/cocos/core/assets/EffectAsset.h +++ b/native/cocos/core/assets/EffectAsset.h @@ -516,7 +516,7 @@ struct IDefineInfo { ccstd::optional> options; ccstd::optional defaultVal; ccstd::optional> defines; // NOTE: it's only used in Editor - ccstd::optional> editor; // NOTE: it's only used in Editor + ccstd::optional>> editor; // NOTE: it's only used in Editor }; struct IBuiltin {