Example #1
0
        public AssetListView(DiagnosticViewContext context)
            : base(context)
        {
            // TODO: This actually needs to use assets that have already been loaded.
            // And update when assets are loaded or unloaded.

            // TODO: Remove this.
            _audioFilenames = new List <string>();
            foreach (var entry in context.Game.ContentManager.FileSystem.Files)
            {
                switch (Path.GetExtension(entry.FilePath).ToLowerInvariant())
                {
                case ".mp3":
                case ".wav":
                    _audioFilenames.Add(entry.FilePath);
                    break;
                }
            }

            _items = new List <AssetListItem>();

            _searchTextBuffer = new byte[32];

            UpdateSearch(null);
        }
Example #2
0
        public MainView(DiagnosticViewContext context)
        {
            _context = context;

            _views = new List <DiagnosticView>();

            void AddView(DiagnosticView view)
            {
                _views.Add(AddDisposable(view));
            }

            AddView(new GameView(context)
            {
                IsVisible = true
            });
            AddView(new AssetListView(context));
            AddView(new MapSettingsView(context));
            AddView(new RenderSettingsView(context));
            AddView(new ScriptingView(context));
            AddView(new StatisticsView(context));
            AddView(new StringsView(context));
            AddView(new AptView(context));
            AddView(new AptConstantsView(context));
            AddView(new AptGeometryView(context));
            AddView(new WndView(context));
            AddView(new GameLoopView(context));
            AddView(new LuaScriptConsole(context));
            AddView(new LogView(context));
        }
Example #3
0
        public MainView(DiagnosticViewContext context)
        {
            _context = context;

            _views = new List <DiagnosticView>();

            _maps = _context.Game.AssetStore.MapCaches
                    .Where(m => _context.Game.ContentManager.GetMapEntry(m.Name) != null)
                    .Select(m => (mapCache: m, mapName: m.GetNameKey().Translate()))
                    .OrderBy(m => m.mapName)
                    .ToDictionary(m => m.mapCache, m => m.mapName);

            void AddView(DiagnosticView view)
            {
                _views.Add(AddDisposable(view));
            }

            AddView(new GameView(context)
            {
                IsVisible = true
            });
            AddView(new AssetListView(context));
            AddView(new MapSettingsView(context));
            AddView(new RenderSettingsView(context));
            AddView(new ScriptingView(context));
            AddView(new StatisticsView(context));
            AddView(new StringsView(context));
            AddView(new AptView(context));
            AddView(new AptConstantsView(context));
            AddView(new AptGeometryView(context));
            AddView(new WndView(context));
            AddView(new GameLoopView(context));
            AddView(new LuaScriptConsole(context));
            AddView(new LogView(context));
        }
Example #4
0
 public RenderSettingsView(DiagnosticViewContext context)
     : base(context)
 {
     _shadowMapSizes = new List <uint> {
         256u, 512u, 1024u, 2048u
     };
     _shadowMapSizeNames = _shadowMapSizes.Select(x => x.ToString()).ToArray();
 }
Example #5
0
        public ScriptingView(DiagnosticViewContext context)
            : base(context)
        {
            _scriptStateContent = new StringBuilder();

            Game.Scripting.OnUpdateFinished += OnScriptingUpdateFinished;

            AddDisposeAction(() => Game.Scripting.OnUpdateFinished -= OnScriptingUpdateFinished);
        }
Example #6
0
        public ObjectListView(DiagnosticViewContext context)
            : base(context)
        {
            _items = new List <GameObject>();

            _searchTextBuffer = new byte[32];

            UpdateSearch(null);
        }
Example #7
0
        public AssetListView(DiagnosticViewContext context)
            : base(context)
        {
            _items = new List <AssetListItem>();

            _searchTextBuffer = new byte[32];

            UpdateSearch(null);
        }
Example #8
0
        public AptGeometryView(DiagnosticViewContext context)
            : base(context)
        {
            _renderedView = AddDisposable(new RenderedView(context));

            _renderedView.RenderPipeline.Rendering2D += (sender, e) =>
            {
                _shapeRenderer.Render(e.DrawingContext);
            };
        }
Example #9
0
        public MainView(DiagnosticViewContext context)
        {
            _context = context;

            _views = new List <DiagnosticView>();

            _maps = _context.Game.AssetStore.MapCaches
                    .Where(m => _context.Game.ContentManager.GetMapEntry(m.Name) != null)
                    .Select(m => (mapCache: m, mapName: m.IsOfficial ? m.GetNameKey().Translate() : m.Name))
                    .OrderBy(m => m.mapCache.IsOfficial ? 0 : 1).ThenBy(m => m.mapName)
                    .ToDictionary(m => m.mapCache, m => m.mapName);
            if (_maps.FirstOrDefault() is var(mapCache, value))
            {
                _map = (mapCache, value);
            }

            _playableSides = _context.Game.GetPlayableSides().ToList();
            _faction       = _playableSides.FirstOrDefault();

            void AddView(DiagnosticView view)
            {
                _views.Add(AddDisposable(view));
            }

            AddView(new GameView(context)
            {
                IsVisible = true
            });
            AddView(new ObjectListView(context));
            AddView(new AssetListView(context));
            AddView(new MapSettingsView(context));
            AddView(new RenderSettingsView(context));
            AddView(new ScriptingView(context));
            AddView(new StatisticsView(context));
            AddView(new StringsView(context));
            AddView(new AptView(context));
            AddView(new AptConstantsView(context));
            AddView(new AptGeometryView(context));
            AddView(new WndView(context));
            AddView(new GameLoopView(context));
            AddView(new GameSettingsView(context));
            AddView(new LuaScriptConsole(context));
            AddView(new LogView(context));
            AddView(new InspectorView(context));
            AddView(new PreviewView(context));
            AddView(new CameraView(context));
            AddView(new PartitionView(context));
        }
Example #10
0
 public PreviewView(DiagnosticViewContext context)
     : base(context)
 {
 }
Example #11
0
 public WndView(DiagnosticViewContext context)
     : base(context)
 {
 }
Example #12
0
 public DefaultInspectable(object value, DiagnosticViewContext context)
 {
     _value   = value;
     _context = context;
 }
Example #13
0
 public CameraView(DiagnosticViewContext context)
     : base(context)
 {
 }
Example #14
0
        public MainView(DiagnosticViewContext context)
        {
            _context = context;

            _views = new List <DiagnosticView>();

            _maps = _context.Game.AssetStore.MapCaches
                    .Where(m => _context.Game.ContentManager.GetMapEntry(m.Name) != null)
                    .Select(m => (mapCache: m, mapName: m.IsOfficial ? m.GetNameKey().Translate() : m.Name))
                    .OrderBy(m => m.mapCache.IsOfficial ? 0 : 1).ThenBy(m => m.mapName)
                    .ToDictionary(m => m.mapCache, m => m.mapName);
            if (_maps.FirstOrDefault() is var(mapCache, value))
            {
                _map = (mapCache, value);
            }

            _playableSides = _context.Game.GetPlayableSides().ToList();
            _faction       = _playableSides.FirstOrDefault();

            void AddView(DiagnosticView view)
            {
                _views.Add(AddDisposable(view));
            }

            AddView(new GameView(context)
            {
                IsVisible = true
            });

            AddView(new ObjectListView(context));
            AddView(new AssetListView(context));
            AddView(new MapSettingsView(context));
            AddView(new RenderSettingsView(context));
            AddView(new ScriptingView(context));
            AddView(new StatisticsView(context));
            AddView(new StringsView(context));
            AddView(new AptView(context));
            AddView(new AptConstantsView(context));
            AddView(new AptGeometryView(context));
            AddView(new WndView(context));
            AddView(new GameLoopView(context));
            AddView(new GameSettingsView(context));
            AddView(new LuaScriptConsole(context));
            AddView(new LogView(context));
            AddView(new InspectorView(context));
            AddView(new PreviewView(context));
            AddView(new CameraView(context));
            AddView(new PartitionView(context));

            if (File.Exists(IniFileName))
            {
                foreach (var line in File.ReadAllText(IniFileName).Split(Environment.NewLine))
                {
                    var settings    = line.Split(" = ");
                    var displayName = settings[0];
                    var visibility  = bool.Parse(settings[1]);

                    var view = _views.FirstOrDefault(x => x.DisplayName == displayName);
                    if (view != null)
                    {
                        view.IsVisible = visibility;
                    }
                }
            }
        }
Example #15
0
 public LuaScriptConsole(DiagnosticViewContext context) : base(context)
 {
 }
Example #16
0
 public StatisticsView(DiagnosticViewContext context)
     : base(context)
 {
 }
Example #17
0
 public InspectorView(DiagnosticViewContext context)
     : base(context)
 {
 }
Example #18
0
 public PartitionView(DiagnosticViewContext context)
     : base(context)
 {
 }
Example #19
0
 public StringsView(DiagnosticViewContext context)
     : base(context)
 {
     _labels           = new List <string>();
     _searchTextBuffer = new byte[32];
 }
Example #20
0
 public GameLoopView(DiagnosticViewContext context) : base(context)
 {
 }
Example #21
0
 public RenderedView(
     DiagnosticViewContext context,
     in Vector3 cameraTarget = default,
Example #22
0
 public MapSettingsView(DiagnosticViewContext context)
     : base(context)
 {
 }
Example #23
0
 public AptConstantsView(DiagnosticViewContext context)
     : base(context)
 {
 }