Customize Unlockable UI not able to unlock item

Posted: 01 Aug 2022 15:47
by TuTlo

Hello,

I have several customized Unlockables, which I would like to display similar as CG Gallery, something like Achievement Gallery, Collection Gallery.
I used customized CGGalleryUI, the CGGalleryUI is fine, and is able to unlock CG. So I use similar UI to set up Achievement Gallery. I could see the Achievement Gallery UI displaying fine, which has exact the number of slots I added to Unlockables list ( to be exact 6 ). But when I use @unlock, it is not able to unlock and display the picture in the slot. For CG Gallery all works fine.

Here is how I setup

Unlockables:
NAME Object
CG/smoke smoke.png
Achievement/win win.png

UI
CGGalleryUI myCGUI (prefab)
AchievementUI myAchievementUI(prefab)

and in the Achievement UI

Cg Sources:
Path Prefix: Unlockables/Achievement

@showUI CGGalleryUI. ---- work fine
@unlock CG/smoke. ----- work fine
@showUI AchievementUI --- work fine
@unlock Achievement/win -- NOT WORKING, not able to unlock

Could you please help me figure out what I am missing or if I am doing something wrong? Let me know if you need more info

Thanks!


Re: Customize Unlockable UI not able to unlock item

Posted: 01 Aug 2022 17:11
by idaot

Make sure this UI does not inherit from ICGGalleryUI as having multiple UIs inherit the same built-in UI interface is known to cause conflicts.

Otherwise, I suggest using debugging tools to see where the code falls short.


Re: Customize Unlockable UI not able to unlock item

Posted: 03 Aug 2022 18:30
by TuTlo

Thanks!

I think I use two built-in UIs, the AchievementUI was copied from CGGalleryUI. So this is causing conflicts.

Is there a way to use two built-in UIs? Since in this scenario, the AchievementUI actually is doing exactly same thing as CG Gallery, and I just wanna to split the unlockables into two categories. Or could you suggest a better using any built-in function from Naninovel to implement this?


Re: Customize Unlockable UI not able to unlock item

Posted: 03 Aug 2022 19:19
by idaot

You might be able to just copy over the code from CGGalleryUI to the new UI; just leave out the reference to ICGGalleryUI.