mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-12-06 03:07:19 +00:00
The progress which I did.
I continue later.
This commit is contained in:
1 parent
955b644ad4
commit
67694a5f96
9 files changed
+311
-20
No files matched your search
@@ -149,4 +149,25 @@ int Input::getUint(int max, std::string Text) {
|
||||
int i = atoi(s.c_str());
|
||||
if(i>max) return 255;
|
||||
return i;
|
||||
}
|
||||
|
||||
std::string Input::getString(const std::string &hint, uint maxLength)
|
||||
{
|
||||
std::string string;
|
||||
C3D_FrameEnd(0);
|
||||
SwkbdState state;
|
||||
const char *hintText = hint.c_str();
|
||||
swkbdInit(&state, SWKBD_TYPE_NORMAL, 2, maxLength);
|
||||
swkbdSetHintText(&state, hintText);
|
||||
swkbdSetValidation(&state, SWKBD_NOTBLANK_NOTEMPTY, SWKBD_FILTER_PROFANITY, 0);
|
||||
char input[maxLength + 1] = {0};
|
||||
SwkbdButton ret = swkbdInputText(&state, input, sizeof(input));
|
||||
input[maxLength] = '\0';
|
||||
if (ret == SWKBD_BUTTON_CONFIRM)
|
||||
{
|
||||
string = input;
|
||||
return string;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user