private WhModel LoadWhCharacterModel(WhRace race, WhGender gender, string[] itemIds) { var gathererItems = WhDataLoader.LoadItemsFromGatherer(itemIds); var options = new WhViewerOptions() { Cls = WhClass.WARRIOR, Hd = true }; if (gathererItems != null) { options.Items = gathererItems .Select((x, i) => new WhViewerOptions.Item() { Slot = x.Value.OtherData.SlotBak, Id = x.Value.OtherData.DisplayId, // Пока так, когда узнать откуда взять этот id - надо тоже прописать VisualId = null }) .ToArray(); } var characterModel = new WhModel( options, WhModelInfo.CreateForCharacter(race, gender), 0); WhDefferedList.Execute(); characterModel.EmulateDraw(false); return(characterModel); }
public static WhJsonCustomizationData LoadMetaCharacterCustomization(WhRace race, WhGender gender) { var relativeUrl = $"meta/charactercustomization/{(int)race}_{(int)gender}.json"; var url = GetModelViewerUrl(relativeUrl); var json = DataLoaderBase.LoadString(url, ".json"); return(JsonConvert.DeserializeObject <WhJsonCustomizationData>(json)); }
// Этот метод я сам добавил public static WhModelInfo CreateForCharacter(WhRace race, WhGender gender) { return(new WhModelInfo() { Type = WhType.CHARACTER, Id = race.GetStringIdentifier() + gender.GetStringIdentifier() }); }
public WowVrcFile(WhRace race, WhGender gender, string[] itemIds) { var manualHeaderData = new WowVrcFileData.HeaderData.ManualHeaderData() { Race = race, Gender = gender, ItemIds = itemIds }; _data = new WowVrcFileData() { Version = currentVersion, Header = new WowVrcFileData.HeaderData() { ManualData = manualHeaderData } }; }
public void Load(int id, WhRace race, WhGender gender) { Id = id; Race = race; Gender = gender; var metaPath = "item"; if (Slot == WhSlot.HEAD || Slot == WhSlot.SHOULDER || Slot == WhSlot.SHIRT || Slot == WhSlot.CHEST || Slot == WhSlot.BELT || Slot == WhSlot.PANTS || Slot == WhSlot.BOOTS || Slot == WhSlot.BRACERS || Slot == WhSlot.HANDS || Slot == WhSlot.CAPE || Slot == WhSlot.TABARD || Slot == WhSlot.ROBE) { metaPath = $"armor/{(int)Slot}"; } WhDefferedList.Add(() => LoadAndHandle_Meta(metaPath, id)); }
public WhItem(WhModel model, WhSlot slot, int id, WhRace race, WhGender gender) { Model = model; Slot = slot; UniqueSlot = WhGlobal.UniqueSlots[slot]; SortValue = WhGlobal.SlotOrder[slot]; Models = null; Textures = null; GeosetGroup = null; Flags = 0; Loaded = false; Visual = null; Visualid = 0; if (id != 0) { Load(id, race, gender); } }
public WowObject LoadCharacter(WhRace race, WhGender gender, string[] itemIds, float scale = 1f) { var whCharacterModel = LoadWhCharacterModel(race, gender, itemIds); return(new WowObjectBuilder(scale).BuildFromCharacterWhModel(whCharacterModel)); }
/// <summary> /// Продолжение ZamModelViewer.Wow.Races но для ключей = самим значениям энама /// </summary> public static string GetStringIdentifier(this WhRace race) { return(_stringIdentifiers[race]); }
private uint SelectBestTexture(WhJsonMeta meta, string textureid, WhGender gender, WhClass cls, WhRace race) { var textures = meta.TextureFiles[textureid]; for (int i = 0; i < textures.Length; i++) { var texture = textures[i]; if (texture.Race != 0 && texture.Race == race && (texture.Class != 0 && texture.Class == cls) && (texture.Gender == gender || texture.Gender == WhGender.Undefined3)) { return(texture.FileDataId); } } for (int i = 0; i < textures.Length; i++) { var texture = textures[i]; if (texture.Race != 0 && texture.Race == race && (texture.Gender == gender || texture.Gender == WhGender.Undefined3)) { return(texture.FileDataId); } } for (int i = 0; i < textures.Length; i++) { var texture = textures[i]; if (texture.Class != 0 && texture.Class == cls && (texture.Gender == gender || texture.Gender == WhGender.Undefined3)) { return(texture.FileDataId); } } for (int i = 0; i < textures.Length; i++) { var texture = textures[i]; if (texture.Gender == gender || texture.Gender == WhGender.Undefined3) { return(texture.FileDataId); } } throw new System.NotImplementedException("selectBestTexture for " + textureid + ", gender " + gender + ", class " + cls + ", race " + race + " failed!"); }