public MapModMenu(int x, int y, int width, int height, bool[] showExtras, Dictionary <string, Dictionary <string, int> > customNPCs, Dictionary <string, string> npcNames) : base(x, y, width, height, false)
        {
            this.map = Game1.content.Load <Texture2D>("LooseSprites\\map");
            Vector2 topLeftPositionForCenteringOnScreen = Utility.getTopLeftPositionForCenteringOnScreen(this.map.Bounds.Width * Game1.pixelZoom, 180 * Game1.pixelZoom, 0, 0);

            this.mapX            = (int)topLeftPositionForCenteringOnScreen.X;
            this.mapY            = (int)topLeftPositionForCenteringOnScreen.Y;
            this.okButton        = new ClickableTextureComponent("OK", new Rectangle(this.xPositionOnScreen + width + Game1.tileSize, this.yPositionOnScreen + height - IClickableMenu.borderWidth - Game1.tileSize / 4, Game1.tileSize, Game1.tileSize), null, null, Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46, -1, -1), 1f, false);
            this.upArrow         = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + width + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 459, 11, 12), (float)Game1.pixelZoom);
            this.downArrow       = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + width + Game1.tileSize / 4, this.yPositionOnScreen + height - Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 472, 11, 12), (float)Game1.pixelZoom);
            this.scrollBar       = new ClickableTextureComponent(new Rectangle(this.upArrow.bounds.X + Game1.pixelZoom * 3, this.upArrow.bounds.Y + this.upArrow.bounds.Height + Game1.pixelZoom, 6 * Game1.pixelZoom, 10 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(435, 463, 6, 10), (float)Game1.pixelZoom);
            this.scrollBarRunner = new Rectangle(this.scrollBar.bounds.X, this.upArrow.bounds.Y + this.upArrow.bounds.Height + Game1.pixelZoom, this.scrollBar.bounds.Width, height - Game1.tileSize * 2 - this.upArrow.bounds.Height - Game1.pixelZoom * 2);
            for (int i = 0; i < 7; i++)
            {
                this.optionSlots.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize * 5 / 4 + Game1.pixelZoom + i * ((height - Game1.tileSize * 2) / 7), width - Game1.tileSize / 2, (height - Game1.tileSize * 2) / 7 + Game1.pixelZoom), string.Concat(i)));
            }
            tooltipButton1   = new MapModButton("在地点提示上方", 1, -1, -1, -1, -1);
            tooltipButton2   = new MapModButton("在地点提示下方", 2, -1, -1, -1, -1);
            tooltipButton3   = new MapModButton("左下角显示", 3, -1, -1, -1, -1);
            immersionButton1 = new MapModButton("总是显示居民", 4, -1, -1, -1, -1);
            immersionButton2 = new MapModButton("显示已经和玩家交谈过的居民", 5, -1, -1, -1, -1);
            immersionButton3 = new MapModButton("隐藏已经和玩家交谈过的居民", 6, -1, -1, -1, -1);
            //this.options.Add(new OptionsElement("Menu Key:"));
            //this.options.Add(new MapModInputListener("Change menu key", 37, this.optionSlots[0].bounds.Width, -1, -1));
            this.options.Add(new OptionsElement("NPC Map Locations Mod Version"));
            this.options.Add(new OptionsElement("名称提示位置:"));
            this.options.Add(tooltipButton1);
            this.options.Add(tooltipButton2);
            this.options.Add(tooltipButton3);
            this.options.Add(new OptionsElement("专注设置:"));
            this.options.Add(immersionButton1);
            this.options.Add(immersionButton2);
            this.options.Add(immersionButton3);
            this.options.Add(new MapModCheckbox("只显示玩家所在位置的居民", 39, -1, -1));
            this.options.Add(new MapModCheckbox("只显示指定好感度范围的居民", 41, -1, -1));
            this.options.Add(new MapModSlider("最低好感度", 0, -1, -1));
            this.options.Add(new MapModSlider("最高好感度", 1, -1, -1));
            this.options.Add(new OptionsElement("扩展设置:"));
            this.options.Add(new MapModCheckbox("显示隐藏居民", 48, -1, -1));
            this.options.Add(new MapModCheckbox("标记有日常任务或者过生日的居民", 42, -1, -1));
            // Custom NPCs
            if (customNPCs != null)
            {
                foreach (KeyValuePair <string, Dictionary <string, int> > entry in customNPCs)
                {
                    if (MapModMain.customNpcId > 0)
                    {
                        this.options.Add(new MapModCheckbox("Show " + entry.Key, 42 + MapModMain.customNpcId, -1, -1));
                    }
                }
            }
            this.options.Add(new MapModCheckbox("显示旅行货车", 40, -1, -1));
            this.options.Add(new OptionsElement("包含/排除居民:"));
            this.options.Add(new MapModCheckbox(npcNames["Abigail"], 7, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Alex"], 8, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Caroline"], 9, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Clint"], 10, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Demetrius"], 11, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Elliott"], 12, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Emily"], 13, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Evelyn"], 14, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["George"], 15, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Gus"], 16, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Haley"], 17, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Harvey"], 18, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Jas"], 19, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Jodi"], 20, -1, -1));
            if (showExtras[3])
            {
                this.options.Add(new MapModCheckbox(npcNames["Kent"], 21, -1, -1));
            }
            this.options.Add(new MapModCheckbox(npcNames["Leah"], 22, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Lewis"], 23, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Linus"], 24, -1, -1));
            if (showExtras[1])
            {
                this.options.Add(new MapModCheckbox(npcNames["Marlon"], 38, -1, -1));
            }
            this.options.Add(new MapModCheckbox(npcNames["Marnie"], 25, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Maru"], 26, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Pam"], 27, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Penny"], 28, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Pierre"], 29, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Robin"], 30, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Sam"], 31, -1, -1));
            if (showExtras[0])
            {
                this.options.Add(new MapModCheckbox(npcNames["Sandy"], 36, -1, -1));
            }
            this.options.Add(new MapModCheckbox(npcNames["Sebastian"], 32, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Shane"], 33, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Vincent"], 34, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Willy"], 35, -1, -1));
            if (showExtras[2])
            {
                this.options.Add(new MapModCheckbox(npcNames["Wizard"], 37, -1, -1));
            }
        }
Exemple #2
0
        public ModMenu(
            Dictionary <string, bool> conditionalNpcs,
            ModCustomizations customizations
            ) : base(Game1.viewport.Width / 2 - (1000 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2, 1000 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2, true)
        {
            var topLeftPositionForCenteringOnScreen =
                Utility.getTopLeftPositionForCenteringOnScreen(ModMain.Map.Bounds.Width * Game1.pixelZoom, 180 * Game1.pixelZoom,
                                                               0, 0);

            mapX     = (int)topLeftPositionForCenteringOnScreen.X;
            mapY     = (int)topLeftPositionForCenteringOnScreen.Y;
            okButton = new ClickableTextureComponent("OK",
                                                     new Rectangle(xPositionOnScreen + width - Game1.tileSize * 2,
                                                                   yPositionOnScreen + height - 7 * Game1.tileSize / 4, Game1.tileSize, Game1.tileSize), null, null,
                                                     Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46, -1, -1), 1f, false);
            upArrow = new ClickableTextureComponent(new Rectangle(xPositionOnScreen + width + Game1.tileSize / 4,
                                                                  yPositionOnScreen + Game1.tileSize,
                                                                  11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 459, 11, 12),
                                                    Game1.pixelZoom);
            downArrow = new ClickableTextureComponent(
                new Rectangle(xPositionOnScreen + width + Game1.tileSize / 4,
                              yPositionOnScreen + height - Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom),
                Game1.mouseCursors, new Rectangle(421, 472, 11, 12), Game1.pixelZoom);
            scrollBar = new ClickableTextureComponent(
                new Rectangle(upArrow.bounds.X + Game1.pixelZoom * 3,
                              upArrow.bounds.Y + upArrow.bounds.Height + Game1.pixelZoom, 6 * Game1.pixelZoom,
                              10 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(435, 463, 6, 10), Game1.pixelZoom);
            scrollBarRunner = new Rectangle(scrollBar.bounds.X,
                                            upArrow.bounds.Y + upArrow.bounds.Height + Game1.pixelZoom, scrollBar.bounds.Width,
                                            height - Game1.tileSize * 2 - upArrow.bounds.Height - Game1.pixelZoom * 2);
            for (var i = 0; i < 7; i++)
            {
                optionSlots.Add(new ClickableComponent(
                                    new Rectangle(xPositionOnScreen + Game1.tileSize / 4,
                                                  yPositionOnScreen + Game1.tileSize * 5 / 4 + Game1.pixelZoom + i * ((height - Game1.tileSize * 2) / 7),
                                                  width - Game1.tileSize / 2, (height - Game1.tileSize * 2) / 7 + Game1.pixelZoom), string.Concat(i)));
            }

            // Translate labels and initialize buttons to handle button press
            string minimapLabel   = ModMain.Helper.Translation.Get("minimap.label");
            string immersionLabel = ModMain.Helper.Translation.Get("immersion.label");
            string villagersLabel = ModMain.Helper.Translation.Get("villagers.label");

            immersionButton1 = new MapModButton("immersion.option1", 4, -1, -1, -1, -1);
            immersionButton2 = new MapModButton("immersion.option2", 5, -1, -1, -1, -1);
            immersionButton3 = new MapModButton("immersion.option3", 6, -1, -1, -1, -1);

            //this.options.Add(new OptionsElement("Menu Key:"));
            //this.options.Add(new MapModInputListener("Change menu key", 37, this.optionSlots[0].bounds.Width, -1, -1));
            options.Add(new OptionsElement("NPC Map Locations"));

            var widths = new List <int>();

            for (var i = 0; i < 16; i++)
            {
                widths.Add(75 + i * 15);
            }

            var heights = new List <int>();

            for (var j = 0; j < 10; j++)
            {
                heights.Add(45 + j * 15);
            }

            var percentages = new List <int>();

            for (var k = 0; k < 11; k++)
            {
                percentages.Add(50 + k * 5);
            }

            options.Add(new OptionsElement(minimapLabel));
            options.Add(new ModCheckbox("minimap.option1", 54, -1, -1, customizations));
            options.Add(new ModPlusMinus("minimap.plusMinus1", 55, widths));
            options.Add(new ModPlusMinus("minimap.plusMinus2", 56, heights));
            //options.Add(new ModPlusMinus("minimap.plusMinus3", 57, percentages));

            options.Add(new OptionsElement(immersionLabel));
            options.Add(immersionButton1);
            options.Add(immersionButton2);
            options.Add(immersionButton3);
            options.Add(new ModCheckbox("immersion.option4", 49, -1, -1, customizations));
            options.Add(new ModCheckbox("immersion.option5", 50, -1, -1, customizations));
            options.Add(new MapModSlider("immersion.slider1", 0, -1, -1, 0, 12));
            options.Add(new MapModSlider("immersion.slider2", 1, -1, -1, 0, 12));

            options.Add(new ModCheckbox("extra.option1", 51, -1, -1, customizations));
            options.Add(new ModCheckbox("extra.option2", 52, -1, -1, customizations));
            options.Add(new ModCheckbox("extra.option3", 53, -1, -1, customizations));
            options.Add(new OptionsElement(villagersLabel));

            // Villagers + up to 10 custom NPCs
            var orderedNames = customizations.Names.Keys.ToList();

            orderedNames.Sort();
            var idx = 7;

            foreach (var name in orderedNames)
            {
                if (conditionalNpcs.ContainsKey(name))
                {
                    if (conditionalNpcs[name])
                    {
                        options.Add(new ModCheckbox(name, idx++, -1, -1, customizations));
                    }
                    else
                    {
                        idx++;
                    }
                }
                else
                {
                    options.Add(new ModCheckbox(name, idx++, -1, -1, customizations));
                }
            }
        }
        public ModMenu(
            Dictionary <string, NpcMarker> npcMarkers,
            Dictionary <string, bool> conditionalNpcs
            ) : base(Game1.viewport.Width / 2 - (1000 + IClickableMenu.borderWidth * 2) / 2, Game1.viewport.Height / 2 - (600 + IClickableMenu.borderWidth * 2) / 2, 1000 + IClickableMenu.borderWidth * 2, 600 + IClickableMenu.borderWidth * 2, true)
        {
            this.npcMarkers = npcMarkers;

            var topLeftPositionForCenteringOnScreen =
                Utility.getTopLeftPositionForCenteringOnScreen(ModMain.Map.Bounds.Width * Game1.pixelZoom, 180 * Game1.pixelZoom,
                                                               0, 0);

            mapX = (int)topLeftPositionForCenteringOnScreen.X;
            mapY = (int)topLeftPositionForCenteringOnScreen.Y;

            // Most of this mess is straight from the game code just... just give it space
            okButton = new ClickableTextureComponent("OK",
                                                     new Rectangle(xPositionOnScreen + width - Game1.tileSize * 2,
                                                                   yPositionOnScreen + height - 7 * Game1.tileSize / 4, Game1.tileSize, Game1.tileSize), null, null,
                                                     Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46, -1, -1), 1f, false);

            upArrow = new ClickableTextureComponent(new Rectangle(xPositionOnScreen + width + Game1.tileSize / 4,
                                                                  yPositionOnScreen + Game1.tileSize,
                                                                  11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 459, 11, 12),
                                                    Game1.pixelZoom);

            downArrow = new ClickableTextureComponent(
                new Rectangle(xPositionOnScreen + width + Game1.tileSize / 4,
                              yPositionOnScreen + height - Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom),
                Game1.mouseCursors, new Rectangle(421, 472, 11, 12), Game1.pixelZoom);

            scrollBar = new ClickableTextureComponent(
                new Rectangle(upArrow.bounds.X + Game1.pixelZoom * 3,
                              upArrow.bounds.Y + upArrow.bounds.Height + Game1.pixelZoom, 6 * Game1.pixelZoom,
                              10 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(435, 463, 6, 10), Game1.pixelZoom);

            scrollBarRunner = new Rectangle(scrollBar.bounds.X,
                                            upArrow.bounds.Y + upArrow.bounds.Height + Game1.pixelZoom, scrollBar.bounds.Width,
                                            height - Game1.tileSize * 2 - upArrow.bounds.Height - Game1.pixelZoom * 2);

            for (var i = 0; i < 7; i++)
            {
                optionSlots.Add(new ClickableComponent(
                                    new Rectangle(xPositionOnScreen + Game1.tileSize / 4,
                                                  yPositionOnScreen + Game1.tileSize * 5 / 4 + Game1.pixelZoom + i * ((height - Game1.tileSize * 2) / 7),
                                                  width - Game1.tileSize / 2, (height - Game1.tileSize * 2) / 7 + Game1.pixelZoom), string.Concat(i)));
            }

            options.Add(new OptionsElement("NPC Map Locations"));

            var widths = new List <int>();

            for (var i = 0; i < 16; i++)
            {
                widths.Add(75 + i * 15);
            }

            var heights = new List <int>();

            for (var j = 0; j < 10; j++)
            {
                heights.Add(45 + j * 15);
            }

            string minimapLabel = ModMain.Helper.Translation.Get("minimap.label");

            options.Add(new OptionsElement(minimapLabel));
            options.Add(new ModCheckbox("minimap.option1", 0, -1, -1));
            options.Add(new ModPlusMinus("minimap.plusMinus1", 1, widths));
            options.Add(new ModPlusMinus("minimap.plusMinus2", 2, heights));

            // Translate labels and initialize buttons to handle button press
            string immersionLabel = ModMain.Helper.Translation.Get("immersion.label");

            options.Add(new OptionsElement(immersionLabel));
            immersionButton1 = new MapModButton("immersion.option1", 3, -1, -1, -1, -1);
            immersionButton2 = new MapModButton("immersion.option2", 4, -1, -1, -1, -1);
            immersionButton3 = new MapModButton("immersion.option3", 5, -1, -1, -1, -1);
            options.Add(immersionButton1);
            options.Add(immersionButton2);
            options.Add(immersionButton3);

            options.Add(new ModCheckbox("immersion.option4", 6, -1, -1));
            options.Add(new ModCheckbox("immersion.option5", 7, -1, -1));
            options.Add(new MapModSlider("immersion.slider1", 8, -1, -1, 0, 12));
            options.Add(new MapModSlider("immersion.slider2", 9, -1, -1, 0, 12));

            options.Add(new ModCheckbox("extra.option1", 10, -1, -1));
            options.Add(new ModCheckbox("extra.option2", 11, -1, -1));
            options.Add(new ModCheckbox("extra.option3", 12, -1, -1));

            string villagersLabel = ModMain.Helper.Translation.Get("villagers.label");

            options.Add(new OptionsElement(villagersLabel));

            var orderedMarkers = npcMarkers.ToList()
                                 .Where(x => x.Value.Sprite != null && x.Value.Type == Character.Villager)
                                 .OrderBy(x => x.Value.DisplayName);

            var idx = 13;

            foreach (var npcMarker in orderedMarkers)
            {
                if (conditionalNpcs.ContainsKey(npcMarker.Key))
                {
                    if (conditionalNpcs[npcMarker.Key])
                    {
                        options.Add(new ModCheckbox(npcMarker.Value.DisplayName, idx++, -1, -1, orderedMarkers));
                    }
                    else
                    {
                        idx++;
                    }
                }
                else
                {
                    options.Add(new ModCheckbox(npcMarker.Value.DisplayName, idx++, -1, -1, orderedMarkers));
                }
            }
        }
        public ModMenu(int x, int y, int width, int height, Dictionary <string, bool> secondaryNPCs, Dictionary <string, object> customNPCs, Dictionary <string, string> npcNames, Dictionary <string, int> markerCrop) : base(x, y, width, height, false)
        {
            this.map = Game1.content.Load <Texture2D>("LooseSprites\\map");
            Vector2 topLeftPositionForCenteringOnScreen = Utility.getTopLeftPositionForCenteringOnScreen(this.map.Bounds.Width * Game1.pixelZoom, 180 * Game1.pixelZoom, 0, 0);

            this.mapX            = (int)topLeftPositionForCenteringOnScreen.X;
            this.mapY            = (int)topLeftPositionForCenteringOnScreen.Y;
            this.okButton        = new ClickableTextureComponent("OK", new Rectangle(this.xPositionOnScreen + width + Game1.tileSize, this.yPositionOnScreen + height - IClickableMenu.borderWidth - Game1.tileSize / 4, Game1.tileSize, Game1.tileSize), null, null, Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46, -1, -1), 1f, false);
            this.upArrow         = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + width + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 459, 11, 12), (float)Game1.pixelZoom);
            this.downArrow       = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + width + Game1.tileSize / 4, this.yPositionOnScreen + height - Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 472, 11, 12), (float)Game1.pixelZoom);
            this.scrollBar       = new ClickableTextureComponent(new Rectangle(this.upArrow.bounds.X + Game1.pixelZoom * 3, this.upArrow.bounds.Y + this.upArrow.bounds.Height + Game1.pixelZoom, 6 * Game1.pixelZoom, 10 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(435, 463, 6, 10), (float)Game1.pixelZoom);
            this.scrollBarRunner = new Rectangle(this.scrollBar.bounds.X, this.upArrow.bounds.Y + this.upArrow.bounds.Height + Game1.pixelZoom, this.scrollBar.bounds.Width, height - Game1.tileSize * 2 - this.upArrow.bounds.Height - Game1.pixelZoom * 2);
            for (int i = 0; i < 7; i++)
            {
                this.optionSlots.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize * 5 / 4 + Game1.pixelZoom + i * ((height - Game1.tileSize * 2) / 7), width - Game1.tileSize / 2, (height - Game1.tileSize * 2) / 7 + Game1.pixelZoom), string.Concat(i)));
            }

            // Translate labels and initialize buttons to handle button press
            string immersionLabel = ModMain.modHelper.Translation.Get("immersion.label");
            string extraLabel     = ModMain.modHelper.Translation.Get("extra.label");
            string villagersLabel = ModMain.modHelper.Translation.Get("villagers.label");

            immersionButton1 = new MapModButton("immersion.option1", 4, -1, -1, -1, -1);
            immersionButton2 = new MapModButton("immersion.option2", 5, -1, -1, -1, -1);
            immersionButton3 = new MapModButton("immersion.option3", 6, -1, -1, -1, -1);

            //this.options.Add(new OptionsElement("Menu Key:"));
            //this.options.Add(new MapModInputListener("Change menu key", 37, this.optionSlots[0].bounds.Width, -1, -1));
            this.options.Add(new OptionsElement("NPC Map Locations"));
            this.options.Add(new OptionsElement(immersionLabel));
            this.options.Add(immersionButton1);
            this.options.Add(immersionButton2);
            this.options.Add(immersionButton3);
            this.options.Add(new ModCheckbox("immersion.option4", 44, -1, -1));
            this.options.Add(new ModCheckbox("immersion.option5", 45, -1, -1));
            this.options.Add(new MapModSlider("immersion.slider1", 0, -1, -1));
            this.options.Add(new MapModSlider("immersion.slider2", 1, -1, -1));
            this.options.Add(new OptionsElement(extraLabel));
            this.options.Add(new ModCheckbox("extra.option1", 46, -1, -1));
            this.options.Add(new ModCheckbox("extra.option2", 47, -1, -1));
            this.options.Add(new ModCheckbox("extra.option3", 48, -1, -1));
            this.options.Add(new OptionsElement(villagersLabel));
            // Custom NPCs
            if (customNPCs != null)
            {
                for (int i = 0; i < customNPCs.Count; i++)
                {
                    this.options.Add(new ModCheckbox(customNPCs.Keys.ElementAt(i), 39 + i, -1, -1, npcNames, markerCrop, customNPCs));
                }
            }
            // Villagers
            var orderedNames = npcNames.Keys.ToList();

            orderedNames.Sort();
            int idx = 7;

            foreach (var name in orderedNames)
            {
                if (secondaryNPCs.Keys.Contains(name))
                {
                    if (secondaryNPCs[name])
                    {
                        this.options.Add(new ModCheckbox(name, idx++, -1, -1, npcNames, markerCrop, customNPCs));
                    }
                    else
                    {
                        idx++;
                        continue;
                    }
                }
                else
                {
                    this.options.Add(new ModCheckbox(name, idx++, -1, -1, npcNames, markerCrop, customNPCs));
                }
            }
        }
        public MapModMenu(int x, int y, int width, int height, bool[] showExtras, Dictionary <string, Dictionary <string, int> > customNPCs, Dictionary <string, string> npcNames) : base(x, y, width, height, false)
        {
            this.map = Game1.content.Load <Texture2D>("LooseSprites\\map");
            Vector2 topLeftPositionForCenteringOnScreen = Utility.getTopLeftPositionForCenteringOnScreen(this.map.Bounds.Width * Game1.pixelZoom, 180 * Game1.pixelZoom, 0, 0);

            this.mapX            = (int)topLeftPositionForCenteringOnScreen.X;
            this.mapY            = (int)topLeftPositionForCenteringOnScreen.Y;
            this.okButton        = new ClickableTextureComponent("OK", new Rectangle(this.xPositionOnScreen + width + Game1.tileSize, this.yPositionOnScreen + height - IClickableMenu.borderWidth - Game1.tileSize / 4, Game1.tileSize, Game1.tileSize), null, null, Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46, -1, -1), 1f, false);
            this.upArrow         = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + width + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 459, 11, 12), (float)Game1.pixelZoom);
            this.downArrow       = new ClickableTextureComponent(new Rectangle(this.xPositionOnScreen + width + Game1.tileSize / 4, this.yPositionOnScreen + height - Game1.tileSize, 11 * Game1.pixelZoom, 12 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(421, 472, 11, 12), (float)Game1.pixelZoom);
            this.scrollBar       = new ClickableTextureComponent(new Rectangle(this.upArrow.bounds.X + Game1.pixelZoom * 3, this.upArrow.bounds.Y + this.upArrow.bounds.Height + Game1.pixelZoom, 6 * Game1.pixelZoom, 10 * Game1.pixelZoom), Game1.mouseCursors, new Rectangle(435, 463, 6, 10), (float)Game1.pixelZoom);
            this.scrollBarRunner = new Rectangle(this.scrollBar.bounds.X, this.upArrow.bounds.Y + this.upArrow.bounds.Height + Game1.pixelZoom, this.scrollBar.bounds.Width, height - Game1.tileSize * 2 - this.upArrow.bounds.Height - Game1.pixelZoom * 2);
            for (int i = 0; i < 7; i++)
            {
                this.optionSlots.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize / 4, this.yPositionOnScreen + Game1.tileSize * 5 / 4 + Game1.pixelZoom + i * ((height - Game1.tileSize * 2) / 7), width - Game1.tileSize / 2, (height - Game1.tileSize * 2) / 7 + Game1.pixelZoom), string.Concat(i)));
            }
            tooltipButton1   = new MapModButton("Above Location Tooltip", 1, -1, -1, -1, -1);
            tooltipButton2   = new MapModButton("Below Location Tooltip", 2, -1, -1, -1, -1);
            tooltipButton3   = new MapModButton("Bottom-left Corner", 3, -1, -1, -1, -1);
            immersionButton1 = new MapModButton("Always Show Villagers", 4, -1, -1, -1, -1);
            immersionButton2 = new MapModButton("Show Villagers Player Has Talked To", 5, -1, -1, -1, -1);
            immersionButton3 = new MapModButton("Hide Villagers Player Has Talked To", 6, -1, -1, -1, -1);
            //this.options.Add(new OptionsElement("Menu Key:"));
            //this.options.Add(new MapModInputListener("Change menu key", 37, this.optionSlots[0].bounds.Width, -1, -1));
            this.options.Add(new OptionsElement("NPC Map Locations Mod Version"));
            this.options.Add(new OptionsElement("Names Tooltip Placement:"));
            this.options.Add(tooltipButton1);
            this.options.Add(tooltipButton2);
            this.options.Add(tooltipButton3);
            this.options.Add(new OptionsElement("Immersion Settings:"));
            this.options.Add(immersionButton1);
            this.options.Add(immersionButton2);
            this.options.Add(immersionButton3);
            this.options.Add(new MapModCheckbox("Only Show Villagers in Player's Location", 39, -1, -1));
            this.options.Add(new MapModCheckbox("Only Show Villagers Within Specified Heart Level", 41, -1, -1));
            this.options.Add(new MapModSlider("Minimum Heart Level", 0, -1, -1));
            this.options.Add(new MapModSlider("Maximum Heart Level", 1, -1, -1));
            this.options.Add(new OptionsElement("Extra Settings:"));
            this.options.Add(new MapModCheckbox("Show Hidden Villagers", 48, -1, -1));
            this.options.Add(new MapModCheckbox("Mark Villagers With Daily Quest or Birthday", 42, -1, -1));
            // Custom NPCs
            if (customNPCs != null)
            {
                foreach (KeyValuePair <string, Dictionary <string, int> > entry in customNPCs)
                {
                    if (MapModMain.customNpcId > 0)
                    {
                        this.options.Add(new MapModCheckbox("Show " + entry.Key, 42 + MapModMain.customNpcId, -1, -1));
                    }
                }
            }
            this.options.Add(new MapModCheckbox("Show Traveling Merchant", 40, -1, -1));
            this.options.Add(new OptionsElement("Include/Exclude Villagers:"));
            this.options.Add(new MapModCheckbox(npcNames["Abigail"], 7, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Alex"], 8, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Caroline"], 9, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Clint"], 10, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Demetrius"], 11, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Elliott"], 12, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Emily"], 13, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Evelyn"], 14, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["George"], 15, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Gus"], 16, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Haley"], 17, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Harvey"], 18, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Jas"], 19, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Jodi"], 20, -1, -1));
            if (showExtras[3])
            {
                this.options.Add(new MapModCheckbox(npcNames["Kent"], 21, -1, -1));
            }
            this.options.Add(new MapModCheckbox(npcNames["Leah"], 22, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Lewis"], 23, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Linus"], 24, -1, -1));
            if (showExtras[1])
            {
                this.options.Add(new MapModCheckbox(npcNames["Marlon"], 38, -1, -1));
            }
            this.options.Add(new MapModCheckbox(npcNames["Marnie"], 25, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Maru"], 26, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Pam"], 27, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Penny"], 28, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Pierre"], 29, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Robin"], 30, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Sam"], 31, -1, -1));
            if (showExtras[0])
            {
                this.options.Add(new MapModCheckbox(npcNames["Sandy"], 36, -1, -1));
            }
            this.options.Add(new MapModCheckbox(npcNames["Sebastian"], 32, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Shane"], 33, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Vincent"], 34, -1, -1));
            this.options.Add(new MapModCheckbox(npcNames["Willy"], 35, -1, -1));
            if (showExtras[2])
            {
                this.options.Add(new MapModCheckbox(npcNames["Wizard"], 37, -1, -1));
            }
        }