Exemplo n.º 1
0
        void gridCLPSData_CellEndEdit(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.ColumnIndex != columns.Length)
                {
                    ulong clps = m_CLPS[e.RowIndex].flags;

                    columns[e.ColumnIndex].SetFlag(ref clps,
                                                   ulong.Parse(gridCLPSData.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()));

                    CLPS.Entry temp = new CLPS.Entry();
                    temp.flags         = clps;
                    m_CLPS[e.RowIndex] = temp;
                }
                else
                {
                    return;
                }

                LoadCLPSData();
            }
            catch (Exception ex)
            {
                new ExceptionMessageBox(ex).ShowDialog();
                return;
            }
        }
Exemplo n.º 2
0
 private void btnShiftDown_Click(object sender, EventArgs e)
 {
     if (gridCLPSData.SelectedRows.Count == 0)
     {
         MessageBox.Show("Please select a row to move.");
     }
     else if (gridCLPSData.SelectedRows[0].Index != gridCLPSData.Rows.Count - 1)
     {
         CLPS.Entry temp = m_CLPS[gridCLPSData.SelectedRows[0].Index];
         m_CLPS[gridCLPSData.SelectedRows[0].Index]     = m_CLPS[gridCLPSData.SelectedRows[0].Index + 1];
         m_CLPS[gridCLPSData.SelectedRows[0].Index + 1] = temp;
     }
     LoadCLPSData();
 }
Exemplo n.º 3
0
        private void LoadCLPS(NitroOverlay ovl)
        {
            uint clpsAddr  = ovl.ReadPointer(0x60);
            int  numCLPSes = ovl.Read16(clpsAddr + 0x06);

            m_CLPS = new CLPS();

            clpsAddr += 8;
            for (int i = 0; i < numCLPSes; ++i)
            {
                CLPS.Entry clps = new CLPS.Entry();
                clps.flags  = ovl.Read32(clpsAddr);
                clps.flags |= (ulong)ovl.Read32(clpsAddr + 4) << 32;
                m_CLPS.Add(clps);
                clpsAddr += 8;
            }
        }
Exemplo n.º 4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            CLPS.Entry clps = new CLPS.Entry();
            clps.flags = 0x000000ff00000fc0;

            if (gridCLPSData.SelectedRows.Count == 0)
            {
                m_CLPS.Add(clps);
            }
            else
            {
                m_CLPS.m_Entries.Insert(gridCLPSData.SelectedRows[0].Index, clps);
            }

            // Reload data
            LoadCLPSData();
        }
Exemplo n.º 5
0
        private void CopyCLPS(int sourceLevel)
        {
            NitroOverlay otherOVL = new NitroOverlay(Program.m_ROM, Program.m_ROM.GetLevelOverlayID(sourceLevel));

            uint   other_clps_addr = otherOVL.ReadPointer(0x60);
            ushort other_clps_num  = otherOVL.Read16(other_clps_addr + 0x06);
            uint   other_clps_size = (uint)(8 + (other_clps_num * 8));

            m_CLPS = new CLPS();
            for (int i = 0; i < other_clps_num; ++i)
            {
                ulong flags = otherOVL.Read32((uint)(other_clps_addr + 8 + 8 * i + 0));
                flags |= (ulong)otherOVL.Read32((uint)(other_clps_addr + 8 + 8 * i + 4)) << 32;
                CLPS.Entry clps = new CLPS.Entry();
                clps.flags = flags;
                m_CLPS.Add(clps);
            }

            LoadCLPSData();
        }