public void UpdateBoxInfo() { BoxInfo.Clear(); if (Player != null) { float angle = Player.Angles.y * 360.0f / 1024.0f; float sideAngle = (angle + 45.0f) % 90.0f - 45.0f; BoxInfo.Append("Position", Player.LocalPosition + Player.Mod); BoxInfo.Append("Angle", "{0:N1} {1:N1}", angle, sideAngle); } if (ShowAITD1Vars || ShowAdditionalInfo) { if (Player != null) { BoxInfo.AppendLine(); } if (ShowAITD1Vars) { int calculatedFps = previousFramesCount.Sum(); TimeSpan totalDelayTS = TimeSpan.FromSeconds(totalDelay.Elapsed); BoxInfo.Append("Timer 1", "{0}.{1:D2}", TimeSpan.FromSeconds(InternalTimer1 / 60), InternalTimer1 % 60); BoxInfo.Append("Timer 2", "{0}.{1:D2}", TimeSpan.FromSeconds(internalTimer2 / 60), internalTimer2 % 60); BoxInfo.Append("FPS/Frame/Delay", "{0}; {1}; {2} ms", calculatedFps, frameCounter, Mathf.FloorToInt(lastDelay * 1000)); BoxInfo.Append("Total delay", "{0:D2}:{1:D2}:{2:D2}.{3:D3} ", totalDelayTS.Hours, totalDelayTS.Minutes, totalDelayTS.Seconds, totalDelayTS.Milliseconds); } Vector3 mousePosition = GetMousePosition(linkroom, linkfloor); BoxInfo.Append("Cursor position", "{0} {1}", Mathf.Clamp((int)(mousePosition.x), -32768, 32767), Mathf.Clamp((int)(mousePosition.z), -32768, 32767)); if (Player != null) { BoxInfo.Append("Last offset/dist", "{0}; {1}", Player.LastOffset, Mathf.RoundToInt(Player.LastDistance)); } if (ShowAITD1Vars) { BoxInfo.Append("Allow inventory", allowInventory ? "Yes" : "No"); BoxInfo.Append("In hand", inHand); } } BoxInfo.UpdateText(); }
public void UpdateText(BoxInfo info) { info.Clear(); info.Append("TYPE", name.ToUpperInvariant()); info.Append("ID", ID); if (name == "Collider" || name == "Trigger") { info.Append("FLAGS", "0x{0:X4}", Flags); } if (name == "Camera" && DosBox != null && DosBox.ShowAdditionalInfo) { Vector3 position = Camera.transform.localPosition * 1000.0f; Vector3 rotation = Camera.transform.rotation.eulerAngles; info.Append("POSITION", "{0:F0} {1:F0} {2:F0}", position.x, -position.y, position.z); info.Append("ANGLE", "{0:N1} {1:N1} {2:N1}", rotation.x > 180.0f ? (rotation.x - 360.0f) : rotation.x, (-rotation.y + 540.0f) % 360.0f, rotation.z > 180.0f ? (rotation.z - 360.0f) : rotation.z); } if (name == "Actor") { if (DosBox.ShowAdditionalInfo) { info.Append("FLAGS/COL", "0x{0:X4} 0x{1:X4}", Flags, ColFlags); } else { info.Append("FLAGS", "0x{0:X4}", Flags); } if (DosBox.ShowAdditionalInfo) { info.Append("ROOM", "E{0}R{1}", Floor, Room); info.Append("ROOM_POS", LocalPosition + Mod); info.Append("WORLD_POS", WorldPosition + Mod); info.Append("ZV_POS", BoundingPos); info.Append("ZV_SIZE", BoundingSize); info.Append("MOD", Mod); info.Append("OFFSET", LastOffset); info.Append("DISTANCE", Mathf.RoundToInt(LastDistance)); if (Angles.x == 0.0f && Angles.z == 0.0f) { info.Append("ANGLE", "{0:N1} {1}", Angles.y * 360.0f / 1024.0f, RotateDir); } else { info.Append("ANGLE", "{0:N1} {1:N1} {2:N1}", Angles.x * 360.0f / 1024.0f, Angles.y * 360.0f / 1024.0f, Angles.z * 360.0f / 1024.0f); } } if (Life != -1) { if (DosBox.ShowAdditionalInfo && LifeMode >= 0 && LifeMode <= 2) { info.Append("LIFE/LIFEMODE", "{0}; {1}", Life, lifeModeInfo[LifeMode]); } else { info.Append("LIFE", Life); } } if (Body != -1) { if (Anim != -1) { if (DosBox.ShowAITD1Vars && NextAnim != -1) { info.Append("BODY/ANIM", "{0}; {1}; {2}", Body, Anim, NextAnim); } else { info.Append("BODY/ANIM", "{0}; {1}", Body, Anim); } if (DosBox.ShowAITD1Vars && AnimType >= 0 && AnimType <= 2) { info.Append("ANIMTYPE", animTypeInfo[AnimType]); } } else { info.Append("BODY", Body); } } if (DosBox.ShowAITD1Vars && Anim != -1) { if (Keyframe != -1) { info.Append("KEYFRAME", "{0}/{1}; {2} {3}", Keyframe, TotalFrames - 1, EndFrame, EndAnim); info.Append("FRAME", Mathf.FloorToInt(lastKeyFrameChange.Elapsed * 60.0f)); } info.Append("SPEED", Speed); } if (DosBox.ShowAITD1Vars && Chrono != 0) { info.Append("CHRONO", "{0}.{1:D2}", TimeSpan.FromSeconds((DosBox.InternalTimer1 - Chrono) / 60), (DosBox.InternalTimer1 - Chrono) % 60); } if (DosBox.ShowAITD1Vars && RoomChrono != 0) { info.Append("ROOM_CHRONO", "{0}.{1:D2}", TimeSpan.FromSeconds((DosBox.InternalTimer1 - RoomChrono) / 60), (DosBox.InternalTimer1 - RoomChrono) % 60); } if (DosBox.ShowAdditionalInfo && TrackMode >= 0 && TrackMode <= 3) { info.Append("TRACKMODE", trackModeInfo[TrackMode]); } if (DosBox.ShowAITD1Vars && TrackNumber != -1) { info.Append("TRACKNUM/POS", "{0} {1}", DashIfEmpty(TrackNumber), DashIfEmpty(PositionInTrack)); } if (DosBox.ShowAITD1Vars && ActionType >= 0 && ActionType <= 10) { info.Append("ACTIONTYPE", actionTypeInfo[ActionType]); } if (DosBox.ShowAITD1Vars) { info.Append("2DBOX", "{0} {1}; {2} {3}", Box2DLower.x, Box2DLower.y, Box2DUpper.x, Box2DUpper.y); } if (DosBox.ShowAITD1Vars) { info.Append("HITFORCE", HitForce); } if (DosBox.ShowAITD1Vars) { info.Append("HIT/BY COL/BY", "{0} {1} {2} {3} {4} {5}", GetActorID(Hit), GetActorID(HitBy), GetActorID((int)Col.x), GetActorID((int)Col.y), GetActorID((int)Col.z), GetActorID(ColBy)); } if (DosBox.ShowAITD1Vars) { info.Append("HARDCOL/TRIG", "{0} {1}", DashIfEmpty(HardCol), DashIfEmpty(HardTrigger)); } if (DosBox.ShowAdditionalInfo) { info.Append("SLOT", Slot); } } info.UpdateText(); }