fixed bug with clicked text area gadgets marking level as changed
[rocksndiamonds.git] / src / libgame / gadgets.c
index c961021a3e2a56e855ed93d9096f270a5823ba63..6c394d7ab2a6993ad080bc7a2b51de61aebd95ba 100644 (file)
@@ -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;