See desc for more.

- Blend Icons as the TextColor.

- Resize the `Add Selection to Queue` button.
This commit is contained in:
StackZ
2021-03-24 22:11:51 +01:00
parent 0f625eb67c
commit 54447c2537
11 changed files with 36 additions and 38 deletions
+11 -11
View File
@@ -89,7 +89,7 @@ void GFX::DrawSprite(int img, int x, int y, float ScaleX, float ScaleY) {
bool selected: if checked, or not.
*/
void GFX::DrawCheckbox(float xPos, float yPos, bool selected) {
GFX::DrawSprite((selected ? sprites_checked_idx : sprites_unchecked_idx), xPos, yPos);
GFX::DrawIcon((selected ? sprites_checked_idx : sprites_unchecked_idx), xPos, yPos, UIThemes->TextColor(), 0.5f);
}
/*
@@ -100,7 +100,7 @@ void GFX::DrawCheckbox(float xPos, float yPos, bool selected) {
bool toggled: If toggled or not.
*/
void GFX::DrawToggle(float xPos, float yPos, bool toggled) {
GFX::DrawSprite((toggled ? sprites_toggle_on_idx : sprites_toggle_off_idx), xPos, yPos);
GFX::DrawIcon((toggled ? sprites_toggle_on_idx : sprites_toggle_off_idx), xPos, yPos, UIThemes->TextColor(), 0.5f);
}
void GFX::DrawTime() {
@@ -122,38 +122,38 @@ void GFX::DrawBattery() {
PTMU_GetAdapterState(&chargerPlugged); // Get if charger adapter is plugged.
if (chargerPlugged) {
GFX::DrawSprite((chargeState ? sprites_battery_charge_idx : sprites_battery_charge_full_idx), 366, 1);
GFX::DrawIcon((chargeState ? sprites_battery_charge_idx : sprites_battery_charge_full_idx), 366, 1, UIThemes->TextColor());
if (batteryLow) batteryLow = false; // Cause we're charging.
} else {
switch(level) {
case 0: // Blinky.
GFX::DrawSprite((blinkState ? sprites_battery_blink_idx : sprites_battery_0_idx), 366, 1);
GFX::DrawIcon((blinkState ? sprites_battery_blink_idx : sprites_battery_0_idx), 366, 1, UIThemes->TextColor());
if (!batteryLow) batteryLow = true;
break;
case 1: // Red.
GFX::DrawSprite(sprites_battery_0_idx, 366, 1);
GFX::DrawIcon(sprites_battery_0_idx, 366, 1, UIThemes->TextColor());
if (batteryLow) batteryLow = false; // Cause we're not low.
break;
case 2: // One.
GFX::DrawSprite(sprites_battery_1_idx, 366, 1);
GFX::DrawIcon(sprites_battery_1_idx, 366, 1, UIThemes->TextColor());
if (batteryLow) batteryLow = false; // Cause we're not low.
break;
case 3: // Two.
GFX::DrawSprite(sprites_battery_2_idx, 366, 1);
GFX::DrawIcon(sprites_battery_2_idx, 366, 1, UIThemes->TextColor());
if (batteryLow) batteryLow = false; // Cause we're not low.
break;
case 4: // Three.
GFX::DrawSprite(sprites_battery_3_idx, 366, 1);
GFX::DrawIcon(sprites_battery_3_idx, 366, 1, UIThemes->TextColor());
if (batteryLow) batteryLow = false; // Cause we're not low.
break;
case 5: // Full.
GFX::DrawSprite(sprites_battery_4_idx, 366, 1);
GFX::DrawIcon(sprites_battery_4_idx, 366, 1, UIThemes->TextColor());
if (batteryLow) batteryLow = false; // Cause we're not low.
break;
}
@@ -176,9 +176,9 @@ void GFX::HandleBattery() {
/*
Draws the sidebar icons blended with the SideBarIconColor.
*/
void GFX::DrawIcon(const int Idx, int X, int Y, float ScaleX, float ScaleY) {
void GFX::DrawIcon(const int Idx, int X, int Y, uint32_t Color, float BlendPower, float ScaleX, float ScaleY) {
C2D_ImageTint tint;
C2D_PlainImageTint(&tint, UIThemes->SideBarIconColor(), 1.0f);
C2D_PlainImageTint(&tint, Color, BlendPower);
C2D_DrawImageAt(C2D_SpriteSheetGetImage(sprites, Idx), X, Y, 0.5f, &tint, ScaleX, ScaleY);
}
+2 -2
View File
@@ -142,10 +142,10 @@ void StoreUtils::DrawDownList(const std::vector<std::string> &entries, bool fetc
if (StoreUtils::store->GetDownloadIndex() == i + StoreUtils::store->GetDownloadSIndex()) Gui::Draw_Rect(downloadBoxes[i].x, downloadBoxes[i].y, downloadBoxes[i].w, downloadBoxes[i].h, UIThemes->MarkSelected());
Gui::DrawStringCentered(46 - 160 + (241 / 2), downloadBoxes[i].y + 4, 0.45f, UIThemes->TextColor(), entries[(i + StoreUtils::store->GetDownloadSIndex())], 235, 0, font);
if (installs[(i + StoreUtils::store->GetDownloadSIndex())]) GFX::DrawSprite(sprites_installed_idx, installedPos[i].x, installedPos[i].y);
if (installs[(i + StoreUtils::store->GetDownloadSIndex())]) GFX::DrawIcon(sprites_installed_idx, installedPos[i].x, installedPos[i].y, UIThemes->TextColor());
}
if (is3DSX) GFX::DrawSprite(sprites_shortcut_idx, downloadBoxes[6].x, downloadBoxes[6].y);
if (is3DSX) GFX::DrawIcon(sprites_shortcut_idx, downloadBoxes[6].x, downloadBoxes[6].y, UIThemes->TextColor());
} else { // If no downloads available..
+2 -2
View File
@@ -56,8 +56,8 @@ void StoreUtils::DrawEntryInfo(const std::unique_ptr<StoreEntry> &entry) {
Gui::DrawString(53, 190, 0.45, UIThemes->TextColor(), Lang::get("LICENSE") + ": " + entry->GetLicense(), 248, 0, font);
GFX::DrawBox(btn.x, btn.y, btn.w, btn.h, false);
if (!entry->GetScreenshots().empty()) GFX::DrawSprite(sprites_screenshot_idx, sshot.x, sshot.y);
if (entry->GetReleaseNotes() != "") GFX::DrawSprite(sprites_notes_idx, notes.x, notes.y);
if (!entry->GetScreenshots().empty()) GFX::DrawIcon(sprites_screenshot_idx, sshot.x, sshot.y, UIThemes->TextColor());
if (entry->GetReleaseNotes() != "") GFX::DrawIcon(sprites_notes_idx, notes.x, notes.y, UIThemes->TextColor());
Gui::DrawString(btn.x + 5, btn.y + 2, 0.6f, UIThemes->TextColor(), "", 0, 0, font);
}
}
+2 -2
View File
@@ -238,7 +238,7 @@ void StoreUtils::DrawQueueMenu(const int queueIndex) {
C2D_DrawImageAt(tempImg, QueueBoxes[0].x + 5 + offsetW, QueueBoxes[0].y + 21 + offsetH, 0.5f);
DrawStatus(queueEntries[0]->status);
GFX::DrawSprite(sprites_cancel_idx, QueueBoxes[2].x, QueueBoxes[2].y); // Don't show until properly implemented.
GFX::DrawIcon(sprites_cancel_idx, QueueBoxes[2].x, QueueBoxes[2].y, UIThemes->TextColor());
/* The next Queue Entries being displayed below. */
if ((1 + queueMenuIdx) < (int)queueEntries.size()) {
@@ -254,7 +254,7 @@ void StoreUtils::DrawQueueMenu(const int queueIndex) {
Gui::DrawString(QueueBoxes[1].x + 60, QueueBoxes[1].y + 30, 0.4f, UIThemes->TextColor(), Lang::get("QUEUE_POSITION") + ": " + std::to_string(queueMenuIdx + 1), 0, 0, font);
/* Cancel. */
GFX::DrawSprite(sprites_cancel_idx, QueueBoxes[3].x, QueueBoxes[3].y);
GFX::DrawIcon(sprites_cancel_idx, QueueBoxes[3].x, QueueBoxes[3].y, UIThemes->TextColor());
}
}
}
+3 -3
View File
@@ -48,7 +48,7 @@ static const std::vector<Structs::ButtonPos> SearchMenu = {
{ 257, 159, 30, 30 },
/* Send to Queue. */
{ 91, 200, 185, 25 },
{ 82, 200, 205, 25 },
/* AND / OR. */
{ 222, 139, 30, 13 },
@@ -113,10 +113,10 @@ void StoreUtils::DrawSearchMenu(const std::vector<bool> &searchIncludes, const s
Gui::DrawString(SearchMenu[7].x + 9, SearchMenu[7].y + 7, 0.5f, UIThemes->TextColor(), "", 0, 0, font);
Gui::DrawString(SearchMenu[8].x + 9, SearchMenu[8].y + 7, 0.5f, UIThemes->TextColor(), "", 0, 0, font);
Gui::DrawString(SearchMenu[9].x + 9, SearchMenu[9].y + 7, 0.5f, UIThemes->TextColor(), "", 0, 0, font);
GFX::DrawSprite(sprites_update_filter_idx, SearchMenu[10].x + 8, SearchMenu[10].y + 8);
GFX::DrawIcon(sprites_update_filter_idx, SearchMenu[10].x + 8, SearchMenu[10].y + 8, UIThemes->TextColor());
Gui::Draw_Rect(SearchMenu[11].x, SearchMenu[11].y, SearchMenu[11].w, SearchMenu[11].h, UIThemes->MarkUnselected());
Gui::DrawStringCentered(23, SearchMenu[11].y + 6, 0.45f, UIThemes->TextColor(), Lang::get("SELECTION_QUEUE"), 280, 0, font);
Gui::DrawStringCentered(23, SearchMenu[11].y + 6, 0.45f, UIThemes->TextColor(), Lang::get("SELECTION_QUEUE"), 200, 0, font);
/* AND / OR. */
Gui::Draw_Rect(SearchMenu[12].x, SearchMenu[12].y, SearchMenu[12].w, SearchMenu[12].h, (isAND ? UIThemes->MarkSelected() : UIThemes->MarkUnselected()));
+6 -6
View File
@@ -115,14 +115,14 @@ static void DrawSettingsMain(int selection) {
static void DrawLanguageSettings(int selection, int sPos) {
Gui::Draw_Rect(40, 0, 280, 25, UIThemes->EntryBar());
Gui::Draw_Rect(40, 25, 280, 1, UIThemes->EntryOutline());
GFX::DrawSprite(sprites_arrow_idx, back.x, back.y);
GFX::DrawSprite(sprites_add_font_idx, langButtons[6].x, langButtons[6].y);
GFX::DrawIcon(sprites_arrow_idx, back.x, back.y, UIThemes->TextColor());
GFX::DrawIcon(sprites_add_font_idx, langButtons[6].x, langButtons[6].y, UIThemes->TextColor());
Gui::DrawStringCentered(20, 2, 0.6, UIThemes->TextColor(), Lang::get("SELECT_LANG"), 248, 0, font);
for(int i = 0; i < 6 && i < (int)languages.size(); i++) {
if (sPos + i == selection) Gui::Draw_Rect(langButtons[i].x, langButtons[i].y, langButtons[i].w, langButtons[i].h, UIThemes->MarkSelected());
if(langSprites[sPos + i].first != -1)
GFX::DrawSprite(langSprites[sPos + i].first, 160 + 20 - (langSprites[sPos + i].second / 2), langButtons[i].y + 6);
GFX::DrawIcon(langSprites[sPos + i].first, 160 + 20 - (langSprites[sPos + i].second / 2), langButtons[i].y + 6, UIThemes->TextColor());
else
Gui::DrawStringCentered(20, langButtons[i].y + 4, 0.45f, UIThemes->TextColor(), languages[sPos + i], 280, 0, font);
}
@@ -146,7 +146,7 @@ static void DrawSettingsDir(int selection) {
GFX::DrawToggle(dirIcons[i].x, dirIcons[i].y, config->_3dsxInFolder());
Gui::DrawString(dirButtons[i].x + 4, dirButtons[i].y + 28, 0.4f, UIThemes->TextColor(), Lang::get("3DSX_IN_FOLDER_DESC"), 265, 0, font, C2D_WordWrap);
} else {
GFX::DrawSprite(sprites_arrow_idx, dirIcons[i].x, dirIcons[i].y, -1.0f);
GFX::DrawIcon(sprites_arrow_idx, dirIcons[i].x, dirIcons[i].y, UIThemes->TextColor(), -1.0f);
}
}
}
@@ -157,7 +157,7 @@ static void DrawSettingsDir(int selection) {
static void DrawAutoUpdate(int selection) {
Gui::Draw_Rect(40, 0, 280, 25, UIThemes->EntryBar());
Gui::Draw_Rect(40, 25, 280, 1, UIThemes->EntryOutline());
GFX::DrawSprite(sprites_arrow_idx, back.x, back.y);
GFX::DrawIcon(sprites_arrow_idx, back.x, back.y, UIThemes->TextColor());
Gui::DrawStringCentered(20, 2, 0.6, UIThemes->TextColor(), Lang::get("AUTO_UPDATE_SETTINGS"), 240, 0, font);
@@ -181,7 +181,7 @@ static void DrawAutoUpdate(int selection) {
static void DrawGUISettings(int selection) {
Gui::Draw_Rect(40, 0, 280, 25, UIThemes->EntryBar());
Gui::Draw_Rect(40, 25, 280, 1, UIThemes->EntryOutline());
GFX::DrawSprite(sprites_arrow_idx, back.x, back.y);
GFX::DrawIcon(sprites_arrow_idx, back.x, back.y, UIThemes->TextColor());
Gui::DrawStringCentered(20, 2, 0.6, UIThemes->TextColor(), Lang::get("GUI_SETTINGS"), 248, 0, font);
+1 -1
View File
@@ -44,7 +44,7 @@ static const std::vector<Structs::ButtonPos> buttons = {
};
static void DrawCheck(int pos, bool v) {
GFX::DrawSprite((v ? sprites_sort_checked_idx : sprites_sort_unchecked_idx), buttons[pos].x + 1, buttons[pos].y);
GFX::DrawIcon((v ? sprites_sort_checked_idx : sprites_sort_unchecked_idx), buttons[pos].x + 1, buttons[pos].y, UIThemes->TextColor());
}
/*
+4 -4
View File
@@ -268,7 +268,7 @@ void Overlays::SelectStore() {
Gui::Draw_Rect(0, 0, 320, 25, UIThemes->BarColor());
Gui::Draw_Rect(0, 25, 320, 1, UIThemes->BarOutline());
GFX::DrawSprite(sprites_arrow_idx, mainButtons[9].x, mainButtons[9].y);
GFX::DrawIcon(sprites_arrow_idx, mainButtons[9].x, mainButtons[9].y, UIThemes->TextColor());
Gui::DrawStringCentered(0, 2, 0.6, UIThemes->TextColor(), Lang::get("SELECT_UNISTORE_2"), 310, 0, font);
for(int i = 0; i < 6 && i < (int)info.size(); i++) {
@@ -279,9 +279,9 @@ void Overlays::SelectStore() {
if (info.size() <= 0) GFX::DrawBottom(); // Otherwise we'd draw on top.
GFX::DrawSprite(sprites_delete_idx, mainButtons[6].x, mainButtons[6].y);
GFX::DrawSprite(sprites_update_idx, mainButtons[7].x, mainButtons[7].y);
GFX::DrawSprite(sprites_add_idx, mainButtons[8].x, mainButtons[8].y);
GFX::DrawIcon(sprites_delete_idx, mainButtons[6].x, mainButtons[6].y, UIThemes->TextColor());
GFX::DrawIcon(sprites_update_idx, mainButtons[7].x, mainButtons[7].y, UIThemes->TextColor());
GFX::DrawIcon(sprites_add_idx, mainButtons[8].x, mainButtons[8].y, UIThemes->TextColor());
C3D_FrameEnd(0);
hidScanInput();
+1 -3
View File
@@ -131,8 +131,6 @@ void Overlays::SelectTheme() {
else if (selection > sPos + 7 - 1) sPos = selection - 7 + 1;
}
if (hidKeysDown() & KEY_B) {
Finish = true;
}
if (hidKeysDown() & KEY_B) Finish = true;
}
}
+3 -3
View File
@@ -176,9 +176,9 @@ void QRCode::drawThread() {
}
}
GFX::DrawSprite((this->displayList ? sprites_qr_code_idx : sprites_list_idx), mainButtons[6].x, mainButtons[6].y);
if (this->displayList) GFX::DrawSprite(sprites_keyboard_idx, mainButtons[7].x, mainButtons[7].y);
GFX::DrawSprite(sprites_arrow_idx, mainButtons[8].x, mainButtons[8].y);
GFX::DrawIcon((this->displayList ? sprites_qr_code_idx : sprites_list_idx), mainButtons[6].x, mainButtons[6].y, UIThemes->TextColor());
if (this->displayList) GFX::DrawIcon(sprites_keyboard_idx, mainButtons[7].x, mainButtons[7].y, UIThemes->TextColor());
GFX::DrawIcon(sprites_arrow_idx, mainButtons[8].x, mainButtons[8].y, UIThemes->TextColor());
C3D_FrameEnd(0);
}