Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Sherberts Privacy Shades Script (Idea by YouFoundMe)
- /// When ran will toggle clear lcd's with the set tag to have an image or become clear.
- /// Setup, Place Programing block, and LCD's - change LCD names to include tag.
- /// If seperate images are wanted for each LCD put the image text generated from Whip's Image convertor
- /// into the custom data of desired lcd's
- /// If the same image is desired leave all lcd's custom data empty and put the image text from Whips converter into the
- /// Programing block's custom data
- /// run programing block,either by hand or threw a button and it will toggle between clear and the images
- /// Enjoy
- ///
- ///
- /// </summary>
- string tag = "[Shade]";
- List<IMyTerminalBlock> lcd = new List<IMyTerminalBlock>();
- public void Main(string argument, UpdateType updateSource)
- {
- GridTerminalSystem.SearchBlocksOfName(tag, lcd);
- string defaultimage = Me.CustomData;
- if (lcd.Count!= 0)
- {
- foreach(var i in lcd)
- {
- IMyTextSurfaceProvider panel = i as IMyTextSurfaceProvider;
- if(panel != null)
- {
- IMyTextSurface screen = panel.GetSurface(0);
- screen.ContentType = VRage.Game.GUI.TextPanel.ContentType.TEXT_AND_IMAGE;
- screen.FontSize = 0.1f;
- screen.Font = "Monospace";
- string text = screen.GetText();
- if(text != "")
- {
- i.CustomData = text;
- screen.WriteText("");
- }
- else
- {
- if (i.CustomData != "")
- screen.WriteText(i.CustomData);
- else
- screen.WriteText(defaultimage);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement