public UIInviteMenu(
     string title,
     UIMenuAction act,
     float xpos,
     float ypos,
     float wide              = -1f,
     float high              = -1f,
     string conString        = "",
     InputProfile conProfile = null,
     bool tiny = false)
     : base(title, xpos, ypos, wide, high)
 {
     if (Steam.IsInitialized())
     {
         int num = Steam.friends.OrderBy <User, int>((Func <User, int>)(u => UIInviteMenu._sortDictionary[(int)u.state])).Count <User>();
         if (num > this._maxShow)
         {
             num = this._maxShow;
         }
         this._littleFont = new BitmapFont("smallBiosFont", 7, 6);
         this._moreArrow  = new Sprite("moreArrow");
         this._moreArrow.CenterOrigin();
         this._box      = new UIBox(0.0f, 0.0f, 100f, (float)(14 * num + 8), isVisible: false);
         this._noAvatar = new Sprite("noAvatar");
         this._noAvatar.CenterOrigin();
         this.Add((UIComponent)this._box, true);
     }
     this._menuAction = act;
 }
예제 #2
0
 public UIServerBrowser(
     UIMenu openOnClose,
     string title,
     float xpos,
     float ypos,
     float wide              = -1f,
     float high              = -1f,
     string conString        = "",
     InputProfile conProfile = null)
     : base(title, xpos, ypos, wide, high, conString, conProfile)
 {
     this.defaultImage = Content.Load <Tex2D>("server_default");
     this._splitter.topSection.components[0].align = UIAlign.Left;
     this._openOnClose = openOnClose;
     this._moreArrow   = new Sprite("moreArrow");
     this._moreArrow.CenterOrigin();
     this._steamIcon       = new Sprite("steamIconSmall");
     this._steamIcon.scale = new Vec2(1f) / 2f;
     this._localIcon       = new SpriteMap("iconSheet", 16, 16);
     this._localIcon.scale = new Vec2(1f) / 2f;
     this._localIcon.SetFrameWithoutReset(1);
     this._newIcon       = new SpriteMap("presents", 16, 16);
     this._newIcon.scale = new Vec2(2f);
     this._newIcon.SetFrameWithoutReset(0);
     this._noImage          = new Sprite("notexture");
     this._noImage.scale    = new Vec2(2f);
     this._cursor           = new SpriteMap("cursors", 16, 16);
     this._maxLobbiesToShow = 8;
     this._box = new UIBox(0.0f, 0.0f, high: ((float)(this._maxLobbiesToShow * 36)), isVisible: false);
     this.Add((UIComponent)this._box, true);
     this._fancyFont          = new FancyBitmapFont("smallFont");
     this._fancyFont.maxWidth = (int)this.width - 100;
     this._fancyFont.maxRows  = 2;
     this.scrollBarOffset     = 0;
     this._editModMenu        = new UIMenu("<mod name>", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 160f, conString: "@SELECT@SELECT");
     this._editModMenu.Add((UIComponent) new UIText(" ", Color.White), true);
     this._editModMenu.Add((UIComponent) new UIMenuItem("BACK", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._editModMenu, (UIComponent)this)), true);
     this._editModMenu.Close();
     this._yesNoMenu = new UIMenu("ARE YOU SURE?", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 160f, conString: "@SELECT@SELECT");
     this._yesNoMenu.Add((UIComponent)(this._yesNoYes = new UIMenuItem("YES")), true);
     this._yesNoMenu.Add((UIComponent)(this._yesNoNo = new UIMenuItem("NO")), true);
     this._yesNoMenu.Close();
     this._updateTextBox           = new Textbox(0.0f, 0.0f, 0.0f, 0.0f);
     this._updateTextBox.depth     = new Depth(0.9f);
     this._updateTextBox.maxLength = 5000;
     this._downloadModsMenu        = new UIMenu("MODS REQUIRED!", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 290f, conString: "@SELECT@SELECT");
     this._downloadModsMenu.Add((UIComponent) new UIText("You're missing the mods required", Colors.DGBlue), true);
     this._downloadModsMenu.Add((UIComponent) new UIText("to join this game. Would you", Colors.DGBlue), true);
     this._downloadModsMenu.Add((UIComponent) new UIText("like to automatically subscribe to", Colors.DGBlue), true);
     this._downloadModsMenu.Add((UIComponent) new UIText("all required mods, restart and", Colors.DGBlue), true);
     this._downloadModsMenu.Add((UIComponent) new UIText("join the game?", Colors.DGBlue), true);
     this._downloadModsMenu.Add((UIComponent) new UIText("", Colors.DGBlue), true);
     this._downloadModsMenu.Add((UIComponent) new UIMenuItem("NO!", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._downloadModsMenu, (UIComponent)this)), true);
     this._downloadModsMenu.Add((UIComponent) new UIMenuItem("YES!", (UIMenuAction) new UIMenuActionCloseMenuCallFunction((UIComponent)this._downloadModsMenu, new UIMenuActionCloseMenuCallFunction.Function(UIServerBrowser.SubscribeAndRestart))), true);
     this._downloadModsMenu.Close();
 }
예제 #3
0
 public UIDivider(bool vert, int splitVal, float sep = 1f)
     : base(0.0f, 0.0f, 0.0f, 0.0f)
 {
     this._vertical = vert;
     this._leftBox  = new UIBox(isVisible: false);
     this._rightBox = new UIBox(isVisible: false);
     this.Add((UIComponent)this._leftBox);
     this.Add((UIComponent)this._rightBox);
     this._splitPixels = splitVal;
     this._canFit      = true;
     this._seperation  = sep;
 }
예제 #4
0
 public UIModManagement(
     UIMenu openOnClose,
     string title,
     float xpos,
     float ypos,
     float wide              = -1f,
     float high              = -1f,
     string conString        = "",
     InputProfile conProfile = null)
     : base(title, xpos, ypos, wide, high, conString, conProfile)
 {
     this._splitter.topSection.components[0].align = UIAlign.Left;
     this._openOnClose = openOnClose;
     this._moreArrow   = new Sprite("moreArrow");
     this._moreArrow.CenterOrigin();
     this._steamIcon       = new Sprite("steamIconSmall");
     this._steamIcon.scale = new Vec2(1f) / 2f;
     this._localIcon       = new SpriteMap("iconSheet", 16, 16);
     this._localIcon.scale = new Vec2(1f) / 2f;
     this._localIcon.SetFrameWithoutReset(1);
     this._newIcon       = new SpriteMap("presents", 16, 16);
     this._newIcon.scale = new Vec2(2f);
     this._newIcon.SetFrameWithoutReset(0);
     this._noImage       = new Sprite("notexture");
     this._noImage.scale = new Vec2(2f);
     this._cursor        = new SpriteMap("cursors", 16, 16);
     this._mods          = (IList <Mod>)ModLoader.allMods.Where <Mod>((Func <Mod, bool>)(a => !(a is CoreMod))).ToList <Mod>();
     this._mods.Add((Mod)null);
     this._maxModsToShow = 8;
     this._box           = new UIBox(0.0f, 0.0f, high: ((float)(this._maxModsToShow * 36)), isVisible: false);
     this.Add((UIComponent)this._box, true);
     this._fancyFont          = new FancyBitmapFont("smallFont");
     this._fancyFont.maxWidth = (int)this.width - 100;
     this._fancyFont.maxRows  = 2;
     this.scrollBarOffset     = 0;
     this._editModMenu        = new UIMenu("<mod name>", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 160f, conString: "@SELECT@SELECT");
     this._editModMenu.Add((UIComponent)(this._disableOrEnableItem = new UIMenuItem("DISABLE", (UIMenuAction) new UIMenuActionCallFunction(new UIMenuActionCallFunction.Function(this.EnableDisableMod)))), true);
     this._deleteOrUnsubItem = new UIMenuItem("DELETE", (UIMenuAction) new UIMenuActionCallFunction(new UIMenuActionCallFunction.Function(this.DeleteMod)));
     this._uploadItem        = new UIMenuItem("UPLOAD", (UIMenuAction) new UIMenuActionCallFunction(new UIMenuActionCallFunction.Function(this.UploadMod)));
     this._visitItem         = new UIMenuItem("VISIT PAGE", (UIMenuAction) new UIMenuActionCallFunction(new UIMenuActionCallFunction.Function(this.VisitModPage)));
     this._editModMenu.Add((UIComponent) new UIText(" ", Color.White), true);
     this._editModMenu.Add((UIComponent) new UIMenuItem("BACK", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._editModMenu, (UIComponent)this)), true);
     this._editModMenu.Close();
     this._yesNoMenu = new UIMenu("ARE YOU SURE?", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 160f, conString: "@SELECT@SELECT");
     this._yesNoMenu.Add((UIComponent)(this._yesNoYes = new UIMenuItem("YES")), true);
     this._yesNoMenu.Add((UIComponent)(this._yesNoNo = new UIMenuItem("NO")), true);
     this._yesNoMenu.Close();
     this._updateTextBox           = new Textbox(0.0f, 0.0f, 0.0f, 0.0f);
     this._updateTextBox.depth     = new Depth(0.9f);
     this._updateTextBox.maxLength = 5000;
 }
예제 #5
0
        public UIControlConfig(
            UIMenu openOnClose,
            string title,
            float xpos,
            float ypos,
            float wide              = -1f,
            float high              = -1f,
            string conString        = "",
            InputProfile conProfile = null)
            : base(title, xpos, ypos, wide, high, conString, conProfile)
        {
            this._openOnClose = openOnClose;
            List <string> stringList1 = new List <string>()
            {
                "P1   ",
                "P2   ",
                "P3   ",
                "P4"
            };
            List <string> stringList2 = new List <string>()
            {
                "GAMEPAD",
                "KEYBOARD",
                "PAD + KEYS"
            };
            BitmapFont bitmapFont = new BitmapFont("smallBiosFontUI", 7, 5);
            UIBox      uiBox      = new UIBox(isVisible: false);

            this._configuringToggle = new UIMenuItemToggle("", (UIMenuAction) new UIMenuActionCallFunction(new UIMenuActionCallFunction.Function(this.SwitchConfigType)), new FieldBinding((object)this, nameof(inputConfigType)), multi: this.inputTypes, compressedMulti: true, tiny: true);
            uiBox.Add((UIComponent)this._configuringToggle, true);
            UIText uiText1 = new UIText(" ", Color.White);

            this._controlElements.Add(new UIControlElement("|DGBLUE|{LEFT", "LEFT", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|/RIGHT", "RIGHT", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|}UP", "UP", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|~DOWN", "DOWN", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|START", "START", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|ACCEPT", "SELECT", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|JUMP", "JUMP", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|GRAB", "GRAB", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|TRIP", "RAGDOLL", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|FIRE", "SHOOT", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|STRAFE", "STRAFE", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGBLUE|QUACK", "QUACK", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGGREEN|L STICK", "LSTICK", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGGREEN|R STICK", "RSTICK", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGGREEN|L TRIGGER", "LTRIGGER", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            this._controlElements.Add(new UIControlElement("|DGGREEN|R TRIGGER", "RTRIGGER", new DeviceInputMapping(), field: new FieldBinding((object)Options.Data, "sfxVolume")));
            uiBox.Add((UIComponent)this._controlElements[this._controlElements.Count - 1], true);
            UIMenuItem uiMenuItem = new UIMenuItem("|RED|REVERT TO DEFAULT", (UIMenuAction) new UIMenuActionCallFunction(new UIMenuActionCallFunction.Function(this.ResetToDefault)));

            uiMenuItem.SetFont(bitmapFont);
            uiBox.Add((UIComponent)uiMenuItem, true);
            UIText uiText2 = new UIText(" ", Color.White);

            uiText2.SetFont(bitmapFont);
            uiBox.Add((UIComponent)uiText2, true);
            UIText uiText3 = new UIText("PERSONAL CONTROLS CAN BE", Color.White);

            uiText3.SetFont(bitmapFont);
            uiBox.Add((UIComponent)uiText3, true);
            UIText uiText4 = new UIText("SET IN PROFILE SCREEN", Color.White);

            uiText4.SetFont(bitmapFont);
            uiBox.Add((UIComponent)uiText4, true);
            this._controlBox = uiBox;
            this._playerBoxes.Add(uiBox);
            this.Add((UIComponent)this._playerBoxes[0], true);
            this._confirmMenu = new UIMenu("SAVE CHANGES?", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 160f, conString: "@SELECT@SELECT");
            this._confirmMenu.Add((UIComponent) new UIMenuItem("YES!", (UIMenuAction) new UIMenuActionCallFunction(new UIMenuActionCallFunction.Function(this.CloseMenuSaving))), true);
            this._confirmMenu.Add((UIComponent) new UIMenuItem("NO!", (UIMenuAction) new UIMenuActionCallFunction(new UIMenuActionCallFunction.Function(this.CloseMenu))), true);
            this._confirmMenu.Add((UIComponent) new UIMenuItem("CANCEL!", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._confirmMenu, (UIComponent)this)), true);
            this._confirmMenu.Close();
        }