PDA

View Full Version : Manual effect deletion (5e)



Stv
January 21st, 2021, 15:41
Hi guys, hoping someone has a quick answer for me on this one.

Does anybody know which function is called when you delete an effect in the CT by using the delete button on the RHS of the CT, and is it the same function that is called when you use right click to delete an effect ?

I've been through the coreRPG and 5E EffectManager scripts and inserted debugs where I think it should call, but to no avail. Any help would be appreciated.

Cheers Steve.

Trenloe
January 21st, 2021, 16:08
It's nothing special in particular for effects - it'll all be related to standard window deletion within a windowlist.

The windowlist in question uses the list_ctsection_effect (GM) or list_clientct_effect (player) template in CoreRPG (in ct\template_ct.xml) and these have script files of ct/scripts/ct_effectlist.lua and ct/scripts/clientct_effectlist.lua, respectively. In those script files is a deleteChild function, that is ran from the onMenuSelection event handler in ct/scripts/ct_effect.lua and deletes the node from that. Using the delete buttons just does a standard delete of the effect window in the windowlist, which deletes the relevant child record.

So, nothing special - just standard deletion of a child record in a windowlist.

Stv
January 21st, 2021, 16:40
Thanks Trenloe,
I'll go and have a poke in those files.

Cheers, Steve.

Stv
January 21st, 2021, 17:44
OK,call me stupid.
I've found the code for the manual deletes with the onMennuSelection handler, but I'm struggling to locate the code for the actual delete button in the CT.
I'm assuming that's hiding somewhere in the template_ct.xml ?

Trenloe
January 21st, 2021, 17:52
I've found the code for the manual deletes with the onMennuSelection handler, but I'm struggling to locate the code for the actual delete button in the CT.
I'm assuming that's hiding somewhere in the template_ct.xml ?
The button template is button_clientct_effect_idelete which is based on button_idelete.

Stv
January 21st, 2021, 19:10
Thanks Trenloe, found that:)
One more question... :)
If I wish to then add or change functionality to the effect delete button in the CT, would the best way to do that to create a new template to replace the button_idelete template in the template_ct.xml file ?

Cheers, Steve.

Trenloe
January 21st, 2021, 19:27
"button_idelete" is used in a lot of places, so changing that isn't good practice. Only replace/change the template specific to the GUI element that you're changing. In this case "button_clientct_effect_idelete ".

Stv
January 21st, 2021, 19:30
Awesome, thanks again Trenloe.

Cheers, Steve.