ExtremeLurker Posted October 23, 2019 Share Posted October 23, 2019 *suddenly unborrows* I'm trying to display a CVar value in the text of a label. Is this possible? Also, is it possible to give the player a buff when they destroy a certain block? Link to comment Share on other sites More sharing options...
ExtremeLurker Posted October 27, 2019 Author Share Posted October 27, 2019 For those interested, it's not possible through xpath alone. To display your own dynamic values (the stuff surrounded with curly braces) in windows.xml, you need to modify the C# assembly. Look at the parent elements for the "controller" attribute, prefix that value with XUiC_ and you'll have the name of the class you'll need to modify. The method to modify is GetBindingValue. You could make your own subclass and assign it via the controller attribute, but that wouldn't play as nicely with other mods as creating a patch. As for giving the player a buff after they destroy a block, this doesn't seem to be implemented as of 17.4. There seems to have been the notion of it in the xml and in the C#, but not an implementation. I've not had the chance to go through 18 just yet to see if that's changed. I was able to accomplish what I needed by patching Block.OnBlockDestroyedBy and BlockLoot.OnBlockDestroyedBy. *borrows, disappearing completely* Link to comment Share on other sites More sharing options...
n2n1 Posted October 27, 2019 Share Posted October 27, 2019 Thank you for the information! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.