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