mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-14 05:55:13 +01:00
frontend/applets/swkbd: use system username
This commit is contained in:
parent
dcaf4a8e83
commit
b54e3b7aa9
@ -7,6 +7,6 @@
|
|||||||
|
|
||||||
namespace Frontend {
|
namespace Frontend {
|
||||||
void RegisterDefaultApplets() {
|
void RegisterDefaultApplets() {
|
||||||
RegisterSoftwareKeyboard(std::make_shared<DefaultCitraKeyboard>());
|
RegisterSoftwareKeyboard(std::make_shared<DefaultKeyboard>());
|
||||||
}
|
}
|
||||||
} // namespace Frontend
|
} // namespace Frontend
|
||||||
|
@ -6,8 +6,10 @@
|
|||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
|
#include "common/string_util.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/frontend/applets/swkbd.h"
|
#include "core/frontend/applets/swkbd.h"
|
||||||
|
#include "core/hle/service/cfg/cfg.h"
|
||||||
|
|
||||||
namespace Frontend {
|
namespace Frontend {
|
||||||
|
|
||||||
@ -130,18 +132,19 @@ ValidationError SoftwareKeyboard::Finalize(const std::string& text, u8 button) {
|
|||||||
data = {text, button};
|
data = {text, button};
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultCitraKeyboard::Setup(const Frontend::KeyboardConfig* config) {
|
void DefaultKeyboard::Setup(const Frontend::KeyboardConfig* config) {
|
||||||
SoftwareKeyboard::Setup(config);
|
SoftwareKeyboard::Setup(config);
|
||||||
|
std::string username = Common::UTF16ToUTF8(Service::CFG::GetCurrentModule()->GetUsername());
|
||||||
switch (this->config.button_config) {
|
switch (this->config.button_config) {
|
||||||
case ButtonConfig::None:
|
case ButtonConfig::None:
|
||||||
case ButtonConfig::Single:
|
case ButtonConfig::Single:
|
||||||
Finalize("Citra", 0);
|
Finalize(username, 0);
|
||||||
break;
|
break;
|
||||||
case ButtonConfig::Dual:
|
case ButtonConfig::Dual:
|
||||||
Finalize("Citra", 1);
|
Finalize(username, 1);
|
||||||
break;
|
break;
|
||||||
case ButtonConfig::Triple:
|
case ButtonConfig::Triple:
|
||||||
Finalize("Citra", 2);
|
Finalize(username, 2);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
@ -119,7 +119,7 @@ protected:
|
|||||||
KeyboardData data;
|
KeyboardData data;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DefaultCitraKeyboard final : public SoftwareKeyboard {
|
class DefaultKeyboard final : public SoftwareKeyboard {
|
||||||
public:
|
public:
|
||||||
void Setup(const KeyboardConfig* config) override;
|
void Setup(const KeyboardConfig* config) override;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user