Esempio n. 1
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();
 }
        public UIGachaBox(
            float xpos,
            float ypos,
            float wide         = -1f,
            float high         = -1f,
            bool rare          = false,
            UIMenu openOnClose = null)
            : base("", xpos, ypos, wide, high)
        {
            this._openOnClose = openOnClose;
            this._rare        = rare;
            this._duckCoin    = new SpriteMap("duckCoin", 18, 18);
            this._duckCoin.CenterOrigin();
            Graphics.fade = 1f;
            this._frame   = new Sprite("unlockFrame");
            this._frame.CenterOrigin();
            this._furni        = new Sprite("furni/tub");
            this._furni.center = new Vec2((float)(this._furni.width / 2), (float)this._furni.height);
            this._star         = new Sprite("prettyStar");
            this._star.CenterOrigin();
            this._font      = new BitmapFont("biosFontUI", 8, 7);
            this._fancyFont = new FancyBitmapFont("smallFontGacha");
            this._gachaEgg  = new SpriteMap("gachaEgg", 44, 36);
            bool flag = false;

            if (Rando.Int(10) == 5)
            {
                flag = true;
            }
            this._contains    = UIGachaBox.GetRandomFurniture(this._rare ? Rarity.VeryVeryRare : Rarity.Common, 1, flag ? 0.75f : (this._rare ? 0.75f : 1f), true)[0];
            this._rareCapsule = this._contains.rarity >= Rarity.VeryVeryRare;
            if (this._rareCapsule)
            {
                this._gachaEgg.frame = 36;
            }
            else
            {
                this._gachaEgg.frame = Rando.Int(2) * 12;
                if (Rando.Int(1000) == 1)
                {
                    this._gachaEgg.frame += 9;
                }
                else if (Rando.Int(500) == 1)
                {
                    this._gachaEgg.frame += 6;
                }
                else if (Rando.Int(100) == 1)
                {
                    this._gachaEgg.frame += 3;
                }
            }
            this._gachaEgg.CenterOrigin();
        }
 public UIUnlockBox(List <Unlockable> unlocks, float xpos, float ypos, float wide = -1f, float high = -1f)
     : base("", xpos, ypos, wide, high)
 {
     Graphics.fade = 1f;
     this._frame   = new Sprite("unlockFrame");
     this._frame.CenterOrigin();
     this._wrappedFrame = new Sprite("unlockFrameWrapped");
     this._wrappedFrame.CenterOrigin();
     this._font      = new BitmapFont("biosFontUI", 8, 7);
     this._fancyFont = new FancyBitmapFont("smallFont");
     this._unlocks   = unlocks;
     this._unlock    = this._unlocks.First <Unlockable>();
 }
Esempio n. 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;
 }
        public UIMatchmakingBox(UIMenu openOnClose, float xpos, float ypos, float wide = -1f, float high = -1f)
            : base("", xpos, ypos, wide, high)
        {
            this._openOnClose = openOnClose;
            Graphics.fade     = 1f;
            this._frame       = new Sprite("online/matchmakingBeta");
            this._frame.CenterOrigin();
            this._font              = new BitmapFont("biosFontUI", 8, 7);
            this._fancyFont         = new FancyBitmapFont("smallFont");
            this._matchmakingSignal = new SpriteMap("online/matchmakingSignal", 4, 9);
            this._matchmakingSignal.CenterOrigin();
            SpriteMap spriteMap1 = new SpriteMap("online/matchmakingStar", 7, 7);

            spriteMap1.AddAnimation("flicker", 0.08f, true, 0, 1, 2, 1);
            spriteMap1.SetAnimation("flicker");
            spriteMap1.CenterOrigin();
            this._signalCrossLocal = new SpriteMap("online/signalCross", 5, 5);
            this._signalCrossLocal.AddAnimation("idle", 0.12f, true, new int[1]);
            this._signalCrossLocal.AddAnimation("flicker", 0.12f, false, 1, 2, 3);
            this._signalCrossLocal.SetAnimation("idle");
            this._signalCrossLocal.CenterOrigin();
            this._signalCrossNetwork = new SpriteMap("online/signalCross", 5, 5);
            this._signalCrossNetwork.AddAnimation("idle", 0.12f, true, new int[1]);
            this._signalCrossNetwork.AddAnimation("flicker", 0.12f, false, 1, 2, 3);
            this._signalCrossNetwork.SetAnimation("idle");
            this._signalCrossNetwork.CenterOrigin();
            this._matchmakingStars.Add(spriteMap1);
            SpriteMap spriteMap2 = new SpriteMap("online/matchmakingStar", 7, 7);

            spriteMap2.AddAnimation("flicker", 0.11f, true, 0, 1, 2, 1);
            spriteMap2.SetAnimation("flicker");
            spriteMap2.CenterOrigin();
            this._matchmakingStars.Add(spriteMap2);
            SpriteMap spriteMap3 = new SpriteMap("online/matchmakingStar", 7, 7);

            spriteMap3.AddAnimation("flicker", 0.03f, true, 0, 1, 2, 1);
            spriteMap3.SetAnimation("flicker");
            spriteMap3.CenterOrigin();
            this._matchmakingStars.Add(spriteMap3);
            SpriteMap spriteMap4 = new SpriteMap("online/matchmakingStar", 7, 7);

            spriteMap4.AddAnimation("flicker", 0.03f, true, 0, 1, 2, 1);
            spriteMap4.SetAnimation("flicker");
            spriteMap4.CenterOrigin();
            this._matchmakingStars.Add(spriteMap4);
        }
        public override void Initialize()
        {
            this.layer = Layer.HUD;
            this.depth = new Depth(0.95f);
            float num1   = 300f;
            float num2   = 40f;
            Vec2  vec2_1 = new Vec2((float)((double)this.layer.width / 2.0 - (double)num1 / 2.0), (float)((double)this.layer.height / 2.0 - (double)num2 / 2.0));
            Vec2  vec2_2 = new Vec2((float)((double)this.layer.width / 2.0 + (double)num1 / 2.0), (float)((double)this.layer.height / 2.0 + (double)num2 / 2.0));

            this.position               = vec2_1 + new Vec2(4f, 20f);
            this.itemSize               = new Vec2(490f, 16f);
            this._root                  = true;
            this.invalidPathChars       = Path.GetInvalidPathChars();
            this._fancyFont             = new FancyBitmapFont("smallFont");
            this._textbox               = new MysteryTextbox(vec2_1.x + 4f, vec2_1.y + 4f, num1 - 20f, num2 - 10f);
            this._textbox.enterConfirms = true;
        }
 public override void Initialize()
 {
     this.layer           = Layer.HUD;
     this.depth           = new Depth(0.9f);
     this._showBackground = false;
     this.itemSize        = new Vec2(386f, 16f);
     this._root           = true;
     this.drawControls    = false;
     this._descriptionBox = new Textbox(this.x + 5f, this.y + 225f, 316f, 40f, 0.5f, 9, "<ENTER DESCRIPTION>");
     this._nameBox        = new Textbox(this.x + 5f, this.y + (float)byte.MaxValue, 316f, 12f, maxLines: 1, emptyText: "<ENTER NAME>");
     this._font           = new FancyBitmapFont("smallFont");
     this._confirm        = new MessageDialogue();
     Level.Add((Thing)this._confirm);
     this._upload = new UploadDialogue();
     Level.Add((Thing)this._upload);
     this._notify = new NotifyDialogue();
     Level.Add((Thing)this._notify);
     this._deathmatchTest = new DeathmatchTestDialogue();
     Level.Add((Thing)this._deathmatchTest);
     this._testSuccess = new TestSuccessDialogue();
     Level.Add((Thing)this._testSuccess);
     this._arcadeTest = new ArcadeTestDialogue();
     Level.Add((Thing)this._arcadeTest);
 }
 public UIGachaBoxNew(
     float xpos,
     float ypos,
     float wide         = -1f,
     float high         = -1f,
     bool rare          = false,
     UIMenu openOnClose = null)
     : base("", xpos, ypos, wide, high)
 {
     this._openOnClose = openOnClose;
     this._rare        = rare;
     this._duckCoin    = new SpriteMap("duckCoin", 18, 18);
     this._duckCoin.CenterOrigin();
     this._gachaMachine = new Sprite("arcade/gotcha/machine");
     this._gachaMachine.CenterOrigin();
     this._gachaGlass = new Sprite("arcade/gotcha/glass");
     this._gachaGlass.CenterOrigin();
     this._gachaDoor = new Sprite("arcade/gotcha/door");
     this._gachaDoor.CenterOrigin();
     this._gachaTwister = new Sprite("arcade/gotcha/twister");
     this._gachaTwister.CenterOrigin();
     this._gachaBall = new SpriteMap("arcade/gotcha/balls", 40, 42);
     this._gachaBall.CenterOrigin();
     this._gachaTwisterShadow = new Sprite("arcade/gotcha/twisterShadow");
     this._gachaTwisterShadow.CenterOrigin();
     this._whiteCircle = new Sprite("furni/whiteCircle");
     this._whiteCircle.CenterOrigin();
     this._coin = new SpriteMap("arcade/gotcha/coin", 22, 22);
     this._coin.CenterOrigin();
     this._coinSlot = new Sprite("arcade/gotcha/coinSlot");
     this._coinSlot.CenterOrigin();
     this._rainbow = new Sprite("arcade/rainbow");
     Graphics.fade = 1f;
     this._frame   = new Sprite("unlockFrame");
     this._frame.CenterOrigin();
     this._furni        = new Sprite("furni/tub");
     this._furni.center = new Vec2((float)(this._furni.width / 2), (float)this._furni.height);
     this._star         = new Sprite("prettyStar");
     this._star.CenterOrigin();
     this._font      = new BitmapFont("biosFontUI", 8, 7);
     this._fancyFont = new FancyBitmapFont("smallFontGacha");
     this._gachaEgg  = new SpriteMap("gachaEgg", 44, 36);
     this._capsule   = new SpriteMap("arcade/egg", 40, 23);
     this._capsule.CenterOrigin();
     this._capsuleBorder = new SpriteMap("arcade/eggBorder", 66, 65);
     this._capsuleBorder.CenterOrigin();
     this._rare           = false;
     this.numGenerate     = MonoMain.core.gachas;
     this.numGenerateRare = MonoMain.core.rareGachas;
     for (int index = 0; index < this.numGenerate; ++index)
     {
         Furniture furniture = UIGachaBox.GetRandomFurniture(Rarity.Common, 1, gacha: true)[0];
         furniture.ballRot = Rando.Float(360f);
         furniture.rareGen = false;
         this.prizes.Add(furniture);
     }
     for (int index = 0; index < this.numGenerateRare; ++index)
     {
         Furniture furniture = UIGachaBox.GetRandomFurniture(Rarity.VeryVeryRare, 1, 0.4f, true).OrderBy <Furniture, int>((Func <Furniture, int>)(x => - x.rarity)).ElementAt <Furniture>(0);
         furniture.ballRot = Rando.Float(360f);
         furniture.rareGen = true;
         this.prizes.Add(furniture);
     }
     for (int index = 0; index < 3; ++index)
     {
         Furniture furniture = UIGachaBox.GetRandomFurniture(Rarity.Common, 1, gacha: true)[0];
         furniture.ballRot = Rando.Float(360f);
         furniture.rareGen = false;
         this.prizes.Add(furniture);
     }
     this.LoadNextPrize();
     this._gachaEgg.CenterOrigin();
 }