public static void OnPostSetupContent()
        {
            if (Main.dedServ)
            {
                return;
            }

            Promises.AddPostModLoadPromise(() => {
                Menus.InitializeOpenConfigButton();
                ModInfoTagsMenuContext.Initialize();
                ModBrowserTagsMenuContext.Initialize();
                ModRecommendsMenuContext.Initialize();
                ModUpdatesMenuContext.Initialize();
                //if( AprilFoolsMenuContext.IsAprilFools() ) {
                //	AprilFoolsMenuContext.Initialize();
                //}
            });
        }
Beispiel #2
0
        ////////////////

        public UIRecommendsList(ModRecommendsMenuContext mc, float width, float height, float xCenterOffset, float y)
            : base(UITheme.Vanilla, width, height, xCenterOffset, y)
        {
            this.MenuContext = mc;

            this.Label = new UIText("Also recommended:");
            this.Label.Left.Set(-6f, 0f);
            this.Label.Top.Set(-6f, 0f);
            this.Append(this.Label);

            this.List = new UIElement();
            this.List.Left.Set(0f, 0f);
            this.List.Top.Set(16f, 0f);
            this.List.Width.Set(0f, 1f);
            this.List.Height.Set(this.Height.Pixels - 16f, 0f);
            this.List.OnMouseOver += (evt, elem) => {
                foreach (var kv in this.Descriptions)
                {
                    string    desc = kv.Key;
                    Rectangle rect = kv.Value;

                    if (rect.Contains(Main.mouseX, Main.mouseY))                          //evt.MousePosition
                    {
                        MenuContext.InfoDisplay?.SetText(desc);
                        break;
                    }
                }
            };
            this.List.OnMouseOut += (evt, elem) => {
                MenuContext.InfoDisplay?.SetText("");
            };
            this.Append(this.List);

            this.EmptyText           = new UIText("See the Mod Helpers\nhomepage for listing\nother mods here.");
            this.EmptyText.TextColor = new Color(128, 128, 128);
            this.EmptyText.Top.Set(16f, 0f);
            this.Append(this.EmptyText);

            this.Recalculate();
        }