Exemplo n.º 1
0
        public void LoadYwr(YwrFile ywr)
        {
            fileName = ywr?.Name;
            if (string.IsNullOrEmpty(fileName))
            {
                fileName = ywr?.RpfFileEntry?.Name;
            }

            UpdateFormTitle();


            StringBuilder sb = new StringBuilder();

            if ((ywr != null) && (ywr.Waypoints != null) && (ywr.Waypoints.Entries != null))
            {
                sb.AppendLine("PositionX, PositionY, PositionZ, Unk0, Unk1, Unk2, Unk3");
                foreach (var entry in ywr.Waypoints.Entries)
                {
                    sb.Append(FloatUtil.ToString(entry.PositionX));
                    sb.Append(", ");
                    sb.Append(FloatUtil.ToString(entry.PositionY));
                    sb.Append(", ");
                    sb.Append(FloatUtil.ToString(entry.PositionZ));
                    sb.Append(", ");
                    sb.Append(entry.Unk0.ToString());
                    sb.Append(", ");
                    sb.Append(entry.Unk1.ToString());
                    sb.Append(", ");
                    sb.Append(entry.Unk2.ToString());
                    sb.Append(", ");
                    sb.Append(entry.Unk3.ToString());
                    sb.AppendLine();
                }
            }
            else
            {
                sb.AppendLine("Unable to load Waypoint Records.");
            }

            MainTextBox.Text = sb.ToString();
        }
Exemplo n.º 2
0
        public void LoadYwr(YwrFile ywr)
        {
            this.ywr = ywr;
            fileName = ywr?.Name;
            if (string.IsNullOrEmpty(fileName))
            {
                fileName = ywr?.RpfFileEntry?.Name;
            }

            UpdateFormTitle();

            if ((ywr != null) && (ywr.Waypoints != null) && (ywr.Waypoints.Entries != null))
            {
                LoadListView();
                ExportButton.Enabled        = true;
                CopyClipboardButton.Enabled = true;
            }
            else
            {
                MessageBox.Show("Error", "Could not load ywr", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }