Пример #1
0
        private void RemapSingleImage_Click(object sender, EventArgs e)
        {
            Button        button   = (Button)sender;
            ImageSelector selector = new ImageSelector(piggyFile, palette, false);

            if (selector.ShowDialog() == DialogResult.OK)
            {
                isLocked = true;
                int                 value       = selector.Selection;
                TMAPInfo            tmapinfo    = datafile.TMapInfo[textureID];
                TMapInfoTransaction transaction = new TMapInfoTransaction("TMapInfo texture change", textureID, 0, datafile, piggyFile, textureID, value);
                transaction.eventHandler += TextureEventHandler;
                transactionManager.ApplyTransaction(transaction);
                isLocked = false;
            }
        }
Пример #2
0
        private void TextureIDTextBox_TextChanged(object sender, EventArgs e)
        {
            if (isLocked || transactionManager.TransactionInProgress)
            {
                return;
            }
            int     value;
            TextBox control = (TextBox)sender;

            if (int.TryParse(control.Text, out value))
            {
                TMAPInfo            tmapinfo    = datafile.TMapInfo[textureID];
                TMapInfoTransaction transaction = new TMapInfoTransaction("TMapInfo texture change", textureID, 0, datafile, piggyFile, textureID, value);
                transaction.eventHandler += TextureEventHandler;
                transactionManager.ApplyTransaction(transaction);
            }
        }