UniStore list and screenshots (#54)

* Initial push.

* Fix png loading

* Remove unneeded casts

* Push my progress.

* Improve screenshot display

* Hopefully last commit here before merge?

Co-authored-by: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com>
This commit is contained in:
Pk11
2020-12-02 14:23:15 -06:00
committed by GitHub
parent 2e2acf819e
commit 78d0dad604
38 changed files with 9213 additions and 106 deletions
+39 -1
View File
@@ -27,6 +27,7 @@
#include "download.hpp"
#include "fileBrowse.hpp"
#include "mainScreen.hpp"
#include "screenshot.hpp"
#include "storeUtils.hpp"
#include <unistd.h>
@@ -104,6 +105,12 @@ MainScreen::MainScreen() {
MainScreen Main Draw.
*/
void MainScreen::Draw(void) const {
if (this->storeMode == 5) {
/* Screenshot Menu. */
StoreUtils::DrawScreenshotMenu(this->Screenshot, this->screenshotIndex, this->screenshotFetch, this->sSize, this->screenshotName, this->zoom);
return;
}
Gui::ScreenDraw(Top);
Gui::Draw_Rect(0, 0, 400, 25, BAR_COLOR);
Gui::Draw_Rect(0, 25, 400, 1, BAR_OUTL_COLOR);
@@ -152,6 +159,37 @@ void MainScreen::Draw(void) const {
MainScreen Logic.
*/
void MainScreen::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
if (this->storeMode == 5) {
if (this->screenshotFetch) {
/* Delete Texture first. */
if (this->Screenshot.tex) {
C3D_TexDelete(this->Screenshot.tex);
this->Screenshot.tex = nullptr;
this->Screenshot.subtex = nullptr;
}
this->screenshotName = "";
if (this->screenshotIndex < (int)this->entries[this->store->GetEntry()]->GetScreenshotNames().size()) {
this->screenshotName = this->entries[this->store->GetEntry()]->GetScreenshotNames()[this->screenshotIndex];
}
this->sSize = 0;
this->sSize = this->entries[this->store->GetEntry()]->GetScreenshots().size();
if (this->screenshotIndex < this->sSize) {
if (this->sSize > 0) {
this->Screenshot = FetchScreenshot(this->entries[this->store->GetEntry()]->GetScreenshots()[this->screenshotIndex]);
}
}
this->screenshotFetch = false;
}
StoreUtils::ScreenshotMenu(this->Screenshot, this->screenshotIndex, this->screenshotFetch, this->storeMode, this->sSize, this->zoom);
return;
}
if (this->showMarks) StoreUtils::MarkHandle(this->entries[this->store->GetEntry()], this->store, this->showMarks, this->meta);
if (!this->showMarks) {
@@ -181,7 +219,7 @@ void MainScreen::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
switch(this->storeMode) {
case 0:
if (this->store && this->store->GetValid()) StoreUtils::EntryHandle(this->showMarks, this->fetchDown);
if (this->store && this->store->GetValid()) StoreUtils::EntryHandle(this->showMarks, this->fetchDown, this->screenshotFetch, this->storeMode);
break;
case 1: