From 21f7f2e355fe3afd57a5613556a78b3219457c1e Mon Sep 17 00:00:00 2001 From: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com> Date: Fri, 3 Jan 2020 09:39:54 +0100 Subject: [PATCH] =?UTF-8?q?Custom=20Buttons=20possible!=20(=20=CD=A1=C2=B0?= =?UTF-8?q?=20=CD=9C=CA=96=20=CD=A1=C2=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/screens/unistore.cpp | 46 ++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/source/screens/unistore.cpp b/source/screens/unistore.cpp index bd63d93..85e6cab 100644 --- a/source/screens/unistore.cpp +++ b/source/screens/unistore.cpp @@ -132,6 +132,19 @@ void freeSheet() { sheetHasLoaded = false; } +void drawBlend(int key, int x, int y) { + C2D_ImageTint tint; + C2D_SetImageTint(&tint, C2D_TopLeft, C2D_Color32(0, 0, 0, 180), 0.5); + C2D_SetImageTint(&tint, C2D_TopRight, C2D_Color32(0, 0, 0, 180), 0.5); + C2D_SetImageTint(&tint, C2D_BotLeft, C2D_Color32(0, 0, 0, 180), 0.5); + C2D_SetImageTint(&tint, C2D_BotRight, C2D_Color32(0, 0, 0, 180), 0.5); + C2D_DrawImageAt(C2D_SpriteSheetGetImage(appStoreSheet, key), x, y, 0.5f, &tint); +} + +void drawNormal(int key, int x, int y) { + C2D_DrawImageAt(C2D_SpriteSheetGetImage(appStoreSheet, key), x, y, 0.5f, NULL); +} + void UniStore::descript() { if (storeInfo[selection].description != "" || storeInfo[selection].description != "MISSING: storeInfo.description") { storeDesc = storeInfo[selection].description; @@ -254,14 +267,15 @@ void UniStore::DrawStore(void) const { Gui::DrawTop(); // Top Background. if (appStoreJson.at("storeInfo").contains("iconIndexTop") && sheetHasLoaded == true) { - C2D_DrawImageAt(C2D_SpriteSheetGetImage(appStoreSheet, appStoreJson["storeInfo"]["iconIndexTop"]), 0, 0, 0.5f, NULL); + drawNormal(appStoreJson["storeInfo"]["iconIndexTop"], 0, 0); } + // Icon. if (appStoreJson.at(selectedOptionAppStore).at("info").contains("iconIndex") && sheetHasLoaded == true) { if (appStoreJson.at(selectedOptionAppStore).at("info").contains("posX") && appStoreJson.at(selectedOptionAppStore).at("info").contains("posY")) { - C2D_DrawImageAt(C2D_SpriteSheetGetImage(appStoreSheet, appStoreJson[selectedOptionAppStore]["info"]["iconIndex"]), appStoreJson[selectedOptionAppStore]["info"]["posX"], appStoreJson[selectedOptionAppStore]["info"]["posY"], 0.5f, NULL); + drawNormal(appStoreJson[selectedOptionAppStore]["info"]["iconIndex"], appStoreJson[selectedOptionAppStore]["info"]["posX"], appStoreJson[selectedOptionAppStore]["info"]["posY"]); } else { - C2D_DrawImageAt(C2D_SpriteSheetGetImage(appStoreSheet, appStoreJson[selectedOptionAppStore]["info"]["iconIndex"]), 175, 155, 0.5f, NULL); + drawNormal(appStoreJson[selectedOptionAppStore]["info"]["iconIndex"], 175, 155); } } @@ -294,7 +308,7 @@ void UniStore::DrawStore(void) const { Gui::DrawBottom(); // Bottom Background. if (appStoreJson.at("storeInfo").contains("iconIndexBottom") && sheetHasLoaded == true) { - C2D_DrawImageAt(C2D_SpriteSheetGetImage(appStoreSheet, appStoreJson["storeInfo"]["iconIndexBottom"]), 0, 0, 0.5f, NULL); + drawNormal(appStoreJson["storeInfo"]["iconIndexBottom"], 0, 0); } Gui::DrawArrow(295, -1); @@ -306,9 +320,17 @@ void UniStore::DrawStore(void) const { for(int i=0;i