mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2026-03-21 17:25:21 -05:00
ConfigMenu: Show wiimote button when the last input was on a wiimote
This commit is contained in:
parent
3ec6b3f4a1
commit
94ca12b415
|
|
@ -88,7 +88,7 @@ WUMS_INITIALIZE() {
|
|||
|
||||
message = "To enable them again, open the plugin config menu (\ue004 + \ue07a + \ue046).";
|
||||
DrawUtils::print(SCREEN_WIDTH / 2 + DrawUtils::getTextWidth(message) / 2, SCREEN_HEIGHT / 2 + 24, message, true);
|
||||
message = "Then press \ue002 to manage active plugins";
|
||||
message = "Then press \ue002 or \uE048 to manage active plugins";
|
||||
DrawUtils::print(SCREEN_WIDTH / 2 + DrawUtils::getTextWidth(message) / 2, SCREEN_HEIGHT / 2 + 48, message, true);
|
||||
|
||||
// draw bottom bar
|
||||
|
|
|
|||
|
|
@ -25,6 +25,25 @@ ConfigRenderer::ConfigRenderer(std::vector<ConfigDisplayItem> &&vec) : mConfigs(
|
|||
ConfigRenderer::~ConfigRenderer() = default;
|
||||
|
||||
ConfigSubState ConfigRenderer::Update(Input &input, const WUPSConfigSimplePadData &simpleInputData, const WUPSConfigComplexPadData &complexInputData) {
|
||||
// Check if the last input was on a wiimote
|
||||
for (uint32_t i = 0; i < std::size(complexInputData.kpad.data); i++) {
|
||||
const KPADError &kpadError = complexInputData.kpad.kpadError[i];
|
||||
const KPADStatus &status = complexInputData.kpad.data[i];
|
||||
|
||||
const bool isWiimote = status.extensionType == WPAD_EXT_CORE || status.extensionType == WPAD_EXT_NUNCHUK ||
|
||||
status.extensionType == WPAD_EXT_MPLUS || status.extensionType == WPAD_EXT_MPLUS_NUNCHUK;
|
||||
|
||||
if (kpadError == KPAD_ERROR_OK) {
|
||||
if (isWiimote && status.hold != 0) {
|
||||
mLastInputWasOnWiimote = true;
|
||||
} else if (!isWiimote && status.classic.hold != 0) {
|
||||
mLastInputWasOnWiimote = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (complexInputData.vpad.vpadError == VPAD_READ_SUCCESS && complexInputData.vpad.data.hold != 0) {
|
||||
mLastInputWasOnWiimote = false;
|
||||
}
|
||||
switch (mState) {
|
||||
case STATE_MAIN:
|
||||
return UpdateStateMain(input);
|
||||
|
|
@ -183,8 +202,8 @@ void ConfigRenderer::RenderStateMain() const {
|
|||
uint32_t szNoConfig = DrawUtils::getTextWidth(noConfigText.data());
|
||||
|
||||
if (!mAllConfigs.empty()) {
|
||||
std::string activateHint = "Press \ue002 to activate inactive plugins";
|
||||
auto szHint = DrawUtils::getTextWidth(activateHint.c_str());
|
||||
const auto activateHint = string_format("Press %s to activate inactive plugins", mLastInputWasOnWiimote ? "\uE048" : "\uE002");
|
||||
const auto szHint = DrawUtils::getTextWidth(activateHint.c_str());
|
||||
|
||||
DrawUtils::print((SCREEN_WIDTH / 2) - (szNoConfig / 2), (SCREEN_HEIGHT / 2) - 16, noConfigText.data());
|
||||
DrawUtils::print((SCREEN_WIDTH / 2) - (szHint / 2), (SCREEN_HEIGHT / 2) + 16, activateHint.data());
|
||||
|
|
@ -226,7 +245,8 @@ void ConfigRenderer::RenderStateMain() const {
|
|||
if (mSetActivePluginsMode) {
|
||||
DrawUtils::print(SCREEN_WIDTH - 16, SCREEN_HEIGHT - 10, "\ue000 Activate | \uE045 Apply", true);
|
||||
} else if (totalElementSize > 0) {
|
||||
DrawUtils::print(SCREEN_WIDTH - 16, SCREEN_HEIGHT - 10, "\ue000 Select | \uE002 Manage plugins", true);
|
||||
const auto text = string_format("\ue000 Select | %s Manage plugins", mLastInputWasOnWiimote ? "\uE048" : "\uE002");
|
||||
DrawUtils::print(SCREEN_WIDTH - 16, SCREEN_HEIGHT - 10, text.c_str(), true);
|
||||
}
|
||||
|
||||
// draw scroll indicator
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ private:
|
|||
int32_t mRenderOffset = 0;
|
||||
int32_t mCurrentOpen = -1;
|
||||
|
||||
bool mNeedRedraw = true;
|
||||
bool mSetActivePluginsMode = false;
|
||||
bool mActivePluginsDirty = false;
|
||||
bool mNeedRedraw = true;
|
||||
bool mSetActivePluginsMode = false;
|
||||
bool mActivePluginsDirty = false;
|
||||
bool mLastInputWasOnWiimote = false;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user