Modding request: make TexButton public, not internal

Started by LWM, May 22, 2020, 11:36:15 PM

Previous topic - Next topic

LWM

Verse.TexButton is an internal class.  If it were a public class, then modders could more easily match the look of the vanilla game.

Modders can get around this by keeping a static Texture2D and using Harmony (or reflection):

        static MyThingThatNeedsTexture_StaticConstructor () {
            Drop=(Texture2D)HarmonyLib.AccessTools.Field(HarmonyLib.AccessTools
                .TypeByName("Verse.TexButton"), "Drop").GetValue(null);
        }
        private static Texture2D Drop; // == TexButton.Drop

But that is not elegant and adds unnecessary clutter to mods.

Thank you for the consideration!

m1st4x

That's true! Just stumbled upon this...
Technical reason? - hm, no. Maybe it's not desired to allow modders to 'copy' vanilla?

Anyway thanks for the workaround, gonna use it!

Pheanox

Thank you for the feature request, will note it down.