Beispiel #1
0
        public string CreateInventoryInfo(List <PlayerItemInfo> _Items, PlayerRace _Race, PlayerClass _Class, PlayerSex _Sex, WowRealm _Realm = WowRealm.All, WowVersionEnum _WowVersion = WowVersionEnum.Vanilla)
        {
            string invInfo = "";

            string currentItemDatabase = DatabaseAccess.GetCurrentItemDatabaseAddress();

            var itemSummaryDB = Hidden.ApplicationInstance.Instance.GetItemSummaryDatabase();

            string modelEqString = "";
            var    itemIDs       = _Items.Select((_Value) => _Value.ItemID);

            foreach (var item in _Items)
            {
                var itemInfo = DatabaseAccess.GetItemInfo(item.ItemID, _WowVersion);
                if (itemInfo == null)
                {
                    invInfo += "<div class='equipment-slot' id='" + CharacterViewer.ItemSlotToIDConversion[item.Slot] + "'><div class='quality' id='epic'></div><img src='assets/img/icons/inv_misc_questionmark.png'/></div>";
                }
                else
                {
                    string currInvInfo = "<div class='equipment-slot' id='" + CharacterViewer.ItemSlotToIDConversion[item.Slot] + "'>"
                                         + "<img class='itempic' src='" + "http://realmplayers.com/" + itemInfo.GetIconImageAddress() + "'/>"
                                         + "<div class='quality' id='" + CharacterViewer.ItemQualityConversion[itemInfo.ItemQuality] + "'></div>"
                                         + "<img class='itemframe' src='assets/img/icons/ItemNormalFrame.png'/>"
                                         + CharacterViewer.GenerateItemLink(currentItemDatabase, item, _WowVersion, itemInfo.GenerateSetPcsStr(itemIDs));

                    if (item.Slot == ItemSlot.Head && ModelViewerOptions.HideHead == true)
                    {
                    }
                    else
                    {
                        if ((_Class == VF_RealmPlayersDatabase.PlayerClass.Hunter && (item.Slot == ItemSlot.Main_Hand || item.Slot == ItemSlot.Off_Hand)) ||
                            (_Class != VF_RealmPlayersDatabase.PlayerClass.Hunter && item.Slot == ItemSlot.Ranged))
                        {
                        }
                        else
                        {
                            int modelViewerID   = 0;
                            int modelViewerSlot = 0;
                            if (itemInfo.GetModelViewerIDAndSlot(item.Slot, out modelViewerID, out modelViewerSlot, true) == true)
                            {
                                if (item.Slot == ItemSlot.Off_Hand)
                                {
                                    if (itemInfo.AjaxTooltip.Contains("Shield") == false)
                                    {
                                        modelViewerSlot = 22;
                                    }
                                }
                                if (modelViewerID != 0)
                                {
                                    modelEqString = modelEqString + "," + modelViewerSlot + "," + modelViewerID;
                                }
                            }
                        }
                    }
                    //List<Tuple<DateTime, string>> players = null;
                    if (_Realm != WowRealm.All)
                    {
                        int usageCount = itemSummaryDB.GetItemUsageCount(_Realm, item);
                        currInvInfo += "<a class='itemplayersframe' href='ItemUsageInfo.aspx?realm=" + StaticValues.ConvertRealmParam(_Realm) + "&item=" + item.ItemID + (item.SuffixID != 0 ? "&suffix=" + item.SuffixID : "") + "'>" + usageCount + "</a>";
                    }
                    currInvInfo += "</div>";
                    invInfo     += currInvInfo;
                }
            }
            invInfo += "<img style='position: absolute;z-index: 1; pointer-events: none;' src='assets/img/bg/CharacterBackgroundTransparent.png'></img>";

            string modelViewerQuery = PageUtility.GetQueryString(Request, "modelviewer", "unknown").ToLower();

            if (modelViewerQuery != "false" && modelEqString != "" && ModelViewerOptions.View3DModel == true)
            {
                if (modelEqString[0] == ',')//För att bli av med det första ","
                {
                    modelEqString = modelEqString.Substring(1);
                }
                //modelEqString = "1,33743,3,33653,5,33650,6,31110,7,31115,8,31111,9,31127,10,33651,13,25629";
                string modelCharString = ((_Race == VF_RealmPlayersDatabase.PlayerRace.Undead) ? "Scourge" : _Race.ToString().Replace("_", "")) + _Sex.ToString();// "orcmale";

                invInfo += "<div style='z-index: 0; position: absolute; margin: 33px 77px; width:385px; height:512px;'><object type='application/x-shockwave-flash' data='http://wow.zamimg.com/modelviewer/ZAMviewerfp11.swf' width='385' height='512' id='dsjkgbdsg2346' style='visibility: visible;'>"
                           + "<param name='quality' value='low'>"
                           + "<param name='allowscriptaccess' value='always'>"
                           + "<param name='allowfullscreen' value='false'>"
                           + "<param name='menu' value='false'>"
                           + "<param name='bgcolor' value='#181818'>"
                           + "<param name='wmode' value='direct'>"
                           + "<param name='flashvars' value='hd=false&amp;model="
                           + modelCharString
                           + "&amp;modelType=16&amp;contentPath=http://wow.zamimg.com/modelviewer/&amp;equipList="
                           + modelEqString
                           + "'>"
                           + "</object></div>";
            }
            else
            {
                invInfo += "<img class='characterimage' src='" + StaticValues.GetRaceCrestImageUrl(_Race) + "'></img>";
            }

            Hidden.ApplicationInstance.Instance.BackupItemInfos();
            return(invInfo);
        }