mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2026-09-13 14:29:30 -05:00
Add "plugins details" command
This commit is contained in:
@@ -598,4 +598,28 @@ WUPSButtonCombo_Error ButtonComboManager::ExecuteForWrapper(const WUPSButtonComb
|
||||
|
||||
uint32_t ButtonComboManager::getHandle() const {
|
||||
return *mHandle;
|
||||
}
|
||||
|
||||
std::vector<ButtonComboInfo> ButtonComboManager::GetButtonCombos() const {
|
||||
std::vector<ButtonComboInfo> result;
|
||||
for (auto &wrapper : mComboWrappers) {
|
||||
ButtonComboInfo res;
|
||||
char text[256] = {};
|
||||
WUPSButtonCombo_MetaOptionsOut meta = {text, sizeof(text)};
|
||||
if (wrapper.GetButtonComboCallback(res.callbackOptions) != WUPS_BUTTON_COMBO_ERROR_SUCCESS) {
|
||||
continue;
|
||||
}
|
||||
if (wrapper.GetButtonComboInfoEx(res.buttonComboOptions) != WUPS_BUTTON_COMBO_ERROR_SUCCESS) {
|
||||
continue;
|
||||
}
|
||||
if (wrapper.GetButtonComboMeta(meta) != WUPS_BUTTON_COMBO_ERROR_SUCCESS) {
|
||||
continue;
|
||||
}
|
||||
if (wrapper.GetButtonComboStatus(res.status) != WUPS_BUTTON_COMBO_ERROR_SUCCESS) {
|
||||
continue;
|
||||
}
|
||||
res.label = text;
|
||||
result.push_back(res);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -10,12 +10,18 @@
|
||||
|
||||
class ButtonComboWrapper;
|
||||
|
||||
struct ButtonComboInfo {
|
||||
std::string label;
|
||||
WUPSButtonCombo_CallbackOptions callbackOptions;
|
||||
WUPSButtonCombo_ButtonComboInfoEx buttonComboOptions;
|
||||
WUPSButtonCombo_ComboStatus status;
|
||||
};
|
||||
|
||||
class ButtonComboManager {
|
||||
public:
|
||||
explicit ButtonComboManager();
|
||||
~ButtonComboManager();
|
||||
|
||||
|
||||
ButtonComboManager(const ButtonComboManager &) = delete;
|
||||
|
||||
ButtonComboManager(ButtonComboManager &&src) noexcept;
|
||||
@@ -67,6 +73,8 @@ public:
|
||||
|
||||
[[nodiscard]] uint32_t getHandle() const;
|
||||
|
||||
[[nodiscard]] std::vector<ButtonComboInfo> GetButtonCombos() const;
|
||||
|
||||
private:
|
||||
std::forward_list<ButtonComboWrapper> mComboWrappers;
|
||||
std::unique_ptr<uint32_t> mHandle = std::make_unique<uint32_t>();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "PluginContainer.h"
|
||||
|
||||
#include "plugin/ButtonComboManager.h"
|
||||
#include "plugin/FunctionData.h"
|
||||
#include "plugin/HookData.h"
|
||||
#include "plugin/PluginConfigData.h"
|
||||
@@ -8,6 +9,7 @@
|
||||
#include "plugin/RelocationData.h"
|
||||
#include "plugin/SectionInfo.h"
|
||||
|
||||
#include "plugin/ButtonComboManager.h"
|
||||
#include "utils/buttoncombo/ButtonComboUtils.h"
|
||||
#include "utils/logger.h"
|
||||
#include "utils/storage/StorageUtils.h"
|
||||
@@ -135,6 +137,7 @@ void PluginContainer::InitButtonComboData() {
|
||||
}
|
||||
mButtonComboManagerHandle = ButtonComboUtils::API::Internal::CreateButtonComboData();
|
||||
}
|
||||
|
||||
void PluginContainer::DeinitButtonComboData() {
|
||||
if (getMetaInformation().getWUPSVersion() < WUPSVersion(0, 8, 2)) {
|
||||
return;
|
||||
@@ -142,6 +145,14 @@ void PluginContainer::DeinitButtonComboData() {
|
||||
ButtonComboUtils::API::Internal::RemoveButtonComboData(mButtonComboManagerHandle);
|
||||
}
|
||||
|
||||
|
||||
std::vector<ButtonComboInfo> PluginContainer::GetButtonComboData() const {
|
||||
if (getMetaInformation().getWUPSVersion() < WUPSVersion(0, 8, 2)) {
|
||||
return {};
|
||||
}
|
||||
return ButtonComboUtils::API::Internal::GetButtonComboData(mButtonComboManagerHandle);
|
||||
}
|
||||
|
||||
uint32_t PluginContainer::getButtonComboManagerHandle() const {
|
||||
return mButtonComboManagerHandle;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
|
||||
struct ButtonComboInfo;
|
||||
class PluginData;
|
||||
|
||||
class PluginContainer {
|
||||
@@ -67,6 +69,7 @@ public:
|
||||
|
||||
void InitButtonComboData();
|
||||
void DeinitButtonComboData();
|
||||
std::vector<ButtonComboInfo> GetButtonComboData() const;
|
||||
|
||||
[[nodiscard]] uint32_t getButtonComboManagerHandle() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user