wiiu: parse locally installed apps based on xml files

This commit is contained in:
vgmoose 2018-09-23 01:10:17 -04:00
parent c061073b63
commit 8e38e6904a
9 changed files with 27 additions and 12 deletions

View File

@ -5,6 +5,7 @@ VPATH := $(BASEDIR)
GET := ./libs/get/src
RAPIDJSON := ./libs/get/src/libs/rapidjson/include
MINIZIP := ./libs/get/src/libs/minizip
TINYXML := libs/get/src/libs/tinyxml
#---------------------------------------------------------------------------------
# TARGET is the name of the output
@ -14,8 +15,8 @@ MINIZIP := ./libs/get/src/libs/minizip
#---------------------------------------------------------------------------------
TARGET := appstore
BUILD := build
SOURCES := . $(GET) $(MINIZIP) console gui
INCLUDES := -I. -I$(RAPIDJSON) -I$(MINIZIP)
SOURCES := . $(GET) $(MINIZIP) $(TINYXML) console gui
INCLUDES := -I. -I$(RAPIDJSON) -I$(MINIZIP) -I$(TINYXML)
#---------------------------------------------------------------------------------
# options for code generation
@ -54,4 +55,4 @@ include $(WUT_ROOT)/share/wut.mk
PORTLIBS := $(DEVKITPRO)/portlibs/ppc
LDFLAGS += -L$(PORTLIBS)/lib
CFLAGS += -I$(PORTLIBS)/include
CXXFLAGS += -I$(PORTLIBS)/include
CXXFLAGS += -I$(PORTLIBS)/include

View File

@ -44,7 +44,7 @@ make
If all goes well, `appstore.nro` should be sitting in the current directory.
### Building for Wii U (with WUT)
[See here](https://github.com/vgmoose/hb-appstore/pull/19) for info on how to setup the Wii U environment.
[See here](https://github.com/vgmoose/hb-appstore/pull/19) for info on how to setup the Wii U environment. The Wii U build also makes use of the tinyxml library to look up HBL apps that may already be installed.
Once the environment is setup:
```

View File

@ -55,9 +55,9 @@ void Menu::display()
line << cur->title << " (" << cur->version << ")";
console->drawString(15, curPosition, line.str().c_str());
int r = (cur->status == UPDATE)? 0xFF : 0x00;
int r = (cur->status == UPDATE || cur->status == LOCAL)? 0xFF : 0x00;
int g = (cur->status == UPDATE)? 0xF7 : 0xFF;
int b = (cur->status == INSTALLED)? 0xFF : 0x00;
int b = (cur->status == INSTALLED || cur->status == LOCAL)? 0xFF : 0x00;
console->drawColorString(5, curPosition, cur->statusString(), r, g, b);
std::stringstream line2;
@ -90,9 +90,9 @@ void Menu::display()
console->drawString(6, 5, cur->version.c_str());
console->drawString(6, 6, cur->author.c_str());
int r = (cur->status == UPDATE)? 0xFF : 0x00;
int r = (cur->status == UPDATE || cur->status == LOCAL)? 0xFF : 0x00;
int g = (cur->status == UPDATE)? 0xF7 : 0xFF;
int b = (cur->status == INSTALLED)? 0xFF : 0x00;
int b = (cur->status == INSTALLED || cur->status == LOCAL)? 0xFF : 0x00;
console->drawColorString(5, 8, cur->statusString(), r, g, b);
console->drawColorString(5, 12, "Press [A] to install this package", 0xff, 0xff, 0x00);

View File

@ -31,6 +31,9 @@ AppDetails::AppDetails(Package* package, AppList* appList)
case INSTALLED:
action = "Remove";
break;
case LOCAL:
action = "Reinstall";
break;
default:
action = "?";
}

View File

@ -139,7 +139,7 @@ void AppList::update()
this->wipeElements();
// quickly create a vector of "sorted" apps
// (they must be sorted by UPDATE -> INSTALLED -> GET)
// (they must be sorted by UPDATE -> INSTALLED -> LOCAL -> GET)
// TODO: sort this a better way, and also don't use 3 distinct for loops
std::vector<Package*> sorted;
@ -162,6 +162,11 @@ void AppList::update()
for (int x=0; x<packages.size(); x++)
if (packages[x]->status == INSTALLED)
sorted.push_back(packages[x]);
// local
for (int x=0; x<packages.size(); x++)
if (packages[x]->status == LOCAL)
sorted.push_back(packages[x]);
// get
for (int x=0; x<packages.size(); x++)
@ -229,7 +234,7 @@ void AppList::update()
Button* sort = new Button("Adjust Sort", 'y', false, 15);
sort->position(settings->x - 20 - sort->width, settings->y);
// settings->action = std::bind(&AppList::cycleSort, this);
sort->action = std::bind(&AppList::cycleSort, this);
this->elements.push_back(sort);
}
else
@ -241,6 +246,11 @@ void AppList::update()
}
}
void AppList::cycleSort()
{
}
void AppList::toggleKeyboard()
{
if (this->keyboard)

View File

@ -19,6 +19,7 @@ public:
Keyboard* keyboard = NULL;
void toggleKeyboard();
void cycleSort();
bool touchMode = true;

@ -1 +1 @@
Subproject commit a02c63b114dfef92ec4f2014ec12aab32d3ffc61
Subproject commit bdc771074e050c8006df037f92e204f0db3ec3de

View File

@ -8,7 +8,7 @@
#include "libs/get/src/Utils.hpp"
#include "libs/get/src/Get.hpp"
#if defined(__WIIU__)
#if !defined(__WIIU__)
#define DEFAULT_REPO "http://wiiubru.com/appstore"
#else
#define DEFAULT_REPO "http://switchbru.com/appstore"

BIN
res/LOCAL.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

After

Width:  |  Height:  |  Size: 2.7 KiB