Example #1
0
 public NamingScreen(doneNamingBehavior b, string title, string defaultName = null) : base(b, title, defaultName)
 {
     Title                   = title;
     textBox.Width           = 800;
     textBox.X               = (Game1.viewport.Width - textBox.Width) / 2;
     doneNamingButton.bounds = new Rectangle(textBox.X + textBox.Width + 32, doneNamingButton.bounds.Y, doneNamingButton.bounds.Width, doneNamingButton.bounds.Height);
 }
Example #2
0
 public TextMenu(string title, doneNamingBehavior b)
     : base(b, title, "")
 {
     base.textBox.limitWidth         = false;
     base.textBox.Width              = 512;
     base.textBox.X                 -= 128;
     base.randomButton.visible       = false;
     base.doneNamingButton.bounds.X += 128;
     base.minLength                  = 0;
 }
        public ChestNamingMenu(doneNamingBehavior b, string title, string defaultName = null, int maxInput = 32) : base(b, title, defaultName)
        {
            this.textBox.textLimit = maxInput;
            textBox.limitWidth     = false;
            int width = textBox.Width;

            textBox.Width = width * 4;
            textBox.Text  = defaultName ?? "";
            textBox.Width = width;
        }
Example #4
0
 public DebugMenu(doneNamingBehavior b)
     : base(b, "Debug Input:", "")
 {
     this.textBox.limitWidth         = false;
     this.textBox.Width              = Game1.tileSize * 8;
     this.textBox.X                 -= Game1.tileSize * 2;
     this.randomButton.bounds.X     += Game1.tileSize * 2;
     this.doneNamingButton.bounds.X += Game1.tileSize * 2;
     this.minLength                  = 0;
 }
Example #5
0
 public TextMenu(string title, bool passwordInput, doneNamingBehavior b, Action callbackOnEscape = null)
     : base(b, title, "")
 {
     base.textBox.limitWidth         = false;
     base.textBox.Width              = 512;
     base.textBox.X                 -= 128;
     base.randomButton.visible       = false;
     base.doneNamingButton.bounds.X += 128;
     base.minLength                  = 0;
     this.passwordInput              = passwordInput;
     this.callbackOnEscape           = callbackOnEscape;
 }
Example #6
0
 public NamingMenu(doneNamingBehavior b, string title, string defaultName = null)
 {
     doneNaming        = b;
     xPositionOnScreen = 0;
     yPositionOnScreen = 0;
     width             = Game1.uiViewport.Width;
     height            = Game1.uiViewport.Height;
     this.title        = title;
     randomButton      = new ClickableTextureComponent(new Rectangle(xPositionOnScreen + width + 51 + 64, Game1.uiViewport.Height / 2, 64, 64), Game1.mouseCursors, new Rectangle(381, 361, 10, 10), 4f);
     textBox           = new TextBox(null, null, Game1.dialogueFont, Game1.textColor);
     textBox.X         = Game1.uiViewport.Width / 2 - 192;
     textBox.Y         = Game1.uiViewport.Height / 2;
     textBox.Width     = 256;
     textBox.Height    = 192;
     e = textBoxEnter;
     textBox.OnEnterPressed += e;
     Game1.keyboardDispatcher.Subscriber = textBox;
     textBox.Text     = ((defaultName != null) ? defaultName : Dialogue.randomName());
     textBox.Selected = true;
     randomButton     = new ClickableTextureComponent(new Rectangle(textBox.X + textBox.Width + 64 + 48 - 8, Game1.uiViewport.Height / 2 + 4, 64, 64), Game1.mouseCursors, new Rectangle(381, 361, 10, 10), 4f)
     {
         myID           = 103,
         leftNeighborID = 102
     };
     doneNamingButton = new ClickableTextureComponent(new Rectangle(textBox.X + textBox.Width + 32 + 4, Game1.uiViewport.Height / 2 - 8, 64, 64), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46), 1f)
     {
         myID            = 102,
         rightNeighborID = 103,
         leftNeighborID  = 104
     };
     textBoxCC = new ClickableComponent(new Rectangle(textBox.X, textBox.Y, 192, 48), "")
     {
         myID            = 104,
         rightNeighborID = 102
     };
     if (Game1.options.SnappyMenus)
     {
         populateClickableComponentList();
         snapToDefaultClickableComponent();
     }
 }
Example #7
0
 public TitleTextInputMenu(string title, doneNamingBehavior b)
     : base(b, title, "")
 {
     textBox.limitWidth   = false;
     textBox.Width        = 512;
     textBox.X           -= 128;
     randomButton.visible = false;
     pasteButton          = new ClickableTextureComponent(new Rectangle(textBox.X + textBox.Width + 32 + 4 + 64, Game1.viewport.Height / 2 - 8, 64, 64), Game1.mouseCursors, new Rectangle(274, 284, 16, 16), 4f)
     {
         myID           = 105,
         leftNeighborID = 102
     };
     pasteButton.visible = DesktopClipboard.IsAvailable;
     doneNamingButton.rightNeighborID = 105;
     doneNamingButton.bounds.X       += 128;
     minLength = 0;
     if (Game1.options.SnappyMenus)
     {
         populateClickableComponentList();
         snapToDefaultClickableComponent();
     }
 }
        public CustomNamingMenu(doneNamingBehavior b, string titleMaleIn, string titleFemaleIn, string defaultName = null)
        {
            doneNaming        = b;
            xPositionOnScreen = 0;
            yPositionOnScreen = 0;
            width             = Game1.viewport.Width;
            height            = Game1.viewport.Height;
            titleMale         = titleMaleIn;
            titleFemale       = titleFemaleIn;
            gender            = "Male";
            //randomButton = new ClickableTextureComponent(new Rectangle(xPositionOnScreen + width + 51 + 64, Game1.viewport.Height / 2, 64, 64), Game1.mouseCursors, new Rectangle(381, 361, 10, 10), 4f, false);
            textBox        = new TextBox(null, null, Game1.dialogueFont, Game1.textColor);
            textBox.X      = Game1.viewport.Width / 2 - 192;
            textBox.Y      = Game1.viewport.Height / 2;
            textBox.Width  = 256;
            textBox.Height = 192;
            e = new TextBoxEvent(this.textBoxEnter);
            textBox.OnEnterPressed += this.e;
            Game1.keyboardDispatcher.Subscriber = textBox;
            textBox.Text     = defaultName != null ? defaultName : Dialogue.randomName();
            textBox.Selected = true;

            ClickableTextureComponent textureComponent1 = new ClickableTextureComponent(new Rectangle(textBox.X + textBox.Width + 64 + 48 - 8, Game1.viewport.Height / 2 + 4, 64, 64), Game1.mouseCursors, new Rectangle(381, 361, 10, 10), 4f, false);

            textureComponent1.myID            = 103;
            textureComponent1.leftNeighborID  = 102;
            textureComponent1.rightNeighborID = region_male;
            randomButton = textureComponent1;

            ClickableTextureComponent textureComponent2 = new ClickableTextureComponent(new Rectangle(textBox.X + textBox.Width + 32 + 4, Game1.viewport.Height / 2 - 8, 64, 64), Game1.mouseCursors, Game1.getSourceRectForStandardTileSheet(Game1.mouseCursors, 46, -1, -1), 1f, false);

            textureComponent2.myID            = 102;
            textureComponent2.rightNeighborID = 103;
            textureComponent2.leftNeighborID  = 104;
            doneNamingButton = textureComponent2;

            ClickableTextureComponent textureComponent3 = new ClickableTextureComponent("Male", new Rectangle(textBox.X + textBox.Width + 64 + 48 + 32 + 8, Game1.viewport.Height / 2 + 4, 64, 64), null, "Male", Game1.mouseCursors, new Rectangle(128, 192, 16, 16), 4f, false);

            textureComponent3.myID            = region_male;
            textureComponent3.rightNeighborID = region_female;
            textureComponent3.leftNeighborID  = region_randomButton;
            maleButton = textureComponent3;

            ClickableTextureComponent textureComponent4 = new ClickableTextureComponent("Female", new Rectangle(textBox.X + textBox.Width + 64 + 48 + 32 + 8 + 64, Game1.viewport.Height / 2 + 4, 64, 64), null, "Female", Game1.mouseCursors, new Rectangle(144, 192, 16, 16), 4f, false);

            textureComponent4.myID           = region_female;
            textureComponent4.leftNeighborID = region_male;
            femaleButton = textureComponent4;

            textBoxCC = new ClickableComponent(new Rectangle(textBox.X, textBox.Y, 192, 48), "")
            {
                myID            = 104,
                rightNeighborID = 102
            };
            if (!Game1.options.SnappyMenus)
            {
                return;
            }
            populateClickableComponentList();
            snapToDefaultClickableComponent();
        }
 public NamingMenu(doneNamingBehavior b, string title, string defaultName = null) : base(b, title, defaultName)
 {
 }