mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 21:02:39 +02:00
Updated swkbdInlineMakeAppearArg, this now just writes defaults and sets type to the input param. Added swkbdInlineAppearArgSetOkButtonText.
This commit is contained in:
parent
131b92a8c8
commit
2ebac06061
@ -158,7 +158,7 @@ typedef struct {
|
|||||||
u8 returnButtonFlag; ///< Controls whether the Return button is enabled, for newlines input. 0 = disabled, non-zero = enabled.
|
u8 returnButtonFlag; ///< Controls whether the Return button is enabled, for newlines input. 0 = disabled, non-zero = enabled.
|
||||||
u16 unk_x29;
|
u16 unk_x29;
|
||||||
u8 unk_x2b;
|
u8 unk_x2b;
|
||||||
u32 flags;
|
u32 flags; ///< Bitmask 0x4: unknown.
|
||||||
u8 unk_x30;
|
u8 unk_x30;
|
||||||
u8 unk_x31[0x17];
|
u8 unk_x31[0x17];
|
||||||
} PACKED SwkbdAppearArg;
|
} PACKED SwkbdAppearArg;
|
||||||
@ -476,13 +476,19 @@ void swkbdInlineAppear(SwkbdInline* s, SwkbdAppearArg* arg);
|
|||||||
void swkbdInlineDisappear(SwkbdInline* s);
|
void swkbdInlineDisappear(SwkbdInline* s);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates a \ref SwkbdAppearArg which can then be passed to \ref swkbdInlineAppear.
|
* @brief Creates a \ref SwkbdAppearArg which can then be passed to \ref swkbdInlineAppear. arg is initialized with the defaults, with type being set to the input type.
|
||||||
* @param arg Output \ref SwkbdAppearArg.
|
* @param arg Output \ref SwkbdAppearArg.
|
||||||
* @param type Type. Must be 0..5, otherwise this will return.
|
* @param type \ref SwkbdType type
|
||||||
* @param flag Unknown flag
|
|
||||||
* @param str Input UTF-8 string for the Ok button text, this can be empty/NULL to use the default.
|
* @param str Input UTF-8 string for the Ok button text, this can be empty/NULL to use the default.
|
||||||
*/
|
*/
|
||||||
void swkbdInlineMakeAppearArg(SwkbdAppearArg* arg, u32 type, bool flag, const char* str);
|
void swkbdInlineMakeAppearArg(SwkbdAppearArg* arg, SwkbdType type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets okButtonText for the specified SwkbdAppearArg, which was previously initialized with \ref swkbdInlineMakeAppearArg.
|
||||||
|
* @param arg \ref SwkbdAppearArg
|
||||||
|
* @param str Input UTF-8 string for the Ok button text, this can be empty/NULL to use the default.
|
||||||
|
*/
|
||||||
|
void swkbdInlineAppearArgSetOkButtonText(SwkbdAppearArg* arg, const char* str);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the audio volume.
|
* @brief Sets the audio volume.
|
||||||
|
@ -643,54 +643,16 @@ void swkbdInlineDisappear(SwkbdInline* s) {
|
|||||||
s->calcArg.flags = (s->calcArg.flags & ~0x4) | 0x80;
|
s->calcArg.flags = (s->calcArg.flags & ~0x4) | 0x80;
|
||||||
}
|
}
|
||||||
|
|
||||||
void swkbdInlineMakeAppearArg(SwkbdAppearArg* arg, u32 type, bool flag, const char* str) {
|
void swkbdInlineMakeAppearArg(SwkbdAppearArg* arg, SwkbdType type) {
|
||||||
memset(arg, 0, sizeof(SwkbdAppearArg));
|
memset(arg, 0, sizeof(SwkbdAppearArg));
|
||||||
|
|
||||||
u32 tmpval=0;
|
|
||||||
u8 tmpval2[2]={0};
|
|
||||||
|
|
||||||
switch(type) {
|
|
||||||
case 0:
|
|
||||||
tmpval = SwkbdType_NumPad;
|
|
||||||
tmpval2[0] = tmpval;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
tmpval = 0x101;
|
|
||||||
tmpval2[0] = 1;
|
|
||||||
tmpval2[1] = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
tmpval = 3;
|
|
||||||
tmpval2[0] = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
tmpval = SwkbdType_QWERTY;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
tmpval = SwkbdType_NumPad;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
tmpval = SwkbdType_Normal;
|
|
||||||
arg->keySetDisableBitmask = SwkbdKeyDisableBitmask_DownloadCode;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
arg->unk_x20 = -1;
|
arg->unk_x20 = -1;
|
||||||
arg->unk_x24 = -1;
|
arg->unk_x24 = -1;
|
||||||
arg->unk_x30 = 1;
|
arg->unk_x30 = 1;
|
||||||
arg->type = tmpval;
|
arg->type = type;
|
||||||
arg->dicFlag = tmpval2[0];
|
}
|
||||||
arg->returnButtonFlag = tmpval2[1];
|
|
||||||
if (flag) arg->flags = 0x4;
|
|
||||||
|
|
||||||
|
void swkbdInlineAppearArgSetOkButtonText(SwkbdAppearArg* arg, const char* str) {
|
||||||
_swkbdConvertToUTF16ByteSize(arg->okButtonText, str, sizeof(arg->okButtonText));
|
_swkbdConvertToUTF16ByteSize(arg->okButtonText, str, sizeof(arg->okButtonText));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user