public AT_Icicle() { accuracy = 1f; range = 250f; penetration = 1f; rangeVariation = 10f; bulletSpeed = 2f; speedVariation = 0f; bulletLength = 0; sprite = TexHelper.ModSprite(tex_Bullet_Icicle); sprite.CenterOrigin(); }
public MoltenSpitter_AmmoType() { accuracy = 0.6f; range = 400f; penetration = 2f; rangeVariation = 10f; bulletLength = 0; combustable = true; bulletColor = Color.OrangeRed; sprite = TexHelper.ModSprite(tex_Bullet_Fireball2); sprite.CenterOrigin(); }
public AT_Leaf() { accuracy = 1f; range = 60f; penetration = 999f; bulletSpeed = 1f; speedVariation = 0.1f; combustable = true; bulletLength = 0; sprite = TexHelper.ModSprite(tex_Bullet_Leaf); sprite.CenterOrigin(); bulletColor = Color.OrangeRed; }
public EternalFlame_AmmoType() { accuracy = 0.2f; range = 200f; penetration = 1f; rangeVariation = 10f; bulletSpeed = 15f; speedVariation = -10f; rangeVariation = -50f; combustable = true; bulletLength = 0; sprite = TexHelper.ModSprite(tex_Bullet_FireBolt); sprite.CenterOrigin(); bulletType = typeof(EternalFlame_Bullet); }
public PrimordialLibram_AmmoType_Flower() { accuracy = 1f; range = 250f; penetration = 1f; bulletSpeed = 4f; speedVariation = 3f; combustable = true; bulletLength = 0; sprite = TexHelper.ModSprite(tex_Bullet_Flower); sprite.CenterOrigin(); bulletType = typeof(PrimordialLibram_Bullet_Flower); bulletColor = Color.OrangeRed; rangeVariation = 60f; }
public PrimordialLibram_AmmoType_Fireball() { accuracy = 0.2f; range = 200f; penetration = 1f; rangeVariation = 10f; bulletSpeed = 15f; speedVariation = -10f; rangeVariation = -50f; combustable = true; bulletLength = 0; sprite = TexHelper.ModSprite(tex_Bullet_FireBolt); sprite.CenterOrigin(); bulletColor = Color.OrangeRed; bulletType = typeof(PrimordialLibram_Bullet_Fireball); }
public ViscousAcidLiquor_AmmoType() { accuracy = 1f; penetration = 0.35f; bulletSpeed = 9f; rangeVariation = 0f; speedVariation = 0f; range = 2000f; affectedByGravity = true; deadly = false; weight = 5f; bulletThickness = 2f; bulletColor = Color.White; bulletType = typeof(ViscousAcidLiquor_Bullet); immediatelyDeadly = true; sprite = TexHelper.ModSprite(tex_Bullet_ViscousAcidLiquorBullet); sprite.CenterOrigin(); }
void textEditor_TextArea_TextEntered1(object sender, TextCompositionEventArgs e) { if (e.Text == @"\") { // open code completion after the user has pressed dot: completionWindow = new CompletionWindow(textEditor.TextArea); // provide AvalonEdit with the data: IList <ICompletionData> data = completionWindow.CompletionList.CompletionData; foreach (string s in TexHelper.TexEntries()["Greek letters"]) { MyCompletionData d = new MyCompletionData(s); data.Add(new MyCompletionData(s.Substring(1, s.Length - 1))); } completionWindow.Show(); completionWindow.Closed += delegate { completionWindow = null; }; } }
/// <summary> /// Gets the model data and sets the display viewmodel /// </summary> private void MeshComboBoxChanged() { if (!is3DLoaded) { disposing = false; meshData = new List <MDLTEXData>(); for (int i = 0; i < meshList.Count; i++) { BitmapSource specularBMP = null; BitmapSource diffuseBMP = null; BitmapSource normalBMP = null; BitmapSource colorBMP = null; BitmapSource alphaBMP = null; BitmapSource maskBMP = null; TEXData specularData = null; TEXData diffuseData = null; TEXData normalData = null; TEXData maskData = null; bool isBody = false; bool isFace = false; MTRLData mtrlData = MTRL3D(i); if (selectedCategory.Equals(Strings.Character)) { if (selectedItem.ItemName.Equals(Strings.Tail) || selectedItem.ItemName.Equals(Strings.Hair)) { normalData = TEX.GetTex(mtrlData.NormalOffset); specularData = TEX.GetTex(mtrlData.SpecularOffset); if (mtrlData.DiffusePath != null) { diffuseData = TEX.GetTex(mtrlData.DiffuseOffset); } var maps = TexHelper.MakeCharacterMaps(normalData, diffuseData, null, specularData); diffuseBMP = maps[0]; specularBMP = maps[1]; normalBMP = maps[2]; alphaBMP = maps[3]; specularData.Dispose(); normalData.Dispose(); if (diffuseData != null) { diffuseData.Dispose(); } } if (selectedItem.ItemName.Equals(Strings.Body)) { normalData = TEX.GetTex(mtrlData.NormalOffset); //specularTI = TEX.GetTex(mInfo.SpecularOffset); diffuseData = TEX.GetTex(mtrlData.DiffuseOffset); isBody = true; diffuseBMP = Imaging.CreateBitmapSourceFromHBitmap(diffuseData.BMP.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); normalBMP = Imaging.CreateBitmapSourceFromHBitmap(normalData.BMP.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); } if (selectedItem.ItemName.Equals(Strings.Face)) { normalData = TEX.GetTex(mtrlData.NormalOffset); if (materialStrings[i].Contains("_fac_")) { specularData = TEX.GetTex(mtrlData.SpecularOffset); diffuseData = TEX.GetTex(mtrlData.DiffuseOffset); var maps = TexHelper.MakeCharacterMaps(normalData, diffuseData, null, specularData); diffuseBMP = maps[0]; specularBMP = maps[1]; normalBMP = maps[2]; alphaBMP = maps[3]; isFace = true; specularData.Dispose(); diffuseData.Dispose(); } else { specularData = TEX.GetTex(mtrlData.SpecularOffset); var maps = TexHelper.MakeCharacterMaps(normalData, diffuseData, null, specularData); diffuseBMP = maps[0]; specularBMP = maps[1]; normalBMP = maps[2]; alphaBMP = maps[3]; } } } else { if (mtrlData.ColorData != null) { var colorBmp = TEX.TextureToBitmap(mtrlData.ColorData, 9312, 4, 16); colorBMP = Imaging.CreateBitmapSourceFromHBitmap(colorBmp.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); } if (mtrlData.NormalOffset != 0) { normalData = TEX.GetTex(mtrlData.NormalOffset); } if (mtrlData.MaskOffset != 0) { maskData = TEX.GetTex(mtrlData.MaskOffset); maskBMP = Imaging.CreateBitmapSourceFromHBitmap(maskData.BMP.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); } if (mtrlData.DiffuseOffset != 0) { diffuseData = TEX.GetTex(mtrlData.DiffuseOffset); if (mtrlData.DiffusePath.Contains("human") && !mtrlData.DiffusePath.Contains("demi")) { isBody = true; diffuseBMP = Imaging.CreateBitmapSourceFromHBitmap(diffuseData.BMP.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); normalBMP = Imaging.CreateBitmapSourceFromHBitmap(normalData.BMP.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); } } if (mtrlData.SpecularOffset != 0) { specularData = TEX.GetTex(mtrlData.SpecularOffset); specularBMP = Imaging.CreateBitmapSourceFromHBitmap(specularData.BMP.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); } if (!isBody && specularData == null) { var maps = TexHelper.MakeModelTextureMaps(normalData, diffuseData, maskData, null, colorBMP); diffuseBMP = maps[0]; specularBMP = maps[1]; normalBMP = maps[2]; alphaBMP = maps[3]; } else if (!isBody && specularData != null) { var maps = TexHelper.MakeModelTextureMaps(normalData, diffuseData, null, specularData, colorBMP); diffuseBMP = maps[0]; specularBMP = maps[1]; normalBMP = maps[2]; alphaBMP = maps[3]; } if (normalData != null) { normalData.Dispose(); } if (maskData != null) { maskData.Dispose(); } if (diffuseData != null) { diffuseData.Dispose(); } if (specularData != null) { specularData.Dispose(); } } var mData = new MDLTEXData() { Specular = specularBMP, ColorTable = colorBMP, Diffuse = diffuseBMP, Normal = normalBMP, Alpha = alphaBMP, Mask = maskBMP, IsBody = isBody, IsFace = isFace, Mesh = meshList[i] }; meshData.Add(mData); } CompositeVM = new Composite3DViewModel(meshData); is3DLoaded = true; ReflectionAmount = String.Format("{0:.##}", CompositeVM.SecondModelMaterial.SpecularShininess); try { } catch (Exception ex) { MessageBox.Show("[Main] mesh 3D Error \n" + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } else { CompositeVM.Rendering(SelectedMesh.Name); } }
public ModListModel ParseEntry(JsonEntry entry) { ModListModel mlm = new ModListModel(); string race, map, part, type; if (entry.fullPath.Contains("mt_")) { Debug.WriteLine(entry.fullPath); } if (entry.fullPath.Contains("weapon") || entry.fullPath.Contains("accessory") || entry.fullPath.Contains("decal") || entry.fullPath.Contains("vfx") || entry.fullPath.Contains("ui/")) { race = Strings.All; } else if (entry.fullPath.Contains("monster") || entry.fullPath.Contains("demihuman")) { race = Strings.Monster; } else { race = entry.fullPath.Substring(entry.fullPath.LastIndexOf('/')); if (entry.fullPath.Contains("mt_") && entry.fullPath.Contains("_acc_")) { race = race.Substring(race.IndexOf("_") + 2, 4); } else if ((entry.fullPath.Contains("_fac_") || entry.fullPath.Contains("_etc_") || entry.fullPath.Contains("_acc_")) && Properties.Settings.Default.DX_Ver.Equals(Strings.DX11)) { race = race.Substring(race.LastIndexOf("--c") + 3, 4); } else if (entry.fullPath.Contains("_fac_") || entry.fullPath.Contains("_etc_") || entry.fullPath.Contains("_acc_")) { race = race.Substring(race.LastIndexOf("/c") + 2, 4); } else if (entry.fullPath.Contains("_c_")) { race = race.Substring(race.IndexOf("_c") + 2, 4); } else { if (entry.fullPath.Contains(".mdl") && entry.fullPath.Contains("_fac")) { race = race.Substring(race.IndexOf('c') + 1, 4); } else { race = race.Substring(race.LastIndexOf('c') + 1, 4); } } if (entry.fullPath.Contains("mt_")) { Debug.WriteLine(race + "\n"); } race = Info.IDRace[race]; } mlm.Race = race; if (entry.fullPath.Contains("_d.")) { map = Strings.Diffuse; } else if (entry.fullPath.Contains("_n.")) { map = Strings.Normal; } else if (entry.fullPath.Contains("_s.")) { map = Strings.Specular; } else if (entry.fullPath.Contains("material")) { map = Strings.ColorSet; } else if (entry.fullPath.Contains("model")) { map = "3D"; } else if (entry.fullPath.Contains("ui/")) { map = "UI"; } else { map = Strings.Mask; } mlm.Map = map; if (entry.fullPath.Contains("_b_")) { part = "b"; } else if (entry.fullPath.Contains("_c_")) { part = "c"; } else if (entry.fullPath.Contains("_d_")) { part = "d"; } else if (entry.fullPath.Contains("decal")) { part = entry.fullPath.Substring(entry.fullPath.LastIndexOf('_') + 1, entry.fullPath.LastIndexOf('.') - (entry.fullPath.LastIndexOf('_') + 1)); } else { part = "a"; } mlm.Part = part; if (entry.fullPath.Contains("_iri_")) { type = "Iris"; } else if (entry.fullPath.Contains("_etc_")) { type = "Etc."; } else if (entry.fullPath.Contains("_fac_")) { type = "Face"; } else if (entry.fullPath.Contains("_hir_")) { type = "Hair"; } else if (entry.fullPath.Contains("_acc_")) { type = "Accessory"; } else if (entry.fullPath.Contains("demihuman")) { type = entry.fullPath.Substring(entry.fullPath.LastIndexOf('_') - 3, 3); type = (Info.slotAbr).FirstOrDefault(x => x.Value == type).Key; } else { type = "-"; } mlm.Type = type; if (entry.fullPath.Contains("material")) { var info = MTRL.GetMTRLInfo(entry.modOffset, false); var bitmap = TEX.ColorSetToBitmap(info.ColorData); mlm.BMP = Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); mlm.BMP.Freeze(); bitmap.Dispose(); } else if (entry.fullPath.Contains("model")) { mlm.BMP = new BitmapImage(new Uri("pack://application:,,,/FFXIV TexTools 2;component/Resources/3DModel.png")); } else { TEXData texData; if (entry.fullPath.Contains("vfx")) { texData = TEX.GetVFX(entry.modOffset, entry.datFile); } else { if (entry.fullPath.Contains("icon")) { texData = TEX.GetTex(entry.modOffset, entry.datFile); } else { texData = TEX.GetTex(entry.modOffset, entry.datFile); } } var scale = 1; if (texData.Width >= 4096 || texData.Height >= 4096) { scale = 16; } else if (texData.Width >= 2048 || texData.Height >= 2048) { scale = 8; } else if (texData.Width >= 1024 || texData.Height >= 1024) { scale = 4; } var nWidth = texData.Width / scale; var nHeight = texData.Height / scale; var resizedImage = TexHelper.CreateResizedImage(texData.BMPSouceNoAlpha, nWidth, nHeight); mlm.BMP = (BitmapSource)resizedImage; mlm.BMP.Freeze(); } var offset = Helper.GetDataOffset(FFCRC.GetHash(entry.fullPath.Substring(0, entry.fullPath.LastIndexOf("/"))), FFCRC.GetHash(Path.GetFileName(entry.fullPath)), entry.datFile); if (offset == entry.modOffset) { mlm.ActiveBorder = Brushes.Green; mlm.Active = Brushes.Transparent; mlm.ActiveOpacity = 1; } else if (offset == entry.originalOffset) { mlm.ActiveBorder = Brushes.Red; mlm.Active = Brushes.Gray; mlm.ActiveOpacity = 0.5f; } else { mlm.ActiveBorder = Brushes.Red; mlm.Active = Brushes.Red; mlm.ActiveOpacity = 1; } mlm.Entry = entry; return(mlm); }
private void Toolbox_Load(object sender, EventArgs e) { if (!this.Visible) { return; } int i = 0; foreach (KeyValuePair <string, string[]> kvp in TexHelper.TexEntries()) { ToolBox.VSTreeNode newGroup = new ToolBox.VSTreeNode(); newGroup.Text = String.Format(kvp.Key); toolBox1.Nodes.Add(newGroup); if (toolBox1.SelectedNode == null) { toolBox1.SelectedNode = toolBox1.Nodes[i]; } foreach (string s in kvp.Value) { Random rndImage = new Random(); ToolBox.VSTreeNode newSubItem = new ToolBox.VSTreeNode(); newSubItem.Text = String.Format(s); string x = s; if (char.IsUpper(s.Substring(1, s.Length - 1)[0])) { x = s + "_U"; } else { x = s + "_L"; } if (this.imageList.Images.ContainsKey(x.Substring(1, x.Length - 1) + ".png")) { newSubItem.ImageIndex = imageList.Images.IndexOfKey(x.Substring(1, x.Length - 1).ToLower() + ".png"); } else { //newSubItem.ImageIndex = imageList.Images.IndexOfKey(s.Substring(1, x.Length - 1).ToLower() + ".png"); newSubItem.ImageIndex = 0; // rndImage.Next(imageList.Images.Count); } //if (char.IsUpper(s.Substring(1, s.Length - 1)[0])) // newSubItem.ImageIndex = 0; newSubItem.ToolTipCaption = newSubItem.Text; newSubItem.ToolTipText = s; toolBox1.Nodes[i].Nodes.Add(newSubItem); toolBox1.SelectedNode.Expand(); continue; if (kvp.Key == "Open Close" || kvp.Key == "Math") { continue; } try { string url = "http://frog.isima.fr/cgi-bin/bruno/tex2png--20.cgi?" + @s; HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url); using (HttpWebResponse httpWebReponse = (HttpWebResponse)httpWebRequest.GetResponse()) { using (Stream stream = httpWebReponse.GetResponseStream()) { if (char.IsUpper(s.Substring(1, s.Length - 1)[0])) { Image.FromStream(stream).Save(@"Z:\imgs" + s + "_U.png"); } else { Image.FromStream(stream).Save(@"Z:\imgs" + s + "_L.png"); } } } } catch (System.Exception ex) { } } i++; } }
public Bullet_Current(float xval, float yval, AmmoType type, float ang = -1f, Thing owner = null, bool rbound = false, float distance = -1f, bool tracer = false, bool network = false) : base(xval, yval, type, ang, owner, rbound, distance, tracer, network) { _thickness = type.bulletThickness; _beem = TexHelper.ModTex2D(tex_Bullet_LaserBeam); }