mirror of
https://github.com/kwsch/PKHeX
synced 2024-09-22 07:12:00 +00:00
Improved item displaying for PKX class
tweaked the main form a little bit for clarity
This commit is contained in:
parent
f8cd5c5c7c
commit
ed36b5a684
2 changed files with 22 additions and 9 deletions
19
Misc/PKX.cs
19
Misc/PKX.cs
|
@ -822,9 +822,6 @@ namespace PKHeX
|
|||
int gender = (pkx[0x1D] >> 1) & 0x3;
|
||||
|
||||
string file;
|
||||
if (isegg == 1)
|
||||
{ file = "egg"; }
|
||||
else
|
||||
{
|
||||
file = "_" + species.ToString();
|
||||
if (altforms > 0) // Alt Form Handling
|
||||
|
@ -837,11 +834,27 @@ namespace PKHeX
|
|||
|
||||
pksprite = (Image)Properties.Resources.ResourceManager.GetObject(file);
|
||||
|
||||
if (misegg)
|
||||
{
|
||||
// Start with a partially transparent species by layering the species with partial opacity onto a blank image.
|
||||
pksprite = Util.LayerImage((Image)Properties.Resources.ResourceManager.GetObject("_0"), pksprite, 0, 0, 0.33);
|
||||
// Add the egg layer over-top with full opacity.
|
||||
pksprite = Util.LayerImage(pksprite, (Image)Properties.Resources.ResourceManager.GetObject("egg"), 0, 0, 1);
|
||||
}
|
||||
if (misshiny)
|
||||
{ // Is Shiny
|
||||
// Redraw our image
|
||||
pksprite = Util.LayerImage(pksprite, Properties.Resources.rare_icon, 0, 0, 0.7);
|
||||
}
|
||||
if (mhelditem > 0)
|
||||
{
|
||||
// Has Item
|
||||
int item = mhelditem;
|
||||
Image itemimg = (Image)Properties.Resources.ResourceManager.GetObject("item_" + item.ToString());
|
||||
if (itemimg == null) itemimg = Properties.Resources.helditem;
|
||||
// Redraw
|
||||
pksprite = Util.LayerImage(pksprite, itemimg, 22 + (15 - itemimg.Width) / 2, 15 + (15 - itemimg.Height), 1);
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
|
|
|
@ -4142,15 +4142,15 @@ namespace PKHeX
|
|||
}
|
||||
if (isegg == 1)
|
||||
{
|
||||
file = "_0"; // Start with a partially transparent species
|
||||
baseImage = PKHeX.Util.LayerImage((Image)Properties.Resources.ResourceManager.GetObject(file), baseImage, 0, 0, 0.33);
|
||||
file = "egg"; // Add the egg layer over-top.
|
||||
baseImage = PKHeX.Util.LayerImage(baseImage, (Image)Properties.Resources.ResourceManager.GetObject(file), 0, 0, 1);
|
||||
// Start with a partially transparent species by layering the species with partial opacity onto a blank image.
|
||||
baseImage = Util.LayerImage((Image)Properties.Resources.ResourceManager.GetObject("_0"), baseImage, 0, 0, 0.33);
|
||||
// Add the egg layer over-top with full opacity.
|
||||
baseImage = Util.LayerImage(baseImage, (Image)Properties.Resources.ResourceManager.GetObject("egg"), 0, 0, 1);
|
||||
}
|
||||
if (PKX.getIsShiny(BitConverter.ToUInt32(dslotdata, 0x18),BitConverter.ToUInt16(dslotdata, 0x0C),BitConverter.ToUInt16(dslotdata, 0x0E)))
|
||||
{ // Is Shiny
|
||||
// Redraw our image
|
||||
baseImage = PKHeX.Util.LayerImage(baseImage, Properties.Resources.rare_icon, 0, 0, 0.7);
|
||||
baseImage = Util.LayerImage(baseImage, Properties.Resources.rare_icon, 0, 0, 0.7);
|
||||
}
|
||||
if (BitConverter.ToUInt16(dslotdata, 0xA) > 0)
|
||||
{
|
||||
|
@ -4159,7 +4159,7 @@ namespace PKHeX
|
|||
Image itemimg = (Image)Properties.Resources.ResourceManager.GetObject("item_"+item.ToString());
|
||||
if (itemimg == null) itemimg = Properties.Resources.helditem;
|
||||
// Redraw
|
||||
baseImage = PKHeX.Util.LayerImage(baseImage, itemimg, 22 + (15-itemimg.Width)/2, 15 + (15-itemimg.Height), 1);
|
||||
baseImage = Util.LayerImage(baseImage, itemimg, 22 + (15-itemimg.Width)/2, 15 + (15-itemimg.Height), 1);
|
||||
}
|
||||
|
||||
pb.Image = baseImage;
|
||||
|
|
Loading…
Reference in a new issue