Esempio n. 1
0
 /// <summary>
 /// Handle changing of a value in the player inventory
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void PInvValueChanged(object sender, EventArgs e)
 {
     if (isLoading)
     {
         return;
     }
     //Update object at address
     char[] buffer = PlayerDatUI.GetValuesFromPDatGrid(this);
     UpdateObjectUIChange(buffer, pdatObjects.objList[CurPDatObject], CmbPdatItem_ID, ChkPdatEnchanted, ChkPdatIsQuant, ChkPdatDoorDir, ChkPdatInvis, NumPInvXpos, NumPInvYPos, NumPInvZpos, NumPInvHeading, NumPdatFlags, NumPdatQuality, NumPdatOwner, NumPdatNext, NumPdatLink);
     isLoading = true;
     PlayerDatUI.PopulatePDatValuesToGrid(buffer, this);
     isLoading = false;
 }
Esempio n. 2
0
 /// <summary>
 /// Handles changes of raw data and reflect it back to the ui
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void GrdPlayerDat_CellValueChanged(object sender, DataGridViewCellEventArgs e)
 {
     if (!isLoading)
     {
         DataGridView senderGrid = (DataGridView)sender;
         if (e.RowIndex >= 0)
         {
             isLoading = true;
             PlayerDatUI.PopulateUI(PlayerDatUI.GetValuesFromPDatGrid(this), pdatObjects.objList, this);
             isLoading = false;
         }
     }
 }
Esempio n. 3
0
        ///// <summary>
        ///// Loads tile info.
        ///// </summary>
        ///// <param name="sender"></param>
        ///// <param name="e"></param>
        //private void TreeTiles_AfterSelect(object sender, TreeViewEventArgs e)
        //{
        //    TileMapUI.LoadTileInfoFromSelectedNode(this);
        //}

        /// <summary>
        /// Saves the current uw1 save file.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void writePlayerDatToolStripMenuItem_Click(object sender, EventArgs e)
        {
            char[] buffer = PlayerDatUI.GetValuesFromPDatGrid(this);
            if (curgame == GAME_UW2)
            {
                buffer = playerdat.EncryptDecryptUW2(buffer, (byte)buffer[0]);
            }
            else
            {
                playerdat.EncryptDecryptUW1(buffer, buffer[0]);
            }

            Util.WriteStreamFile(main.basepath + "\\save" + curslot + "\\PLAYER.DAT", buffer);
        }