From: Holger Schemel Date: Thu, 22 Oct 2020 16:37:29 +0000 (+0200) Subject: fixed bug with clicked text area gadgets marking level as changed X-Git-Tag: 4.2.0.4~9 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9e9b4d408b4626ce4c1018801b5fb6a687a06ee9;p=rocksndiamonds.git fixed bug with clicked text area gadgets marking level as changed This bugs happens when clicking into a text area gadgets, then deactivating it again by clicking somewhere else. This marks the level as changed, even though nothing was changed at all. --- diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index c961021a..6c394d7a 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -1711,7 +1711,7 @@ boolean HandleGadgets(int mx, int my, int button) struct GadgetInfo *gi = last_gi; boolean gadget_changed = ((gi->event_mask & GD_EVENT_TEXT_LEAVING) != 0); - // check if text gadget has changed its value + // check if text input gadget has changed its value if (gi->type & GD_TYPE_TEXT_INPUT) { CheckRangeOfNumericInputGadget(gi); @@ -1722,6 +1722,15 @@ boolean HandleGadgets(int mx, int my, int button) gadget_changed = FALSE; } + // check if text area gadget has changed its value + if (gi->type & GD_TYPE_TEXT_AREA) + { + if (!strEqual(gi->textarea.last_value, gi->textarea.value)) + strcpy(gi->textarea.last_value, gi->textarea.value); + else + gadget_changed = FALSE; + } + // selectbox does not change its value when closed by clicking outside if (gi->type & GD_TYPE_SELECTBOX) gadget_changed = FALSE;