Unable to add images to cockpit screens programmatically
The code that actually sends the update image request is missing in implementation from cockpits and other non-text panel surface blocks.
Steps to reproduce:
1. Place a PB and a cockpit / flight seat.
2. In the PB, enter the following:
void Main()
{
var provider = GridTerminalSystem.GetBlockWithName(“block name”) as IMyTextSurfaceProvider;
if (provider == null)
{
Echo(“Provider null”);
return;
}
if (provider.SurfaceCount == 0)
{
Echo(“Provider has no screens”);
return;
}
var screen = provider.GetSurface(0);
screen.ContentType = ContentType.TEXT_AND_IMAGE;
screen.ClearImagesFromSelection();
screen.AddImageToSelection(“Cross”);
}
3. Notice that the image is never displayed, but the content type is properly updated.
Make sure you change “block name” to the actual name of the block you place
Make sure you change “block name” to the actual name of the block you place
Replies have been locked on this page!