Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit 3a6f010

Browse files
R3FR4GR3FR4G
authored andcommitted
Changed order of drawing
DPad is now behind the Stick and not over it
1 parent 77f20d5 commit 3a6f010

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

JoystickDisplay.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,8 @@ protected override void OnPaint(PaintEventArgs e)
717717
}
718718
}
719719

720+
721+
720722
if (!drawButtonCount)
721723
{
722724
if (S != 0)
@@ -732,6 +734,25 @@ protected override void OnPaint(PaintEventArgs e)
732734
int drawRY = 68 - ((64 * joyRY) / 128);
733735

734736
e.Graphics.DrawImage(imgBase, 108 - 64, 68 - 64, 128, 128);
737+
if (DPadBehave == 1)
738+
{
739+
if (DUp != 0)
740+
{
741+
e.Graphics.DrawImage(imgDUp, 92, 3, 32, 62);
742+
}
743+
if (DDown != 0)
744+
{
745+
e.Graphics.DrawImage(imgDDown, 92, 71, 32, 62);
746+
}
747+
if (DRight != 0)
748+
{
749+
e.Graphics.DrawImage(imgDRight, 111, 52, 62, 32);
750+
}
751+
if (DLeft != 0)
752+
{
753+
e.Graphics.DrawImage(imgDLeft, 43, 52, 62, 32);
754+
}
755+
}
735756
if (RStickBehave == 1 && (joyRX != 0 || joyRY != 0))
736757
{
737758
e.Graphics.DrawLine(penRStick, 108, 68, drawRX, drawRY);
@@ -793,27 +814,6 @@ protected override void OnPaint(PaintEventArgs e)
793814
e.Graphics.DrawString("" + countS, fontArial, Brushes.White, recS, formatLeft);
794815
e.Graphics.DrawString("" + countS2, fontArial, Brushes.White, recS2, formatRight);
795816
}
796-
797-
if (DPadBehave == 1 && drawButtonCount == false)
798-
{
799-
if (DUp != 0)
800-
{
801-
e.Graphics.DrawImage(imgDUp, 92, 3, 32, 62);
802-
}
803-
if (DDown != 0)
804-
{
805-
e.Graphics.DrawImage(imgDDown, 92, 71, 32, 62);
806-
}
807-
if (DRight != 0)
808-
{
809-
e.Graphics.DrawImage(imgDRight, 111, 52, 62, 32);
810-
}
811-
if (DLeft != 0)
812-
{
813-
e.Graphics.DrawImage(imgDLeft, 43, 52, 62, 32);
814-
}
815-
}
816-
817817
base.OnPaint(e);
818818
}
819819

0 commit comments

Comments
 (0)