Open thos-grol opened 2 years ago
For example, the image above, how do I target this text. I tried the hook button, but nothing found.
ITextComponentManipulator
and register it. See https://github.com/bbepis/XUnity.AutoTranslator/blob/master/src/XUnity.AutoTranslator.Plugin.Core/Extensions/ComponentExtensions.cs#L86Thanks, am going to try soon.
- Determine what component you need to hook.
- Hook the setter methods of the text (postfix) and methods that initializes the component such as Awake/OnEnable, etc. See https://github.com/bbepis/XUnity.AutoTranslator/tree/master/src/XUnity.AutoTranslator.Plugin.Core/Hooks
- Register the hooks. See https://github.com/bbepis/XUnity.AutoTranslator/blob/master/src/XUnity.AutoTranslator.Plugin.Core/Hooks/HooksSetup.cs
- If the text property of the component is not called exactly "text" and is a string, implement a custom
ITextComponentManipulator
and register it. See https://github.com/bbepis/XUnity.AutoTranslator/blob/master/src/XUnity.AutoTranslator.Plugin.Core/Extensions/ComponentExtensions.cs#L86- Update IsKnownTextType to regcognize the component. See https://github.com/bbepis/XUnity.AutoTranslator/blob/master/src/XUnity.AutoTranslator.Plugin.Core/Extensions/ComponentExtensions.cs#L187
- If targetting IL2CPP as well, update CreateDerivedProxyIfRequiredAndPossible. See https://github.com/bbepis/XUnity.AutoTranslator/blob/master/src/XUnity.AutoTranslator.Plugin.Core/Extensions/ComponentExtensions.cs#L409
Ok so I found the component, but I dont know how to reference it. I looked at all the hooks and they seem general, but the type of component Im hooking seems specific?
The component in question is WXB.SymbolText.
I assume you do this, but I dont know how to make a custom hook class :/.
This tool works great. Just some minor issues where the text is not being hooked. I'm interested in how I can modify some code so that the translator can hook these texts. A high level explanation would be enough.