Exemple #1
0
 /// <summary>
 /// Loads save 4
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void slot4ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (curgame == GAME_UW1)
     {
         PlayerDatUI.LoadUW1PDat(this, 4);
     }
     else
     {
         PlayerDatUI.LoadUW2PDat(this, 4);
     }
 }
Exemple #2
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;
 }
Exemple #3
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;
         }
     }
 }
Exemple #4
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);
        }
Exemple #5
0
 public static void PopulateWorldNode(TreeNode node, int index, objects.ObjectInfo[] objList)
 {
     while (index != 0)
     {
         TreeNode newnode = node.Nodes.Add(index + ". " + objects.ObjectName(objList[index].item_id, main.curgame));
         newnode.Tag = index;
         if (objects.isContainer(objList[index].item_id))
         {
             PlayerDatUI.PopulateLinkedInventoryNode(newnode, objList[index].link, objList);
         }
         index = objList[index].next;
         //else
         //{
         //    PopulateInventoryMagicLink(newnode, index, objList);
         //}
     }
 }
 public static void PopulateUI(char[] buffer, objects.ObjectInfo[] objList, main MAIN)
 {
     PlayerDatUI.PopulateCharName(buffer, MAIN);
     PlayerDatUI.PopulateStats(buffer, MAIN);
     PlayerDatUI.PopulateInventory(buffer, objList, MAIN);
 }
Exemple #7
0
 /// <summary>
 /// Handle the changing of the character nae
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void txtCharName_TextChanged(object sender, EventArgs e)
 {
     PlayerDatUI.ChangeCharName(this);
 }