From ff2226c4c00df9de017705109e87503b6eab2d7b Mon Sep 17 00:00:00 2001
From: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com>
Date: Tue, 10 Mar 2020 10:47:42 +0100
Subject: [PATCH] Add delete Icon.
---
README.md | 4 ++++
assets/gfx/sprites.t3s | 1 +
assets/gfx/sprites/delete.png | Bin 0 -> 429 bytes
include/screens/scriptlist.hpp | 2 +-
include/screens/unistore.hpp | 2 +-
romfs/lang/en/app.json | 4 +++-
source/screens/scriptlist.cpp | 11 +++++++++--
source/screens/unistore.cpp | 6 ++++--
8 files changed, 23 insertions(+), 7 deletions(-)
create mode 100644 assets/gfx/sprites/delete.png
diff --git a/README.md b/README.md
index cc45b2a..8ceb715 100644
--- a/README.md
+++ b/README.md
@@ -37,3 +37,7 @@ To build Universal-Updater from source, you need devkitPro installed, along with
## Contributions
[PabloMK7](https://github.com/mariohackandglitch): For improving the Download code.
+
+## Icon Credits
+
+Trash icon icon by Icons8
\ No newline at end of file
diff --git a/assets/gfx/sprites.t3s b/assets/gfx/sprites.t3s
index 66e901f..da17745 100644
--- a/assets/gfx/sprites.t3s
+++ b/assets/gfx/sprites.t3s
@@ -3,6 +3,7 @@
sprites/arrow.png
sprites/bottom_screen_bot.png
sprites/bottom_screen_top.png
+sprites/delete.png
sprites/download_all.png
sprites/top_screen_bot.png
sprites/top_screen_top.png
diff --git a/assets/gfx/sprites/delete.png b/assets/gfx/sprites/delete.png
new file mode 100644
index 0000000000000000000000000000000000000000..ad92fd93a562b682d6f4d5b09a8ecbecc3f26e41
GIT binary patch
literal 429
zcmV;e0aE^nP)P000>X1^@s6#OZ}&0004WNklgAlPTQ&6y#EuFM`58oO11F+R_9LJty
zCuszLh+sr?EoXliNqPsc1K>i)hwV*7+!v$|l17rQ#gg1idLk*=HhEgMJspCK^Sf=3
z#OXL)64jmzB(Ee1fC?es)aJWsyB6t8G|a|Nl2S@YlSb7ZVR)B)OIJl&k1EuWx2Ncm`mSVLKK*iHPf5nq##;SMCAekk9X0!Ud9yh?^q$
zOV~uj-JF6sc;dOn4#3NANm^k5!<3MVB>wsexq@gvWk1z>EUB+@G8ZmNdh|q#h=p8q
zt^G5fSw)gA?9F*H*bdvrwTV|1V>j5Y^5l4)8!aEBZRYN)H6&xvVY>yAj^r-yM>9!8
z+!pR17LtBAS7FiT+R*oXzs5eLlvdAppP;HVS subPos = {
{10, 70, 140, 40}, // Script list.
diff --git a/include/screens/unistore.hpp b/include/screens/unistore.hpp
index 409547b..bcc9ab7 100644
--- a/include/screens/unistore.hpp
+++ b/include/screens/unistore.hpp
@@ -100,7 +100,7 @@ private:
{295, 215, 25, 25}, // Arrow Down.
{0, 215, 25, 25}, // Back Arrow.
{5, 0, 25, 25}, // ViewMode Change.
- {45, 0, 25, 25}, // Search.
+ {45, 0, 25, 25}, // Delete.
{85, 0, 25, 25}, // Update.
};
std::vector URLBtn = {
diff --git a/romfs/lang/en/app.json b/romfs/lang/en/app.json
index ace257e..2a23ae7 100644
--- a/romfs/lang/en/app.json
+++ b/romfs/lang/en/app.json
@@ -148,5 +148,7 @@
"NOT_FOUND_COLOR": "Not Found Script Color",
"OUTDATED_COLOR": "Outdated Script Color",
"UPTODATE_COLOR": "Up-To-Date Script Color",
- "FUTURE_COLOR": "Future Script Color"
+ "FUTURE_COLOR": "Future Script Color",
+ "DELETE_SCRIPT2": "Delete the selected Script.",
+ "DELETE_UNISTORE": "Delete the selected UniStore."
}
diff --git a/source/screens/scriptlist.cpp b/source/screens/scriptlist.cpp
index bc101c5..836fbf9 100644
--- a/source/screens/scriptlist.cpp
+++ b/source/screens/scriptlist.cpp
@@ -244,6 +244,7 @@ void ScriptList::DrawList(void) const {
GFX::DrawArrow(315, 240, 180.0);
GFX::DrawArrow(0, 218, 0, 1);
GFX::DrawSpriteBlend(sprites_view_idx, arrowPos[3].x, arrowPos[3].y);
+ GFX::DrawSpriteBlend(sprites_delete_idx, arrowPos[4].x, arrowPos[4].y);
if (Config::viewMode == 0) {
for(int i=0;i 40+(i*57) && touch.py < 40+(i*57)+45) {
if (fileInfo2.size() != 0) {
choice = fileInfo2[screenPos + i];
- runFunctions(jsonFile);
+ if (Msg::promptMsg(Lang::get("EXECUTE_SCRIPT") + "\n\n" + choice)) {
+ runFunctions(jsonFile);
+ }
}
}
}
@@ -766,6 +769,10 @@ void ScriptList::DrawGlossary(void) const {
Gui::DrawString(50, 102, 0.6f, Config::TxtColor, Lang::get("ENTRY_DOWN"), 260);
GFX::DrawArrow(20, 130, 0, 1);
Gui::DrawString(50, 132, 0.6f, Config::TxtColor, Lang::get("GO_BACK"), 260);
+ if (lastMode == 1) {
+ GFX::DrawSpriteBlend(sprites_delete_idx, 20, 160);
+ Gui::DrawString(50, 162, 0.6f, Config::TxtColor, Lang::get("DELETE_SCRIPT2"), 260);
+ }
GFX::DrawArrow(0, 218, 0, 1);
}
diff --git a/source/screens/unistore.cpp b/source/screens/unistore.cpp
index 06b75c8..b32a9e2 100644
--- a/source/screens/unistore.cpp
+++ b/source/screens/unistore.cpp
@@ -280,7 +280,7 @@ void UniStore::DrawStoreList(void) const {
GFX::DrawArrow(315, 240, 180.0);
GFX::DrawArrow(0, 218, 0, 1);
GFX::DrawSpriteBlend(sprites_view_idx, arrowPos[3].x, arrowPos[3].y);
- GFX::DrawSpriteBlend(sprites_search_idx, arrowPos[4].x, arrowPos[4].y);
+ GFX::DrawSpriteBlend(sprites_delete_idx, arrowPos[4].x, arrowPos[4].y);
GFX::DrawSpriteBlend(sprites_update_idx, arrowPos[5].x, arrowPos[5].y);
if (Config::viewMode == 0) {
@@ -686,7 +686,7 @@ void UniStore::StoreSelectionLogic(u32 hDown, u32 hHeld, touchPosition touch) {
}
}
- if (hDown & KEY_SELECT) {
+ if ((hDown & KEY_SELECT) || (hDown & KEY_TOUCH && touching(touch, arrowPos[4]))) {
if (Msg::promptMsg(Lang::get("DELETE_STORE"))) {
deleteStore(Selection);
}
@@ -1097,6 +1097,8 @@ void UniStore::DrawGlossary(void) const {
if (lastMode == 1) {
GFX::DrawSpriteBlend(sprites_update_idx, 20, 160);
Gui::DrawString(50, 162, 0.6f, Config::TxtColor, Lang::get("UPDATE_STORE"), 260);
+ GFX::DrawSpriteBlend(sprites_delete_idx, 20, 190);
+ Gui::DrawString(50, 192, 0.6f, Config::TxtColor, Lang::get("DELETE_UNISTORE"), 260);
}
}