Exemple #1
0
        /// <inheritdoc cref="Window.DoWindowContents"/>
        public override void DoWindowContents(Rect canvas)
        {
            Rect tabRect     = new Rect(0f, 0f, canvas.width, Text.LineHeight * 2f).Rounded();
            var  contentRect = new Rect(0f, tabRect.height, canvas.width, canvas.height - tabRect.height);

            GUI.BeginGroup(canvas);
            _tabWorker.Draw(tabRect);
            DrawWindowDecorations(tabRect);


            GUI.BeginGroup(contentRect);
            var innerRect = new Rect(0f, 0f, contentRect.width, contentRect.height);

            if (_dirty)
            {
                Rect innerResolution = innerRect.ContractedBy(16f);
                _itemWorker.NotifyResolutionChanged(innerResolution);
                _traitWorker.NotifyResolutionChanged(innerResolution);
                _pawnWorker.NotifyResolutionChanged(innerResolution);
                _eventWorker.NotifyResolutionChanged(innerResolution);
                _dirty = false;
            }

            _tabWorker.SelectedTab?.Draw(innerRect);
            GUI.EndGroup();

            GUI.EndGroup();
        }