private void btnIcon_Click(object sender, EventArgs e) { if (Loading) { return; } ImagePicker.InitialDirectory = I9Gfx.GetPowersetsPath(); ImagePicker.FileName = myPS.ImageName; if (ImagePicker.ShowDialog() != DialogResult.OK) { return; } var str = FileIO.StripPath(ImagePicker.FileName); if (!File.Exists(FileIO.AddSlash(ImagePicker.InitialDirectory) + str)) { MessageBox.Show( $"You must select an image from the {I9Gfx.GetPowersetsPath()} folder!\r\n\r\nIf you are adding a new image, you should copy it the folder and then select it.", "Ah...", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { myPS.ImageName = str; DisplayIcon(); } }
public static void LoadSetTypes() { Array values = Enum.GetValues(typeof(Enums.eSetType)); string[] names = Enum.GetNames(typeof(Enums.eSetType)); int length = values.Length; I9Gfx.SetTypes = new ExtendedBitmap(length * 30, 30); for (int index = 0; index <= length - 1; ++index) { int x = index * 30; using (ExtendedBitmap extendedBitmap = new ExtendedBitmap(I9Gfx.ImagePath() + "Sets\\" + names[index] + ".png")) { Size size = extendedBitmap.Size; int num1 = size.Height > 30 ? 1 : 0; size = extendedBitmap.Size; int num2 = size.Width > 30 ? 1 : 0; if ((num1 | num2) != 0) { I9Gfx.SetTypes.Graphics.DrawImage((Image)extendedBitmap.Bitmap, x, 0, 30, 30); } else { I9Gfx.SetTypes.Graphics.DrawImage((Image)extendedBitmap.Bitmap, x, 0); } } } }
public static void LoadEnhancements() { I9Gfx.Enhancements = new Bitmap[DatabaseAPI.Database.Enhancements.Length]; for (int index = 0; index <= DatabaseAPI.Database.Enhancements.Length - 1; ++index) { if (DatabaseAPI.Database.Enhancements[index].Image != string.Empty) { try { I9Gfx.Enhancements[index] = new Bitmap(I9Gfx.GetEnhancementsPath() + DatabaseAPI.Database.Enhancements[index].Image); } catch (Exception ex) { I9Gfx.Enhancements[index] = new Bitmap(30, 30, PixelFormat.Format32bppArgb); } DatabaseAPI.Database.Enhancements[index].ImageIdx = index; } else { I9Gfx.Enhancements[index] = new Bitmap(30, 30, PixelFormat.Format32bppArgb); DatabaseAPI.Database.Enhancements[index].ImageIdx = -1; } if (index % 5 == 0) { Application.DoEvents(); } } }
public static void DrawEnhancementAt( ref Graphics iTarget, Rectangle iDest, int iImageIndex, Origin.Grade iGrade, ImageAttributes imageAttributes) { if (iDest.Width > 30) { iDest.Width = 30; } if (iDest.Height > 30) { iDest.Height = 30; } if (iImageIndex < 0 | iImageIndex >= I9Gfx.Enhancements.Length) { return; } Graphics graphics = iTarget; Bitmap bitmap = I9Gfx.Borders.Bitmap; Rectangle destRect = iDest; Rectangle overlayRect = I9Gfx.GetOverlayRect(iGrade); int x = overlayRect.X; overlayRect = I9Gfx.GetOverlayRect(iGrade); int y = overlayRect.Y; ImageAttributes imageAttr = imageAttributes; graphics.DrawImage((Image)bitmap, destRect, x, y, 30, 30, GraphicsUnit.Pixel, imageAttr); iTarget.DrawImage((Image)I9Gfx.Enhancements[iImageIndex], iDest, 0, 0, 30, 30, GraphicsUnit.Pixel, imageAttributes); }
public frmRecipeViewer(frmMain iParent) { this.FormClosed += new FormClosedEventHandler(this.frmRecipeViewer_FormClosed); this.Load += new EventHandler(this.frmRecipeViewer_Load); this.Loading = true; this.InitializeComponent(); this.Name = nameof(frmRecipeViewer); System.ComponentModel.ComponentResourceManager componentResourceManager = new System.ComponentModel.ComponentResourceManager(typeof(frmRecipeViewer)); this.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon"); this.RecipeInfo.MouseWheel += new MouseEventHandler(this.RecipeInfo_MouseWheel); this.RecipeInfo.MouseEnter += new EventHandler(this.RecipeInfo_MouseEnter); this.lvPower.MouseEnter += new EventHandler(this.lvPower_MouseEnter); this.lvPower.ItemChecked += new ItemCheckedEventHandler(this.lvPower_ItemChecked); this.lvDPA.SelectedIndexChanged += new EventHandler(this.lvDPA_SelectedIndexChanged); this.lvDPA.MouseEnter += new EventHandler(this.lvDPA_MouseEnter); this.VScrollBar1.Scroll += VScrollBar1_Scroll; this.chkRecipe.CheckedChanged += chkRecipe_CheckedChanged; this.chkSortByLevel.CheckedChanged += chkSortByLevel_CheckedChanged; this.ibClipboard.ButtonClicked += ibClipboard_ButtonClicked; this.ibClose.ButtonClicked += ibClose_ButtonClicked; this.ibMiniList.ButtonClicked += ibMiniList_ButtonClicked; this.ibTopmost.ButtonClicked += ibTopmost_ButtonClicked; this.myParent = iParent; this.bxRecipe = new ExtendedBitmap(I9Gfx.GetRecipeName()); }
static RectangleF GetImageRectF(int index) { Rectangle imageRect = I9Gfx.GetImageRect(index); return(new RectangleF((float)imageRect.X, (float)imageRect.Y, (float)imageRect.Width, (float)imageRect.Height)); }
static RectangleF GetOverlayRectF(Origin.Grade iGrade) { Rectangle overlayRect = I9Gfx.GetOverlayRect(iGrade); return(new RectangleF((float)overlayRect.X, (float)overlayRect.Y, (float)overlayRect.Width, (float)overlayRect.Height)); }
public static void LoadClasses() { I9Gfx.Classes = new ExtendedBitmap(DatabaseAPI.Database.EnhancementClasses.Length * 30, 30); using (ExtendedBitmap extendedBitmap = new ExtendedBitmap(I9Gfx.ImagePath() + "Overlay\\Class.png")) { for (int index = 0; index <= DatabaseAPI.Database.EnhancementClasses.Length - 1; index++) { int x = index * 30; using (ExtendedBitmap extendedBitmap2 = new ExtendedBitmap(string.Concat(new object[] { I9Gfx.ImagePath(), "Classes\\", DatabaseAPI.Database.EnhancementClasses[index].ID, ".png" }))) { I9Gfx.Classes.Graphics.DrawImageUnscaled(extendedBitmap.Bitmap, x, 0); if (extendedBitmap2.Size.Height > 30 | extendedBitmap2.Size.Width > 30) { I9Gfx.Classes.Graphics.DrawImage(extendedBitmap2.Bitmap, x, 0, 30, 30); } else { I9Gfx.Classes.Graphics.DrawImage(extendedBitmap2.Bitmap, x, 0); } } } } GC.Collect(); }
public void FillImageList() { Size imageSize1 = this.ilSets.ImageSize; int width1 = imageSize1.Width; imageSize1 = this.ilSets.ImageSize; int height1 = imageSize1.Height; ExtendedBitmap extendedBitmap = new ExtendedBitmap(width1, height1); this.ilSets.Images.Clear(); int num = DatabaseAPI.Database.EnhancementSets.Count - 1; for (int index = 0; index <= num; ++index) { if (DatabaseAPI.Database.EnhancementSets[index].ImageIdx > -1) { extendedBitmap.Graphics.Clear(Color.White); Graphics graphics = extendedBitmap.Graphics; I9Gfx.DrawEnhancementSet(ref graphics, DatabaseAPI.Database.EnhancementSets[index].ImageIdx); this.ilSets.Images.Add((Image)extendedBitmap.Bitmap); } else { ImageList.ImageCollection images = this.ilSets.Images; Size imageSize2 = this.ilSets.ImageSize; int width2 = imageSize2.Width; imageSize2 = this.ilSets.ImageSize; int height2 = imageSize2.Height; Bitmap bitmap = new Bitmap(width2, height2); images.Add((Image)bitmap); } } }
public frmRecipeViewer(frmMain iParent) { FormClosed += frmRecipeViewer_FormClosed; Load += frmRecipeViewer_Load; Loading = true; InitializeComponent(); Name = nameof(frmRecipeViewer); var componentResourceManager = new ComponentResourceManager(typeof(frmRecipeViewer)); Icon = Resources.reborn; RecipeInfo.MouseWheel += RecipeInfo_MouseWheel; RecipeInfo.MouseEnter += RecipeInfo_MouseEnter; lvPower.MouseEnter += lvPower_MouseEnter; lvPower.ItemChecked += lvPower_ItemChecked; lvDPA.SelectedIndexChanged += lvDPA_SelectedIndexChanged; lvDPA.MouseEnter += lvDPA_MouseEnter; VScrollBar1.Scroll += VScrollBar1_Scroll; chkRecipe.CheckedChanged += chkRecipe_CheckedChanged; chkSortByLevel.CheckedChanged += chkSortByLevel_CheckedChanged; ibClipboard.ButtonClicked += ibClipboard_ButtonClicked; ibClose.ButtonClicked += ibClose_ButtonClicked; ibMiniList.ButtonClicked += ibMiniList_ButtonClicked; ibTopmost.ButtonClicked += ibTopmost_ButtonClicked; ibEnhCheckMode.ButtonClicked += ibEnhCheckMode_ButtonClicked; myParent = iParent; bxRecipe = new ExtendedBitmap(I9Gfx.GetRecipeName()); }
void FillImageList() { ExtendedBitmap extendedBitmap = new ExtendedBitmap(this.ilSet.ImageSize.Width, this.ilSet.ImageSize.Height); this.ilSet.Images.Clear(); int num = MidsContext.Character.CurrentBuild.SetBonus.Count - 1; for (int index = 0; index <= num; index++) { int num2 = MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo.Length - 1; for (int index2 = 0; index2 <= num2; index2++) { if (MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].SetIDX > -1) { EnhancementSet enhancementSet = DatabaseAPI.Database.EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].SetIDX]; if (enhancementSet.ImageIdx > -1) { extendedBitmap.Graphics.Clear(Color.White); Graphics graphics = extendedBitmap.Graphics; I9Gfx.DrawEnhancementSet(ref graphics, enhancementSet.ImageIdx); this.ilSet.Images.Add(extendedBitmap.Bitmap); } else { this.ilSet.Images.Add(new Bitmap(this.ilSet.ImageSize.Width, this.ilSet.ImageSize.Height)); } } } } }
private void FillImageList() { var imageSize1 = ilSets.ImageSize; var width1 = imageSize1.Width; imageSize1 = ilSets.ImageSize; var height1 = imageSize1.Height; using var extendedBitmap = new ExtendedBitmap(width1, height1); ilSets.Images.Clear(); var num = DatabaseAPI.Database.EnhancementSets.Count - 1; for (var index = 0; index <= num; ++index) { if (DatabaseAPI.Database.EnhancementSets[index].ImageIdx > -1) { extendedBitmap.Graphics.Clear(Color.White); var graphics = extendedBitmap.Graphics; I9Gfx.DrawEnhancementSet(ref graphics, DatabaseAPI.Database.EnhancementSets[index].ImageIdx); ilSets.Images.Add(extendedBitmap.Bitmap); } else { var images = ilSets.Images; var imageSize2 = ilSets.ImageSize; var width2 = imageSize2.Width; imageSize2 = ilSets.ImageSize; var height2 = imageSize2.Height; var bitmap = new Bitmap(width2, height2); images.Add(bitmap); } } }
public void FillImageList() { Size imageSize1 = ilEnh.ImageSize; int width1 = imageSize1.Width; imageSize1 = ilEnh.ImageSize; int height1 = imageSize1.Height; ExtendedBitmap extendedBitmap = new ExtendedBitmap(width1, height1); ilEnh.Images.Clear(); int num = mySet.Enhancements.Length - 1; for (int index = 0; index <= num; ++index) { IEnhancement enhancement = DatabaseAPI.Database.Enhancements[mySet.Enhancements[index]]; if (enhancement.ImageIdx > -1) { Origin.Grade gfxGrade = I9Gfx.ToGfxGrade(enhancement.TypeID); extendedBitmap.Graphics.Clear(Color.White); Graphics graphics = extendedBitmap.Graphics; I9Gfx.DrawEnhancement(ref graphics, DatabaseAPI.Database.Enhancements[mySet.Enhancements[index]].ImageIdx, gfxGrade); ilEnh.Images.Add((Image)extendedBitmap.Bitmap); } else { ImageList.ImageCollection images = ilEnh.Images; Size imageSize2 = ilEnh.ImageSize; int width2 = imageSize2.Width; imageSize2 = ilEnh.ImageSize; int height2 = imageSize2.Height; Bitmap bitmap = new Bitmap(width2, height2); images.Add((Image)bitmap); } } }
public static void LoadEnhTypes() { Array values3 = Enum.GetValues(typeof(Enums.eType)); string[] names3 = Enum.GetNames(typeof(Enums.eType)); names3[3] = "HamiO"; I9Gfx.EnhTypes = new ExtendedBitmap(values3.Length * 30, 30); for (int index = 0; index < values3.Length; index++) { int x = index * 30; using (ExtendedBitmap extendedBitmap = new ExtendedBitmap(I9Gfx.ImagePath() + "Sets\\" + names3[index] + ".png")) { if (extendedBitmap.Size.Height > 30 | extendedBitmap.Size.Width > 30) { I9Gfx.EnhTypes.Graphics.DrawImage(extendedBitmap.Bitmap, x, 0, 30, 30); } else { I9Gfx.EnhTypes.Graphics.DrawImage(extendedBitmap.Bitmap, x, 0); } } } values3 = Enum.GetValues(typeof(Enums.eEnhGrade)); names3 = Enum.GetNames(typeof(Enums.eEnhGrade)); I9Gfx.EnhGrades = new ExtendedBitmap(values3.Length * 30, 30); for (int index2 = 0; index2 < values3.Length; index2++) { int x2 = index2 * 30; using (ExtendedBitmap extendedBitmap2 = new ExtendedBitmap(I9Gfx.ImagePath() + "Sets\\" + names3[index2] + ".png")) { if (extendedBitmap2.Size.Height > 30 | extendedBitmap2.Size.Width > 30) { I9Gfx.EnhGrades.Graphics.DrawImage(extendedBitmap2.Bitmap, x2, 0, 30, 30); } else { I9Gfx.EnhGrades.Graphics.DrawImage(extendedBitmap2.Bitmap, x2, 0); } } } values3 = Enum.GetValues(typeof(Enums.eSubtype)); names3 = Enum.GetNames(typeof(Enums.eSubtype)); I9Gfx.EnhSpecials = new ExtendedBitmap(values3.Length * 30, 30); for (int index3 = 0; index3 < values3.Length; index3++) { int x3 = index3 * 30; using (ExtendedBitmap extendedBitmap3 = new ExtendedBitmap(I9Gfx.ImagePath() + "Sets\\" + names3[index3] + ".png")) { if (extendedBitmap3.Size.Height > 30 | extendedBitmap3.Size.Width > 30) { I9Gfx.EnhSpecials.Graphics.DrawImage(extendedBitmap3.Bitmap, x3, 0, 30, 30); } else { I9Gfx.EnhSpecials.Graphics.DrawImage(extendedBitmap3.Bitmap, x3, 0); } } } }
public static void DrawFlippingEnhancement(ref Graphics iTarget, Rectangle iDest, float iSize, int iImageIndex, Origin.Grade iGrade) { Rectangle iDest2 = iDest; iDest2.Width = (int)((float)iDest2.Width * iSize); iDest2.X += (iDest.Width - iDest2.Width) / 2; I9Gfx.DrawEnhancementAt(ref iTarget, iDest2, iImageIndex, iGrade); }
public void ImageUpdate() { if (!this.NoReload.Checked) { I9Gfx.LoadEnhancements(); this.FillImageList(); } }
void btnSave_Click(object sender, EventArgs e) { I9Gfx.LoadEnhancements(); DatabaseAPI.AssignStaticIndexValues(); DatabaseAPI.AssignRecipeIDs(); DatabaseAPI.SaveEnhancementDb(); base.Hide(); }
public void ImageUpdate() { if (NoReload.Checked) { return; } I9Gfx.LoadEnhancements(); FillImageList(); }
private void ImageUpdate() { if (NoReload.Checked) { return; } I9Gfx.LoadSets(); FillImageList(); }
public void ImageUpdate() { if (this.NoReload.Checked) { return; } I9Gfx.LoadSets(); this.FillImageList(); }
public frmDPSCalc(frmMain iParent) { base.FormClosed += this.frmDPSCalc_FormClosed; base.Load += this.frmDPSCalc_Load; this.Loading = true; this.InitializeComponent(); this.myParent = iParent; this.bxRecipe = new ExtendedBitmap(I9Gfx.GetRecipeName()); }
void btnSave_Click(object sender, EventArgs e) { I9Gfx.LoadEnhancements(); var serializer = MyApplication.GetSerializer(); DatabaseAPI.AssignStaticIndexValues(serializer, false); DatabaseAPI.AssignRecipeIDs(); DatabaseAPI.SaveEnhancementDb(serializer); Hide(); }
public frmDPSCalc(frmMain iParent) { this.FormClosed += new FormClosedEventHandler(this.frmDPSCalc_FormClosed); this.Load += new EventHandler(this.frmDPSCalc_Load); this.InitializeComponent(); this.Name = nameof(frmDPSCalc); var componentResourceManager = new ComponentResourceManager(typeof(frmDPSCalc)); this.Icon = (Icon)componentResourceManager.GetObject("$this.Icon"); this.myParent = iParent; this.bxRecipe = new ExtendedBitmap(I9Gfx.GetRecipeName()); }
public frmDPSCalc(frmMain iParent) { FormClosed += frmDPSCalc_FormClosed; Load += frmDPSCalc_Load; InitializeComponent(); Name = nameof(frmDPSCalc); var componentResourceManager = new ComponentResourceManager(typeof(frmDPSCalc)); Icon = Resources.reborn; myParent = iParent; bxRecipe = new ExtendedBitmap(I9Gfx.GetRecipeName()); }
public void DisplayIcon() { if (myPS.ImageName != "") { picIcon.Image = new Bitmap(new ExtendedBitmap(I9Gfx.GetPowersetsPath() + myPS.ImageName).Bitmap); btnIcon.Text = myPS.ImageName; } else { picIcon.Image = new Bitmap(new ExtendedBitmap(30, 30).Bitmap); btnIcon.Text = "Select Icon"; } }
public void DisplayIcon() { if (this.myPS.ImageName != "") { this.picIcon.Image = (Image) new Bitmap((Image) new ExtendedBitmap(I9Gfx.GetPowersetsPath() + this.myPS.ImageName).Bitmap); this.btnIcon.Text = this.myPS.ImageName; } else { this.picIcon.Image = (Image) new Bitmap((Image) new ExtendedBitmap(30, 30).Bitmap); this.btnIcon.Text = "Select Icon"; } }
private void DisplayIcon() { if (!string.IsNullOrEmpty(myPS.ImageName)) { using var extendedBitmap = new ExtendedBitmap(I9Gfx.GetPowersetsPath() + myPS.ImageName); picIcon.Image = new Bitmap(extendedBitmap.Bitmap); btnIcon.Text = myPS.ImageName; } else { using var extendedBitmap = new ExtendedBitmap(30, 30); picIcon.Image = new Bitmap(extendedBitmap.Bitmap); btnIcon.Text = "Select Icon"; } }
public static void LoadSets() { I9Gfx.Sets = new ExtendedBitmap(DatabaseAPI.Database.EnhancementSets.Count * 30, 30); for (int index = 0; index <= DatabaseAPI.Database.EnhancementSets.Count - 1; ++index) { if (!string.IsNullOrEmpty(DatabaseAPI.Database.EnhancementSets[index].Image)) { int x = index * 30; using (ExtendedBitmap extendedBitmap = new ExtendedBitmap(I9Gfx.GetEnhancementsPath() + DatabaseAPI.Database.EnhancementSets[index].Image)) { DatabaseAPI.Database.EnhancementSets[index].ImageIdx = index; Size size = extendedBitmap.Size; int num; if (size.Height <= 30) { size = extendedBitmap.Size; num = size.Width <= 30 ? 1 : 0; } else { num = 0; } if (num == 0) { I9Gfx.Sets.Graphics.DrawImage((Image)extendedBitmap.Bitmap, x, 0, 30, 30); } else { I9Gfx.Sets.Graphics.DrawImage((Image)extendedBitmap.Bitmap, x, 0); } } } else { goto label_16; } label_13: if (index % 5 == 0) { Application.DoEvents(); continue; } continue; label_16: DatabaseAPI.Database.EnhancementSets[index].ImageIdx = -1; goto label_13; } }
public static void DrawEnhancementAt(ref Graphics iTarget, Rectangle iDest, int iImageIndex, Origin.Grade iGrade) { if (iDest.Width > 30) { iDest.Width = 30; } if (iDest.Height > 30) { iDest.Height = 30; } if (!(iImageIndex < 0 | iImageIndex >= I9Gfx.Enhancements.Length)) { iTarget.DrawImage(I9Gfx.Borders.Bitmap, iDest, I9Gfx.GetOverlayRect(iGrade), GraphicsUnit.Pixel); iTarget.DrawImage(I9Gfx.Enhancements[iImageIndex], iDest, new Rectangle(0, 0, 30, 30), GraphicsUnit.Pixel); } }
private void FillImageList() { var imageSize1 = ilSet.ImageSize; var width1 = imageSize1.Width; imageSize1 = ilSet.ImageSize; var height1 = imageSize1.Height; var extendedBitmap = new ExtendedBitmap(width1, height1); ilSet.Images.Clear(); var setBonusCount = MidsContext.Character.CurrentBuild.SetBonus.Count - 1; for (var index1 = 0; index1 <= setBonusCount; ++index1) { var num2 = MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo.Length - 1; for (var index2 = 0; index2 <= num2; ++index2) { if (MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2].SetIDX <= -1) { continue; } var enhancementSet = DatabaseAPI.Database.EnhancementSets[ MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2].SetIDX]; if (enhancementSet.ImageIdx > -1) { extendedBitmap.Graphics.Clear(Color.White); var graphics = extendedBitmap.Graphics; I9Gfx.DrawEnhancementSet(ref graphics, enhancementSet.ImageIdx); ilSet.Images.Add(extendedBitmap.Bitmap); } else { var images = ilSet.Images; var imageSize2 = ilSet.ImageSize; var width2 = imageSize2.Width; imageSize2 = ilSet.ImageSize; var height2 = imageSize2.Height; var bitmap = new Bitmap(width2, height2); images.Add(bitmap); } } } }