I almost managed to implement this, but I can't get the game to remove the unpressed Frame when the pressed Frame is drawn. The code I'm using:
if (Preference.IconsShift && Preference.IconFrameG && Preference.PressedIconFrameG) {
if (!(flags & IconClicked)) {
Preference.IconFrameG->DrawClip(pos.x - 4, pos.y - 4);
}
if (flags & IconActive) { // Code to make a border appear around the icon when the mouse hovers over it.
Video.DrawRectangle(ColorGray, pos.x - 4, pos.y - 4, 54, 46);
DrawUIButton(&s, flags, pos.x, pos.y, text, player);
}
if (flags & IconClicked) { // Shift the icon a bit to make it look like it's been pressed.
DrawUIButton(&s, flags, pos.x + 1, pos.y + 1, text, player);
if (flags & IconSelected) {
Video.DrawRectangle(ColorGreen, pos.x + 1, pos.y + 1, 46, 38);
}
Preference.PressedIconFrameG->DrawClip(pos.x - 3, pos.y - 3);
Video.DrawRectangle(ColorGray, pos.x - 4, pos.y - 4, 54, 46);
} else {
DrawUIButton(&s, flags, pos.x, pos.y, text, player);
if (flags & IconSelected) {
Video.DrawRectangle(ColorGreen, pos.x, pos.y, 46, 38);
}
}
} else if (Preference.IconsShift) {
[...]
I almost managed to implement this, but I can't get the game to remove the unpressed Frame when the pressed Frame is drawn. The code I'm using:
if (Preference. IconsShift && Preference. IconFrameG && Preference. PressedIconFram eG) { IconFrameG- >DrawClip( pos.x - 4, pos.y - 4);
if (!(flags & IconClicked)) {
Preference.
}
if (flags & IconActive) { // Code to make a border appear around the icon when the mouse hovers over it. DrawRectangle( ColorGray, pos.x - 4, pos.y - 4, 54, 46);
Video.
DrawUIButton(&s, flags, pos.x, pos.y, text, player);
}
if (flags & IconClicked) { // Shift the icon a bit to make it look like it's been pressed. DrawRectangle( ColorGreen, pos.x + 1, pos.y + 1, 46, 38); PressedIconFram eG->DrawClip( pos.x - 3, pos.y - 3); DrawRectangle( ColorGray, pos.x - 4, pos.y - 4, 54, 46); DrawRectangle( ColorGreen, pos.x, pos.y, 46, 38); IconsShift) {
DrawUIButton(&s, flags, pos.x + 1, pos.y + 1, text, player);
if (flags & IconSelected) {
Video.
}
Preference.
Video.
} else {
DrawUIButton(&s, flags, pos.x, pos.y, text, player);
if (flags & IconSelected) {
Video.
}
}
} else if (Preference.
[...]