X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fgadgets.c;h=7f5125d20cd885cf059dc131b0d7eb761be9ff7d;hb=7ff43d7ba40390c41b10888aad0a35dfe3cad82a;hp=02d22f9f03c477f35a0b7dc501a2c315c2de7e6c;hpb=bf7f1c667ad861d6cadacd0b9d6fe517be977a6e;p=rocksndiamonds.git diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 02d22f9f..7f5125d2 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -82,11 +82,6 @@ static struct GadgetInfo *getGadgetInfoFromMousePosition(int mx, int my) static void default_callback_info(void *ptr) { -#if 0 - if (game_status == LEVELED) - HandleEditorGadgetInfoText(ptr); -#endif - return; } @@ -851,15 +846,27 @@ void HandleGadgets(int mx, int my, int button) if (last_info_gi != new_gi || (new_gi && new_gi->type == GD_TYPE_DRAWING_AREA && changed_position)) { - last_info_gi = new_gi; - if (new_gi != NULL && (button == 0 || new_gi == last_gi)) { - new_gi->event.type = 0; + new_gi->event.type = GD_EVENT_INFO_ENTERING; new_gi->callback_info(new_gi); } - else + else if (last_info_gi != NULL) + { + last_info_gi->event.type = GD_EVENT_INFO_LEAVING; + last_info_gi->callback_info(last_info_gi); + +#if 0 default_callback_info(NULL); + + printf("It seems that we are leaving gadget [%s]!\n", + (last_info_gi != NULL && + last_info_gi->info_text != NULL ? + last_info_gi->info_text : "")); +#endif + } + + last_info_gi = new_gi; } if (gadget_pressed)