private void BuildSceneItems() { lock (LoadingTaskMan._lock_TaskDictEdit) { MapMenuEntriesToTaskKeys.Clear(); Items.Clear(); foreach (var it in baseMenuItems) { Items.Add(it); } foreach (var kvp in LoadingTaskMan.TaskDict) { var menuItem = new DbgMenuItem() { ClickAction = (m) => LoadingTaskMan.KillTask(kvp.Key), RefreshTextFunction = () => $"{kvp.Key} [{kvp.Value.ProgressRatio:0.00}] [\"{kvp.Value.DisplayString}\"]", CustomColorFunction = () => kvp.Value.IsBeingKilledManually ? Color.Red : Color.Cyan }; Items.Add(menuItem); MapMenuEntriesToTaskKeys.Add(menuItem, kvp.Key); } RequestTextRefresh(); } }
protected override void LoadContent() { GFX.Init(Content); DBG.LoadContent(Content); InterrootLoader.OnLoadError += InterrootLoader_OnLoadError; DBG.CreateDebugPrimitives(); GFX.World.ResetCameraLocation(); DbgMenuItem.Init(); UpdateMemoryUsage(); CFG.Init(); }
protected override void Update(GameTime gameTime) { float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds; IsFixedTimeStep = FIXED_TIME_STEP; Active = IsActive; DbgMenuItem.UpdateInput(elapsed); DbgMenuItem.UICursorBlinkUpdate(elapsed); if (DbgMenuItem.MenuOpenState != DbgMenuOpenState.Open) { // Only update input if debug menu isnt fully open. GFX.World.UpdateInput(this, gameTime); } GFX.World.UpdateMatrices(GraphicsDevice); GFX.World.CameraPositionDefault.Position = Vector3.Zero; GFX.World.CameraOrigin.Position = new Vector3(GFX.World.CameraPositionDefault.Position.X, GFX.World.CameraOrigin.Position.Y, GFX.World.CameraPositionDefault.Position.Z); DBG.DbgPrim_Grid.Transform = GFX.World.CameraPositionDefault; if (REQUEST_EXIT) { Exit(); } MemoryUsageCheckTimer += elapsed; if (MemoryUsageCheckTimer >= MemoryUsageCheckInterval) { MemoryUsageCheckTimer = 0; UpdateMemoryUsage(); } LoadingTaskMan.Update(elapsed); base.Update(gameTime); }