示例#1
0
 private AssetID GetAssetID(string assetName)
 {
     if (AssetIDTypeConverter.Legacy)
     {
         return(Convert.ToUInt32(assetName, 16));
     }
     return(AssetIDTypeConverter.AssetIDFromString(assetName));
 }
示例#2
0
        private void textBoxFindAsset_TextChanged(object sender, EventArgs e)
        {
            uint assetID = 0;

            try
            {
                textBoxFindAsset.BackColor = defaultColor;
                assetID = AssetIDTypeConverter.AssetIDFromString(textBoxFindAsset.Text);
            }
            catch
            {
                textBoxFindAsset.BackColor = System.Drawing.Color.Red;
            }

            if (assetID != 0 && archive.ContainsAsset(assetID))
            {
                SetSelectedIndices(new List <uint>()
                {
                    assetID
                }, false);
            }
            else
            {
                foreach (Asset a in archive.GetAllAssets())
                {
                    if (a.AHDR.ADBG.assetName.ToLower().Contains(textBoxFindAsset.Text.ToLower()) && !a.isSelected)
                    {
                        SetSelectedIndices(new List <uint>()
                        {
                            a.AHDR.assetID
                        }, false);
                        return;
                    }
                }
            }
        }