Comment 1 for bug 1428597

Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

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) {
[...]