mirror of
https://github.com/BernardoGiordano/Checkpoint
synced 2024-11-28 19:40:18 +00:00
add big icon and shiny selector
This commit is contained in:
parent
60bdf1d826
commit
c45dc4dd40
2 changed files with 18 additions and 3 deletions
|
@ -5,8 +5,9 @@
|
|||
|
||||
#define COLOR_WHITE MakeColor(255, 255, 255, 255)
|
||||
#define COLOR_BLACK MakeColor(0, 0, 0, 255)
|
||||
#define COLOR_BLUE MakeColor(0, 0, 255, 255)
|
||||
#define COLOR_GREEN MakeColor(0, 255, 201, 255)
|
||||
#define COLOR_BLUE MakeColor(29, 50, 243, 255)
|
||||
#define COLOR_GREEN MakeColor(0, 254, 197, 255)
|
||||
#define COLOR_RED MakeColor(255, 81, 48, 255);
|
||||
|
||||
#define COLOR_GREY_DARKER MakeColor(70, 70, 70, 255)
|
||||
#define COLOR_GREY_DARK MakeColor(79, 79, 79, 255)
|
||||
|
|
|
@ -43,6 +43,7 @@ static bool backupScrollEnabled;
|
|||
static Hid* hid;
|
||||
static entryType_t type;
|
||||
|
||||
static float timer = 0;
|
||||
static void drawSelector(void);
|
||||
static int selectorX(size_t i);
|
||||
static int selectorY(size_t i);
|
||||
|
@ -342,6 +343,12 @@ void Gui::draw(u128 uid)
|
|||
}
|
||||
}
|
||||
|
||||
if (title.icon() != NULL)
|
||||
{
|
||||
drawOutline(1016, 157, 256, 256, 4, COLOR_BLACK);
|
||||
DrawImage(1016, 157, 256, 256, title.icon(), IMAGE_MODE_RGB24);
|
||||
}
|
||||
|
||||
drawOutline(540, 462, 730, 222, 4, COLOR_GREY_LIGHT);
|
||||
rectangled(1046, 462, 4, 222, COLOR_GREY_LIGHT);
|
||||
rectangled(1048, 571, 222, 4, COLOR_GREY_LIGHT);
|
||||
|
@ -362,6 +369,9 @@ void Gui::draw(u128 uid)
|
|||
GetTextDimensions(5, instructions, &ins_w, &ins_h);
|
||||
DrawText(5, ceil((1280 - ins_w) / 2), 720 - bar_height + (bar_height - ins_h) / 2, COLOR_WHITE, instructions);
|
||||
|
||||
// increase timer
|
||||
timer += 0.05f;
|
||||
|
||||
gfxFlushBuffers();
|
||||
gfxSwapBuffers();
|
||||
gfxWaitForVsync();
|
||||
|
@ -420,8 +430,12 @@ static void drawSelector(void)
|
|||
static const int w = 4;
|
||||
const int x = selectorX(hid->index()) + w/2;
|
||||
const int y = selectorY(hid->index()) + w/2;
|
||||
|
||||
float highlight_multiplier = fmax(0.0, fabs(fmod(timer, 1.0) - 0.5) / 0.5);
|
||||
color_t color = COLOR_BLUE;
|
||||
color = MakeColor(color.r + (255 - color.r) * highlight_multiplier, color.g + (255 - color.g) * highlight_multiplier, color.b + (255 - color.b) * highlight_multiplier, 255);
|
||||
|
||||
drawOutline(x, y, sz, sz, w, COLOR_GREEN);
|
||||
drawOutline(x, y, sz, sz, w, color);
|
||||
}
|
||||
|
||||
static int selectorX(size_t i)
|
||||
|
|
Loading…
Reference in a new issue