Custom Actor Implementations
Hi again! This is part of my ongoing chat system project. One of the goals is to be able to send photos in messages as well.
For the messaging I'm using a TextPrinter similar to the Chat printer. Now the problem with using textprinters is that they are, well text printers, they aren't supposed to be used for images.
I must say that I already implemented this in a CustomUI to be used as a kind of message log, the conversation history, however I would also like to send photos in a regular text printer in order to take advantage of the continue conversation by clicking functionality and also have the visual goodies like delayed message with the dots being printed while someone is "typing", etc. Essentially the CustomUI is to check previous messages and the TextPrinter is to advance the story.
In theory, I just need an extra property in the UITextPrinterPanel that stores a PhotoId string passed from a SendMessage Command via PrinterManager.PrintTextAsync() on ExecuteAsync() of an altered PrintText command (this is the reason I need a new actor implementation, to pass the extra argument on PrintTextAsync()). That PhotoId will be referenced by a method when a Message is instantiated and the corresponding photo Sprite will be fetched with a resource provider. I had a look at ITextPrinterActor and followed references until I believe have found all the relevant connections to make it work.
The problem is that I don't want to touch the framework's asset files, so I copied the files I deemed necessary and made my changes to new similar classes. Now that I've implemented them into my printer's panel class, Unity is throwing me an "actor implementation type for ITextPrinterActorPhoto
is not found", it comes from the ActorManager.cs:211 class. I followed the calls and it goes into ReflectionUtils cached domains. This is where i'm at a lost. Tried several stuff but I'm still not sure how to fix this. The files are inside the base Naninovel>Runtime>Actor>TextPrinter folder, in a subfolder called "PhotoImplementation" just so I don't mix them up. The namespace is the default from the files they were copied from (either Naninovel or Naninovel.UI).
Just for exposition sake these are the files I've copied/changed:
Runtime > Actor > TextPrinter - ITextPrinterActor, ITextPrinterManager, PrintTextArgs, TextPrinterManager, TextPrinterState, UITextPrinter
Runtime > UI > TextPrinter - UITextPrinterPanel
I'm not sure if this is a general C#, Unity or Naninovel related issue and my searches lead me nowhere so I must resort to the forum to get help. Hopefully this could also be useful in the future for someone trying to achieve similar things.