From b1a00c7bf19d3a459d225ee0341fa7b8d4d4cb3b Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 13 Mar 2024 10:08:06 +0100 Subject: [PATCH] fixed input of negative numbers to numeric text gadgets --- src/libgame/gadgets.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 64637dc4..844f4f4e 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -2455,8 +2455,7 @@ boolean HandleGadgetsKeyInput(Key key) int cursor_pos = gi->textinput.cursor_position; char letter = getCharFromKey(key); boolean legal_letter = (gi->type == GD_TYPE_TEXT_INPUT_NUMERIC ? - letter >= '0' && letter <= '9' : - letter != 0); + (letter >= '0' && letter <= '9') || letter == '-' : letter != 0); if (legal_letter && text_length < gi->textinput.size) { -- 2.34.1