[1.190.008][PB API] TextPanel returns component instead of self in GetSurface()
Outdated
The problem with returning component instead of self is that the existing text write methods are defined in MyTextPanel and the ones from the component don't actually do anything.
The properties (Font, ContentType, etc) do work along with DrawFrame() because those are indeed handled in the component.
See attached script for replicating, it will find all text surfaces and draw to them while also printing their names in the detail info, you should have at least one PB and one LCD block to test with.
The part with the issue:
// Sandbox.Game.Entities.Blocks.MyTextPanel IMyTextSurface IMyTextSurfaceProvider.GetSurface(int index) { if (index != 0) { return null; } return this.m_panelComponent; }
Either that needs to return `this` or the component needs to handle the textpanel's WriteText()/GetText()/etc too.
Files:
Test PB Script.txt
Hello, Engineer!
Thank you for your feedback! Your topic has been added between considered issues.
Please keep voting for the issue as it will help us to identify the most serious bugs.
We really appreciate your patience.
Kind Regards
Keen Software House: QA Department
Hello, Engineer!
Thank you for your feedback! Your topic has been added between considered issues.
Please keep voting for the issue as it will help us to identify the most serious bugs.
We really appreciate your patience.
Kind Regards
Keen Software House: QA Department
This issue seems to be fixed, tested in v1.194.211.
This issue seems to be fixed, tested in v1.194.211.
Problem is back.
Problem is back.
I re-tested this in v1.197.181 and it seems to work fine with the script, I also tested without the ContentType being set every write and also works fine.
I re-tested this in v1.197.181 and it seems to work fine with the script, I also tested without the ContentType being set every write and also works fine.
Replies have been locked on this page!