Customize Unlockable UI not able to unlock item

All about user interface, be it customizing built-in UIs or adding new ones.
Post Reply
TuTlo
Posts: 14
Joined: 02 Jun 2022 14:40

Customize Unlockable UI not able to unlock item

Post 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!

idaot
support
Posts: 262
Joined: 01 Aug 2020 08:25

Re: Customize Unlockable UI not able to unlock item

Post 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.

TuTlo
Posts: 14
Joined: 02 Jun 2022 14:40

Re: Customize Unlockable UI not able to unlock item

Post 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?

idaot
support
Posts: 262
Joined: 01 Aug 2020 08:25

Re: Customize Unlockable UI not able to unlock item

Post 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.

Post Reply