Add delete Icon.

This commit is contained in:
StackZ
2020-03-10 10:47:42 +01:00
parent 95a714012e
commit ff2226c4c0
8 changed files with 23 additions and 7 deletions
+4
View File
@@ -37,3 +37,7 @@ To build Universal-Updater from source, you need devkitPro installed, along with
## Contributions ## Contributions
[PabloMK7](https://github.com/mariohackandglitch): For improving the Download code. [PabloMK7](https://github.com/mariohackandglitch): For improving the Download code.
## Icon Credits
<a target="_blank" href="https://icons8.com/icons/set/trash">Trash icon</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a>
+1
View File
@@ -3,6 +3,7 @@
sprites/arrow.png sprites/arrow.png
sprites/bottom_screen_bot.png sprites/bottom_screen_bot.png
sprites/bottom_screen_top.png sprites/bottom_screen_top.png
sprites/delete.png
sprites/download_all.png sprites/download_all.png
sprites/top_screen_bot.png sprites/top_screen_bot.png
sprites/top_screen_top.png sprites/top_screen_top.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

+1 -1
View File
@@ -93,7 +93,7 @@ private:
{295, 215, 25, 25}, // Arrow Down. {295, 215, 25, 25}, // Arrow Down.
{0, 215, 25, 25}, // Back Arrow. {0, 215, 25, 25}, // Back Arrow.
{5, 0, 25, 25}, // viewMode Change {5, 0, 25, 25}, // viewMode Change
{45, 0, 25, 25}, // Search. {45, 0, 25, 25}, // Delete.
}; };
std::vector<Structs::ButtonPos> subPos = { std::vector<Structs::ButtonPos> subPos = {
{10, 70, 140, 40}, // Script list. {10, 70, 140, 40}, // Script list.
+1 -1
View File
@@ -100,7 +100,7 @@ private:
{295, 215, 25, 25}, // Arrow Down. {295, 215, 25, 25}, // Arrow Down.
{0, 215, 25, 25}, // Back Arrow. {0, 215, 25, 25}, // Back Arrow.
{5, 0, 25, 25}, // ViewMode Change. {5, 0, 25, 25}, // ViewMode Change.
{45, 0, 25, 25}, // Search. {45, 0, 25, 25}, // Delete.
{85, 0, 25, 25}, // Update. {85, 0, 25, 25}, // Update.
}; };
std::vector<Structs::ButtonPos> URLBtn = { std::vector<Structs::ButtonPos> URLBtn = {
+3 -1
View File
@@ -148,5 +148,7 @@
"NOT_FOUND_COLOR": "Not Found Script Color", "NOT_FOUND_COLOR": "Not Found Script Color",
"OUTDATED_COLOR": "Outdated Script Color", "OUTDATED_COLOR": "Outdated Script Color",
"UPTODATE_COLOR": "Up-To-Date 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."
} }
+9 -2
View File
@@ -244,6 +244,7 @@ void ScriptList::DrawList(void) const {
GFX::DrawArrow(315, 240, 180.0); GFX::DrawArrow(315, 240, 180.0);
GFX::DrawArrow(0, 218, 0, 1); GFX::DrawArrow(0, 218, 0, 1);
GFX::DrawSpriteBlend(sprites_view_idx, arrowPos[3].x, arrowPos[3].y); 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) { if (Config::viewMode == 0) {
for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)fileInfo.size();i++) { for(int i=0;i<ENTRIES_PER_SCREEN && i<(int)fileInfo.size();i++) {
@@ -501,7 +502,7 @@ void ScriptList::ListSelection(u32 hDown, u32 hHeld, touchPosition touch) {
keyRepeatDelay = 6; keyRepeatDelay = 6;
} }
} }
if (hDown & KEY_SELECT) { if ((hDown & KEY_SELECT) || (hDown & KEY_TOUCH && touching(touch, arrowPos[4]))) {
if (Msg::promptMsg(Lang::get("DELETE_SCRIPT"))) { if (Msg::promptMsg(Lang::get("DELETE_SCRIPT"))) {
deleteScript(Selection); deleteScript(Selection);
} }
@@ -650,7 +651,9 @@ void ScriptList::SelectFunction(u32 hDown, u32 hHeld, touchPosition touch) {
if(touch.py > 40+(i*57) && touch.py < 40+(i*57)+45) { if(touch.py > 40+(i*57) && touch.py < 40+(i*57)+45) {
if (fileInfo2.size() != 0) { if (fileInfo2.size() != 0) {
choice = fileInfo2[screenPos + i]; 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); Gui::DrawString(50, 102, 0.6f, Config::TxtColor, Lang::get("ENTRY_DOWN"), 260);
GFX::DrawArrow(20, 130, 0, 1); GFX::DrawArrow(20, 130, 0, 1);
Gui::DrawString(50, 132, 0.6f, Config::TxtColor, Lang::get("GO_BACK"), 260); 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); GFX::DrawArrow(0, 218, 0, 1);
} }
+4 -2
View File
@@ -280,7 +280,7 @@ void UniStore::DrawStoreList(void) const {
GFX::DrawArrow(315, 240, 180.0); GFX::DrawArrow(315, 240, 180.0);
GFX::DrawArrow(0, 218, 0, 1); GFX::DrawArrow(0, 218, 0, 1);
GFX::DrawSpriteBlend(sprites_view_idx, arrowPos[3].x, arrowPos[3].y); 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); GFX::DrawSpriteBlend(sprites_update_idx, arrowPos[5].x, arrowPos[5].y);
if (Config::viewMode == 0) { 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"))) { if (Msg::promptMsg(Lang::get("DELETE_STORE"))) {
deleteStore(Selection); deleteStore(Selection);
} }
@@ -1097,6 +1097,8 @@ void UniStore::DrawGlossary(void) const {
if (lastMode == 1) { if (lastMode == 1) {
GFX::DrawSpriteBlend(sprites_update_idx, 20, 160); GFX::DrawSpriteBlend(sprites_update_idx, 20, 160);
Gui::DrawString(50, 162, 0.6f, Config::TxtColor, Lang::get("UPDATE_STORE"), 260); 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);
} }
} }