public static int GetSpacing(this MenuCubeFace face) { switch (face) { case MenuCubeFace.CubeShards: return(12); case MenuCubeFace.Maps: return(28); case MenuCubeFace.Artifacts: return(40); case MenuCubeFace.AntiCubes: return(12); default: throw new InvalidOperationException(); } }
public static int GetOffset(this MenuCubeFace face) { switch (face) { case MenuCubeFace.CubeShards: return(34); case MenuCubeFace.Maps: return(36); case MenuCubeFace.Artifacts: return(44); case MenuCubeFace.AntiCubes: return(34); default: throw new InvalidOperationException(); } }
public static Vector3 GetRight(this MenuCubeFace face) { switch (face) { case MenuCubeFace.CubeShards: return(Vector3.UnitX); case MenuCubeFace.Maps: return(-Vector3.UnitZ); case MenuCubeFace.Artifacts: return(-Vector3.UnitX); case MenuCubeFace.AntiCubes: return(Vector3.UnitZ); default: throw new InvalidOperationException(); } }
public static string GetTitle(this MenuCubeFace face) { switch (face) { case MenuCubeFace.CubeShards: return(StaticText.GetString("MenuCube_CubeShards")); case MenuCubeFace.Maps: return(StaticText.GetString("MenuCube_Maps")); case MenuCubeFace.Artifacts: return(StaticText.GetString("MenuCube_Artifacts")); case MenuCubeFace.AntiCubes: return(StaticText.GetString("MenuCube_AntiCubes")); default: throw new InvalidOperationException(); } }
public override void Update(GameTime gameTime) { if (this.GameState.Paused || this.GameState.Loading || this.GameState.InMap) return; if (!this.GameState.InMenuCube) ServiceHelper.RemoveComponent<MenuCube>(this); else if (!this.GameState.MenuCubeIsZoomed && !this.CameraManager.ProjectionTransition && (this.InputManager.Back == FezButtonState.Pressed || this.InputManager.CancelTalk == FezButtonState.Pressed || this.InputManager.OpenInventory == FezButtonState.Pressed)) { this.ScheduleExit = true; this.Enabled = false; this.Resolved = false; this.TargetRenderingManager.ScheduleHook(this.DrawOrder, this.OutRtHandle.Target); } else { bool flag = FezMath.IsOrthographic(this.CameraManager.Viewpoint); bool menuCubeIsZoomed = this.GameState.MenuCubeIsZoomed; if (this.InputManager.RotateRight == FezButtonState.Pressed) { if (this.TomeOpen) { if (this.TomePageIndex > 0) { if (this.TomePageIndex != 0) --this.TomePageIndex; int tpi = this.TomePageIndex; Waiters.Interpolate(0.25, (Action<float>) (s => { s = Easing.EaseOut((double) FezMath.Saturate(1f - s), EasingType.Quadratic); this.TomePages.Groups[tpi].Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float) (-2.35619449615479 * (double) s * (1.0 - (double) tpi / 8.0 * 0.0500000007450581))); }), (Action) (() => { this.TomePages.Groups[tpi].Rotation = Quaternion.Identity; if (tpi == 8) return; this.TomePages.Groups[tpi + 1].Enabled = false; })); } } else { SoundEffectExtensions.Emit(this.rotateRightSound); if (!flag && !menuCubeIsZoomed) { this.LastFace = this.Face; ++this.Face; if (this.Face > MenuCubeFace.AntiCubes) this.Face = MenuCubeFace.CubeShards; ++this.Turns; this.GameService.CloseScroll((string) null); if (this.Face != MenuCubeFace.AntiCubes || this.GameState.SaveData.SecretCubes > 0) this.GameState.ShowScroll(MenuCubeFaceExtensions.GetTitle(this.Face), 0.0f, true); foreach (Group group in this.HidingPlanes.Groups) { MenuCubeFace menuCubeFace = (MenuCubeFace) group.CustomData; group.Enabled = menuCubeFace == this.Face || menuCubeFace == this.LastFace; } } if (FezMath.IsOrthographic(this.CameraManager.Viewpoint) && !menuCubeIsZoomed) this.OriginalRotation *= Quaternion.CreateFromAxisAngle(Vector3.Up, -1.570796f); } } else if (this.InputManager.RotateLeft == FezButtonState.Pressed) { if (this.TomeOpen) { if (this.TomePageIndex <= 8) { int tpi = this.TomePageIndex; if (this.TomePageIndex <= 8) ++this.TomePageIndex; Waiters.Interpolate(0.25, (Action<float>) (s => { s = Easing.EaseOut((double) FezMath.Saturate(s), EasingType.Quadratic); if (tpi != 8) this.TomePages.Groups[tpi + 1].Enabled = true; this.TomePages.Groups[tpi].Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float) (-2.35619449615479 * (double) s * (1.0 - (double) tpi / 8.0 * 0.0500000007450581))); }), (Action) (() => this.TomePages.Groups[tpi].Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float) (-2.35619449615479 * (1.0 - (double) tpi / 8.0 * 0.0500000007450581))))); } } else { SoundEffectExtensions.Emit(this.rotateLeftSound); if (!flag && !menuCubeIsZoomed) { this.LastFace = this.Face; --this.Face; if (this.Face < MenuCubeFace.CubeShards) this.Face = MenuCubeFace.AntiCubes; --this.Turns; this.GameService.CloseScroll((string) null); if (this.Face != MenuCubeFace.AntiCubes || this.GameState.SaveData.SecretCubes > 0) this.GameState.ShowScroll(MenuCubeFaceExtensions.GetTitle(this.Face), 0.0f, true); foreach (Group group in this.HidingPlanes.Groups) { MenuCubeFace menuCubeFace = (MenuCubeFace) group.CustomData; group.Enabled = menuCubeFace == this.Face || menuCubeFace == this.LastFace; } } if (FezMath.IsOrthographic(this.CameraManager.Viewpoint) && !menuCubeIsZoomed) this.OriginalRotation *= Quaternion.CreateFromAxisAngle(Vector3.Up, 1.570796f); } } this.UpdateHighlights((float) gameTime.TotalGameTime.TotalSeconds); this.AntiCubes.Rotation = this.Maps.Rotation = this.HidingPlanes.Rotation = this.Highlights.Rotation = this.AoInstance.Rotation = this.GoldenCubes.Rotation = Quaternion.Slerp(this.GoldenCubes.Rotation, this.OriginalRotation, 0.0875f); this.AntiCubes.Position = this.Maps.Position = this.HidingPlanes.Position = this.GoldenCubes.Position = this.AoInstance.Position; this.TransformArtifacts(); this.HandleSelection(); this.TestForTempleOfLove(); } }
private void CreateFaceHighlights(MenuCubeFace cf, Color color) { Vector3 vector3 = color.ToVector3(); Vector3 size = this.AoInstance.ArtObject.Size; for (int index = 0; index < 4; ++index) this.Highlights.AddWireframeFace(new Vector3((float) ((double) MenuCubeFaceExtensions.GetSize(cf) * 1.25 / 16.0)) * (Vector3.UnitY + FezMath.Abs(MenuCubeFaceExtensions.GetRight(cf))) * (float) (0.949999988079071 - (double) index * 0.0500000007450581), Vector3.Zero, FezMath.OrientationFromDirection(MenuCubeFaceExtensions.GetForward(cf)), new Color(vector3.X, vector3.Y, vector3.Z, (float) (1.0 - (double) index / 4.0)), true).Position = size / 2f * (MenuCubeFaceExtensions.GetForward(cf) + Vector3.Up - MenuCubeFaceExtensions.GetRight(cf)) + MenuCubeFaceExtensions.GetForward(cf) * (-7.0 / 16.0) + (Vector3.Down + MenuCubeFaceExtensions.GetRight(cf)) * (float) MenuCubeFaceExtensions.GetOffset(cf) / 16f; }
private void HandleSelection() { if (!this.zooming && this.Face == MenuCubeFace.CubeShards || this.Face == MenuCubeFace.AntiCubes) return; if (this.TomeZoom && this.InputManager.GrabThrow == FezButtonState.Pressed || this.TomeOpen && this.InputManager.CancelTalk == FezButtonState.Pressed) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type MenuCube.\u003C\u003Ec__DisplayClass31 cDisplayClass31_1 = new MenuCube.\u003C\u003Ec__DisplayClass31(); // ISSUE: reference to a compiler-generated field cDisplayClass31_1.\u003C\u003E4__this = this; this.TomeOpen = !this.TomeOpen; if (this.TomeOpen) { this.CameraManager.OriginalDirection = this.OriginalDirection; this.GameState.DisallowRotation = true; } else { this.GameState.DisallowRotation = false; for (int index = this.TomePageIndex - 1; index >= 0; --index) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type MenuCube.\u003C\u003Ec__DisplayClass33 cDisplayClass33 = new MenuCube.\u003C\u003Ec__DisplayClass33(); // ISSUE: reference to a compiler-generated field cDisplayClass33.CS\u0024\u003C\u003E8__locals32 = cDisplayClass31_1; // ISSUE: reference to a compiler-generated field cDisplayClass33.i1 = index; // ISSUE: reference to a compiler-generated method // ISSUE: reference to a compiler-generated method Waiters.Interpolate(0.25 + (double) (8 - index) / 8.0 * 0.150000005960464, new Action<float>(cDisplayClass33.\u003CHandleSelection\u003Eb__2b), new Action(cDisplayClass33.\u003CHandleSelection\u003Eb__2c)); } this.TomePageIndex = 0; } // ISSUE: reference to a compiler-generated field cDisplayClass31_1.thisWaiter = (IWaiter) null; // ISSUE: variable of a compiler-generated type MenuCube.\u003C\u003Ec__DisplayClass31 cDisplayClass31_2 = cDisplayClass31_1; MenuCube menuCube = this; double durationSeconds = this.TomeOpen ? 0.875 : 0.425000011920929; IWaiter waiter1; // ISSUE: reference to a compiler-generated method // ISSUE: reference to a compiler-generated method IWaiter waiter2 = waiter1 = Waiters.Interpolate(durationSeconds, new Action<float>(cDisplayClass31_1.\u003CHandleSelection\u003Eb__2d), new Action(cDisplayClass31_1.\u003CHandleSelection\u003Eb__2e)); menuCube.tomeOpenWaiter = waiter1; IWaiter waiter3 = waiter2; // ISSUE: reference to a compiler-generated field cDisplayClass31_2.thisWaiter = waiter3; } else { if (this.TomeOpen || this.zooming || (this.GameState.MenuCubeIsZoomed || this.InputManager.Jump != FezButtonState.Pressed) && (!this.GameState.MenuCubeIsZoomed || this.InputManager.Back != FezButtonState.Pressed && this.InputManager.CancelTalk != FezButtonState.Pressed)) return; // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type MenuCube.\u003C\u003Ec__DisplayClass36 cDisplayClass36 = new MenuCube.\u003C\u003Ec__DisplayClass36(); // ISSUE: reference to a compiler-generated field cDisplayClass36.\u003C\u003E4__this = this; this.zoomed = !this.zoomed; if (this.zoomed) { this.GameService.CloseScroll((string) null); this.GameState.MenuCubeIsZoomed = true; this.zoomedFace = this.Face; this.OriginalDirection = this.CameraManager.OriginalDirection; this.AntiCubes.Blending = this.GoldenCubes.Blending = new BlendingMode?(BlendingMode.Alphablending); } else { this.AntiCubes.Blending = this.GoldenCubes.Blending = new BlendingMode?(BlendingMode.Opaque); this.CameraManager.OriginalDirection = this.OriginalDirection; this.GameState.ShowScroll(MenuCubeFaceExtensions.GetTitle(this.Face), 0.0f, true); this.TomeOpen = false; } // ISSUE: reference to a compiler-generated field cDisplayClass36.oid = (int) ((double) this.HighlightPosition[this.zoomedFace].X + (double) this.HighlightPosition[this.zoomedFace].Y * Math.Sqrt((double) MenuCubeFaceExtensions.GetCount(this.zoomedFace))); this.zooming = true; switch (this.zoomedFace) { case MenuCubeFace.Maps: // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type MenuCube.\u003C\u003Ec__DisplayClass38 cDisplayClass38 = new MenuCube.\u003C\u003Ec__DisplayClass38(); // ISSUE: reference to a compiler-generated field cDisplayClass38.CS\u0024\u003C\u003E8__locals37 = cDisplayClass36; // ISSUE: reference to a compiler-generated field if (this.GameState.SaveData.Maps.Count <= cDisplayClass36.oid) { this.zooming = false; this.zoomed = false; this.GameState.MenuCubeIsZoomed = false; return; } else { if (this.zoomed) { for (int index = 0; index < 6; ++index) { // ISSUE: reference to a compiler-generated field this.Maps.Groups[cDisplayClass36.oid * 6 + index].Material = new Material(); // ISSUE: reference to a compiler-generated field this.originalMapPositions[index] = this.Maps.Groups[cDisplayClass36.oid * 6 + index].Position; } } Vector2 vector2 = this.HighlightPosition[this.zoomedFace]; // ISSUE: reference to a compiler-generated field cDisplayClass38.middleOffset = (float) ((double) vector2.X * (double) MenuCubeFaceExtensions.GetSpacing(this.zoomedFace) / 16.0) * MenuCubeFaceExtensions.GetRight(this.zoomedFace) + (float) ((double) vector2.Y * (double) MenuCubeFaceExtensions.GetSpacing(this.zoomedFace) / 16.0) * Vector3.Down + (Vector3.Down + MenuCubeFaceExtensions.GetRight(this.zoomedFace)) * (float) MenuCubeFaceExtensions.GetOffset(this.zoomedFace) / 16f; // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field cDisplayClass38.middleOffset = this.AoInstance.ArtObject.Size / 2f * (MenuCubeFaceExtensions.GetRight(this.zoomedFace) + Vector3.Down) - cDisplayClass38.middleOffset; // ISSUE: reference to a compiler-generated method // ISSUE: reference to a compiler-generated method Waiters.Interpolate(0.25, new Action<float>(cDisplayClass38.\u003CHandleSelection\u003Eb__2f), new Action(cDisplayClass36.\u003CHandleSelection\u003Eb__30)); break; } case MenuCubeFace.Artifacts: int count = this.ArtifactAOs.Count; if (this.GameState.SaveData.Artifacts.Contains(ActorType.Tome)) --count; // ISSUE: reference to a compiler-generated field if (count <= cDisplayClass36.oid) { this.zooming = false; this.zoomed = false; this.GameState.MenuCubeIsZoomed = false; return; } else { // ISSUE: reference to a compiler-generated field for (int index = 0; index <= cDisplayClass36.oid; ++index) { // ISSUE: reference to a compiler-generated field if (index != cDisplayClass36.oid && this.ArtifactAOs[index].ArtObjectName == "TOME_BAO") { // ISSUE: reference to a compiler-generated field ++cDisplayClass36.oid; } } // ISSUE: reference to a compiler-generated field this.DoArtifactZoom(this.ArtifactAOs[cDisplayClass36.oid]); // ISSUE: reference to a compiler-generated field if (this.ArtifactAOs[cDisplayClass36.oid].ArtObjectName == "TOME_BAO") { // ISSUE: reference to a compiler-generated field this.DoArtifactZoom(this.ArtifactAOs[cDisplayClass36.oid + 1]); break; } else break; } } if (this.zoomed) SoundEffectExtensions.Emit(this.zoomInSound); else SoundEffectExtensions.Emit(this.zoomOutSound); } }
private void MoveAndRotate(MenuCubeFace cf, Vector2 diff) { Vector2 op = this.HighlightPosition[cf]; this.HighlightPosition[cf] = FezMath.Round(this.HighlightPosition[cf] + diff); int sgn = Math.Sign(Vector2.Dot(diff, Vector2.One)); Vector3 axis = (double) diff.X != 0.0 ? Vector3.Up : MenuCubeFaceExtensions.GetRight(cf); Vector3 scale = this.AoInstance.ArtObject.Size; SoundEffectExtensions.Emit(this.cursorSound); Waiters.Interpolate(0.15, (Action<float>) (s => { for (int local_0 = 0; local_0 < 4; ++local_0) { Group local_1 = this.Highlights.Groups[(int) cf * 4 + local_0]; Vector2 local_2 = this.HighlightPosition[cf] - diff; if (op != local_2) break; s = Easing.EaseOut((double) FezMath.Saturate(s), EasingType.Sine); local_1.Position = (float) (((double) local_2.X + (double) diff.X * (double) s) * (double) MenuCubeFaceExtensions.GetSpacing(cf) / 16.0) * MenuCubeFaceExtensions.GetRight(cf) + (float) (((double) local_2.Y + (double) diff.Y * (double) s) * (double) MenuCubeFaceExtensions.GetSpacing(cf) / 16.0) * -Vector3.UnitY + scale / 2f * (MenuCubeFaceExtensions.GetForward(cf) + Vector3.Up - MenuCubeFaceExtensions.GetRight(cf)) + MenuCubeFaceExtensions.GetForward(cf) * (float) ((double) MenuCubeFaceExtensions.GetSize(cf) / 2.0 / 16.0 * Math.Sin((double) s * 3.14159274101257) - 7.0 / 16.0) + (Vector3.Down + MenuCubeFaceExtensions.GetRight(cf)) * (float) MenuCubeFaceExtensions.GetOffset(cf) / 16f; local_1.Rotation = Quaternion.CreateFromAxisAngle(axis, s * 3.141593f * (float) sgn); } }), (Action) (() => { for (int local_0 = 0; local_0 < 4; ++local_0) this.Highlights.Groups[(int) cf * 4 + local_0].Rotation = Quaternion.Identity; })); }