public override void Open() { HUD.CloseAllCorners(); this._showedWarning = false; this._showWarning = false; HUD.AddCornerControl(HUDCorner.BottomRight, "@QUACK@EXIT"); MonoMain.doPauseFade = false; base.Open(); }
public override void Update() { if (this.finished) { return; } this.yOffset = Lerp.FloatSmooth(this.yOffset, this.down ? 150f : 0.0f, 0.3f, 1.1f); if (this.down) { this._downWait -= 0.06f; if ((double)this._downWait <= 0.0) { if (this._doneDown) { this.finished = true; this.Close(); return; } this._openWait = 1f; this._downWait = 1f; this.down = false; SFX.Play("pause", 0.6f); } } else { if (!this._shown) { UIFuneral.oldSong = Music.currentSong; Music.Play("littlesad", false); HUD.AddCornerControl(HUDCorner.BottomRight, "@SELECT@CONTINUE"); this._shown = true; } if (Input.Pressed("SELECT")) { HUD.CloseAllCorners(); SFX.Play("resume", 0.6f); this.down = true; this._doneDown = true; } } base.Update(); }
public override void Update() { if (this.finished) { return; } this.yOffset = Lerp.FloatSmooth(this.yOffset, this.down ? 150f : 0.0f, 0.3f, 1.1f); if (this.down) { this._downWait -= 0.06f; if ((double)this._downWait <= 0.0) { if (this._doneDown) { this.finished = true; this.Close(); return; } this._openWait = 1f; this._wrapped = true; this._downWait = 1f; this.down = false; SFX.Play("pause", 0.6f); } } else { this._openWait -= 0.06f; if ((double)this._openWait <= 0.0 && this._wrapped && !this._flash) { this._flash = true; } if (this._flash) { Graphics.flashAdd = Lerp.Float(Graphics.flashAdd, 1f, 0.2f); if ((double)Graphics.flashAdd > 0.990000009536743) { this._wrapped = !this._wrapped; if (!this._wrapped) { this._oldSong = Music.currentSong; Music.Play("jollyjingle"); Profiles.experienceProfile.SetNumFurnitures((int)this._furni.index, Profiles.experienceProfile.GetNumFurnitures((int)this._furni.index) + 1); SFX.Play("harp"); HUD.AddCornerControl(HUDCorner.BottomRight, "@SELECT@CONTINUE"); } this._flash = false; } } else { Graphics.flashAdd = Lerp.Float(Graphics.flashAdd, 0.0f, 0.2f); } if (!this._wrapped && Input.Pressed("SELECT")) { HUD.CloseAllCorners(); SFX.Play("resume", 0.6f); if (this._oldSong != null) { Music.Play(this._oldSong); } this.down = true; this._doneDown = true; } } base.Update(); }
public override void Update() { if (this.open) { if (this._showWarning) { this._selectionChanged = true; if (Input.Pressed("QUACK")) { SFX.Play("consoleCancel"); this._showWarning = false; } else if (Input.Pressed("GRAB")) { SFX.Play("death"); this._showedWarning = true; this._showWarning = false; if (Level.core.gameInProgress) { Main.ResetGameStuff(); Main.ResetMatchStuff(); Level.core.gameInProgress = false; Send.Message((NetMessage) new NMResetGameSettings()); } } } else { int slot = this._slot; if (Input.Pressed("LEFT") && (this._slot == 1 || this._slot == 3)) { --this._slot; } if (Input.Pressed("RIGHT") && (this._slot == 0 || this._slot == 2)) { ++this._slot; } if (Input.Pressed("UP") && (this._slot == 2 || this._slot == 3)) { this._slot -= 2; } if (Input.Pressed("DOWN") && (this._slot == 0 || this._slot == 1)) { this._slot += 2; } UISlotEditor.hoveringSlot = this._slot; if (this._slot != slot) { this._selectionChanged = true; } if (this._slot == 0) { this._rectPosition = new Vec2(0.0f, 0.0f); } else if (this._slot == 1) { this._rectPosition = new Vec2(178f, 0.0f); } else if (this._slot == 2) { this._rectPosition = new Vec2(0.0f, 90f); } else if (this._slot == 3) { this._rectPosition = new Vec2(178f, 90f); } if (this._selectionChanged) { if (DuckNetwork.profiles[this._slot].connection != null && DuckNetwork.profiles[this._slot].connection != DuckNetwork.localConnection) { HUD.CloseCorner(HUDCorner.TopLeft); HUD.AddCornerControl(HUDCorner.TopLeft, "@GRAB@KICK"); } else { HUD.CloseCorner(HUDCorner.TopLeft); } if (DuckNetwork.profiles[this._slot].connection != DuckNetwork.localConnection) { HUD.CloseCorner(HUDCorner.BottomLeft); HUD.AddCornerControl(HUDCorner.BottomLeft, "TOGGLE MODE@SELECT@"); } else { HUD.CloseCorner(HUDCorner.BottomLeft); } this._selectionChanged = false; } if (Input.Pressed("SELECT") && DuckNetwork.profiles[this._slot].connection != DuckNetwork.localConnection) { if (!this._showedWarning && Level.core.gameInProgress) { this._showWarning = true; SFX.Play("pause"); HUD.CloseAllCorners(); HUD.AddCornerControl(HUDCorner.BottomLeft, "YEAH OK!@GRAB@"); HUD.AddCornerControl(HUDCorner.BottomRight, "@QUACK@CANCEL"); } else { int num = (int)(DuckNetwork.profiles[this._slot].slotType + 1); if (DuckNetwork.profiles[this._slot].reservedUser != null && num == 5) { ++num; } if (DuckNetwork.profiles[this._slot].reservedUser == null && num >= 5 || DuckNetwork.profiles[this._slot].reservedUser != null && num > 6) { num = 0; } DuckNetwork.profiles[this._slot].slotType = (SlotType)num; DuckNetwork.ChangeSlotSettings(); SFX.Play("menuBlip01"); } } else if (Input.Pressed("GRAB") && DuckNetwork.profiles[this._slot].connection != DuckNetwork.localConnection) { DuckNetwork.Kick(DuckNetwork.profiles[this._slot]); } else if (Input.Pressed("QUACK")) { SFX.Play("consoleCancel"); new UIMenuActionOpenMenu((UIComponent)this, (UIComponent)this._closeMenu).Activate(); } } } base.Update(); }