private void updateAirlockDisplay() { System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (var item in airlocks) { sb.Append("\n\n" + item.Value.description()); } string displayText = "[Airlock " + SpinningBar.Render() + "]\n---------------------------------------" + sb.ToString(); System.Collections.Generic.List <IMyTextPanel> displays = new System.Collections.Generic.List <IMyTextPanel>(); GridTerminalSystem.GetBlocksOfType <IMyTextPanel>(displays, d => { MyIni displayIni; if (MyIni.HasSection(d.CustomData, "airlock")) { displayIni = new MyIni(); string prefix = ""; if (displayIni.TryParse(d.CustomData)) { prefix = displayIni.Get("airlock", "gridPrefix").ToString(); if (prefix != "") { prefix = prefix + "_"; } return(gridPrefix == prefix); } } return(false); }); foreach (IMyTextPanel d in displays) { d.WriteText(displayText); } SpinningBar.Step(); }
public void Steps() { Assert.AreEqual("-", SpinningBar.Render()); SpinningBar.Step(); Assert.AreEqual("\\", SpinningBar.Render()); SpinningBar.Step(); Assert.AreEqual("|", SpinningBar.Render()); SpinningBar.Step(); Assert.AreEqual("/", SpinningBar.Render()); SpinningBar.Step(); Assert.AreEqual("-", SpinningBar.Render()); }
public string Render(IEnumerable <ListItemRenderer <C> > rowDisplays) { StringBuilder result = new StringBuilder(); result.AppendLine(string.Format("[{0} {1}]", _ctx.Name, SpinningBar.Render())); result.Append(_ctx.HR); foreach (ListItemRenderer <C> rd in rowDisplays) { if (rd != null) { result.Append(Environment.NewLine + rd.Render(_ctx)); } } return(result.ToString()); }
protected string RenderHeader(EnergyRendererContext ctx) { string header = Name + " " + (Enabled ? "[" + SpinningBar.Render() + "]" : "OFF"); return(header); }
override public string GetLabel() { string check = (_showSpinBar ? SpinningBar.Render() : "X"); return(" " + this.name + " " + (_block.Enabled ? "[" + check + "]" : "[ ]")); }