Esempio n. 1
0
 internal static string CSText(string key, string category = "ItemBrowser") => CheatSheet.CSText(category, key);
Esempio n. 2
0
 internal static string CSText(string key, string category = "ConfigurationTool") => CheatSheet.CSText(category, key);
Esempio n. 3
0
 public static string BuildCheatSheet()
 {
     return(CheatSheet.BuildCheatSheet(false, false));
 }
        public QuickClearHotbar(CheatSheet mod)
        {
            this.mod = mod;
            //parentHotbar = mod.hotbar;

            this.buttonView = new UIView();
            base.Visible    = false;

            // Button images
            bItems       = new UIImage(Main.itemTexture[ItemID.WoodenSword]);
            bProjectiles = new UIImage(Main.itemTexture[ItemID.WoodenArrow]);
            bBuffs       = new UIImage(Main.buffTexture[BuffID.Honey]);
            bDebuffs     = new UIImage(Main.buffTexture[BuffID.Poisoned]);

            // Button tooltips
            bItems.Tooltip       = CSText("ClearDroppedItems");
            bProjectiles.Tooltip = CSText("ClearProjectiles");
            bBuffs.Tooltip       = CSText("ClearBuffs");
            bDebuffs.Tooltip     = CSText("ClearDebuffs");

            // Button EventHandlers
            bItems.onLeftClick += (s, e) =>
            {
                HandleQuickClear();
            };
            bProjectiles.onLeftClick += (s, e) =>
            {
                HandleQuickClear(1);
            };
            bBuffs.onLeftClick += (s, e) =>
            {
                HandleQuickClear(2);
            };
            bDebuffs.onLeftClick += (s, e) =>
            {
                HandleQuickClear(3);
            };

            // Register mousedown
            onMouseDown += (s, e) =>
            {
                if (!Main.LocalPlayer.mouseInterface && !mod.hotbar.MouseInside && !mod.hotbar.button.MouseInside)
                {
                    mouseDown = true;
                    Main.LocalPlayer.mouseInterface = true;
                }
            };
            onMouseUp += (s, e) => { justMouseDown = true; mouseDown = false; /*startTileX = -1; startTileY = -1;*/ };

            // ButtonView
            buttonView.AddChild(bItems);
            buttonView.AddChild(bProjectiles);
            buttonView.AddChild(bBuffs);
            buttonView.AddChild(bDebuffs);

            base.Width             = 200f;
            base.Height            = 55f;
            this.buttonView.Height = base.Height;
            base.Anchor            = AnchorPosition.Top;
            this.AddChild(this.buttonView);
            base.Position = new Vector2(Hotbar.xPosition, this.hiddenPosition);
            base.CenterXAxisToParentCenter();
            float num = this.spacing;

            for (int i = 0; i < this.buttonView.children.Count; i++)
            {
                this.buttonView.children[i].Anchor   = AnchorPosition.Left;
                this.buttonView.children[i].Position = new Vector2(num, 0f);
                this.buttonView.children[i].CenterYAxisToParentCenter();
                this.buttonView.children[i].Visible         = true;
                this.buttonView.children[i].ForegroundColor = buttonUnselectedColor;
                num += this.buttonView.children[i].Width + this.spacing;
            }
            this.Resize();
        }
 internal static string CSText(string key, string category = "SpawnRate") => CheatSheet.CSText(category, key);
Esempio n. 6
0
 internal static string CSText(string key, string category = "Butcherer") => CheatSheet.CSText(category, key);
Esempio n. 7
0
        public PaintToolsHotbar(CheatSheet mod)
        {
            this.mod = mod;
            //parentHotbar = mod.hotbar;

            this.buttonView = new UIView();
            base.Visible    = false;
            //base.UpdateWhenOutOfBounds = true;

            //		bDecreaseBrushSize = new UIImage(Main.itemTexture[ItemID.CopperShortsword]);
            //		bIncreaseBrushSize = new UIImage(Main.itemTexture[ItemID.CrossNecklace]);
            bStampTiles                 = new UIImage(Main.itemTexture[ItemID.Paintbrush]);
            bUndo                       = new UIImage(Main.itemTexture[ItemID.AlphabetStatueU]);
            bEyeDropper                 = new UIImage(Main.itemTexture[ItemID.EmptyDropper]);
            bFlipHorizontal             = new UIImage(mod.GetTexture("CustomUI/Horizontal"));
            bFlipVertical               = new UIImage(mod.GetTexture("CustomUI/Vertical"));
            bToggleTransparentSelection = new UIImage(Main.buffTexture[BuffID.Invisibility]);

            //		this.bIncreaseBrushSize.Tooltip = "    Increase Brush Size";
            //		this.bDecreaseBrushSize.Tooltip = "    Decrease Brush Size";
            bStampTiles.Tooltip                 = CSText("PaintTiles");
            bEyeDropper.Tooltip                 = CSText("EyeDropper");
            bUndo.Tooltip                       = CSText("Undo");
            bFlipHorizontal.Tooltip             = CSText("FlipHorizontal");
            bFlipVertical.Tooltip               = CSText("FlipVertical");
            bToggleTransparentSelection.Tooltip = CSText("TransparentSelectionOff");

            //		this.bIncreaseBrushSize.onLeftClick += (s, e) => brushSize = Math.Min(10, brushSize + 1);
            //		this.bDecreaseBrushSize.onLeftClick += (s, e) => brushSize = Math.Max(1, brushSize - 1);
            bStampTiles.onLeftClick   += new EventHandler(this.bTogglePaintTiles_onLeftClick);
            bEyeDropper.onLeftClick   += new EventHandler(this.bToggleEyeDropper_onLeftClick);
            bFlipVertical.onLeftClick += (s, e) =>
            {
                for (int i = 0; i < StampTiles.GetLength(0); i++)
                {
                    for (int j = 0; j < StampTiles.GetLength(1) / 2; j++)
                    {
                        Utils.Swap(ref StampTiles[i, j], ref StampTiles[i, StampTiles.GetLength(1) - 1 - j]);
                    }
                }
                if (stampInfo != null)
                {
                    stampInfo.bFlipVertical = !stampInfo.bFlipVertical;
                }
            };
            bUndo.onLeftClick           += (a, b) => bUndo_onClick(false);
            bUndo.onRightClick          += (a, b) => bUndo_onClick(true);
            bFlipHorizontal.onLeftClick += (s, e) =>
            {
                for (int j = 0; j < StampTiles.GetLength(1); j++)
                {
                    for (int i = 0; i < StampTiles.GetLength(0) / 2; i++)
                    {
                        Utils.Swap(ref StampTiles[i, j], ref StampTiles[StampTiles.GetLength(0) - 1 - i, j]);
                    }
                }
                if (stampInfo != null)
                {
                    stampInfo.bFlipHorizontal = !stampInfo.bFlipHorizontal;
                }
            };
            bToggleTransparentSelection.onLeftClick += (s, e) => { TransparentSelectionEnabled = !TransparentSelectionEnabled; bToggleTransparentSelection.Tooltip = TransparentSelectionEnabled ? CSText("TransparentSelectionOn") : CSText("TransparentSelectionOff"); };

            onMouseDown += (s, e) =>
            {
                if (!Main.LocalPlayer.mouseInterface && !mod.hotbar.MouseInside && !mod.hotbar.button.MouseInside && !UIView.MouseRightButton)
                {
                    leftMouseDown = true;
                    Main.LocalPlayer.mouseInterface = true;
                }
            };
            onMouseUp += (s, e) =>
            {
                if (!Main.LocalPlayer.mouseInterface && !mod.hotbar.MouseInside && !mod.hotbar.button.MouseInside && (!UIView.MousePrevRightButton || (UIView.MousePrevLeftButton && !UIView.MouseLeftButton)))
                {
                    justLeftMouseDown = true; leftMouseDown = false;                     /*startTileX = -1; startTileY = -1;*/
                }
            };

            //UpdateWhenOutOfBounds = true;

            //	buttonView.AddChild(bDecreaseBrushSize);
            //		buttonView.AddChild(bIncreaseBrushSize);
            buttonView.AddChild(bStampTiles);
            buttonView.AddChild(bEyeDropper);
            buttonView.AddChild(bUndo);
            buttonView.AddChild(bFlipHorizontal);
            buttonView.AddChild(bFlipVertical);
            buttonView.AddChild(bToggleTransparentSelection);

            base.Width             = 200f;
            base.Height            = 55f;
            this.buttonView.Height = base.Height;
            base.Anchor            = AnchorPosition.Top;
            this.AddChild(this.buttonView);
            base.Position = new Vector2(Hotbar.xPosition, this.hiddenPosition);
            base.CenterXAxisToParentCenter();
            float num = this.spacing;

            for (int i = 0; i < this.buttonView.children.Count; i++)
            {
                this.buttonView.children[i].Anchor   = AnchorPosition.Left;
                this.buttonView.children[i].Position = new Vector2(num, 0f);
                this.buttonView.children[i].CenterYAxisToParentCenter();
                this.buttonView.children[i].Visible         = true;
                this.buttonView.children[i].ForegroundColor = buttonUnselectedColor;
                num += this.buttonView.children[i].Width + this.spacing;
            }
            this.Resize();
        }
Esempio n. 8
0
 internal static string CSText(string key, string category = "Teleport") => CheatSheet.CSText(category, key);
Esempio n. 9
0
        public QuickTeleportHotbar(CheatSheet mod)
        {
            this.mod = mod;
            //parentHotbar = mod.hotbar;

            buttonView = new UIView();
            Visible    = false;
            //base.UpdateWhenOutOfBounds = true;

            Main.instance.LoadItem(ItemID.DungeonDoor);
            Main.instance.LoadItem(ItemID.WoodenDoor);
            Main.instance.LoadItem(ItemID.ObsidianDoor);
            Main.instance.LoadItem(ItemID.LihzahrdDoor);
            Main.instance.LoadItem(ItemID.SpookyDoor);

            bDungeon = new UIImage(TextureAssets.Item[ItemID.DungeonDoor].Value);
            bSpawn   = new UIImage(TextureAssets.Item[ItemID.WoodenDoor].Value);
            bHell    = new UIImage(TextureAssets.Item[ItemID.ObsidianDoor].Value);
            bTemple  = new UIImage(TextureAssets.Item[ItemID.LihzahrdDoor].Value);
            bRandom  = new UIImage(TextureAssets.Item[ItemID.SpookyDoor].Value);

            bDungeon.Tooltip = CSText("Dungeon");
            bSpawn.Tooltip   = CSText("Spawnpoint");
            bHell.Tooltip    = CSText("Hell");
            bTemple.Tooltip  = CSText("Temple");
            bRandom.Tooltip  = CSText("Random");

            bDungeon.onLeftClick += (s, e) => { HandleTeleport(); };
            bSpawn.onLeftClick   += (s, e) => { HandleTeleport(1); };
            bHell.onLeftClick    += (s, e) => { HandleTeleport(2); };
            bTemple.onLeftClick  += (s, e) => { HandleTeleport(3); };
            bRandom.onLeftClick  += (s, e) => { HandleTeleport(4); };

            onMouseDown += (s, e) =>
            {
                if (!Main.LocalPlayer.mouseInterface && !mod.hotbar.MouseInside && !mod.hotbar.button.MouseInside)
                {
                    mouseDown = true;
                    Main.LocalPlayer.mouseInterface = true;
                }
            };
            onMouseUp += (s, e) =>
            {
                justMouseDown = true;
                mouseDown     = false;             /*startTileX = -1; startTileY = -1;*/
            };

            //UpdateWhenOutOfBounds = true;

            buttonView.AddChild(bDungeon);
            buttonView.AddChild(bSpawn);
            buttonView.AddChild(bHell);
            buttonView.AddChild(bTemple);
            buttonView.AddChild(bRandom);

            Width             = 200f;
            Height            = 55f;
            buttonView.Height = Height;
            Anchor            = AnchorPosition.Top;
            AddChild(buttonView);
            Position = new Vector2(Hotbar.xPosition, hiddenPosition);
            CenterXAxisToParentCenter();
            float num = spacing;

            for (int i = 0; i < buttonView.children.Count; i++)
            {
                buttonView.children[i].Anchor   = AnchorPosition.Left;
                buttonView.children[i].Position = new Vector2(num, 0f);
                buttonView.children[i].CenterYAxisToParentCenter();
                buttonView.children[i].Visible         = true;
                buttonView.children[i].ForegroundColor = buttonUnselectedColor;
                num += buttonView.children[i].Width + spacing;
            }

            Resize();
        }
Esempio n. 10
0
        // 270 : 16 40 ?? 16

        public RecipeBrowserWindow(CheatSheet mod)
        {
            Main.instance.LoadItem(ItemID.AlphabetStatueA);
            Main.instance.LoadItem(ItemID.AlphabetStatueM);

            Texture2D[] categoryIcons =
            {
                TextureAssets.Item[ItemID.AlphabetStatueA].Value,
                TextureAssets.Item[ItemID.AlphabetStatueM].Value,
            };

            categories.Clear();
            bCategories         = new UIImage[categoryIcons.Length];
            recipeView          = new RecipeView();
            this.mod            = mod;
            CanMove             = true;
            Width               = recipeView.Width + spacing * 2f;
            Height              = 420f;
            recipeView.Position = new Vector2(spacing, spacing + 40);
            AddChild(recipeView);
            InitializeRecipeCategories();
            Texture2D texture = mod.GetTexture("UI/closeButton").Value;
            UIImage   uIImage = new UIImage(texture);

            uIImage.Anchor       = AnchorPosition.TopRight;
            uIImage.Position     = new Vector2(Width - spacing, spacing);
            uIImage.onLeftClick += bClose_onLeftClick;
            AddChild(uIImage);
            textbox             = new UITextbox();
            textbox.Anchor      = AnchorPosition.TopRight;
            textbox.Position    = new Vector2(Width - spacing * 2f - uIImage.Width, spacing /** 2f + uIImage.Height*/);
            textbox.KeyPressed += textbox_KeyPressed;
            AddChild(textbox);

            //lookupItemSlot = new Slot(0);
            lookupItemSlot          = new RecipeQuerySlot();
            lookupItemSlot.Position = new Vector2(spacing, halfspacing);
            lookupItemSlot.Scale    = .85f;
            //lookupItemSlot.functionalSlot = true;
            AddChild(lookupItemSlot);

            for (int j = 0; j < categoryIcons.Length; j++)
            {
                UIImage uIImage2 = new UIImage(categoryIcons[j]);
                Vector2 position = new Vector2(spacing + 48, spacing);
                uIImage2.Scale = 32f / Math.Max(categoryIcons[j].Width, categoryIcons[j].Height);

                position.X += j % 6 * 40;
                position.Y += j / 6 * 40;

                if (categoryIcons[j].Height > categoryIcons[j].Width)
                {
                    position.X += (32 - categoryIcons[j].Width) / 2;
                }
                else if (categoryIcons[j].Height < categoryIcons[j].Width)
                {
                    position.Y += (32 - categoryIcons[j].Height) / 2;
                }

                uIImage2.Position        = position;
                uIImage2.Tag             = j;
                uIImage2.onLeftClick    += (s, e) => buttonClick(s, e, true);
                uIImage2.onRightClick   += (s, e) => buttonClick(s, e, false);
                uIImage2.ForegroundColor = buttonColor;
                if (j == 0)
                {
                    uIImage2.ForegroundColor = buttonSelectedColor;
                }

                uIImage2.Tooltip = categNames[j];
                bCategories[j]   = uIImage2;
                AddChild(uIImage2);
            }

            ingredients = new GenericItemSlot[Recipe.maxRequirements];
            for (int j = 0; j < Recipe.maxRequirements; j++)
            {
                GenericItemSlot genericItemSlot = new GenericItemSlot();
                Vector2         position        = new Vector2(spacing, spacing);

                //position.X += j * 60 + 120;
                //position.Y += 250;

                position.X += 166 + j % cols * 51;
                position.Y += 244 + j / cols * 51;

                genericItemSlot.Position = position;
                genericItemSlot.Tag      = j;
                ingredients[j]           = genericItemSlot;
                AddChild(genericItemSlot, false);
            }

            recipeView.selectedCategory = categories[0].ToArray();
            recipeView.activeSlots      = recipeView.selectedCategory;
            recipeView.ReorderSlots();
        }
Esempio n. 11
0
 internal static string CSText(string key, string category = "LightHack") => CheatSheet.CSText(category, key);
Esempio n. 12
0
 internal static string CSText(string key, string category = "GodMode") => CheatSheet.CSText(category, key);
Esempio n. 13
0
        public ExtendedCheatMenu(CheatSheet mod)
        {
            buttons      = new UIImage[CheatSheet.ButtonTexture.Count];
            this.mod     = mod;
            this.CanMove = true;
            base.Width   = spacing * 2;
            base.Height  = spacing * 2;

            if (CheatSheet.ButtonTexture.Count == 0)
            {
                UILabel none = new UILabel(CSText("NoExtensionCheatModsInstalled"));
                none.Scale = .3f;
                //none.OverridesMouse = false;
                //none.
                //none.MouseInside = (X => false);
                none.Position = new Vector2(spacing, spacing);
                AddChild(none);
                Height = 100;
                Width  = 140;
            }

            if (CheatSheet.ButtonTexture.Count > 0)
            {
                int count = CheatSheet.ButtonTexture.Count;

                int cols = (count + 4) / 5;
                int rows = count >= 5 ? 5 : count;

                for (int j = 0; j < CheatSheet.ButtonTexture.Count; j++)
                {
                    UIImage button   = new UIImage(CheatSheet.ButtonTexture[j]);
                    Vector2 position = new Vector2(this.spacing + 1, this.spacing + 1);
                    button.Scale = 38f / Math.Max(CheatSheet.ButtonTexture[j].Width, CheatSheet.ButtonTexture[j].Height);

                    position.X += (float)(j / rows * 40);
                    position.Y += (float)(j % rows * 40);

                    if (CheatSheet.ButtonTexture[j].Height > CheatSheet.ButtonTexture[j].Width)
                    {
                        position.X += (38 - CheatSheet.ButtonTexture[j].Width) / 2;
                    }
                    else if (CheatSheet.ButtonTexture[j].Height < CheatSheet.ButtonTexture[j].Width)
                    {
                        position.Y += (38 - CheatSheet.ButtonTexture[j].Height) / 2;
                    }

                    button.Position     = position;
                    button.Tag          = j;
                    button.onLeftClick += new EventHandler(this.button_onLeftClick);
                    button.onHover     += new EventHandler(this.button_onHover);
                    //	button.ForegroundColor = RecipeBrowser.buttonColor;
                    //	uIImage2.Tooltip = RecipeBrowser.categNames[j];
                    ExtendedCheatMenu.buttons[j] = button;
                    this.AddChild(button);
                }

                Width  += 40 * cols;
                Height += 40 * rows;
            }

            Texture2D texture = mod.GetTexture("UI/closeButton");
            UIImage   uIImage = new UIImage(texture);

            uIImage.Anchor       = AnchorPosition.TopRight;
            uIImage.Position     = new Vector2(base.Width - this.spacing / 2, this.spacing / 2);
            uIImage.onLeftClick += new EventHandler(this.bClose_onLeftClick);
            this.AddChild(uIImage);
        }
Esempio n. 14
0
        public static string Rules2(Rule R, bool useExample)
        {
            string s = R.RuleText == null?CheatSheet.BuildRules2(R, useExample) : R.RuleText;

            return("<div class='err'>" + R.Name + "</div>" + s);
        }
Esempio n. 15
0
        public ItemBrowser(CheatSheet mod)
        {
            categories.Clear();
            bCategories            = new UIImage[categoryIcons.Length];
            this.itemView          = new ItemView();
            this.mod               = mod;
            this.CanMove           = true;
            base.Width             = this.itemView.Width + this.spacing * 2f;
            base.Height            = 420f;
            this.itemView.Position = new Vector2(this.spacing, base.Height - this.spacing - this.itemView.Height);
            this.AddChild(this.itemView);
            this.ParseList2();
            Texture2D texture = mod.GetTexture("UI/closeButton");
            UIImage   uIImage = new UIImage(texture /*UIView.GetEmbeddedTexture("Images.closeButton.png")*/);

            uIImage.Anchor       = AnchorPosition.TopRight;
            uIImage.Position     = new Vector2(base.Width - this.spacing, this.spacing);
            uIImage.onLeftClick += new EventHandler(this.bClose_onLeftClick);
            this.AddChild(uIImage);
            this.textbox          = new UITextbox();
            this.textbox.Width    = 100;
            this.textbox.Anchor   = AnchorPosition.TopRight;
            this.textbox.Position = new Vector2(base.Width - this.spacing * 2f - uIImage.Width, this.spacing + 40);
            //	this.textbox.Position = new Vector2(base.Width - this.spacing * 2f - uIImage.Width, this.spacing * 2f + uIImage.Height);
            this.textbox.KeyPressed += new UITextbox.KeyPressedHandler(this.textbox_KeyPressed);
            this.AddChild(this.textbox);
            for (int j = 0; j < ItemBrowser.categoryIcons.Length; j++)
            {
                UIImage uIImage2 = new UIImage(ItemBrowser.categoryIcons[j]);
                Vector2 position = new Vector2(this.spacing, this.spacing);
                uIImage2.Scale = 32f / Math.Max(categoryIcons[j].Width, categoryIcons[j].Height);

                position.X += (float)(j % 12 * 40);
                position.Y += (float)(j / 12 * 40);

                if (categoryIcons[j].Height > categoryIcons[j].Width)
                {
                    position.X += (32 - categoryIcons[j].Width) / 2;
                }
                else if (categoryIcons[j].Height < categoryIcons[j].Width)
                {
                    position.Y += (32 - categoryIcons[j].Height) / 2;
                }

                uIImage2.Position        = position;
                uIImage2.Tag             = j;
                uIImage2.onLeftClick    += new EventHandler(this.button_onLeftClick);
                uIImage2.ForegroundColor = ItemBrowser.buttonColor;
                if (j == 0)
                {
                    uIImage2.ForegroundColor = ItemBrowser.buttonSelectedColor;
                }
                uIImage2.Tooltip           = ItemBrowser.categNames[j];
                ItemBrowser.bCategories[j] = uIImage2;
                this.AddChild(uIImage2);
            }
            itemView.selectedCategory = ItemBrowser.categories[0].ToArray();
            itemView.activeSlots      = itemView.selectedCategory;
            itemView.ReorderSlots();
            return;
        }
Esempio n. 16
0
        private void BuildCheatSheet(List <Rule> Rules, string file)
        {
            string s = CheatSheet.BuildCheatSheet2(false, false, SortHelper.SortByCharLength(Rules));

            File.WriteAllText(file, s, Encoding.UTF8);
        }
Esempio n. 17
0
 internal static string CSText(string key, string category = "ExtendedCheatMenu") => CheatSheet.CSText(category, key);
Esempio n. 18
0
 internal static string CSText(string key, string category = "MinionSlot") => CheatSheet.CSText(category, key);
Esempio n. 19
0
        public NPCButchererHotbar(CheatSheet mod)
        {
            this.mod = mod;
            //parentHotbar = mod.hotbar;

            this.buttonView = new UIView();
            base.Visible    = false;

            // Button images
            bButcherHostiles = new UIImage(Main.itemTexture[ItemID.DemonHeart]);
            bButcherBoth     = new UIImage(Main.itemTexture[ItemID.CrimsonHeart]);
            bButcherTownNPCs = new UIImage(Main.itemTexture[ItemID.Heart]);

            // Button tooltips
            bButcherHostiles.Tooltip = CSText("ButcherHostileNPCs");
            bButcherBoth.Tooltip     = CSText("ButcherHostileAndFriendlyNPCs");
            bButcherTownNPCs.Tooltip = CSText("ButcherFriendlyNPCs");

            // Button EventHandlers
            bButcherHostiles.onLeftClick += (s, e) =>
            {
                HandleButcher(0);
            };
            bButcherBoth.onLeftClick += (s, e) =>
            {
                HandleButcher(1);
            };
            bButcherTownNPCs.onLeftClick += (s, e) =>
            {
                HandleButcher(2);
            };

            // Register mousedown
            onMouseDown += (s, e) =>
            {
                if (!Main.LocalPlayer.mouseInterface && !mod.hotbar.MouseInside && !mod.hotbar.button.MouseInside)
                {
                    mouseDown = true;
                    Main.LocalPlayer.mouseInterface = true;
                }
            };
            onMouseUp += (s, e) => { justMouseDown = true; mouseDown = false; /*startTileX = -1; startTileY = -1;*/ };

            // ButtonView
            buttonView.AddChild(bButcherHostiles);
            buttonView.AddChild(bButcherBoth);
            buttonView.AddChild(bButcherTownNPCs);

            base.Width             = 200f;
            base.Height            = 55f;
            this.buttonView.Height = base.Height;
            base.Anchor            = AnchorPosition.Top;
            this.AddChild(this.buttonView);
            base.Position = new Vector2(Hotbar.xPosition, this.hiddenPosition);
            base.CenterXAxisToParentCenter();
            float num = this.spacing;

            for (int i = 0; i < this.buttonView.children.Count; i++)
            {
                this.buttonView.children[i].Anchor   = AnchorPosition.Left;
                this.buttonView.children[i].Position = new Vector2(num, 0f);
                this.buttonView.children[i].CenterYAxisToParentCenter();
                this.buttonView.children[i].Visible         = true;
                this.buttonView.children[i].ForegroundColor = buttonUnselectedColor;
                num += this.buttonView.children[i].Width + this.spacing;
            }
            this.Resize();
        }
Esempio n. 20
0
        // 270 : 16 40 ?? 16

        public RecipeBrowserWindow(CheatSheet mod)
        {
            categories.Clear();
            bCategories         = new UIImage[categoryIcons.Length];
            recipeView          = new RecipeView();
            this.mod            = mod;
            this.CanMove        = true;
            base.Width          = recipeView.Width + this.spacing * 2f;
            base.Height         = 420f;
            recipeView.Position = new Vector2(this.spacing, this.spacing + 40);
            this.AddChild(recipeView);
            this.InitializeRecipeCategories();
            Texture2D texture = mod.GetTexture("UI/closeButton");
            UIImage   uIImage = new UIImage(texture);

            uIImage.Anchor       = AnchorPosition.TopRight;
            uIImage.Position     = new Vector2(base.Width - this.spacing, this.spacing);
            uIImage.onLeftClick += new EventHandler(this.bClose_onLeftClick);
            this.AddChild(uIImage);
            this.textbox             = new UITextbox();
            this.textbox.Anchor      = AnchorPosition.TopRight;
            this.textbox.Position    = new Vector2(base.Width - this.spacing * 2f - uIImage.Width, this.spacing /** 2f + uIImage.Height*/);
            this.textbox.KeyPressed += new UITextbox.KeyPressedHandler(this.textbox_KeyPressed);
            this.AddChild(this.textbox);

            //lookupItemSlot = new Slot(0);
            lookupItemSlot          = new RecipeQuerySlot();
            lookupItemSlot.Position = new Vector2(spacing, halfspacing);
            lookupItemSlot.Scale    = .85f;
            //lookupItemSlot.functionalSlot = true;
            this.AddChild(lookupItemSlot);

            for (int j = 0; j < RecipeBrowserWindow.categoryIcons.Length; j++)
            {
                UIImage uIImage2 = new UIImage(RecipeBrowserWindow.categoryIcons[j]);
                Vector2 position = new Vector2(this.spacing + 48, this.spacing);
                uIImage2.Scale = 32f / Math.Max(categoryIcons[j].Width, categoryIcons[j].Height);

                position.X += (float)(j % 6 * 40);
                position.Y += (float)(j / 6 * 40);

                if (categoryIcons[j].Height > categoryIcons[j].Width)
                {
                    position.X += (32 - categoryIcons[j].Width) / 2;
                }
                else if (categoryIcons[j].Height < categoryIcons[j].Width)
                {
                    position.Y += (32 - categoryIcons[j].Height) / 2;
                }

                uIImage2.Position        = position;
                uIImage2.Tag             = j;
                uIImage2.onLeftClick    += new EventHandler(this.button_onLeftClick);
                uIImage2.ForegroundColor = RecipeBrowserWindow.buttonColor;
                if (j == 0)
                {
                    uIImage2.ForegroundColor = RecipeBrowserWindow.buttonSelectedColor;
                }
                uIImage2.Tooltip = RecipeBrowserWindow.categNames[j];
                RecipeBrowserWindow.bCategories[j] = uIImage2;
                this.AddChild(uIImage2);
            }

            ingredients = new GenericItemSlot[Recipe.maxRequirements];
            for (int j = 0; j < Recipe.maxRequirements; j++)
            {
                GenericItemSlot genericItemSlot = new GenericItemSlot();
                Vector2         position        = new Vector2(this.spacing, this.spacing);

                //position.X += j * 60 + 120;
                //position.Y += 250;

                position.X += 166 + (j % cols * 51);
                position.Y += 244 + (j / cols * 51);

                genericItemSlot.Position           = position;
                genericItemSlot.Tag                = j;
                RecipeBrowserWindow.ingredients[j] = genericItemSlot;
                this.AddChild(genericItemSlot, false);
            }

            recipeView.selectedCategory = RecipeBrowserWindow.categories[0].ToArray();
            recipeView.activeSlots      = recipeView.selectedCategory;
            recipeView.ReorderSlots();
            return;
        }
        public override void Draw(SpriteBatch spriteBatch)
        {
            if (Visible)
            {
                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, this._rasterizerState, null, Main.UIScaleMatrix);
                //	Rectangle scissorRectangle = new Rectangle((int)base.X- (int)base.Width, (int)base.Y, (int)base.Width, (int)base.Height);
                //Parent.Position.Y
                //		Main.NewText((int)Parent.Position.Y + " " + (int)shownPosition);
                //	Rectangle scissorRectangle = new Rectangle((int)(base.X - base.Width / 2), (int)(shownPosition), (int)base.Width, (int)base.Height);
                Rectangle scissorRectangle = new Rectangle((int)(base.X - base.Width / 2), (int)(shownPosition), (int)base.Width, (int)(mod.hotbar.Position.Y - shownPosition));

                /*if (scissorRectangle.X < 0)
                 * {
                 *      scissorRectangle.Width += scissorRectangle.X;
                 *      scissorRectangle.X = 0;
                 * }
                 * if (scissorRectangle.Y < 0)
                 * {
                 *      scissorRectangle.Height += scissorRectangle.Y;
                 *      scissorRectangle.Y = 0;
                 * }
                 * if ((float)scissorRectangle.X + base.Width > (float)Main.screenWidth)
                 * {
                 *      scissorRectangle.Width = Main.screenWidth - scissorRectangle.X;
                 * }
                 * if ((float)scissorRectangle.Y + base.Height > (float)Main.screenHeight)
                 * {
                 *      scissorRectangle.Height = Main.screenHeight - scissorRectangle.Y;
                 * }*/
                scissorRectangle = CheatSheet.GetClippingRectangle(spriteBatch, scissorRectangle);
                Rectangle scissorRectangle2 = spriteBatch.GraphicsDevice.ScissorRectangle;
                spriteBatch.GraphicsDevice.ScissorRectangle = scissorRectangle;

                base.Draw(spriteBatch);

                spriteBatch.GraphicsDevice.ScissorRectangle = scissorRectangle2;
                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
            }

            //	base.Draw(spriteBatch);

            if (Visible && (base.IsMouseInside() /*|| button.MouseInside*/))
            {
                Main.LocalPlayer.mouseInterface = true;
                //Main.LocalPlayer.showItemIcon = false;
            }

            if (Visible && IsMouseInside())
            {
                Main.LocalPlayer.mouseInterface = true;
            }

            float   x      = Main.fontMouseText.MeasureString(UIView.HoverText).X;
            Vector2 vector = new Vector2((float)Main.mouseX, (float)Main.mouseY) + new Vector2(16f);

            if (vector.Y > (float)(Main.screenHeight - 30))
            {
                vector.Y = (float)(Main.screenHeight - 30);
            }
            if (vector.X > (float)Main.screenWidth - x)
            {
                vector.X = (float)(Main.screenWidth - 460);
            }
            Utils.DrawBorderStringFourWay(spriteBatch, Main.fontMouseText, UIView.HoverText, vector.X, vector.Y, new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), Color.Black, Vector2.Zero, 1f);
        }
Esempio n. 22
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            if (focused)
            {
                Terraria.GameInput.PlayerInput.WritingText = true;
                Main.instance.HandleIME();
                string oldText = Text;
                Text = Main.GetInputText(Text);
                if (oldText != Text)
                {
                    KeyPressed?.Invoke(this, ' ');
                }
                if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Tab))
                {
                    OnTabPress?.Invoke(this, new EventArgs());
                }
                if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Enter))
                {
                    OnEnterPress?.Invoke(this, new EventArgs());
                }
                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
                Main.instance.DrawWindowsIMEPanel(new Vector2(98f, (float)(Main.screenHeight - 36)), 0f);
            }

            spriteBatch.Draw(textboxBackground, DrawPosition, null, Color.White, 0f, Origin, 1f, SpriteEffects.None, 0f);
            int     fillWidth = (int)Width - 2 * textboxBackground.Width;
            Vector2 pos       = DrawPosition;

            pos.X += textboxBackground.Width;
            spriteBatch.Draw(TextboxFill, pos - Origin, null, Color.White, 0f, Vector2.Zero, new Vector2(fillWidth, 1f), SpriteEffects.None, 0f);
            pos.X += fillWidth;
            spriteBatch.Draw(textboxBackground, pos, null, Color.White, 0f, Origin, 1f, SpriteEffects.FlipHorizontally, 0f);
            string drawString = Text;

            if (PasswordBox)
            {
                drawString = passwordString;
            }
            if (drawCarrot && focused)
            {
                drawString += "|";
            }
            label.Text = drawString;

            pos = DrawPosition - Origin;

            if (pos.X <= Main.screenWidth && pos.Y <= Main.screenHeight && pos.X + Width >= 0 && pos.Y + Height >= 0)
            {
                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, _rasterizerState, null, Main.UIScaleMatrix);

                Rectangle cutRect = new Rectangle((int)pos.X, (int)pos.Y, (int)Width, (int)Height);

                /*if (cutRect.X < 0)
                 * {
                 *      cutRect.Width += cutRect.X;
                 *      cutRect.X = 0;
                 * }
                 * if (cutRect.Y < 0)
                 * {
                 *      cutRect.Height += cutRect.Y;
                 *      cutRect.Y = 0;
                 * }
                 * if (cutRect.X + Width > Main.screenWidth) cutRect.Width = Main.screenWidth - cutRect.X;
                 * if (cutRect.Y + Height > Main.screenHeight) cutRect.Height = Main.screenHeight - cutRect.Y;*/
                cutRect = CheatSheet.GetClippingRectangle(spriteBatch, cutRect);
                Rectangle currentRect = spriteBatch.GraphicsDevice.ScissorRectangle;
                spriteBatch.GraphicsDevice.ScissorRectangle = cutRect;

                base.Draw(spriteBatch);

                spriteBatch.GraphicsDevice.ScissorRectangle = currentRect;
                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, null, null, null, null, Main.UIScaleMatrix);
            }
        }
Esempio n. 23
0
 internal static string CSText(string key, string category = "PaintTools") => CheatSheet.CSText(category, key);
Esempio n. 24
0
        // 270 : 16 40 ?? 16

        public NPCBrowser(CheatSheet mod)
        {
            categories.Clear();
            ModToNPCs.Clear();
            this.npcView          = new NPCView();
            this.mod              = mod;
            this.CanMove          = true;
            base.Width            = this.npcView.Width + this.spacing * 2f;
            base.Height           = 300f;   // 272f
            this.npcView.Position = new Vector2(this.spacing, base.Height - this.npcView.Height - this.spacing * 3f);
            this.AddChild(this.npcView);
            this.ParseList2();
            Texture2D texture = mod.GetTexture("UI/closeButton");
            UIImage   uIImage = new UIImage(texture);

            uIImage.Anchor       = AnchorPosition.TopRight;
            uIImage.Position     = new Vector2(base.Width - this.spacing, this.spacing);
            uIImage.onLeftClick += new EventHandler(this.bClose_onLeftClick);
            this.AddChild(uIImage);
            this.textbox        = new UITextbox();
            this.textbox.Anchor = AnchorPosition.BottomLeft;
            //this.textbox.Position = new Vector2(base.Width - this.spacing * 2f + uIImage.Width * numWidth * 2, this.spacing /** 2f + uIImage.Height*/);
            this.textbox.Position    = new Vector2(this.spacing, base.Height - this.spacing);
            this.textbox.KeyPressed += new UITextbox.KeyPressedHandler(this.textbox_KeyPressed);
            this.AddChild(this.textbox);
            bCategories = new UIImage[categoryIcons.Length];
            for (int j = 0; j < NPCBrowser.categoryIcons.Length; j++)
            {
                UIImage uIImage2 = new UIImage(NPCBrowser.categoryIcons[j]);
                Vector2 position = new Vector2(this.spacing, this.spacing);
                uIImage2.Scale = 32f / Math.Max(categoryIcons[j].Width, categoryIcons[j].Height);

                position.X += (float)(j % 6 * 40);
                position.Y += (float)(j / 6 * 40);

                if (categoryIcons[j].Height > categoryIcons[j].Width)
                {
                    position.X += (32 - categoryIcons[j].Width) / 2;
                }
                else if (categoryIcons[j].Height < categoryIcons[j].Width)
                {
                    position.Y += (32 - categoryIcons[j].Height) / 2;
                }

                uIImage2.Position        = position;
                uIImage2.Tag             = j;
                uIImage2.onLeftClick    += (s, e) => buttonClick(s, e, true);
                uIImage2.onRightClick   += (s, e) => buttonClick(s, e, false);
                uIImage2.ForegroundColor = NPCBrowser.buttonColor;
                if (j == 0)
                {
                    uIImage2.ForegroundColor = NPCBrowser.buttonSelectedColor;
                }
                uIImage2.Tooltip          = NPCBrowser.categNames[j];
                NPCBrowser.bCategories[j] = uIImage2;
                this.AddChild(uIImage2);
            }
            npcView.selectedCategory = NPCBrowser.categories[0].ToArray();
            npcView.activeSlots      = npcView.selectedCategory;
            npcView.ReorderSlots();
            textures = new Texture2D[]
            {
                mod.GetTexture("UI/NPCLifeIcon"),
                mod.GetTexture("UI/NPCDamageIcon"),
                mod.GetTexture("UI/NPCDefenseIcon"),
                mod.GetTexture("UI/NPCKnockbackIcon"),
            };
        }
Esempio n. 25
0
 internal static string CSText(string key, string category = "Hotbar") => CheatSheet.CSText(category, key);
Esempio n. 26
0
        public Hotbar(CheatSheet mod)
        {
            this.mod        = mod;
            this.buttonView = new UIView();
            //	this.timeWindow = new TimeControlWindow();
            //	this.npcSpawnWindow = new NPCSpawnerWindow();
            //	this.weatherWindow = new WeatherControlWindow();
            //	this.timeWindow.Visible = false;
            //	this.npcSpawnWindow.Visible = false;
            //	this.weatherWindow.Visible = false;
            //	this.AddChild(this.timeWindow);
            //	this.AddChild(this.npcSpawnWindow);
            //	this.AddChild(this.weatherWindow);
            Hotbar.loginTexture  = mod.GetTexture("UI/Images.login");           // UIView.GetEmbeddedTexture("Images.login.png");
            Hotbar.logoutTexture = mod.GetTexture("UI/Images.logout");          //UIView.GetEmbeddedTexture("Images.logout.png");
            //	this.bLogin = new UIImage(Hotbar.loginTexture);
            //		bLogin = new UIImage(mod.GetTexture("UI/Images.login"));
            base.Visible = false;
            base.UpdateWhenOutOfBounds = true;
            //	Hotbar.groupWindow = new GroupManagementWindow();
            this.button = new UIImage(mod.GetTexture("UI/Images.CollapseBar.CollapseButtonHorizontal"));            //new UIImage(UIView.GetEmbeddedTexture("Images.CollapseBar.CollapseButtonHorizontal.png"));
            this.button.UpdateWhenOutOfBounds = true;
            this.arrow = new UIImage(mod.GetTexture("UI/Images.CollapseBar.CollapseArrowHorizontal"));              //new UIImage(UIView.GetEmbeddedTexture("Images.CollapseBar.CollapseArrowHorizontal.png"));

            //		bToggleEnemies = new UIImage(mod.GetTexture("UI/Images.npcIcon"));
            //		bToggleBlockReach = new UIImage(Main.itemTexture[407]);
            //		bFlyCamera = new UIImage(Main.itemTexture[493]);
            //		bRevealMap = new UIImage(mod.GetTexture("UI/Images.canIcon"));// Hotbar.mapTexture);
            //		bWaypoints = new UIImage(mod.GetTexture("UI/Images.waypointIcon"));
            //		bGroupManager = new UIImage(mod.GetTexture("UI/Images.manageGroups"));
            //		bOnlinePlayers = new UIImage(mod.GetTexture("UI/Images.connectedPlayers"));
            //		bTime = new UIImage(mod.GetTexture("UI/Images.sunIcon"));
            //		bWeatherWindow = new UIImage(Main.npcHeadTexture[2]);// WeatherControlWindow.rainTexture);
            //		bBackupWorld = new UIImage(mod.GetTexture("UI/Images.UIKit.saveIcon"));
            //		bCTFSettings = new UIImage(mod.GetTexture("UI/Images.CTF.redFlag"));

            //	Main.instance.LoadNPC(NPCID.KingSlime);

            bToggleItemBrowser        = new UIImage(Main.itemTexture[ItemID.WorkBench]);
            bToggleNPCBrowser         = new UIImage(mod.GetTexture("UI/Images.npcIcon"));
            bToggleClearMenu          = new UIImage(Main.itemTexture[ItemID.TrashCan]);
            bToggleRecipeBrowser      = new UIImage(Main.itemTexture[ItemID.CookingPot]);
            bToggleExtendedCheat      = new UIImage(Main.itemTexture[ItemID.CellPhone]);
            bTogglePaintTools         = new UIImage(Main.itemTexture[ItemID.Paintbrush]);
            bCycleExtraAccessorySlots = new UIImage(Main.itemTexture[ItemID.DemonHeart]);
            bVacuum              = new UIImage(mod.GetTexture("UI/Images.bVacuum"));
            bToggleNPCButcherer  = new UIImage(Main.itemTexture[ItemID.Skull]);
            bToggleQuickTeleport = new UIImage(Main.itemTexture[ItemID.WoodenDoor]);
            //bToggleEventManager = new UIImage(Main.itemTexture[ItemID.PirateMap]);

            this.arrow.UpdateWhenOutOfBounds = true;
            this.button.Anchor      = AnchorPosition.Top;
            this.arrow.Anchor       = AnchorPosition.Top;
            this.arrow.SpriteEffect = SpriteEffects.FlipVertically;
            this.AddChild(this.button);
            this.AddChild(this.arrow);
            this.button.Position = new Vector2(0f, -this.button.Height);
            this.button.CenterXAxisToParentCenter();
            //Do i need this?		this.button.X -= 40;
            this.arrow.Position     = this.button.Position;
            this.arrow.onLeftClick += new EventHandler(this.button_onLeftClick);
            //		this.bBackupWorld.onLeftClick += new EventHandler(this.bBackupWorld_onLeftClick);
            //		this.bToggleBlockReach.Tooltip = "Toggle Block Reach";
            //		this.bToggleEnemies.Tooltip = "Toggle Enemy Spawns";
            //		this.bFlyCamera.Tooltip = "Toggle Fly Cam";
            //		this.bRevealMap.Tooltip = "Reveal Map";
            //		this.bWaypoints.Tooltip = "Open Waypoints Window";
            //		this.bGroupManager.Tooltip = "Open Group Management";
            //		this.bOnlinePlayers.Tooltip = "View Connected Players";
            //		this.bTime.Tooltip = "Set Time";
            //		this.bWeatherWindow.Tooltip = "Control Rain";
            //		this.bLogin.Tooltip = "Login";
            //		this.bCTFSettings.Tooltip = "Capture the Flag Settings";
            //		this.bBackupWorld.Tooltip = "Backup World";
            this.bToggleItemBrowser.Tooltip   = CSText("Show Item Browser");
            this.bToggleClearMenu.Tooltip     = CSText("Show Clear Menu");
            this.bToggleNPCBrowser.Tooltip    = CSText("Show NPC Browser");
            bToggleRecipeBrowser.Tooltip      = CSText("Show Recipe Browser");
            bToggleExtendedCheat.Tooltip      = CSText("Show Mod Extension Cheats");
            bTogglePaintTools.Tooltip         = CSText("Show Paint Tools");
            bCycleExtraAccessorySlots.Tooltip = CSText("Extra Accessory Slots") + ": ?";
            bVacuum.Tooltip              = CSText("Vacuum Items");
            bToggleNPCButcherer.Tooltip  = CSText("Show NPC Butcherer");
            bToggleQuickTeleport.Tooltip = CSText("Show Quick Waypoints");
            //		bToggleEventManager.Tooltip = "Show Event Manager";

            //		this.bToggleBlockReach.Opacity = Hotbar.disabledOpacity;
            //		this.bFlyCamera.Opacity = Hotbar.disabledOpacity;
            //		this.bToggleEnemies.Opacity = Hotbar.disabledOpacity;
            //		this.bToggleBlockReach.onLeftClick += new EventHandler(this.bToggleBlockReach_onLeftClick);
            //		this.bFlyCamera.onLeftClick += new EventHandler(this.bFlyCamera_onLeftClick);
            //		this.bToggleEnemies.onLeftClick += new EventHandler(this.bToggleEnemies_onLeftClick);
            //			this.bRevealMap.onLeftClick += new EventHandler(this.bRevealMap_onLeftClick);
            //			this.bWaypoints.onLeftClick += new EventHandler(this.bWaypoints_onLeftClick);
            //		this.bGroupManager.onLeftClick += new EventHandler(this.bGroupManager_onLeftClick);
            //		this.bOnlinePlayers.onLeftClick += new EventHandler(this.bOnlinePlayers_onLeftClick);
            //		this.bCTFSettings.onLeftClick += new EventHandler(this.bCTFSettings_onLeftClick);
            //		this.bLogin.onLeftClick += new EventHandler(this.bLogin_onLeftClick);
            //		this.bTime.onLeftClick += new EventHandler(this.bTime_onLeftClick);
            //		this.bWeatherWindow.onLeftClick += new EventHandler(this.bWeatherWindow_onLeftClick);
            this.bToggleItemBrowser.onLeftClick += new EventHandler(this.bToggleItemBrowser_onLeftClick);
            this.bToggleClearMenu.onLeftClick   += new EventHandler(this.bClearItems_onLeftClick);
            this.bToggleClearMenu.onRightClick  += (s, e) =>
            {
                QuickClearHotbar.HandleQuickClear();
            };
            this.bToggleNPCBrowser.onLeftClick         += new EventHandler(this.bToggleNPCBrowser_onLeftClick);
            this.bToggleRecipeBrowser.onLeftClick      += new EventHandler(this.bToggleRecipeBrowser_onLeftClick);
            this.bToggleExtendedCheat.onLeftClick      += new EventHandler(this.bToggleExtendedCheat_onLeftClick);
            this.bTogglePaintTools.onLeftClick         += new EventHandler(this.bTogglePaintTools_onLeftClick);
            this.bCycleExtraAccessorySlots.onLeftClick += (s, e) =>
            {
                Main.LocalPlayer.GetModPlayer <CheatSheetPlayer>(mod).numberExtraAccessoriesEnabled = (Main.LocalPlayer.GetModPlayer <CheatSheetPlayer>(mod).numberExtraAccessoriesEnabled + 1) % (CheatSheetPlayer.MaxExtraAccessories + 1);
                bCycleExtraAccessorySlots.Tooltip = CSText("Extra Accessory Slots") + ": " + Main.LocalPlayer.GetModPlayer <CheatSheetPlayer>(mod).numberExtraAccessoriesEnabled;
            };
            this.bCycleExtraAccessorySlots.onRightClick += (s, e) =>
            {
                Main.LocalPlayer.GetModPlayer <CheatSheetPlayer>(mod).numberExtraAccessoriesEnabled = (Main.LocalPlayer.GetModPlayer <CheatSheetPlayer>(mod).numberExtraAccessoriesEnabled == 0) ? 0 : (Main.LocalPlayer.GetModPlayer <CheatSheetPlayer>(mod).numberExtraAccessoriesEnabled - 1) % (CheatSheetPlayer.MaxExtraAccessories + 1);
                bCycleExtraAccessorySlots.Tooltip = CSText("Extra Accessory Slots") + ": " + Main.LocalPlayer.GetModPlayer <CheatSheetPlayer>(mod).numberExtraAccessoriesEnabled;
            };
            this.bVacuum.onLeftClick              += new EventHandler(this.bVacuum_onLeftClick);
            this.bToggleNPCButcherer.onLeftClick  += new EventHandler(this.bButcher_onLeftClick);
            this.bToggleNPCButcherer.onRightClick += (s, e) =>
            {
                NPCButchererHotbar.HandleButcher();
            };
            this.bToggleQuickTeleport.onLeftClick  += new EventHandler(this.bToggleQuickTeleport_onLeftClick);
            this.bToggleQuickTeleport.onRightClick += (s, e) =>
            {
                //QuickTeleportHotbar.TeleportPlayer(Main.LocalPlayer, new Vector2(Main.spawnTileX, Main.spawnTileY), true);
                QuickTeleportHotbar.HandleTeleport();
            };
            //		this.bToggleEventManager.onLeftClick += new EventHandler(this.bToggleEventManager_onLeftClick);

            //		this.buttonView.AddChild(this.bToggleBlockReach);
            //		this.buttonView.AddChild(this.bFlyCamera);
            //		this.buttonView.AddChild(this.bToggleEnemies);
            //		this.buttonView.AddChild(this.bRevealMap);
            //		this.buttonView.AddChild(this.bWaypoints);
            //		this.buttonView.AddChild(this.bTime);
            //			this.buttonView.AddChild(this.bWeatherWindow);
            //			this.buttonView.AddChild(this.bGroupManager);
            //			this.buttonView.AddChild(this.bOnlinePlayers);
            //			this.buttonView.AddChild(this.bCTFSettings);
            //			this.buttonView.AddChild(this.bLogin);
            //			this.buttonView.AddChild(this.bBackupWorld);

            buttonView.AddChild(bToggleItemBrowser);
            buttonView.AddChild(bToggleNPCBrowser);
            buttonView.AddChild(bToggleRecipeBrowser);
            buttonView.AddChild(bToggleExtendedCheat);
            buttonView.AddChild(bToggleClearMenu);
            buttonView.AddChild(bTogglePaintTools);
            buttonView.AddChild(bCycleExtraAccessorySlots);
            buttonView.AddChild(bVacuum);
            buttonView.AddChild(bToggleNPCButcherer);
            buttonView.AddChild(bToggleQuickTeleport);
            //			buttonView.AddChild(bToggleEventManager);
            buttonView.AddChild(SpawnRateMultiplier.GetButton(mod));
            buttonView.AddChild(MinionSlotBooster.GetButton(mod));
            buttonView.AddChild(LightHack.GetButton(mod));
            //	buttonView.AddChild(FullBright.GetButton(mod));
            //			buttonView.AddChild(BossDowner.GetButton(mod));
            buttonView.AddChild(ConfigurationTool.GetButton(mod));

            base.Width             = 200f;
            base.Height            = 55f;
            this.buttonView.Height = base.Height;
            base.Anchor            = AnchorPosition.Top;
            this.AddChild(this.buttonView);
            base.Position = new Vector2(Hotbar.xPosition, this.hiddenPosition);
            base.CenterXAxisToParentCenter();
            float num = this.spacing;

            for (int i = 0; i < this.buttonView.children.Count; i++)
            {
                this.buttonView.children[i].Anchor   = AnchorPosition.Left;
                this.buttonView.children[i].Position = new Vector2(num, 0f);
                this.buttonView.children[i].CenterYAxisToParentCenter();
                this.buttonView.children[i].Visible         = true;
                this.buttonView.children[i].ForegroundColor = buttonUnselectedColor;
                num += this.buttonView.children[i].Width + this.spacing;
            }
            //	Hotbar.groupWindow.Visible = false;
            //	MasterView.gameScreen.AddChild(Hotbar.groupWindow);
            ChangedConfiguration();
            //this.Resize();
        }
Esempio n. 27
0
        public ConfigurationWindow(CheatSheet mod)
        {
            this.mod     = mod;
            this.CanMove = true;
            base.Width   = 280;
            base.Height  = 348;

            Texture2D texture = mod.GetTexture("UI/closeButton");
            UIImage   uIImage = new UIImage(texture);

            uIImage.Anchor       = AnchorPosition.TopRight;
            uIImage.Position     = new Vector2(base.Width - this.spacing, this.spacing);
            uIImage.onLeftClick += new EventHandler(this.bClose_onLeftClick);
            this.AddChild(uIImage);

            //ConfigurationLoader.Initialized();

            string[] labels = new string[] { CSText("ItemBrowser"), CSText("NPCBrowser"), CSText("RecipeBrowser"), CSText("MinionBooster"), CSText("Butcher"), CSText("ClearMenu"),
                                             CSText("ExtraAccessorySlots"), CSText("ModExtensions"), CSText("PaintTools"), CSText("SpawnRate"), CSText("Vacuum"), CSText("Waypoints"), CSText("LightHack")
                                             /* "Boss Downer", "Event Manager"*/
            };
            bool[] selecteds = new bool[] {
                ConfigurationLoader.personalConfiguration.ItemBrowser,
                ConfigurationLoader.personalConfiguration.NPCBrowser,
                ConfigurationLoader.personalConfiguration.RecipeBrowser,
                ConfigurationLoader.personalConfiguration.MinionBooster,
                ConfigurationLoader.personalConfiguration.Butcher,
                ConfigurationLoader.personalConfiguration.ClearMenu,
                ConfigurationLoader.personalConfiguration.ExtraAccessorySlots,
                ConfigurationLoader.personalConfiguration.ModExtensions,
                ConfigurationLoader.personalConfiguration.PaintTools,
                ConfigurationLoader.personalConfiguration.SpawnRate,
                ConfigurationLoader.personalConfiguration.Vacuum,
                ConfigurationLoader.personalConfiguration.Waypoints,
                ConfigurationLoader.personalConfiguration.LightHack,
                //  ConfigurationLoader.configuration.BossDowner,
                //  ConfigurationLoader.configuration.EventManager,
            };

            for (int i = 0; i < labels.Length; i++)
            {
                UICheckbox cb = new UICheckbox(labels[i]);
                cb.Selected         = selecteds[i];
                cb.X                = spacing;
                cb.Y                = i * 24 + spacing;
                cb.SelectedChanged += new EventHandler(bCheckBoxTicked);

                //cb.label.ForegroundColor = Color.Red;
                AddChild(cb);
            }

            //UICheckbox cb = new UICheckbox("Item Browser");
            //cb.Selected = ConfigurationLoader.configuration.ItemBrowser;
            //cb.X = 0;
            //cb.Y = 1 * 20;
            //cb.SelectedChanged += new EventHandler(bCheckBoxTicked);
            //AddChild(cb);

            //cb = new UICheckbox("NPC Browser");
            //cb.Selected = ConfigurationLoader.configuration.NPCBrowser;
            //cb.X = 0;
            //cb.Y = 2 * 20;
            //cb.SelectedChanged += new EventHandler(bCheckBoxTicked);
            //AddChild(cb);

            //cb = new UICheckbox("Recipe Browser");
            //cb.Selected = ConfigurationLoader.configuration.RecipeBrowser;
            //cb.X = 0;
            //cb.Y = 3 * 20;
            //cb.SelectedChanged += new EventHandler(bCheckBoxTicked);
            //AddChild(cb);

            //cb = new UICheckbox("Minion Booster");
            //cb.Selected = ConfigurationLoader.configuration.MinionBooster;
            //cb.X = 0;
            //cb.Y = 4 * 20;
            //cb.SelectedChanged += new EventHandler(bCheckBoxTicked);
            //AddChild(cb);

            //for (int j = 0; j < 7; j++)
            //{
            //	GenericItemSlot genericItemSlot = new GenericItemSlot();
            //	Vector2 position = new Vector2(this.spacing, this.spacing);

            //	position.X += j * 60;
            //	position.Y += 250;

            //	genericItemSlot.Position = position;
            //	genericItemSlot.Tag = j;
            //	RecipeBrowser.ingredients[j] = genericItemSlot;
            //	this.AddChild(genericItemSlot, false);
            //}
        }
Esempio n. 28
0
 public static string BuildBook()
 {
     return(CheatSheet.BuildBook());
 }