Store secret text as static variable (#195)
When compiling with Zig, the old implementation raises this error: ``` error: expected type '[*c]u8', found '*const [16:0]u8' note: cast discards const qualifier ``` As it does not allow casting away the const qualifier, we need to store the "********" placeholder in a writable variable. Co-authored-by: Fabien Freling <fabien.freling@momagroup.com>
This commit is contained in:
parent
baf3790cac
commit
c4e121d548
@ -3151,8 +3151,9 @@ int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, co
|
||||
|
||||
if (secretViewActive != NULL)
|
||||
{
|
||||
static char stars[] = "****************";
|
||||
if (GuiTextBox(RAYGUI_CLITERAL(Rectangle){ textBoxBounds.x, textBoxBounds.y, textBoxBounds.width - 4 - RAYGUI_TEXTINPUTBOX_HEIGHT, textBoxBounds.height },
|
||||
((*secretViewActive == 1) || textEditMode)? text : (char *) "****************", textMaxSize, textEditMode)) textEditMode = !textEditMode;
|
||||
((*secretViewActive == 1) || textEditMode)? text : stars, textMaxSize, textEditMode)) textEditMode = !textEditMode;
|
||||
|
||||
*secretViewActive = GuiToggle(RAYGUI_CLITERAL(Rectangle){ textBoxBounds.x + textBoxBounds.width - RAYGUI_TEXTINPUTBOX_HEIGHT, textBoxBounds.y, RAYGUI_TEXTINPUTBOX_HEIGHT, RAYGUI_TEXTINPUTBOX_HEIGHT }, (*secretViewActive == 1)? "#44#" : "#45#", *secretViewActive);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user