示例#1
0
        public static void AddButton(WidgetRow row, bool worldView)
        {
            if (worldView)
            {
                return;
            }

            foreach (BaseOverlay overlay in BaseOverlay.AllOverlays())
            {
                if (!overlay.IconEnabled())
                {
                    continue;
                }

                Type overlayType = overlay.GetType();

                bool show    = BaseOverlay.toggleShow.Contains(overlayType);
                bool oldShow = show;
                row.ToggleableIcon(ref show, overlay.Icon(), overlay.IconTip());
                if (show != oldShow)
                {
                    if (show)
                    {
                        BaseOverlay.toggleShow.Add(overlayType);
                    }
                    else
                    {
                        BaseOverlay.toggleShow.Remove(overlayType);
                    }
                }
            }
        }
示例#2
0
        public static void Postfix()
        {
            if (Find.CurrentMap == null || WorldRendererUtility.WorldRenderedNow)
            {
                return;
            }

            foreach (BaseOverlay overlay in BaseOverlay.AllOverlays())
            {
                overlay.Update();
            }
        }