- Allow users to enable/disable plugin in the loader
- Fix some memory leaks - Add assets needed to display plugins
@ -35,6 +35,7 @@ TARGET := wiiupluginloader
|
|||||||
BUILD := build
|
BUILD := build
|
||||||
BUILD_DBG := $(TARGET)_dbg
|
BUILD_DBG := $(TARGET)_dbg
|
||||||
SOURCES := src/common \
|
SOURCES := src/common \
|
||||||
|
src/custom/gui \
|
||||||
src/libelf \
|
src/libelf \
|
||||||
src/menu/content \
|
src/menu/content \
|
||||||
src/menu \
|
src/menu \
|
||||||
|
BIN
loader/data/images/gameSettingsButton.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
loader/data/images/gameSettingsButtonEx.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
loader/data/images/gameSettingsButtonExHighlighted.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
loader/data/images/gameSettingsButtonExSelected.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
loader/data/images/gameSettingsButtonSelected.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
loader/data/images/switchIconBase.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
loader/data/images/switchIconBaseHighlighted.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
loader/data/images/switchIconOff.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
loader/data/images/switchIconOn.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
loader/data/sounds/settings_click_2.mp3
Normal file
@ -1,3 +1,6 @@
|
|||||||
|
msgid "Language"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
# English translations for Wii U Plugin System loader
|
# English translations for Wii U Plugin System loader
|
||||||
# This file is distributed under the same license as the PACKAGE package.
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -13,14 +16,14 @@ msgstr ""
|
|||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: src/menu/content/ContentHome.cpp:20
|
#: src/menu/content/ContentHome.cpp:23
|
||||||
msgid "Welcome to the Wii U plugin loader"
|
msgid "Welcome to the Wii U plugin loader"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/menu/content/ContentHome.cpp:29
|
#: src/menu/content/ContentHome.cpp:32
|
||||||
msgid "Exit to HBL "
|
msgid "Exit to HBL "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/menu/content/ContentHome.cpp:32
|
#: src/menu/content/ContentHome.cpp:35
|
||||||
msgid "Apply Patches"
|
msgid "Apply Patches"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -183,6 +183,14 @@ void Application::executeThread(void) {
|
|||||||
|
|
||||||
if(controller[i]->data.buttons_d & VPAD_BUTTON_PLUS) {
|
if(controller[i]->data.buttons_d & VPAD_BUTTON_PLUS) {
|
||||||
exitCode = APPLICATION_CLOSE_APPLY;
|
exitCode = APPLICATION_CLOSE_APPLY;
|
||||||
|
if(linkPluginsCallback != NULL) {
|
||||||
|
bool result = linkPluginsCallback();
|
||||||
|
if(!result) {
|
||||||
|
// On linking errors return to the HBL.
|
||||||
|
#warning TODO: proper error handling when linking fails.
|
||||||
|
exitCode = APPLICATION_CLOSE_MIIMAKER;
|
||||||
|
}
|
||||||
|
}
|
||||||
exitApplication = true;
|
exitApplication = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#define _APPLICATION_H
|
#define _APPLICATION_H
|
||||||
|
|
||||||
#include "menu/MainWindow.h"
|
#include "menu/MainWindow.h"
|
||||||
|
#include <functional>
|
||||||
#include <video/CVideo.h>
|
#include <video/CVideo.h>
|
||||||
#include <system/CThread.h>
|
#include <system/CThread.h>
|
||||||
#include <language/gettext.h>
|
#include <language/gettext.h>
|
||||||
@ -61,6 +62,11 @@ public:
|
|||||||
exitCode = code;
|
exitCode = code;
|
||||||
exitApplication = true;
|
exitApplication = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setLinkPluginsCallback(std::function<bool(void)> fun) {
|
||||||
|
linkPluginsCallback = fun;
|
||||||
|
DEBUG_FUNCTION_LINE("Set callback to %08X \n",linkPluginsCallback);
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
Application();
|
Application();
|
||||||
|
|
||||||
@ -80,6 +86,7 @@ private:
|
|||||||
MainWindow *mainWindow;
|
MainWindow *mainWindow;
|
||||||
GuiController *controller[5];
|
GuiController *controller[5];
|
||||||
int32_t exitCode;
|
int32_t exitCode;
|
||||||
|
std::function<bool(void)> linkPluginsCallback = NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //_APPLICATION_H
|
#endif //_APPLICATION_H
|
||||||
|
52
loader/src/custom/gui/DefaultGuiSelectBox.cpp
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (C) 2017 Maschell
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DefaultGuiSelectBox.h"
|
||||||
|
/**
|
||||||
|
* Constructor for the DefaultGuiSelectBox class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DefaultGuiSelectBox::DefaultGuiSelectBox(std::string caption, GuiFrame *parent)
|
||||||
|
: GuiSelectBox(NULL,caption)
|
||||||
|
,topBackgroundImg_imgdata(Resources::GetImageData("gameSettingsButton.png"))
|
||||||
|
,topBackgroundImg_img(topBackgroundImg_imgdata)
|
||||||
|
,topHighlightedImg_imgdata(Resources::GetImageData("gameSettingsButtonSelected.png"))
|
||||||
|
,topHighlightedImg_img(topHighlightedImg_imgdata)
|
||||||
|
,valueImageData(Resources::GetImageData("gameSettingsButtonEx.png"))
|
||||||
|
,valueSelectedImageData(Resources::GetImageData("gameSettingsButtonExSelected.png"))
|
||||||
|
,valueHighlightedImageData(Resources::GetImageData("gameSettingsButtonExHighlighted.png"))
|
||||||
|
,buttonClickSound(Resources::GetSound("settings_click_2.mp3"))
|
||||||
|
{
|
||||||
|
setSize(topBackgroundImg_img.getWidth(),topBackgroundImg_img.getHeight());
|
||||||
|
this->setImageTopBackground(&topBackgroundImg_img);
|
||||||
|
this->setImageTopHighlighted(&topHighlightedImg_img);
|
||||||
|
this->setImageValueBackground(valueImageData);
|
||||||
|
this->setImageValueHighlighted(valueHighlightedImageData);
|
||||||
|
this->setImageValueSelected(valueSelectedImageData);
|
||||||
|
this->setSoundClick(buttonClickSound);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destructor for the DefaultGuiSelectBox class.
|
||||||
|
*/
|
||||||
|
DefaultGuiSelectBox::~DefaultGuiSelectBox()
|
||||||
|
{
|
||||||
|
Resources::RemoveImageData(topBackgroundImg_imgdata);
|
||||||
|
Resources::RemoveImageData(topHighlightedImg_imgdata);
|
||||||
|
Resources::RemoveImageData(valueImageData);
|
||||||
|
Resources::RemoveImageData(valueSelectedImageData);
|
||||||
|
Resources::RemoveImageData(valueHighlightedImageData);
|
||||||
|
Resources::RemoveSound(buttonClickSound);
|
||||||
|
}
|
45
loader/src/custom/gui/DefaultGuiSelectBox.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (C) 2017 Maschell
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DEFAULT_GUI_SELECTBOX_H_
|
||||||
|
#define DEFAULT_GUI_SELECTBOX_H_
|
||||||
|
|
||||||
|
#include <gui/GuiSelectBox.h>
|
||||||
|
|
||||||
|
//!A simple select box with default values.
|
||||||
|
class DefaultGuiSelectBox : public GuiSelectBox{
|
||||||
|
public:
|
||||||
|
//!Constructor
|
||||||
|
//!\param checked Checked
|
||||||
|
DefaultGuiSelectBox(std::string caption, GuiFrame *parent = NULL);
|
||||||
|
//!Destructor
|
||||||
|
virtual ~DefaultGuiSelectBox();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
GuiImageData * topBackgroundImg_imgdata;
|
||||||
|
GuiImage topBackgroundImg_img;
|
||||||
|
|
||||||
|
GuiImageData * topHighlightedImg_imgdata;
|
||||||
|
GuiImage topHighlightedImg_img;
|
||||||
|
|
||||||
|
GuiImageData * valueImageData;
|
||||||
|
GuiImageData * valueSelectedImageData;
|
||||||
|
GuiImageData * valueHighlightedImageData;
|
||||||
|
|
||||||
|
GuiSound * buttonClickSound;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
48
loader/src/custom/gui/DefaultGuiSwitch.cpp
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (C) 2017 Maschell
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
****************************************************************************/
|
||||||
|
#include "DefaultGuiSwitch.h"
|
||||||
|
/**
|
||||||
|
* Constructor for the DefaultGuiSwitch class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DefaultGuiSwitch::DefaultGuiSwitch(bool checked)
|
||||||
|
: GuiSwitch(NULL,checked)
|
||||||
|
,switchbase_imgdata(Resources::GetImageData("switchIconBase.png"))
|
||||||
|
,switchbase_img(switchbase_imgdata)
|
||||||
|
,switchbase_highlighted_imgdata(Resources::GetImageData("switchIconBaseHighlighted.png"))
|
||||||
|
,switchbase_highlighted_img(switchbase_highlighted_imgdata)
|
||||||
|
,switchOn_imgdata(Resources::GetImageData("switchIconOn.png"))
|
||||||
|
,switchOn_img(switchOn_imgdata)
|
||||||
|
,switchOff_imgdata(Resources::GetImageData("switchIconOff.png"))
|
||||||
|
,switchOff_img(switchOff_imgdata)
|
||||||
|
{
|
||||||
|
setSize(switchbase_img.getWidth(),switchbase_img.getHeight());
|
||||||
|
this->setImageBackground(&switchbase_img);
|
||||||
|
this->setImageHighlighted(&switchbase_highlighted_img);
|
||||||
|
this->setImageOn(&switchOn_img);
|
||||||
|
this->setImageOff(&switchOff_img);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Destructor for the DefaultGuiSwitch class.
|
||||||
|
*/
|
||||||
|
DefaultGuiSwitch::~DefaultGuiSwitch()
|
||||||
|
{
|
||||||
|
Resources::RemoveImageData(switchbase_imgdata);
|
||||||
|
Resources::RemoveImageData(switchbase_highlighted_imgdata);
|
||||||
|
Resources::RemoveImageData(switchOn_imgdata);
|
||||||
|
Resources::RemoveImageData(switchOff_imgdata);
|
||||||
|
}
|
45
loader/src/custom/gui/DefaultGuiSwitch.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* Copyright (C) 2017 Maschell
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef DEFAULT_GUI_SWTICH_H_
|
||||||
|
#define DEFAULT_GUI_SWTICH_H_
|
||||||
|
|
||||||
|
#include <gui/GuiSwitch.h>
|
||||||
|
|
||||||
|
//!A simple switch
|
||||||
|
class DefaultGuiSwitch : public GuiSwitch{
|
||||||
|
public:
|
||||||
|
//!Constructor
|
||||||
|
//!\param checked Checked
|
||||||
|
DefaultGuiSwitch(bool checked);
|
||||||
|
//!Destructor
|
||||||
|
virtual ~DefaultGuiSwitch();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
GuiImageData * switchbase_imgdata = NULL;
|
||||||
|
GuiImage switchbase_img;
|
||||||
|
|
||||||
|
GuiImageData * switchbase_highlighted_imgdata = NULL;
|
||||||
|
GuiImage switchbase_highlighted_img;
|
||||||
|
|
||||||
|
GuiImageData * switchOn_imgdata = NULL;
|
||||||
|
GuiImage switchOn_img;
|
||||||
|
|
||||||
|
GuiImageData * switchOff_imgdata = NULL;
|
||||||
|
GuiImage switchOff_img;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -107,9 +107,10 @@ extern "C" int32_t Menu_Main(int32_t argc, char **argv) {
|
|||||||
|
|
||||||
DynamicLinkingHelper::getInstance()->clearAll();
|
DynamicLinkingHelper::getInstance()->clearAll();
|
||||||
|
|
||||||
PluginLoader * pluginLoader = PluginLoader::getInstance();
|
//PluginLoader * pluginLoader = PluginLoader::getInstance();
|
||||||
std::vector<PluginInformation *> pluginList = pluginLoader->getPluginInformation("sd:/wiiu/plugins/");
|
//std::vector<PluginInformation *> pluginList = pluginLoader->getPluginInformation("sd:/wiiu/plugins/");
|
||||||
pluginLoader->loadAndLinkPlugins(pluginList);
|
//pluginLoader->loadAndLinkPlugins(pluginList);
|
||||||
|
//pluginLoader->clearPluginInformation(pluginList);
|
||||||
|
|
||||||
//!*******************************************************************
|
//!*******************************************************************
|
||||||
//! Initialize heap memory *
|
//! Initialize heap memory *
|
||||||
@ -145,8 +146,6 @@ extern "C" int32_t Menu_Main(int32_t argc, char **argv) {
|
|||||||
OSFatal("fillRelocations failed.");
|
OSFatal("fillRelocations failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!isInMiiMakerHBL()) {
|
if(!isInMiiMakerHBL()) {
|
||||||
DEBUG_FUNCTION_LINE("Apply patches.\n");
|
DEBUG_FUNCTION_LINE("Apply patches.\n");
|
||||||
ApplyPatchesAndCallHookStartingApp();
|
ApplyPatchesAndCallHookStartingApp();
|
||||||
@ -166,12 +165,9 @@ extern "C" int32_t Menu_Main(int32_t argc, char **argv) {
|
|||||||
DEBUG_FUNCTION_LINE("<----------------- COPY PASTE ME END -----------------> \n");
|
DEBUG_FUNCTION_LINE("<----------------- COPY PASTE ME END -----------------> \n");
|
||||||
DEBUG_FUNCTION_LINE("<-----------------------------------------------------> \n");
|
DEBUG_FUNCTION_LINE("<-----------------------------------------------------> \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return EXIT_RELAUNCH_ON_LOAD;
|
return EXIT_RELAUNCH_ON_LOAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(result == APPLICATION_CLOSE_APPLY || result == APPLICATION_CLOSE_APPLY_MEMORY) {
|
if(result == APPLICATION_CLOSE_APPLY || result == APPLICATION_CLOSE_APPLY_MEMORY) {
|
||||||
CallHook(WUPS_LOADER_HOOK_INIT_KERNEL);
|
CallHook(WUPS_LOADER_HOOK_INIT_KERNEL);
|
||||||
CallHook(WUPS_LOADER_HOOK_INIT_FS);
|
CallHook(WUPS_LOADER_HOOK_INIT_FS);
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "ContentHome.h"
|
#include "ContentHome.h"
|
||||||
|
#include "plugin/PluginLoader.h"
|
||||||
|
#include "custom/gui/DefaultGuiSwitch.h"
|
||||||
|
#include "Application.h"
|
||||||
|
|
||||||
ContentHome::ContentHome():ContentTemplate()
|
ContentHome::ContentHome():ContentTemplate()
|
||||||
, welcomeHeadLineLabel(gettext("Welcome to the Wii U plugin loader"))
|
, welcomeHeadLineLabel(gettext("Welcome to the Wii U plugin loader"))
|
||||||
@ -29,7 +32,10 @@ ContentHome::ContentHome():ContentTemplate()
|
|||||||
, exitHome(gettext("Exit to HBL "))
|
, exitHome(gettext("Exit to HBL "))
|
||||||
, plusbutton_imgdata(Resources::GetImageData("PlusButtonIcon.png"))
|
, plusbutton_imgdata(Resources::GetImageData("PlusButtonIcon.png"))
|
||||||
, plusbutton_img(plusbutton_imgdata)
|
, plusbutton_img(plusbutton_imgdata)
|
||||||
, exitPlus(gettext("Apply Patches")) {
|
, exitPlus(gettext("Apply Patches"))
|
||||||
|
, touchTrigger(GuiTrigger::CHANNEL_1, GuiTrigger::VPAD_TOUCH)
|
||||||
|
, wpadTouchTrigger(GuiTrigger::CHANNEL_2 | GuiTrigger::CHANNEL_3 | GuiTrigger::CHANNEL_4 | GuiTrigger::CHANNEL_5, GuiTrigger::BUTTON_A)
|
||||||
|
, buttonClickSound(Resources::GetSound("settings_click_2.mp3")) {
|
||||||
glm::vec4 textColor = glm::vec4(1.0f,1.0f,1.0f,1.0f);
|
glm::vec4 textColor = glm::vec4(1.0f,1.0f,1.0f,1.0f);
|
||||||
|
|
||||||
homebutton_img.setAlignment(ALIGN_LEFT);
|
homebutton_img.setAlignment(ALIGN_LEFT);
|
||||||
@ -72,6 +78,70 @@ ContentHome::ContentHome():ContentTemplate()
|
|||||||
URLLabel.setAlignment(ALIGN_BOTTOM|ALIGN_LEFT);
|
URLLabel.setAlignment(ALIGN_BOTTOM|ALIGN_LEFT);
|
||||||
URLLabel.setPosition(280,50);
|
URLLabel.setPosition(280,50);
|
||||||
|
|
||||||
|
PluginLoader * pluginLoader = PluginLoader::getInstance();
|
||||||
|
std::vector<PluginInformation *> pluginList = pluginLoader->getPluginInformation("sd:/wiiu/plugins/");
|
||||||
|
std::vector<PluginInformation *> pluginListLoaded = pluginLoader->getPluginsLoadedInMemory();
|
||||||
|
|
||||||
|
pluginsFrame.setAlignment(ALIGN_TOP_CENTER);
|
||||||
|
pluginsFrame.setPosition(0,-80);
|
||||||
|
pluginsFrame.setSize(getWidth(),getHeight());
|
||||||
|
append(&pluginsFrame);
|
||||||
|
|
||||||
|
float frameoffset = 0;
|
||||||
|
float frameheight = 50.0f;
|
||||||
|
for (std::vector<PluginInformation *>::iterator it = pluginList.begin() ; it != pluginList.end(); ++it) {
|
||||||
|
PluginInformation * curPlugin = *it;
|
||||||
|
|
||||||
|
DefaultGuiSwitch * element = new DefaultGuiSwitch(false);
|
||||||
|
element->setTrigger(&touchTrigger);
|
||||||
|
element->setTrigger(&wpadTouchTrigger);
|
||||||
|
element->setSoundClick(buttonClickSound);
|
||||||
|
element->valueChanged.connect(this, &ContentHome::OnValueChanged);
|
||||||
|
|
||||||
|
for (std::vector<PluginInformation *>::iterator itOther = pluginListLoaded.begin() ; itOther != pluginListLoaded.end(); ++itOther) {
|
||||||
|
PluginInformation * otherPlugin = *itOther;
|
||||||
|
if(otherPlugin->getName().compare(curPlugin->getName()) == 0) {
|
||||||
|
element->setValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pluginMapping[element] = curPlugin;
|
||||||
|
|
||||||
|
GuiFrame * frame = new GuiFrame();
|
||||||
|
GuiFrame * left = new GuiFrame();
|
||||||
|
GuiFrame * right = new GuiFrame();
|
||||||
|
|
||||||
|
frame->append(left);
|
||||||
|
frame->append(right);
|
||||||
|
frame->setAlignment(ALIGN_TOP_CENTER);
|
||||||
|
frame->setSize(getWidth()*0.80f,frameheight);
|
||||||
|
|
||||||
|
GuiText * text = new GuiText(curPlugin->getName().c_str());
|
||||||
|
text->setColor(glm::vec4(0.3f,0.3f,0.3f,1.0f));
|
||||||
|
text->setFontSize(40);
|
||||||
|
text->setColor(textColor);
|
||||||
|
text->setAlignment(ALIGN_LEFT);
|
||||||
|
left->append(text);
|
||||||
|
left->setAlignment(ALIGN_LEFT);
|
||||||
|
right->setAlignment(ALIGN_RIGHT);
|
||||||
|
element->setAlignment(ALIGN_RIGHT);
|
||||||
|
element->setPosition(0,10);
|
||||||
|
element->setScale(2.0f);
|
||||||
|
|
||||||
|
right->append(element);
|
||||||
|
|
||||||
|
frameoffset -= frameheight;
|
||||||
|
frame->setPosition(0,frameoffset);
|
||||||
|
pluginsFrame.append(frame);
|
||||||
|
|
||||||
|
toDelete.push_back(element);
|
||||||
|
toDelete.push_back(frame);
|
||||||
|
toDelete.push_back(left);
|
||||||
|
toDelete.push_back(right);
|
||||||
|
toDelete.push_back(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
pluginLoader->clearPluginInformation(pluginListLoaded);
|
||||||
|
|
||||||
append(&welcomeHeadLineLabel);
|
append(&welcomeHeadLineLabel);
|
||||||
append(&twitterLogoImage);
|
append(&twitterLogoImage);
|
||||||
append(&githubLogoImage);
|
append(&githubLogoImage);
|
||||||
@ -79,6 +149,28 @@ ContentHome::ContentHome():ContentTemplate()
|
|||||||
append(&URLLabel);
|
append(&URLLabel);
|
||||||
append(&exitHomeFrame);
|
append(&exitHomeFrame);
|
||||||
append(&exitPlusFrame);
|
append(&exitPlusFrame);
|
||||||
|
|
||||||
|
auto fp = std::bind(&ContentHome::linkPlugins, this);
|
||||||
|
Application::instance()->setLinkPluginsCallback(fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ContentHome::OnValueChanged(GuiToggle * toggle,bool value) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ContentHome::linkPlugins() {
|
||||||
|
std::vector<PluginInformation*> willBeLoaded;
|
||||||
|
|
||||||
|
for (auto const& x : pluginMapping) {
|
||||||
|
GuiToggle * guiElement = x.first;
|
||||||
|
if(guiElement->getValue()) {
|
||||||
|
PluginInformation* pluginInformation = x.second;
|
||||||
|
DEBUG_FUNCTION_LINE("We want to link %s\n",pluginInformation->getName().c_str());
|
||||||
|
willBeLoaded.push_back(pluginInformation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PluginLoader::getInstance()->loadAndLinkPlugins(willBeLoaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentHome::~ContentHome() {
|
ContentHome::~ContentHome() {
|
||||||
@ -91,4 +183,15 @@ ContentHome::~ContentHome() {
|
|||||||
remove(&URLLabel);
|
remove(&URLLabel);
|
||||||
remove(&exitHomeFrame);
|
remove(&exitHomeFrame);
|
||||||
remove(&exitPlusFrame);
|
remove(&exitPlusFrame);
|
||||||
|
|
||||||
|
for (auto const& x : pluginMapping) {
|
||||||
|
// x.first is also in the toDelete vector.
|
||||||
|
PluginInformation* pluginInformation = x.second;
|
||||||
|
delete pluginInformation;
|
||||||
|
}
|
||||||
|
|
||||||
|
Resources::RemoveSound(buttonClickSound);
|
||||||
|
for (std::vector<GuiElement *>::iterator it = toDelete.begin() ; it != toDelete.end(); ++it) {
|
||||||
|
delete *it;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#include "gui/Gui.h"
|
#include "gui/Gui.h"
|
||||||
#include "ContentTemplate.h"
|
#include "ContentTemplate.h"
|
||||||
#include "language/gettext.h"
|
#include "language/gettext.h"
|
||||||
|
#include "plugin/PluginInformation.h"
|
||||||
|
#include "custom/gui/DefaultGuiSwitch.h"
|
||||||
|
|
||||||
class ContentHome : public ContentTemplate {
|
class ContentHome : public ContentTemplate {
|
||||||
public:
|
public:
|
||||||
@ -52,6 +54,17 @@ private:
|
|||||||
GuiText exitPlus;
|
GuiText exitPlus;
|
||||||
GuiFrame exitPlusFrame;
|
GuiFrame exitPlusFrame;
|
||||||
|
|
||||||
|
GuiTrigger touchTrigger;
|
||||||
|
GuiTrigger wpadTouchTrigger;
|
||||||
|
|
||||||
|
GuiSound *buttonClickSound;
|
||||||
|
|
||||||
|
GuiFrame pluginsFrame;
|
||||||
|
|
||||||
|
std::vector<GuiElement*> toDelete;
|
||||||
|
void OnValueChanged(GuiToggle * toggle,bool value);
|
||||||
|
bool linkPlugins();
|
||||||
|
std::map<GuiToggle *, PluginInformation *> pluginMapping;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //_CONTENT_HOME_H
|
#endif //_CONTENT_HOME_H
|
||||||
|
@ -223,12 +223,14 @@ int32_t TcpReceiver::loadToMemory(int32_t clientSocket, uint32_t ipAddress) {
|
|||||||
if(plugin == NULL) {
|
if(plugin == NULL) {
|
||||||
return NOT_A_VALID_PLUGIN;
|
return NOT_A_VALID_PLUGIN;
|
||||||
}
|
}
|
||||||
|
delete plugin;
|
||||||
PluginLoader * pluginLoader = PluginLoader::getInstance();
|
PluginLoader * pluginLoader = PluginLoader::getInstance();
|
||||||
pluginLoader->resetPluginLoader();
|
pluginLoader->resetPluginLoader();
|
||||||
std::vector<PluginInformation* > pluginList = pluginLoader->getPluginInformation(WUPS_TEMP_PLUGIN_PATH);
|
std::vector<PluginInformation* > pluginList = pluginLoader->getPluginInformation(WUPS_TEMP_PLUGIN_PATH);
|
||||||
if(pluginList.size() == 0 || !pluginLoader->loadAndLinkPlugins(pluginList)) {
|
if(pluginList.size() == 0 || !pluginLoader->loadAndLinkPlugins(pluginList)) {
|
||||||
return NOT_A_VALID_PLUGIN;
|
return NOT_A_VALID_PLUGIN;
|
||||||
}
|
}
|
||||||
|
pluginLoader->clearPluginInformation(pluginList);
|
||||||
Application::instance()->quit(APPLICATION_CLOSE_APPLY);
|
Application::instance()->quit(APPLICATION_CLOSE_APPLY);
|
||||||
|
|
||||||
return fileSize;
|
return fileSize;
|
||||||
|
@ -108,7 +108,13 @@ bool PluginLoader::loadAndLinkPlugins(std::vector<PluginInformation *> pluginInf
|
|||||||
|
|
||||||
PluginLoader::flushCache();
|
PluginLoader::flushCache();
|
||||||
|
|
||||||
|
if(success) {
|
||||||
copyPluginDataIntoGlobalStruct(loadedPlugins);
|
copyPluginDataIntoGlobalStruct(loadedPlugins);
|
||||||
|
} else {
|
||||||
|
PluginLoader::resetPluginLoader();
|
||||||
|
memset((void*)&gbl_replacement_data,0,sizeof(gbl_replacement_data));
|
||||||
|
}
|
||||||
|
|
||||||
clearPluginData(loadedPlugins);
|
clearPluginData(loadedPlugins);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Resource files.
|
* Resource files.
|
||||||
* This file is generated automatically.
|
* This file is generated automatically.
|
||||||
* Includes 5 files.
|
* Includes 15 files.
|
||||||
*
|
*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
* Any manual modification of this file will be overwriten by the generation.
|
* Any manual modification of this file will be overwriten by the generation.
|
||||||
@ -12,6 +12,21 @@
|
|||||||
extern const uint8_t font_ttf[];
|
extern const uint8_t font_ttf[];
|
||||||
extern const uint32_t font_ttf_size;
|
extern const uint32_t font_ttf_size;
|
||||||
|
|
||||||
|
extern const uint8_t gameSettingsButton_png[];
|
||||||
|
extern const uint32_t gameSettingsButton_png_size;
|
||||||
|
|
||||||
|
extern const uint8_t gameSettingsButtonEx_png[];
|
||||||
|
extern const uint32_t gameSettingsButtonEx_png_size;
|
||||||
|
|
||||||
|
extern const uint8_t gameSettingsButtonExHighlighted_png[];
|
||||||
|
extern const uint32_t gameSettingsButtonExHighlighted_png_size;
|
||||||
|
|
||||||
|
extern const uint8_t gameSettingsButtonExSelected_png[];
|
||||||
|
extern const uint32_t gameSettingsButtonExSelected_png_size;
|
||||||
|
|
||||||
|
extern const uint8_t gameSettingsButtonSelected_png[];
|
||||||
|
extern const uint32_t gameSettingsButtonSelected_png_size;
|
||||||
|
|
||||||
extern const uint8_t GithubIcon_png[];
|
extern const uint8_t GithubIcon_png[];
|
||||||
extern const uint32_t GithubIcon_png_size;
|
extern const uint32_t GithubIcon_png_size;
|
||||||
|
|
||||||
@ -21,15 +36,40 @@ extern const uint32_t HomeButtonIcon_png_size;
|
|||||||
extern const uint8_t PlusButtonIcon_png[];
|
extern const uint8_t PlusButtonIcon_png[];
|
||||||
extern const uint32_t PlusButtonIcon_png_size;
|
extern const uint32_t PlusButtonIcon_png_size;
|
||||||
|
|
||||||
|
extern const uint8_t settings_click_2_mp3[];
|
||||||
|
extern const uint32_t settings_click_2_mp3_size;
|
||||||
|
|
||||||
|
extern const uint8_t switchIconBase_png[];
|
||||||
|
extern const uint32_t switchIconBase_png_size;
|
||||||
|
|
||||||
|
extern const uint8_t switchIconBaseHighlighted_png[];
|
||||||
|
extern const uint32_t switchIconBaseHighlighted_png_size;
|
||||||
|
|
||||||
|
extern const uint8_t switchIconOff_png[];
|
||||||
|
extern const uint32_t switchIconOff_png_size;
|
||||||
|
|
||||||
|
extern const uint8_t switchIconOn_png[];
|
||||||
|
extern const uint32_t switchIconOn_png_size;
|
||||||
|
|
||||||
extern const uint8_t TwitterIcon_png[];
|
extern const uint8_t TwitterIcon_png[];
|
||||||
extern const uint32_t TwitterIcon_png_size;
|
extern const uint32_t TwitterIcon_png_size;
|
||||||
|
|
||||||
static ResourceFile ResourceList[] =
|
static ResourceFile ResourceList[] =
|
||||||
{
|
{
|
||||||
{"font.ttf", font_ttf, font_ttf_size, NULL, 0},
|
{"font.ttf", font_ttf, font_ttf_size, NULL, 0},
|
||||||
|
{"gameSettingsButton.png", gameSettingsButton_png, gameSettingsButton_png_size, NULL, 0},
|
||||||
|
{"gameSettingsButtonEx.png", gameSettingsButtonEx_png, gameSettingsButtonEx_png_size, NULL, 0},
|
||||||
|
{"gameSettingsButtonExHighlighted.png", gameSettingsButtonExHighlighted_png, gameSettingsButtonExHighlighted_png_size, NULL, 0},
|
||||||
|
{"gameSettingsButtonExSelected.png", gameSettingsButtonExSelected_png, gameSettingsButtonExSelected_png_size, NULL, 0},
|
||||||
|
{"gameSettingsButtonSelected.png", gameSettingsButtonSelected_png, gameSettingsButtonSelected_png_size, NULL, 0},
|
||||||
{"GithubIcon.png", GithubIcon_png, GithubIcon_png_size, NULL, 0},
|
{"GithubIcon.png", GithubIcon_png, GithubIcon_png_size, NULL, 0},
|
||||||
{"HomeButtonIcon.png", HomeButtonIcon_png, HomeButtonIcon_png_size, NULL, 0},
|
{"HomeButtonIcon.png", HomeButtonIcon_png, HomeButtonIcon_png_size, NULL, 0},
|
||||||
{"PlusButtonIcon.png", PlusButtonIcon_png, PlusButtonIcon_png_size, NULL, 0},
|
{"PlusButtonIcon.png", PlusButtonIcon_png, PlusButtonIcon_png_size, NULL, 0},
|
||||||
|
{"settings_click_2.mp3", settings_click_2_mp3, settings_click_2_mp3_size, NULL, 0},
|
||||||
|
{"switchIconBase.png", switchIconBase_png, switchIconBase_png_size, NULL, 0},
|
||||||
|
{"switchIconBaseHighlighted.png", switchIconBaseHighlighted_png, switchIconBaseHighlighted_png_size, NULL, 0},
|
||||||
|
{"switchIconOff.png", switchIconOff_png, switchIconOff_png_size, NULL, 0},
|
||||||
|
{"switchIconOn.png", switchIconOn_png, switchIconOn_png_size, NULL, 0},
|
||||||
{"TwitterIcon.png", TwitterIcon_png, TwitterIcon_png_size, NULL, 0},
|
{"TwitterIcon.png", TwitterIcon_png, TwitterIcon_png_size, NULL, 0},
|
||||||
{NULL, NULL, 0, NULL, 0}
|
{NULL, NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|