Use img instead of color

Still too big
This commit is contained in:
Kurt 2024-04-17 01:56:09 -05:00
parent f630ad8271
commit e1b964ad64
13 changed files with 121 additions and 14 deletions

View file

@ -57910,6 +57910,76 @@ namespace PKHeX.Drawing.PokeSprite.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap sickburn {
get {
object obj = ResourceManager.GetObject("sickburn", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap sickfaint {
get {
object obj = ResourceManager.GetObject("sickfaint", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap sickfrostbite {
get {
object obj = ResourceManager.GetObject("sickfrostbite", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap sickparalyze {
get {
object obj = ResourceManager.GetObject("sickparalyze", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap sickpoison {
get {
object obj = ResourceManager.GetObject("sickpoison", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap sicksleep {
get {
object obj = ResourceManager.GetObject("sicksleep", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap sicktoxic {
get {
object obj = ResourceManager.GetObject("sicktoxic", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View file

@ -17362,6 +17362,27 @@
<data name="rare_icon_alt_2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Pokemon Sprite Overlays\rare_icon_alt_2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sickburn" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Status\sickburn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sickfaint" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Status\sickfaint.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sickfrostbite" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Status\sickfrostbite.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sickparalyze" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Status\sickparalyze.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sickpoison" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Status\sickpoison.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sicksleep" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Status\sicksleep.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sicktoxic" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Status\sicktoxic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="slotDel" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\accents\slotDel.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

@ -311,8 +311,22 @@ public static class SpriteUtil
return img;
}
public static Image GetStatusSprite(StatusType value)
public static Image? GetStatusSprite(this StatusCondition value)
{
throw new NotImplementedException();
if (value == 0)
return null;
if (value < StatusCondition.Poison)
return Resources.sicksleep;
if (value.HasFlag(StatusCondition.PoisonBad))
return Resources.sicktoxic;
if (value.HasFlag(StatusCondition.Poison))
return Resources.sickpoison;
if (value.HasFlag(StatusCondition.Burn))
return Resources.sickburn;
if (value.HasFlag(StatusCondition.Paralysis))
return Resources.sickparalyze;
if (value.HasFlag(StatusCondition.Freeze))
return Resources.sickfrostbite;
return null;
}
}

View file

@ -2886,11 +2886,11 @@ namespace PKHeX.WinForms.Controls
//
// StatusView
//
StatusView.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
StatusView.Location = new System.Drawing.Point(357, 1);
StatusView.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
StatusView.Location = new System.Drawing.Point(-4, 344);
StatusView.Margin = new System.Windows.Forms.Padding(0);
StatusView.Name = "StatusView";
StatusView.Size = new System.Drawing.Size(40, 24);
StatusView.Size = new System.Drawing.Size(64, 64);
StatusView.TabIndex = 2;
//
// TC_Editor

View file

@ -12,20 +12,21 @@ public partial class StatusBrowser : Form
public bool WasChosen { get; private set; }
public StatusCondition Choice { get; private set; }
private const int StatusHeight = 24;
private const int StatusWidth = StatusHeight * 2;
private readonly int StatusHeight;
private const int StatusCount = 7;
private const int StatusBrowserWidth = StatusWidth * 2;
private int StatusWidth => StatusHeight;
private int StatusBrowserWidth => StatusWidth * 2;
public StatusBrowser()
{
InitializeComponent();
StatusHeight = Drawing.PokeSprite.Properties.Resources.sicksleep.Height;
NUD_Sleep = new NumericUpDown
{
Minimum = 1,
Maximum = 7,
Value = 1,
Width = StatusWidth,
Width = 40,
TextAlign = HorizontalAlignment.Center,
Margin = Padding.Empty,
Padding = Padding.Empty,
@ -62,10 +63,12 @@ public partial class StatusBrowser : Form
private SelectablePictureBox GetImage(StatusCondition value, string name)
{
var color = value.GetStatusColor();
var img = value == 0
? Drawing.PokeSprite.Properties.Resources.sickfaint
: value.GetStatusSprite();
var pb = new SelectablePictureBox
{
BackColor = color,
Image = img,
Name = name,
AccessibleDescription = name,
AccessibleName = name,

View file

@ -20,7 +20,7 @@ public partial class StatusConditionView : UserControl
public StatusConditionView()
{
InitializeComponent();
PB_Status.MouseHover += (s, e) => PB_Status.Cursor = Cursors.Hand;
PB_Status.MouseHover += (_, _) => PB_Status.Cursor = Cursors.Hand;
}
public void LoadPKM(PKM entity)
@ -41,8 +41,7 @@ public partial class StatusConditionView : UserControl
private void SetStatus(StatusCondition status)
{
var color = status.GetStatusColor();
PB_Status.BackColor = color;
PB_Status.Image = status.GetStatusSprite();
Hover.SetToolTip(PB_Status, $"Status Condition: {status}");
}