[1.190.008][PB API] TextPanel returns component instead of self in GetSurface()

Digi shared this bug 4 years ago
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.

Replies (4)

photo
1

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

photo
1

This issue seems to be fixed, tested in v1.194.211.

photo
1

Problem is back.

photo
1

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.

Leave a Comment
 
Attach a file