public static void UpdateTextBox(String id, String text) { try { OverlayManager overlayMgr = OverlayManager.Singleton; TextAreaOverlayElement textArea = (TextAreaOverlayElement)overlayMgr.GetOverlayElement("_area_" + id); textArea.Caption = text; } catch (Exception e) { Util.Log("Unable to update text area."); } }
public void Start(RenderWindow window, ushort numGroupsInit, ushort numGroupsLoad, float initProportion) { this.window = window; this.numGroupsInit = numGroupsInit; this.numGroupsLoad = numGroupsLoad; this.initProportion = initProportion; // We need to pre-initialise the 'Bootstrap' group so we can use // the basic contents in the loading screen ResourceGroupManager.Singleton.InitialiseResourceGroup("Bootstrap"); OverlayManager omgr = OverlayManager.Singleton; loadOverlay = omgr.GetByName("Core/LoadOverlay"); if (loadOverlay == null) { System.Windows.Forms.MessageBox.Show("Cannot find loading overlay", "ExampleLoadingBar::start", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } loadOverlay.Show(); // Save links to the bar and to the loading text, for updates as we go loadingBarElement = omgr.GetOverlayElement("Core/LoadPanel/Bar/Progress"); loadingCommentElement = omgr.GetOverlayElement("Core/LoadPanel/Comment"); loadingDescriptionElement = omgr.GetOverlayElement("Core/LoadPanel/Description"); OverlayElement barContainer = omgr.GetOverlayElement("Core/LoadPanel/Bar"); progressBarMaxSize = barContainer.Width; loadingBarElement.Width = 0F; ResourceGroupManager.Singleton.ResourceGroupScriptingStarted += ResourceGroupScriptingStarted; ResourceGroupManager.Singleton.ScriptParseStarted += ScriptParseStarted; ResourceGroupManager.Singleton.ScriptParseEnded += ScriptParseEnded; ResourceGroupManager.Singleton.ResourceGroupLoadStarted += ResourceGroupLoadStarted; ResourceGroupManager.Singleton.ResourceLoadStarted += ResourceLoadStarted; ResourceGroupManager.Singleton.WorldGeometryStageStarted += WorldGeometryStageStarted; ResourceGroupManager.Singleton.WorldGeometryStageEnded += WorldGeometryStageEnded; }