@cc-component/cc-guide 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -33,7 +33,7 @@ export class GuideCenter {
|
|
|
33
33
|
|
|
34
34
|
callClick: (step: number) => void;
|
|
35
35
|
callJumpWindow: (urls: string[]) => void;
|
|
36
|
-
callFinishGroup: (
|
|
36
|
+
callFinishGroup: (param: ITableGuide) => void;
|
|
37
37
|
/** 游戏初始化模块 */
|
|
38
38
|
guide: Guide = null!;
|
|
39
39
|
node: Node;
|
|
@@ -208,7 +208,7 @@ export class GuideCenter {
|
|
|
208
208
|
this.step = 100000
|
|
209
209
|
step_net = this.step;
|
|
210
210
|
}
|
|
211
|
-
GuideModule.GuideCenter.callFinishGroup?.(curren.data
|
|
211
|
+
GuideModule.GuideCenter.callFinishGroup?.(curren.data)
|
|
212
212
|
this.callMessageNet?.(step_net, () => { }) //功能引导
|
|
213
213
|
}
|
|
214
214
|
else {
|
|
@@ -324,7 +324,7 @@ export class GuideCenter {
|
|
|
324
324
|
OnMessageJumpWindow(call: (urls: string[]) => void) {
|
|
325
325
|
this.callJumpWindow = call
|
|
326
326
|
}
|
|
327
|
-
OnMessageFinishGroup(call: (
|
|
327
|
+
OnMessageFinishGroup(call: (param: ITableGuide) => void) {
|
|
328
328
|
this.callFinishGroup = call
|
|
329
329
|
}
|
|
330
330
|
|
|
@@ -192,9 +192,9 @@ export class GuideViewComp extends Component {
|
|
|
192
192
|
|
|
193
193
|
} else {
|
|
194
194
|
//@ts-ignore
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
197
|
-
|
|
195
|
+
const mbutton_event = target_button?.onClick;//自定义事件
|
|
196
|
+
if (mbutton_event) {
|
|
197
|
+
mbutton_event.dispatch()
|
|
198
198
|
this.onClick()
|
|
199
199
|
}
|
|
200
200
|
else {
|
|
@@ -213,29 +213,35 @@ export class GuideViewComp extends Component {
|
|
|
213
213
|
const view = item.getComponent(GuideViewItem)
|
|
214
214
|
//按钮
|
|
215
215
|
let target_button = view.findButton()
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (target_button
|
|
223
|
-
|
|
216
|
+
//@ts-ignore
|
|
217
|
+
const mbutton_event = target_button?.onClick;//自定义事件
|
|
218
|
+
if (mbutton_event) {
|
|
219
|
+
mbutton_event.dispatch()
|
|
220
|
+
} else {
|
|
221
|
+
const clickEvents = target_button?.clickEvents ?? [];
|
|
222
|
+
if (target_button?.interactable) {
|
|
223
|
+
clickEvents.forEach((e, index) => { e.emit([event]); });
|
|
224
224
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (target_toggle_container && target_toggle) {
|
|
231
|
-
target_toggle_container?.checkEvents.forEach(event => {
|
|
232
|
-
if (target_toggle.interactable)
|
|
233
|
-
event.emit([target_toggle]);
|
|
234
|
-
})
|
|
235
|
-
} else {
|
|
236
|
-
btn.dispatchEvent(event)
|
|
225
|
+
//解决用node.on("click") 监听的事件
|
|
226
|
+
if (target_button && clickEvents.length <= 0) {
|
|
227
|
+
if (target_button.interactable) {
|
|
228
|
+
target_button.node.emit("click");
|
|
229
|
+
}
|
|
237
230
|
}
|
|
231
|
+
else {
|
|
232
|
+
//toggle组件
|
|
233
|
+
const target_toggle = view.findToggle()
|
|
234
|
+
const target_toggle_container = view.findToggleContainer()
|
|
235
|
+
if (target_toggle_container && target_toggle) {
|
|
236
|
+
target_toggle_container?.checkEvents.forEach(event => {
|
|
237
|
+
if (target_toggle.interactable)
|
|
238
|
+
event.emit([target_toggle]);
|
|
239
|
+
})
|
|
240
|
+
} else {
|
|
241
|
+
btn.dispatchEvent(event)
|
|
242
|
+
}
|
|
238
243
|
|
|
244
|
+
}
|
|
239
245
|
}
|
|
240
246
|
}
|
|
241
247
|
this.onClick()
|
|
@@ -24,7 +24,7 @@ class GuideModule {
|
|
|
24
24
|
static OnMessageStepNet(call: (step: number, finish: Function) => void) { GuideCenter.instance.OnMessageStepNet(call) }
|
|
25
25
|
static OnMessageClick(call: (step: number) => void) { GuideCenter.instance.OnMessageClick(call) }
|
|
26
26
|
static OnMessageJumpWindow(call: (urls: string[]) => void) { GuideCenter.instance.OnMessageJumpWindow(call) }
|
|
27
|
-
static OnMessageFinishGroup(call: (
|
|
27
|
+
static OnMessageFinishGroup(call: (param: ITableGuide) => void) { GuideCenter.instance.OnMessageFinishGroup(call) }
|
|
28
28
|
/**是否引导中 */
|
|
29
29
|
static GuideShow(): boolean { return GuideSDK.GuideShow() };
|
|
30
30
|
|
|
@@ -27,7 +27,7 @@ declare global {
|
|
|
27
27
|
/**监听跳转界面 */
|
|
28
28
|
function OnMessageJumpWindow(call: (urls: string[]) => void)
|
|
29
29
|
/**监听完成引导组引导 */
|
|
30
|
-
function OnMessageFinishGroup(call: (
|
|
30
|
+
function OnMessageFinishGroup(call: (param: ITableGuide) => void)
|
|
31
31
|
/**是否引导中 */
|
|
32
32
|
function GuideShow(): boolean;
|
|
33
33
|
/**开启日志打印 */
|