Exemplo n.º 1
0
        public override void LoadCamera(BCAMEntry Entry)
        {
            base.LoadCamera(Entry);
            Loading = true;
            RotationZNumericUpDown.Value   = (decimal)Entry.RotationZ.RadianToDegree();
            ZoomNumericUpDown.Value        = (decimal)Entry.Zoom;
            StringTextBox.Text             = Entry.String;
            FieldOfViewNumericUpDown.Value = (decimal)Entry.FieldOfView;
            CamIntNumericUpDown.Value      = Entry.TransitionTime;
            CamEndIntNumericUpDown.Value   = Entry.TransitionEndTime;
            EventFrameNumericUpDown.Value  = Entry.EventFrames;

            FixpointVector3NumericUpDown.LoadVector3(Entry.FixPointOffset);
            WorldOffsetVector3NumericUpDown.LoadVector3(Entry.WorldPointOffset);
            Vector3 <float> PlayerOffset = Entry.PlayerOffset;

            PlayerOffsetYNumericUpDown.Value = (decimal)PlayerOffset.YValue.RadianToDegree();
            PlayerOffsetXNumericUpDown.Value = (decimal)PlayerOffset.XValue.RadianToDegree();
            UpAxisVector3NumericUpDown.LoadVector3(Entry.UpAxis);

            FieldOfViewCheckBox.Checked        = Entry.EnableFoV;
            DisableCollisionCheckBox.Checked   = Entry.DisableCollision;
            DisableFirstPersonCheckBox.Checked = !Entry.DisableFirstPerson;
            EventUseTimeCheckBox.Checked       = Entry.EventUseTransitionTime;
            EventUseEndTimeCheckBox.Checked    = Entry.EventUseTransitionEndTime;
            Loading = false;
        }
Exemplo n.º 2
0
        public override void LoadCamera(BCAMEntry Entry)
        {
            base.LoadCamera(Entry);
            Loading = true;
            RotationYNumericUpDown.Value    = Math.Min(RotationYNumericUpDown.Maximum, Math.Max(RotationYNumericUpDown.Minimum, (decimal)Entry.RotationY.RadianToDegree()));
            StringTextBox.Text              = Entry.String;
            FieldOfViewNumericUpDown.Value  = (decimal)Entry.FieldOfView;
            CamIntNumericUpDown.Value       = Entry.TransitionTime;
            CamEndIntNumericUpDown.Value    = Entry.TransitionEndTime;
            FrontOffsetNumericUpDown.Value  = (decimal)Entry.LookOffset;
            HeightOffsetNumericUpDown.Value = (decimal)Entry.LookOffsetVertical;
            EventFrameNumericUpDown.Value   = Entry.EventFrames;

            FixpointVector3NumericUpDown.LoadVector3(Entry.FixPointOffset);
            Vector3 <float> PlayerOffset = Entry.PlayerOffset;

            PlayerOffsetYNumericUpDown.Value = (decimal)PlayerOffset.YValue;
            PlayerOffsetXNumericUpDown.Value = (decimal)PlayerOffset.XValue;

            FieldOfViewCheckBox.Checked        = Entry.EnableFoV;
            SharpZoomCheckBox.Checked          = Entry.StaticLookOffset;
            DisableAntiBlurCheckBox.Checked    = Entry.DisableAntiBlur;
            DisableCollisionCheckBox.Checked   = Entry.DisableCollision;
            DisableFirstPersonCheckBox.Checked = !Entry.DisableFirstPerson;
            GFlagEndErpFrameCheckBox.Checked   = Entry.GFlagEndErpFrame;
            GFlagThroughCheckBox.Checked       = Entry.GFlagThrough;
            GFlagEndTimeNumericUpDown.Value    = (decimal)Entry.GFlagEndTime;
            EventUseTimeCheckBox.Checked       = Entry.EventUseTransitionTime;
            EventUseEndTimeCheckBox.Checked    = Entry.EventUseTransitionEndTime;
            Loading = false;
        }
Exemplo n.º 3
0
 public virtual void LoadCamera(BCAMEntry Entry)
 {
     Loading           = true;
     IDTextBox.Text    = Entry.Identification;
     TypeComboBox.Text = Entry.Type;
     Loading           = false;
 }
Exemplo n.º 4
0
        private void AutoSortToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Cameras is null)
            {
                return;
            }

            BCAMEntry Cam = CameraListBox.SelectedIndex == -1 ? null : Cameras[CameraListBox.SelectedIndex];

            CameraListBox.SelectedIndex = -1;
            CameraListBox.Enabled       = false;

            Cameras.Sort();
            ReloadCameraListBox();

            CameraListBox.Enabled = true;
            if (!(Cam is null))
            {
                for (int i = 0; i < Cameras.EntryCount; i++)
                {
                    if (Cameras[i] == Cam)
                    {
                        CameraListBox.SelectedIndex = i;
                        break;
                    }
                }
            }
            Program.IsUnsavedChanges = true;
        }
Exemplo n.º 5
0
        public override void LoadCamera(BCAMEntry Entry)
        {
            base.LoadCamera(Entry);
            Loading = true;
            RotationZNumericUpDown.Value    = (decimal)Entry.RotationZ.RadianToDegree();
            Num1CheckBox.Checked            = Entry.Num1 > 0;
            StringTextBox.Text              = Entry.String;
            CamIntNumericUpDown.Value       = Entry.TransitionTime;
            CamEndIntNumericUpDown.Value    = Entry.TransitionEndTime;
            FrontOffsetNumericUpDown.Value  = (decimal)Entry.LookOffset;
            HeightOffsetNumericUpDown.Value = (decimal)Entry.LookOffsetVertical;
            EventFrameNumericUpDown.Value   = Entry.EventFrames;

            FixpointVector3NumericUpDown.LoadVector3(Entry.FixPointOffset);
            UpAxisVector3NumericUpDown.LoadVector3(Entry.UpAxis);

            SharpZoomCheckBox.Checked          = Entry.StaticLookOffset;
            DisableFirstPersonCheckBox.Checked = !Entry.DisableFirstPerson;
            GFlagEndErpFrameCheckBox.Checked   = Entry.GFlagEndErpFrame;
            GFlagThroughCheckBox.Checked       = Entry.GFlagThrough;
            GFlagEndTimeNumericUpDown.Value    = (decimal)Entry.GFlagEndTime;
            EventUseTimeCheckBox.Checked       = Entry.EventUseTransitionTime;
            EventUseEndTimeCheckBox.Checked    = Entry.EventUseTransitionEndTime;
            Loading = false;
        }
Exemplo n.º 6
0
        public override void LoadCamera(BCAMEntry Entry)
        {
            base.LoadCamera(Entry);
            Loading = true;
            RotationZNumericUpDown.Value    = (decimal)Entry.RotationZ.RadianToDegree();
            ZoomNumericUpDown.Value         = (decimal)Entry.Zoom;
            Num1NumericUpDown.Value         = Entry.Num1;
            Num2NumericUpDown.Value         = Entry.Num2;
            StringTextBox.Text              = Entry.String;
            FieldOfViewNumericUpDown.Value  = (decimal)Entry.FieldOfView;
            JumpingYNumericUpDown.Value     = (decimal)Entry.MaxY;
            FallingYNumericUpDown.Value     = (decimal)Entry.MinY;
            CamIntNumericUpDown.Value       = Entry.TransitionTime;
            CamEndIntNumericUpDown.Value    = Entry.TransitionEndTime;
            FrontOffsetNumericUpDown.Value  = (decimal)Entry.LookOffset;
            HeightOffsetNumericUpDown.Value = (decimal)Entry.LookOffsetVertical;
            UpperBorderNumericUpDown.Value  = (decimal)Entry.UpperBorder;
            LowerBorderNumericUpDown.Value  = (decimal)Entry.LowerBorder;
            EventFrameNumericUpDown.Value   = Entry.EventFrames;

            FixpointVector3NumericUpDown.LoadVector3(Entry.FixPointOffset);
            WorldOffsetXNumericUpDown.Value = (decimal)Entry.WorldPointOffset.XValue;
            WorldOffsetYNumericUpDown.Value = (decimal)Entry.WorldPointOffset.YValue;
            VerticalPanAxisVector3NumericUpDown.LoadVector3(Entry.VerticalPanAxis);
            UpAxisVector3NumericUpDown.LoadVector3(Entry.UpAxis);

            FieldOfViewCheckBox.Checked        = Entry.EnableFoV;
            SharpZoomCheckBox.Checked          = Entry.StaticLookOffset;
            DisableCollisionCheckBox.Checked   = !Entry.DisableCollision;
            DisableFirstPersonCheckBox.Checked = !Entry.DisableFirstPerson;
            UseVerticalPanAxisCheckBox.Checked = Entry.EnableVerticalPanAxis;
            EventUseTimeCheckBox.Checked       = Entry.EventUseTransitionTime;
            EventUseEndTimeCheckBox.Checked    = Entry.EventUseTransitionEndTime;
            Loading = false;
        }
Exemplo n.º 7
0
 public virtual void UnLoadCamera(BCAMEntry Entry)
 {
     Entry.Identification = IDTextBox.Text;
     if (Entry.Identification.ToLower()[0] == 's' || Entry.Identification.ToLower()[0] == 'c')
     {
         Entry.Identification = Entry.Identification.ToLower();
     }
     Entry.Type = TypeComboBox.Text;
 }
Exemplo n.º 8
0
        public KeyValuePair <BCAMEntry, int> StealSelected()
        {
            if (CameraListBox.SelectedIndex == -1 || Cameras[CameraListBox.SelectedIndex] is null)
            {
                return(new KeyValuePair <BCAMEntry, int>(null, -1));
            }

            BCAMEntry val   = Cameras[CameraListBox.SelectedIndex];
            int       index = CameraListBox.SelectedIndex;

            Cameras[CameraListBox.SelectedIndex]             = null;
            CameraListBox.Items[CameraListBox.SelectedIndex] = "<Already in preset>";
            return(new KeyValuePair <BCAMEntry, int>(val, index));
        }
Exemplo n.º 9
0
        private void AddDefaultCameraToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Cameras == null)
            {
                Console.WriteLine(Program.ConsoleHalfSplitter);
                Console.WriteLine("Failed to add the camera!\nNo camera file is active");
                Console.WriteLine(Program.ConsoleHalfSplitter);
                return;
            }
            BCAMEntry newcamera = CameraDefaults.Defaults["CAM_TYPE_XZ_PARA"];

            newcamera.Identification = "c:" + BCAMEx.CalculateNextCameraArea(Cameras).ToString("x4");
            newcamera.Type           = "CAM_TYPE_XZ_PARA";
            AddCamera(newcamera);
            Console.WriteLine("Added the Default Camera to the end of the Camera List");
        }
Exemplo n.º 10
0
        public override void LoadCamera(BCAMEntry Entry)
        {
            base.LoadCamera(Entry);
            Loading = true;
            RotationXNumericUpDown.Value     = (decimal)Entry.RotationX.RadianToDegree();
            RotationYNumericUpDown.Value     = (decimal)Entry.RotationY.RadianToDegree();
            RotationZNumericUpDown.Value     = (decimal)Entry.RotationZ.RadianToDegree();
            ZoomNumericUpDown.Value          = (decimal)Entry.Zoom;
            Num1NumericUpDown.Value          = Entry.Num1;
            Num2NumericUpDown.Value          = Entry.Num2;
            StringTextBox.Text               = Entry.String;
            FieldOfViewNumericUpDown.Value   = (decimal)Entry.FieldOfView;
            JumpingYNumericUpDown.Value      = (decimal)Entry.MaxY;
            FallingYNumericUpDown.Value      = (decimal)Entry.MinY;
            CamIntNumericUpDown.Value        = Entry.TransitionTime;
            CamEndIntNumericUpDown.Value     = Entry.TransitionEndTime;
            FrontOffsetNumericUpDown.Value   = (decimal)Entry.LookOffset;
            HeightOffsetNumericUpDown.Value  = (decimal)Entry.LookOffsetVertical;
            GroundDelayNumericUpDown.Value   = Entry.GroundMoveDelay;
            AirDelayNumericUpDown.Value      = Entry.AirMoveDelay;
            UpperBorderNumericUpDown.Value   = (decimal)Entry.UpperBorder;
            LowerBorderNumericUpDown.Value   = (decimal)Entry.LowerBorder;
            EventFrameNumericUpDown.Value    = Entry.EventFrames;
            EventPriorityNumericUpDown.Value = Entry.EventPriority;

            FixpointVector3NumericUpDown.LoadVector3(Entry.FixPointOffset);
            WorldOffsetVector3NumericUpDown.LoadVector3(Entry.WorldPointOffset);
            PlayerOffsetVector3NumericUpDown.LoadVector3(Entry.PlayerOffset);
            VerticalPanAxisVector3NumericUpDown.LoadVector3(Entry.VerticalPanAxis);
            UpAxisVector3NumericUpDown.LoadVector3(Entry.UpAxis);

            DisableResetCheckBox.Checked       = !Entry.DisableReset;
            FieldOfViewCheckBox.Checked        = Entry.EnableFoV;
            SharpZoomCheckBox.Checked          = Entry.StaticLookOffset;
            DisableAntiBlurCheckBox.Checked    = Entry.DisableAntiBlur;
            DisableCollisionCheckBox.Checked   = !Entry.DisableCollision;
            DisableFirstPersonCheckBox.Checked = !Entry.DisableFirstPerson;
            GFlagEndErpFrameCheckBox.Checked   = Entry.GFlagEndErpFrame;
            GFlagThroughCheckBox.Checked       = Entry.GFlagThrough;
            GFlagEndTimeNumericUpDown.Value    = (decimal)Entry.GFlagEndTime;
            UseVerticalPanAxisCheckBox.Checked = Entry.EnableVerticalPanAxis;
            EventUseTimeCheckBox.Checked       = Entry.EventUseTransitionTime;
            EventUseEndTimeCheckBox.Checked    = Entry.EventUseTransitionEndTime;
            Loading = false;
        }
Exemplo n.º 11
0
        public override void UnLoadCamera(BCAMEntry Entry)
        {
            base.UnLoadCamera(Entry);
            Entry.RotationX                 = 0.0f;
            Entry.RotationY                 = 0.0f;
            Entry.RotationZ                 = ((float)RotationZNumericUpDown.Value).DegreeToRadian();
            Entry.Zoom                      = (float)ZoomNumericUpDown.Value;
            Entry.Num1                      = 0;
            Entry.Num2                      = 0;
            Entry.String                    = StringTextBox.Text;
            Entry.FieldOfView               = (float)FieldOfViewNumericUpDown.Value;
            Entry.MaxY                      = 300;
            Entry.MinY                      = 800;
            Entry.TransitionTime            = (int)CamIntNumericUpDown.Value;
            Entry.TransitionEndTime         = (int)CamEndIntNumericUpDown.Value;
            Entry.LookOffset                = 0.0f;
            Entry.LookOffsetVertical        = 0.0f;
            Entry.GroundMoveDelay           = 120;
            Entry.AirMoveDelay              = 120;
            Entry.UpperBorder               = 0.0f;
            Entry.LowerBorder               = 0.0f;
            Entry.EventFrames               = (int)EventFrameNumericUpDown.Value;
            Entry.EventPriority             = Entry.IsOfCategory("e") ? 1 : 0;
            Entry.FixPointOffset            = FixpointVector3NumericUpDown.GetVector3();
            Entry.WorldPointOffset          = WorldOffsetVector3NumericUpDown.GetVector3();
            Entry.PlayerOffset              = new Vector3 <float>(((float)PlayerOffsetXNumericUpDown.Value).DegreeToRadian(), ((float)PlayerOffsetYNumericUpDown.Value).DegreeToRadian(), 0);
            Entry.VerticalPanAxis           = new Vector3 <float>(0, 0, 0);
            Entry.UpAxis                    = UpAxisVector3NumericUpDown.GetVector3();
            Entry.DisableReset              = false;
            Entry.EnableFoV                 = FieldOfViewCheckBox.Checked;
            Entry.StaticLookOffset          = false; //SharpZoomCheckBox.Checked;
            Entry.DisableAntiBlur           = false; // DisableAntiBlurCheckBox.Checked;
            Entry.DisableCollision          = DisableCollisionCheckBox.Checked;
            Entry.DisableFirstPerson        = !DisableFirstPersonCheckBox.Checked;
            Entry.GFlagEndErpFrame          = false; // GFlagEndErpFrameCheckBox.Checked;
            Entry.GFlagThrough              = false; // GFlagThroughCheckBox.Checked;
            Entry.GFlagEndTime              = 0;     // (int)GFlagEndTimeNumericUpDown.Value;
            Entry.EnableVerticalPanAxis     = false;
            Entry.EventUseTransitionTime    = EventUseTimeCheckBox.Checked;
            Entry.EventUseTransitionEndTime = EventUseEndTimeCheckBox.Checked;

            Entry.UDown = 120;
            Entry.TransitionGroundTime = 160;
        }
Exemplo n.º 12
0
        public override void UnLoadCamera(BCAMEntry Entry)
        {
            base.UnLoadCamera(Entry);
            Entry.RotationX                 = ((float)RotationXNumericUpDown.Value).DegreeToRadian();
            Entry.RotationY                 = ((float)RotationYNumericUpDown.Value).DegreeToRadian();
            Entry.RotationZ                 = ((float)RotationZNumericUpDown.Value).DegreeToRadian();
            Entry.Zoom                      = (float)ZoomNumericUpDown.Value;
            Entry.Num1                      = (int)Num1NumericUpDown.Value;
            Entry.Num2                      = (int)Num2NumericUpDown.Value;
            Entry.String                    = StringTextBox.Text;
            Entry.FieldOfView               = (float)FieldOfViewNumericUpDown.Value;
            Entry.MaxY                      = (float)JumpingYNumericUpDown.Value;
            Entry.MinY                      = (float)FallingYNumericUpDown.Value;
            Entry.TransitionTime            = (int)CamIntNumericUpDown.Value;
            Entry.TransitionEndTime         = (int)CamEndIntNumericUpDown.Value;
            Entry.LookOffset                = (float)FrontOffsetNumericUpDown.Value;
            Entry.LookOffsetVertical        = (float)HeightOffsetNumericUpDown.Value;
            Entry.GroundMoveDelay           = (int)GroundDelayNumericUpDown.Value;
            Entry.AirMoveDelay              = (int)AirDelayNumericUpDown.Value;
            Entry.UpperBorder               = (float)UpperBorderNumericUpDown.Value;
            Entry.LowerBorder               = (float)LowerBorderNumericUpDown.Value;
            Entry.EventFrames               = (int)EventFrameNumericUpDown.Value;
            Entry.EventPriority             = (int)EventPriorityNumericUpDown.Value;
            Entry.FixPointOffset            = FixpointVector3NumericUpDown.GetVector3();
            Entry.WorldPointOffset          = WorldOffsetVector3NumericUpDown.GetVector3();
            Entry.PlayerOffset              = PlayerOffsetVector3NumericUpDown.GetVector3();
            Entry.VerticalPanAxis           = VerticalPanAxisVector3NumericUpDown.GetVector3();
            Entry.UpAxis                    = UpAxisVector3NumericUpDown.GetVector3();
            Entry.DisableReset              = !DisableResetCheckBox.Checked;
            Entry.EnableFoV                 = FieldOfViewCheckBox.Checked;
            Entry.StaticLookOffset          = SharpZoomCheckBox.Checked;
            Entry.DisableAntiBlur           = DisableAntiBlurCheckBox.Checked;
            Entry.DisableCollision          = !DisableCollisionCheckBox.Checked;
            Entry.DisableFirstPerson        = !DisableFirstPersonCheckBox.Checked;
            Entry.GFlagEndErpFrame          = GFlagEndErpFrameCheckBox.Checked;
            Entry.GFlagThrough              = GFlagThroughCheckBox.Checked;
            Entry.GFlagEndTime              = (int)GFlagEndTimeNumericUpDown.Value;
            Entry.EnableVerticalPanAxis     = UseVerticalPanAxisCheckBox.Checked;
            Entry.EventUseTransitionTime    = EventUseTimeCheckBox.Checked;
            Entry.EventUseTransitionEndTime = EventUseEndTimeCheckBox.Checked;

            Entry.UDown = 120;
            Entry.TransitionGroundTime = 120;
        }
Exemplo n.º 13
0
        private void AddNewFromClipboardToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BCAMEntry NewFromClipboard = new BCAMEntry();

            if (NewFromClipboard.FromClipboard(Clipboard.GetText()))
            {
                if (Cameras == null)
                {
                    Console.WriteLine(Program.ConsoleHalfSplitter);
                    Console.WriteLine("Failed to add the camera!\nNo camera file is active");
                    Console.WriteLine(Program.ConsoleHalfSplitter);
                    return;
                }
                AddCamera(NewFromClipboard);
                Console.WriteLine("Camera Added from Clipboard!");
            }
            else
            {
                Console.WriteLine("Clipboard doesn't contain a Valid LCP Camera!" + (Cameras == null ? "\nAnd there is no camera file currently active":""));
            }
        }
Exemplo n.º 14
0
 private void SelectButton_Click(object sender, EventArgs e)
 {
     if (((CameraEditorForm)ParentForm).Cameras == null)
     {
         Console.WriteLine(Program.ConsoleHalfSplitter);
         Console.WriteLine("Failed to add the preset!\nNo camera file is active");
         Console.WriteLine(Program.ConsoleHalfSplitter);
         return;
     }
     try
     {
         string full = ((FileInfo)PresetsTreeView.SelectedNode.Tag).FullName;
         if (!File.Exists(full))
         {
             PresetsTreeView.SelectedNode.Remove();
             throw new FileNotFoundException($"Could not find file '{full}'.");
         }
         Console.WriteLine("Loading preset...");
         LCPP CurrentPreset = new LCPP(full);
         for (int i = 0; i < CurrentPreset.Count; i++)
         {
             BCAMEntry entry = new BCAMEntry();
             entry.FromClipboard(CurrentPreset[i]);
             ((CameraEditorForm)ParentForm).AddCamera(entry);
             Console.Write($"\r{Math.Min(((float)(i + 1) / (float)CurrentPreset.Count) * 100.0f, 100.0f)}%          ");
         }
         Console.WriteLine();
         Console.WriteLine("Preset loaded successfully!");
         if (CurrentPreset.Count == 0)
         {
             Console.WriteLine("(Though the preset has no cameras...)");
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(Program.ConsoleHalfSplitter);
         Console.WriteLine("Preset Failed to load!\n" + ex.GetType().FullName + ": " + ex.Message);
         Console.WriteLine(Program.ConsoleHalfSplitter);
     }
 }
Exemplo n.º 15
0
 public void AddCamera(BCAMEntry NewCamera)
 {
     Cameras.Add(NewCamera);
     CameraListBox.Items.Add(NewCamera.GetTranslatedName());
     Program.IsUnsavedChanges = true;
 }
Exemplo n.º 16
0
        public void LoadCompressedLegacyFile(Stream FS)
        {
            byte[] Read         = new byte[4];
            int    stringlength = FS.ReadByte();

            Read = new byte[stringlength];
            FS.Read(Read, 0, stringlength);
            Name = Program.StringEncoder.GetString(Read);

            stringlength = FS.ReadByte();
            Read         = new byte[stringlength];
            FS.Read(Read, 0, stringlength);
            Creator = Program.StringEncoder.GetString(Read);

            Read = new byte[4];
            FS.Read(Read, 0, 4);
            Array.Reverse(Read);
            int CameraCount = BitConverter.ToInt32(Read, 0);

            FS.Read(Read, 0, 4);
            Array.Reverse(Read);
            long Offset = BitConverter.ToInt32(Read, 0);

            for (int i = 0; i < CameraCount; i++)
            {
                BCAMEntry Added = new BCAMEntry()
                {
                    Version                   = (int)FindNumber(FS, Offset),
                    Identification            = FindString(FS, Offset),
                    Type                      = FindString(FS, Offset),
                    RotationX                 = FindNumber(FS, Offset),
                    RotationY                 = FindNumber(FS, Offset),
                    RotationZ                 = FindNumber(FS, Offset),
                    Zoom                      = FindNumber(FS, Offset),
                    FieldOfView               = FindNumber(FS, Offset),
                    TransitionTime            = (int)FindNumber(FS, Offset),
                    TransitionEndTime         = (int)FindNumber(FS, Offset),
                    TransitionGroundTime      = (int)FindNumber(FS, Offset),
                    Num1                      = (int)FindNumber(FS, Offset),
                    Num2                      = (int)FindNumber(FS, Offset),
                    MaxY                      = FindNumber(FS, Offset),
                    MinY                      = FindNumber(FS, Offset),
                    GroundMoveDelay           = (int)FindNumber(FS, Offset),
                    AirMoveDelay              = (int)FindNumber(FS, Offset),
                    UDown                     = (int)FindNumber(FS, Offset),
                    LookOffset                = FindNumber(FS, Offset),
                    LookOffsetVertical        = FindNumber(FS, Offset),
                    UpperBorder               = FindNumber(FS, Offset),
                    LowerBorder               = FindNumber(FS, Offset),
                    EventFrames               = (int)FindNumber(FS, Offset),
                    EventPriority             = (int)FindNumber(FS, Offset),
                    FixPointOffset            = new Vector3 <float>(FindNumber(FS, Offset), FindNumber(FS, Offset), FindNumber(FS, Offset)),
                    WorldPointOffset          = new Vector3 <float>(FindNumber(FS, Offset), FindNumber(FS, Offset), FindNumber(FS, Offset)),
                    PlayerOffset              = new Vector3 <float>(FindNumber(FS, Offset), FindNumber(FS, Offset), FindNumber(FS, Offset)),
                    VerticalPanAxis           = new Vector3 <float>(FindNumber(FS, Offset), FindNumber(FS, Offset), FindNumber(FS, Offset)),
                    UpAxis                    = new Vector3 <float>(FindNumber(FS, Offset), FindNumber(FS, Offset), FindNumber(FS, Offset)),
                    DisableReset              = FindBoolean(FS, Offset),
                    StaticLookOffset          = FindBoolean(FS, Offset),
                    DisableAntiBlur           = FindBoolean(FS, Offset),
                    DisableCollision          = FindBoolean(FS, Offset),
                    DisableFirstPerson        = FindBoolean(FS, Offset),
                    GFlagEndErpFrame          = FindBoolean(FS, Offset),
                    GFlagThrough              = FindBoolean(FS, Offset),
                    GFlagEndTime              = FindBoolean(FS, Offset) ? 1 : 0,
                    EnableVerticalPanAxis     = FindBoolean(FS, Offset),
                    EventUseTransitionEndTime = FindBoolean(FS, Offset),
                    EventUseTransitionTime    = FindBoolean(FS, Offset),
                };
                Entries.Add(Added.ToClipboard());
            }
        }
Exemplo n.º 17
0
 public void Add(BCAMEntry entry) => Entries.Add(entry.ToClipboard());
Exemplo n.º 18
0
        /// <summary>
        /// LCPP Versions 0.1 and 0.2
        /// </summary>
        /// <param name="FS"></param>
        public void LoadLegacyFile(Stream FS)
        {
            byte[] ToRead = new byte[10]; //Version of LaunchCamPlus
            FS.Read(ToRead, 0, 10);
            string LCPVersion = Program.StringEncoder.GetString(ToRead);

            ToRead = new byte[49]; //Preset Name
            FS.Read(ToRead, 0, 48);
            string presetname = Program.StringEncoder.GetString(ToRead).Replace("\0", "");

            ToRead = new byte[49]; //Preset Creator
            FS.Read(ToRead, 0, 48);
            string creator = Program.StringEncoder.GetString(ToRead).Replace("\0", "");

            ToRead = new byte[4]; //Number of Cameras
            FS.Read(ToRead, 0, 4);
            int cameranum = Convert.ToInt32(ToRead[0] + ToRead[1] + ToRead[2] + ToRead[3]);

            ToRead = new byte[12]; //Padding
            FS.Read(ToRead, 0, 12);
            //<------------------------------------------------------------------------------------------>
            for (int i = 0; i < cameranum; i++)
            {
                ToRead = new byte[4];
                FS.Read(ToRead, 0, 4);
                Array.Reverse(ToRead);
                int nextoffset = BitConverter.ToInt32(ToRead, 0);
                ToRead = new byte[nextoffset];
                FS.Read(ToRead, 0, nextoffset);
                string CurrentString = Program.StringEncoder.GetString(ToRead);

                BCAMEntry Properties = new BCAMEntry();
                string[]  Props      = CurrentString.Split(',');

                string[]        P;
                Vector3 <float> FixPoint        = new Vector3 <float>();
                Vector3 <float> WorldPoint      = new Vector3 <float>();
                Vector3 <float> PlayerOffset    = new Vector3 <float>();
                Vector3 <float> VerticalPanAxis = new Vector3 <float>();
                Vector3 <float> UpAxis          = new Vector3 <float>();
                for (int j = 0; j < Props.Length; j++)
                {
                    P = Props[j].Split('=');
                    switch (P[0])
                    {
                    case "Version":
                    case "Num":
                        break;

                    case "Identification":
                        Properties.Identification = P[1].Replace("\"", "");
                        break;

                    case "Type":
                        Properties.Type = P[1].Replace("\"", "");
                        break;

                    case "RotationX":
                        P[1] = P[1].Replace("f", "");
                        Properties.RotationX = Convert.ToSingle(P[1]);
                        break;

                    case "RotationY":
                        P[1] = P[1].Replace("f", "");
                        Properties.RotationY = Convert.ToSingle(P[1]);
                        break;

                    case "RotationZ":
                        P[1] = P[1].Replace("f", "");
                        Properties.RotationZ = Convert.ToSingle(P[1]);
                        break;

                    case "Zoom":
                        P[1]            = P[1].Replace("f", "");
                        Properties.Zoom = Convert.ToSingle(P[1]);
                        break;

                    case "DPDRotation":
                        Properties.FieldOfView = Convert.ToSingle(P[1]);
                        break;

                    case "TransitionSpeed":
                        Properties.TransitionTime = Convert.ToInt32(P[1]);
                        break;

                    case "EndTransitionSpeed":
                        Properties.TransitionEndTime = Convert.ToInt32(P[1]);
                        break;

                    case "GroundMoveSpeed":
                        Properties.TransitionGroundTime = Convert.ToInt32(P[1]);
                        break;

                    case "UseDPAD":
                        Properties.Num1 = Convert.ToInt32(P[1]);
                        break;

                    case "UnknownNum2":
                        Properties.Num2 = Convert.ToInt32(P[1]);
                        break;

                    case "MaxY":
                        Properties.MaxY = Convert.ToSingle(P[1]);
                        break;

                    case "MinY":
                        Properties.MinY = Convert.ToSingle(P[1]);
                        break;

                    case "GroundStartMoveDelay":
                        Properties.GroundMoveDelay = Convert.ToInt32(P[1]);
                        break;

                    case "AirStartMoveDelay":
                        Properties.AirMoveDelay = Convert.ToInt32(P[1]);
                        break;

                    case "UnknownUDown":
                        Properties.UDown = Convert.ToInt32(P[1]);
                        break;

                    case "FrontZoom":
                        Properties.LookOffset = Convert.ToSingle(P[1]);
                        break;

                    case "HeightZoom":
                        Properties.LookOffsetVertical = Convert.ToSingle(P[1]);
                        break;

                    case "UpperBorder":
                        P[1] = P[1].Replace("f", "");
                        Properties.UpperBorder = Convert.ToSingle(P[1]);
                        break;

                    case "LowerBorder":
                        P[1] = P[1].Replace("f", "");
                        Properties.LowerBorder = Convert.ToSingle(P[1]);
                        break;

                    case "EventFrames":
                        Properties.EventFrames = Convert.ToInt32(P[1]);
                        break;

                    case "EventPriority":
                        Properties.EventPriority = Convert.ToInt32(P[1]);
                        break;

                    case "FixpointOffsetX":
                        FixPoint.XValue = Convert.ToSingle(P[1]);
                        break;

                    case "FixpointOffsetY":
                        FixPoint.YValue = Convert.ToSingle(P[1]);
                        break;

                    case "FixpointOffsetZ":
                        FixPoint.ZValue = Convert.ToSingle(P[1]);
                        break;

                    case "WorldPointX":
                        WorldPoint.XValue = Convert.ToSingle(P[1]);
                        break;

                    case "WorldPointY":
                        WorldPoint.YValue = Convert.ToSingle(P[1]);
                        break;

                    case "WorldPointZ":
                        WorldPoint.ZValue = Convert.ToSingle(P[1]);
                        break;

                    case "PlayerOffsetX":
                        PlayerOffset.XValue = Convert.ToSingle(P[1]);
                        break;

                    case "PlayerOffsetY":
                        PlayerOffset.YValue = Convert.ToSingle(P[1]);
                        break;

                    case "PlayerOffsetZ":
                        PlayerOffset.ZValue = Convert.ToSingle(P[1]);
                        break;

                    case "VPanAxisX":
                        VerticalPanAxis.XValue = Convert.ToSingle(P[1]);
                        break;

                    case "VPanAxisY":
                        VerticalPanAxis.YValue = Convert.ToSingle(P[1]);
                        break;

                    case "VPanAxisZ":
                        VerticalPanAxis.ZValue = Convert.ToSingle(P[1]);
                        break;

                    case "UnknownUpX":
                        UpAxis.XValue = Convert.ToSingle(P[1]);
                        break;

                    case "UnknownUpY":
                        UpAxis.YValue = Convert.ToSingle(P[1]);
                        break;

                    case "UnknownUpZ":
                        UpAxis.ZValue = Convert.ToSingle(P[1]);
                        break;

                    case "DisableReset":
                        Properties.DisableReset = P[1] == "true" ? true : false;
                        break;

                    case "DisableDPAD":
                        Properties.EnableFoV = P[1] == "true" ? true : false;
                        break;

                    case "SharpZoom":
                        Properties.StaticLookOffset = P[1] == "true" ? true : false;
                        break;

                    case "DisableAntiBlur":
                        Properties.DisableAntiBlur = P[1] == "true" ? true : false;
                        break;

                    case "DisableCollision":
                        Properties.DisableCollision = P[1] == "true" ? true : false;
                        break;

                    case "DisableFirstPerson":
                        Properties.DisableFirstPerson = P[1] == "true" ? true : false;
                        break;

                    case "GFlagEndErpFrame":
                        Properties.GFlagEndErpFrame = P[1] == "true" ? true : false;
                        break;

                    case "GFlagThrough":
                        Properties.GFlagThrough = P[1] == "true" ? true : false;
                        break;

                    case "GFlagEndTransitionSpeed":
                        Properties.GFlagEndTime = 0;
                        break;

                    case "VPanUse":
                        Properties.EnableVerticalPanAxis = P[1] == "true" ? true : false;
                        break;

                    case "EventUseEndTransition":
                        Properties.EventUseTransitionEndTime = P[1] == "true" ? true : false;
                        break;

                    case "EventUseTransition":
                        Properties.EventUseTransitionTime = P[1] == "true" ? true : false;
                        break;

                    default:
                        System.Windows.Forms.MessageBox.Show("Sorry, but this Preset file is corrupted or outdated", "LCPP Error");
                        return;
                    }
                }

                Properties.FixPointOffset   = FixPoint;
                Properties.WorldPointOffset = WorldPoint;
                Properties.PlayerOffset     = PlayerOffset;
                Properties.VerticalPanAxis  = VerticalPanAxis;
                Properties.UpAxis           = UpAxis;
                Entries.Add(Properties.ToClipboard());
            }

            Creator = creator;
            Name    = presetname;
        }