From c092c63efe3fc633ab37d72d7471721b3154d857 Mon Sep 17 00:00:00 2001 From: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com> Date: Tue, 24 Dec 2019 00:21:46 +0100 Subject: [PATCH] Add viewMode change icon. --- assets/gfx/sprites.t3s | 1 + assets/gfx/sprites/view.png | Bin 0 -> 514 bytes include/screens/scriptBrowse.hpp | 4 +++- include/screens/scriptlist.hpp | 3 ++- include/screens/tinyDB.hpp | 4 +++- source/screens/scriptBrowse.cpp | 6 +++--- source/screens/scriptlist.cpp | 5 ++++- source/screens/tinyDB.cpp | 7 +++---- 8 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 assets/gfx/sprites/view.png diff --git a/assets/gfx/sprites.t3s b/assets/gfx/sprites.t3s index 5115888..cba0852 100644 --- a/assets/gfx/sprites.t3s +++ b/assets/gfx/sprites.t3s @@ -7,6 +7,7 @@ sprites/download_all.png sprites/top_screen_bot.png sprites/top_screen_top.png sprites/search.png +sprites/view.png sprites/credits/discord.png sprites/credits/voltZ.png \ No newline at end of file diff --git a/assets/gfx/sprites/view.png b/assets/gfx/sprites/view.png new file mode 100644 index 0000000000000000000000000000000000000000..e6415684dd0c039bce5d302b4c8e1d866825a9e1 GIT binary patch literal 514 zcmV+d0{#7oP)P000>X1^@s6#OZ}&00006VoOIv00000 z008+zyMF)x010qNS#tmYE+YT{E+YYWr9XB6000McNliru;|v!TD>xG4+nxXb04j7v zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj27VtF7`Z**a7Yy840a66#gXA@dgwE9W{Ykw1;=m2f&WThOOWs=v7RpG$FAe zF))$O=C0Xnb^@y;T5yuhN#@);XJ%*a9chpMhG3f@ASdZe(ut%4NgtA4Bs~W~u>P^T zb51}7xCiE>V{UrIIhV}jhe3_2-^??BBH zUo$Snn(29<2iyT&ARjYIF3bVdq(K3grTph%%wUqxCNZNhC3glCBq?V; zJxRrs4L%s(NGd0^vZU)oTpUH4_uHiDIi@$`bB`X4zk2j$++^ShIx>Fr=ugJS9(}Nj zGdbMmOtRjtE^uoc8Pq+u>vC6hQctOqPj8*X5?h{%4{Z?*fQw8` za arrowPos = { + std::vector arrowPos = { {295, 0, 25, 25, -1}, // Arrow Up. {295, 215, 25, 25, -1}, // Arrow Down. {0, 215, 25, 25, -1}, // Back Arrow. {0, 0, 25, 25, -1}, // Download All. + {40, 0, 25, 25, -1}, // ViewMode Change. + {75, 0, 25, 25, -1}, // Search. }; }; diff --git a/include/screens/scriptlist.hpp b/include/screens/scriptlist.hpp index 011ee4a..f5c0099 100644 --- a/include/screens/scriptlist.hpp +++ b/include/screens/scriptlist.hpp @@ -59,10 +59,11 @@ private: int keyRepeatDelay = 0; int fastMode = false; - std::vector arrowPos = { + std::vector arrowPos = { {295, 0, 25, 25, -1}, // Arrow Up. {295, 215, 25, 25, -1}, // Arrow Down. {0, 215, 25, 25, -1}, // Back Arrow. + {0, 0, 25, 25, -1}, // viewMode Change }; }; diff --git a/include/screens/tinyDB.hpp b/include/screens/tinyDB.hpp index 77fde15..d5268c5 100644 --- a/include/screens/tinyDB.hpp +++ b/include/screens/tinyDB.hpp @@ -46,10 +46,12 @@ private: mutable int screenPosList = 0; int keyRepeatDelay = 0; int fastMode = false; - std::vector arrowPos = { + std::vector arrowPos = { {295, 0, 25, 25, -1}, // Arrow Up. {295, 215, 25, 25, -1}, // Arrow Down. {0, 215, 25, 25, -1}, // Back Arrow. + {0, 0, 25, 25, -1}, // ViewMode Change. + {40, 0, 25, 25, -1}, // Search. }; }; diff --git a/source/screens/scriptBrowse.cpp b/source/screens/scriptBrowse.cpp index 6fd1f30..8d8699c 100644 --- a/source/screens/scriptBrowse.cpp +++ b/source/screens/scriptBrowse.cpp @@ -128,8 +128,8 @@ void ScriptBrowse::Draw(void) const { Gui::DrawBottom(); Gui::DrawArrow(295, -3); Gui::DrawArrow(315, 242, 180.0); -// Gui::spriteBlend(sprites_search_idx, -3, 0, Config::TxtColor); -// Gui::DrawString(7.5, 1.5, 0.72f, Config::TxtColor, "\uE003"); + Gui::spriteBlend(sprites_view_idx, arrowPos[4].x, arrowPos[4].y); + //Gui::spriteBlend(sprites_search_idx, arrowPos[5].x, arrowPos[5].y); Gui::spriteBlend(sprites_download_all_idx, 0, 0); Gui::DrawArrow(0, 242, 270.0); Gui::DrawStringCentered(-23, 3, 0.6f, Config::TxtColor, std::to_string(selection + 1) + " / " + maxScripts); @@ -288,7 +288,7 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) { fastMode = false; } - if (hDown & KEY_X) { + if (hDown & KEY_X || hDown & KEY_TOUCH && touching(touch, arrowPos[4])) { if (Config::viewMode == 0) { Config::viewMode = 1; } else { diff --git a/source/screens/scriptlist.cpp b/source/screens/scriptlist.cpp index f6931bf..adad82d 100644 --- a/source/screens/scriptlist.cpp +++ b/source/screens/scriptlist.cpp @@ -287,6 +287,8 @@ void ScriptList::DrawList(void) const { Gui::DrawArrow(295, -3); Gui::DrawArrow(315, 242, 180.0); Gui::DrawArrow(0, 242, 270.0); + Gui::spriteBlend(sprites_view_idx, arrowPos[3].x, arrowPos[3].y); + if (Config::viewMode == 0) { for(int i=0;i