mirror of
https://github.com/Maschell/hid_to_vpad.git
synced 2024-11-28 09:14:14 +01:00
Add a simple configuration menu.
This commit is contained in:
parent
7172450c5e
commit
943ac03b93
29
src/main.cpp
29
src/main.cpp
@ -1,4 +1,6 @@
|
|||||||
#include <wups.h>
|
#include <wups.h>
|
||||||
|
#include <wups/config.h>
|
||||||
|
#include <wups/config/WUPSConfigItemBoolean.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <controller_patcher/ControllerPatcher.hpp>
|
#include <controller_patcher/ControllerPatcher.hpp>
|
||||||
#include <utils/logger.h>
|
#include <utils/logger.h>
|
||||||
@ -18,6 +20,33 @@ WUPS_FS_ACCESS()
|
|||||||
#define WIIU_PATH "/wiiu"
|
#define WIIU_PATH "/wiiu"
|
||||||
#define DEFAULT_HID_TO_VPAD_PATH SD_PATH WIIU_PATH "/apps/hidtovpad"
|
#define DEFAULT_HID_TO_VPAD_PATH SD_PATH WIIU_PATH "/apps/hidtovpad"
|
||||||
|
|
||||||
|
void rumbleChanged(bool newValue) {
|
||||||
|
DEBUG_FUNCTION_LINE("rumbleChanged %d \n",newValue);
|
||||||
|
ControllerPatcher::setRumbleActivated(newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
void networkClient(bool newValue) {
|
||||||
|
DEBUG_FUNCTION_LINE("Trigger network %d\n",newValue);
|
||||||
|
ControllerPatcher::setNetworkControllerActivated(newValue);
|
||||||
|
if(newValue) {
|
||||||
|
ControllerPatcher::startNetworkServer();
|
||||||
|
} else {
|
||||||
|
ControllerPatcher::stopNetworkServer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WUPS_GET_CONFIG() {
|
||||||
|
WUPSConfig* config = new WUPSConfig("HID to VPAD");
|
||||||
|
WUPSConfigCategory* catOther = config->addCategory("Other");
|
||||||
|
|
||||||
|
// item Type config id displayed name default value onChangeCallback.
|
||||||
|
catOther->addItem(new WUPSConfigItemBoolean("rumble", "Enable rumble", ControllerPatcher::isRumbleActivated(), rumbleChanged));
|
||||||
|
catOther->addItem(new WUPSConfigItemBoolean("networkclient", "Enable network client", true, networkClient));
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DEINITIALIZE_PLUGIN() {
|
DEINITIALIZE_PLUGIN() {
|
||||||
//CursorDrawer::destroyInstance();
|
//CursorDrawer::destroyInstance();
|
||||||
ControllerPatcher::DeInit();
|
ControllerPatcher::DeInit();
|
||||||
|
Loading…
Reference in New Issue
Block a user