Commit 6409c27a authored by vgmoose's avatar vgmoose 🌱
Browse files

Merge branch 'master' into wii

parents ea813a45 cf426990
......@@ -6,10 +6,12 @@ services:
matrix:
include:
- env: PLATFORM=pc
- env: PLATFORM=switch
- env: PLATFORM=pc-sdl1
- env: PLATFORM=wiiu
- env: PLATFORM=switch
- env: PLATFORM=3ds
script:
- docker run -e PLATFORM="$PLATFORM"
-v $(pwd):/code ubuntu:18.10
-v $(pwd):/code ubuntu:18.04
/bin/bash -c "cd /code && ./dependency_helper.sh && ./build.sh"
......@@ -18,7 +18,7 @@ INCLUDES := libs/chesto/src libs/chesto/libs/resinfs/include libs/libget/src lib
RAMFS_DIR := resin
APP_TITLE := HB App Store
APP_DESCRIPTION := Download and manage homebrew apps on your 3DS
APP_DESCRIPTION := Download and manage homebrew apps
APP_AUTHOR := 4TU Team
APP_VERSION := 2.2
ICON := resin/res/icon_small.png
......
# Homebrew App Store
[![GPLv3 License](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat-square)](https://opensource.org/licenses/GPL-3.0) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome!-tomato.svg?style=flat-square)](http://makeapullrequest.com) [![travis](https://img.shields.io/travis/vgmoose/hb-appstore.svg?label=travis&style=flat-square)](https://travis-ci.org/vgmoose/hb-appstore) [![discord](https://img.shields.io/discord/339118412414582786.svg?color=blueviolet&label=discord&style=flat-square)](https://discordapp.com/invite/F2PKpEj) [![twitter](https://img.shields.io/twitter/follow/wiiubru.svg?label=twitter&style=flat-square)](https://twitter.com/wiiubru)
[![GPLv3 License](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat-square)](https://opensource.org/licenses/GPL-3.0)
[![gitlab ci](https://gitlab.com/4TU/hb-appstore/badges/master/pipeline.svg?style=flat-square)](https://gitlab.com/4TU/hb-appstore/pipelines)
[![travis](https://img.shields.io/travis/vgmoose/hb-appstore.svg?label=travis&style=flat-square)](https://travis-ci.org/vgmoose/hb-appstore)
[![Financial Contributors on Open Collective](https://opencollective.com/fortheusers/all/badge.svg?label=financial+contributors&style=flat-square)](https://opencollective.com/fortheusers)
[![discord](https://img.shields.io/discord/339118412414582786.svg?color=blueviolet&label=discord&style=flat-square)](https://discordapp.com/invite/F2PKpEj)
[![twitter](https://img.shields.io/twitter/follow/wiiubru.svg?label=twitter&style=flat-square)](https://twitter.com/wiiubru)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome!-tomato.svg?style=flat-square)](http://makeapullrequest.com)
A graphical frontend to the [get package manager](https://github.com/vgmoose/libget) for downloading and managing homebrew on video game consoles, such as the Nintendo Switch and Wii U. This is a replacement to the older [Wii U Homebrew App Store](https://github.com/vgmoose/wiiu-hbas).
......@@ -106,20 +112,48 @@ cd hb-appstore
make -f Makefile.pc
```
### License
## License
This software is licensed under the GPLv3.
#### Maintainers
> Free software is software that gives you the user the freedom to share, study and modify it. We call this free software because the user is free. - [Free Software Foundation](https://www.fsf.org/about/what-is-free-software)
### Maintainers
- [vgmoose](https://github.com/vgmoose)
- [pwsincd](https://github.com/pwsincd)
- [rw-r-r_0644](https://github.com/rw-r-r-0644)
- [crc32](https://github.com/crc-32)
- [Compucat](https://github.com/compucat)
#### Contributing
## Contributing
If you have some functionality that you'd like to see feel free to discuss it on an [issues page](https://github.com/vgmoose/hb-appstore/issues), or if you already have an implementation or desire that you'd like to see, feel free to fork and make a [pull request](https://github.com/vgmoose/hb-appstore/pulls)!
It's not required, but running a clang-format before making a PR helps to clean up styling issues:
For code contributions, it's not required, but running a clang-format before making a PR helps to clean up styling issues:
```
find . \( -name "*.cpp" -or -name "*.hpp" \) -not -path "./libs/*" -exec clang-format -i {} \;
```
### Contributors
#### Code Contributors
This project exists thanks to all the people who contribute!
<a href="https://github.com/vgmoose/hb-appstore/graphs/contributors"><img src="https://opencollective.com/fortheusers/contributors.svg?width=890&button=false" /></a>
#### Financial Contributors
Become a [financial contributor](https://opencollective.com/fortheusers/contribute) and help us sustain our community!
<a href="https://opencollective.com/hb-appstore"><img src="https://opencollective.com/fortheusers/individuals.svg?width=890"></a>
#### Organizations
Support this project with your organization. Your logo will show up here with a link to your website.
<a href="https://opencollective.com/fortheusers/organization/0/website"><img src="https://opencollective.com/fortheusers/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/fortheusers/organization/1/website"><img src="https://opencollective.com/fortheusers/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/fortheusers/organization/2/website"><img src="https://opencollective.com/fortheusers/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/fortheusers/organization/3/website"><img src="https://opencollective.com/fortheusers/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/fortheusers/organization/4/website"><img src="https://opencollective.com/fortheusers/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/fortheusers/organization/5/website"><img src="https://opencollective.com/fortheusers/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/fortheusers/organization/6/website"><img src="https://opencollective.com/fortheusers/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/fortheusers/organization/7/website"><img src="https://opencollective.com/fortheusers/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/fortheusers/organization/8/website"><img src="https://opencollective.com/fortheusers/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/fortheusers/organization/9/website"><img src="https://opencollective.com/fortheusers/organization/9/avatar.svg"></a>
......@@ -2,7 +2,7 @@
#include "AppList.hpp"
#include "MainDisplay.hpp"
#define TEXT_SIZE 13
#define TEXT_SIZE 13 / SCALER
CST_Color AppCard::gray = { 80, 80, 80, 0xff };
CST_Color AppCard::black = { 0, 0, 0, 0xff };
......@@ -22,7 +22,7 @@ AppCard::AppCard(Package* package, AppList* list)
, statusicon((RAMFS "res/" + std::string(package->statusString()) + ".png").c_str())
{
// fixed width+height of one app card
this->width = 256;
this->width = 256; // + 9px margins
this->height = ICON_SIZE + 45;
this->touchable = true;
......@@ -31,12 +31,21 @@ AppCard::AppCard(Package* package, AppList* list)
this->action = std::bind(&AppCard::displaySubscreen, this);
// create the layout of the app card (all relative)
icon.resize(256, ICON_SIZE);
statusicon.resize(30, 30);
#if defined(_3DS) || defined(_3DS_MOCK)
icon.resize(ICON_SIZE, ICON_SIZE);
this->width = 85;
#else
icon.resize(256, ICON_SIZE);
#endif
statusicon.resize(30 / SCALER, 30 / SCALER);
super::append(&icon);
#if !defined(_3DS) && !defined(_3DS_MOCK)
super::append(&version);
super::append(&status);
#endif
super::append(&appname);
super::append(&author);
super::append(&statusicon);
......@@ -52,11 +61,13 @@ void AppCard::update()
version.position(this->x + 40, this->y + icon.height + 10);
status.position(this->x + 40, this->y + icon.height + 25);
int spacer = this->width - 11; // 245 on 720p
appname.getTextureSize(&w, &h);
appname.position(this->x + 245 - w, this->y + icon.height + 5);
appname.position(this->x + spacer - w, this->y + icon.height + 5);
author.getTextureSize(&w, &h);
author.position(this->x + 245 - w, this->y + icon.height + 25);
author.position(this->x + spacer - w, this->y + icon.height + 25);
statusicon.position(this->x + 4, this->y + icon.height + 10);
}
......@@ -88,7 +99,9 @@ void AppCard::render(Element* parent)
this->yOff = parent->y;
// TODO: don't render this card if it's going to be offscreen anyway according to the parent (AppList)
// if (((AppList*)parent)->scrollOffset)
CST_Rect rect = { this->xOff + this->x, this->yOff + this->y, this->width, this->height };
if (CST_isRectOffscreen(&rect))
return;
// render all the subelements of this card
super::render(parent);
......
......@@ -23,11 +23,11 @@ AppDetails::AppDetails(Package* package, AppList* appList)
, get(appList->get)
, appList(appList)
, downloadProgress()
, download(getAction(package), A_BUTTON, true, 30)
, cancel("Cancel", B_BUTTON, true, 30, download.width)
, download(getAction(package), A_BUTTON, true, 30 / SCALER)
, cancel("Cancel", B_BUTTON, true, 30 / SCALER, download.width)
, details(getPackageDetails(package).c_str(), 20, &white, false, 300)
, content(package, appList->useBannerIcons)
, downloadStatus("Download Status", 30, &white)
, downloadStatus("Download Status", 30 / SCALER, &white)
{
// TODO: show current app status somewhere
......@@ -39,6 +39,11 @@ AppDetails::AppDetails(Package* package, AppList* appList)
cancel.position(970, 630);
cancel.action = std::bind(&AppDetails::back, this);
#if defined(_3DS) || defined(_3DS_MOCK)
download.position(SCREEN_WIDTH / 2 - download.width / 2, 360);
cancel.position(SCREEN_WIDTH / 2 - cancel.width / 2, 410);
#endif
#if defined(SWITCH)
// display an additional launch/install button if the package is installed, and has a binary or is a theme
......@@ -73,9 +78,6 @@ AppDetails::AppDetails(Package* package, AppList* appList)
}
#endif
super::append(&download);
super::append(&cancel);
// more details
details.position(940, 50);
......@@ -86,13 +88,16 @@ AppDetails::AppDetails(Package* package, AppList* appList)
content.reportIssue.action = std::bind(&AppDetails::leaveFeedback, this);
super::append(&content);
downloadProgress.width = 740;
downloadProgress.position(1280 / 2 - downloadProgress.width / 2, 720 / 2 - 5);
super::append(&download);
super::append(&cancel);
downloadProgress.width = PANE_WIDTH;
downloadProgress.position(SCREEN_WIDTH / 2 - downloadProgress.width / 2, PANE_WIDTH / 2 - 5);
downloadProgress.color = 0xff0000ff;
downloadProgress.dimBg = true;
// download informations (not visible until the download is started)
downloadStatus.position(1280 / 2 - downloadProgress.width / 2, 720 / 2 - 70);
downloadStatus.position(SCREEN_WIDTH / 2 - downloadProgress.width / 2, PANE_WIDTH / 2 - 70 / SCALER);
}
AppDetails::~AppDetails()
......@@ -355,7 +360,7 @@ void AppDetails::render(Element* parent)
this->parent = parent;
// draw white background
CST_Rect dimens = { 0, 0, 920, 720 };
CST_Rect dimens = { 0, 0, 920, PANE_WIDTH };
CST_Color white = { 0xff, 0xff, 0xff, 0xff };
......@@ -442,8 +447,8 @@ AppDetailsContent::AppDetailsContent(Package *package, bool useBannerIcons)
, moreByAuthor("More by Author", X_BUTTON)
, title(package->title.c_str(), 35, &black)
, title2(package->author.c_str(), 27, &gray)
, details(package->long_desc.c_str(), 20, &black, false, 740)
, changelog((std::string("Changelog:\n") + package->changelog).c_str(), 20, &black, false, 740)
, details(package->long_desc.c_str(), 20 / SCALER, &black, false, PANE_WIDTH + 20 / SCALER)
, changelog((std::string("Changelog:\n") + package->changelog).c_str(), 20 / SCALER, &black, false, PANE_WIDTH + 20 / SCALER)
, banner(useBannerIcons ? package->getBannerUrl().c_str() : package->getIconUrl().c_str(), [package]{
// If the banner fails to load, use an icon banner
NetImageElement* icon = new NetImageElement(package->getIconUrl().c_str(), []{
......@@ -468,18 +473,18 @@ AppDetailsContent::AppDetailsContent(Package *package, bool useBannerIcons)
if (!useBannerIcons)
banner.setScaleMode(SCALE_PROPORTIONAL_WITH_BG);
banner.resize(787, 193);
banner.position(BANNER_X, BANNER_Y);
banner.resize(767 / SCALER, 193 / SCALER);
banner.position(BANNER_X / SCALER, BANNER_Y);
super::append(&banner);
title2.position(MARGIN, 80);
super::append(&title2);
// the main description (wrapped text)
details.position(MARGIN + 30, banner.y + banner.height + 22);
details.position((MARGIN / SCALER + 30), banner.y + banner.height + 22);
super::append(&details);
changelog.position(MARGIN + 30, details.y + details.height + 30);
changelog.position((MARGIN / SCALER + 30), details.y + details.height + 30);
super::append(&changelog);
}
......
......@@ -86,8 +86,6 @@ public:
ProgressBar downloadProgress;
private:
Button download;
Button cancel;
#if defined(SWITCH)
Button* start = nullptr;
TextElement* errorText = nullptr;
......@@ -95,6 +93,9 @@ private:
TextElement details;
AppDetailsContent content;
TextElement downloadStatus;
Button download;
Button cancel;
};
......
......@@ -288,6 +288,10 @@ void AppList::update()
if (!get)
return;
#if defined(_3DS) || defined(_3DS_MOCK)
R = 3; // force 3 app cards at time
this->x = 45; // no sidebar
#endif
// remove elements
super::removeAll();
......@@ -336,15 +340,20 @@ void AppList::update()
appCards.emplace_back(package, this);
AppCard& card = appCards.back();
card.index = appCards.size() - 1;
card.position(25 + (card.index % R) * 265, 145 + (card.height + 15) * (card.index / R));
card.position(25 + (card.index % R) * (card.width + 9 / SCALER), 145 + (card.height + 15) * (card.index / R));
card.update();
super::append(&card);
}
totalCount = appCards.size();
// add quit button
quitBtn.position(720 + 260 * (R - 3), 70);
quitBtn.position(SCREEN_HEIGHT + 260 * (R - 3), 70);
#if defined(_3DS) || defined(_3DS_MOCK)
quitBtn.position(SCREEN_WIDTH - quitBtn.width - 5, 20);
#else
super::append(&quitBtn);
#endif
// update the view for the current category
if (curCategoryValue == "_search")
......
......@@ -5,8 +5,10 @@
#include "../libs/chesto/src/RootDisplay.hpp"
#ifndef NETWORK_MOCK
#include <curl/curl.h>
#include <curl/easy.h>
#endif
Feedback::Feedback(Package* package)
: package(package)
......@@ -23,7 +25,11 @@ Feedback::Feedback(Package* package)
super::append(&title);
icon.position(50, 160);
#if defined(_3DS) || defined(_3DS_MOCK)
icon.resize(ICON_SIZE, ICON_SIZE);
#else
icon.resize(256, ICON_SIZE);
#endif
super::append(&icon);
keyboard.inputCallback = std::bind(&Feedback::keyboardInputCallback, this);
......@@ -73,6 +79,7 @@ void Feedback::keyboardInputCallback()
void Feedback::submit()
{
#ifndef NETWORK_MOCK
CURL* curl;
CURLcode res;
......@@ -94,6 +101,7 @@ void Feedback::submit()
/* always cleanup */
curl_easy_cleanup(curl);
}
#endif
// close this window
this->back();
......
......@@ -50,6 +50,11 @@ bool MainDisplay::process(InputEvents* event)
spinner->resize(90, 90);
super::append(spinner);
#if defined(_3DS) || defined(_3DS_MOCK)
spinner->resize(40, 40);
spinner->position(SCREEN_WIDTH / 2 - spinner->width / 2, 70);
#endif
networking_callback = MainDisplay::updateLoader;
// fetch repositories metadata
......
......@@ -9,12 +9,6 @@
#include <SDL2/SDL_mixer.h>
#endif
#if defined(__WIIU__)
#define ICON_SIZE 90
#else
#define ICON_SIZE 150
#endif
class MainDisplay : public RootDisplay
{
public:
......
......@@ -103,6 +103,7 @@ bool Sidebar::process(InputEvents* event)
if (this->highlighted >= TOTAL_CATS) this->highlighted = TOTAL_CATS - 1;
}
#if !defined(_3DS) && !defined(_3DS_MOCK)
// saw click down, set dragging state
if (event->isTouchDown())
{
......@@ -125,6 +126,7 @@ bool Sidebar::process(InputEvents* event)
return true;
}
#endif
// detect if a click is on one of the sidebar elements
// (or we saw the A button be pressed)
......@@ -167,6 +169,10 @@ bool Sidebar::process(InputEvents* event)
void Sidebar::render(Element* parent)
{
#if defined(_3DS) || defined(_3DS_MOCK)
// no sidebar on 3ds
return;
#endif
// draw the light gray bg behind the active category
CST_Rect dimens = { 0, 0, 400 - 260 * (appList->R - 3) - 35, 60 }; // TODO: extract this to a method too
dimens.y = 150 + this->curCategory * 70 - 15; // TODO: extract formula into method
......
Subproject commit 22256f8716a434fd917eebaf4f4316f08bcb8d7e
Subproject commit aa3e8cbeaa679ee60ea97d3feacdd722fdee90ab
Subproject commit 343f4bce9d52bb74e00bb9c3d742d14447daea41
Subproject commit 0d403f680d82a93faabcf3e0129cf308efed990c
......@@ -85,6 +85,8 @@ int main(int argc, char* argv[])
while (events->update()) {
cliMode |= (events->held(L_BUTTON) || events->held(R_BUTTON));
}
// small delay for recovery mode input
CST_Delay(16);
}
......
......@@ -2,7 +2,7 @@
#if defined(__WIIU__)
#define DEFAULT_REPO "https://wiiubru.com/appstore"
#elif defined(_3DS)
#elif defined(_3DS) || defined(_3DS_MOCK)
#define DEFAULT_REPO "https://3ds.apps.fortheusers.org"
#else
#define DEFAULT_REPO "https://switchbru.com/appstore"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment