X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=f6bd6181d046f8b126629833e07d571b240680c7;hb=ff56a43aa3799aa3357f4deca4d6482fc25a6a41;hp=0977a92a6dbb97b4161369f7ccb0425dfa9cd903;hpb=4bca9bc5f299a9b287134b06e41b147f506792b4;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index 0977a92a..f6bd6181 100644 --- a/src/editor.c +++ b/src/editor.c @@ -13,11 +13,11 @@ #include +#include "libgame/libgame.h" + #include "editor.h" #include "screens.h" #include "tools.h" -#include "misc.h" -#include "buttons.h" #include "files.h" #include "game.h" #include "tape.h" @@ -1394,6 +1394,7 @@ static void CreateControlButtons() GDI_ALT_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y2, GDI_ALT_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y2, GDI_EVENT_MASK, event_mask, + GDI_CALLBACK_INFO, HandleEditorGadgetInfoText, GDI_CALLBACK_ACTION, HandleControlButtons, GDI_END); @@ -1451,6 +1452,7 @@ static void CreateControlButtons() GDI_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y1, GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y2, GDI_EVENT_MASK, event_mask, + GDI_CALLBACK_INFO, HandleEditorGadgetInfoText, GDI_CALLBACK_ACTION, HandleControlButtons, GDI_END); @@ -1501,6 +1503,7 @@ static void CreateControlButtons() GDI_DECORATION_SIZE, MINI_TILEX, MINI_TILEY, GDI_DECORATION_SHIFTING, 1, 1, GDI_EVENT_MASK, event_mask, + GDI_CALLBACK_INFO, HandleEditorGadgetInfoText, GDI_CALLBACK_ACTION, HandleControlButtons, GDI_END); @@ -1579,6 +1582,7 @@ static void CreateCounterButtons() GDI_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y, GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y, GDI_EVENT_MASK, event_mask, + GDI_CALLBACK_INFO, HandleEditorGadgetInfoText, GDI_CALLBACK_ACTION, HandleCounterButtons, GDI_END); @@ -1629,6 +1633,7 @@ static void CreateCounterButtons() GDI_BORDER_SIZE, ED_BORDER_SIZE, GDI_TEXTINPUT_DESIGN_WIDTH, gd_width, GDI_EVENT_MASK, event_mask, + GDI_CALLBACK_INFO, HandleEditorGadgetInfoText, GDI_CALLBACK_ACTION, HandleCounterButtons, GDI_END); @@ -1772,6 +1777,7 @@ static void CreateTextInputGadgets() GDI_BORDER_SIZE, ED_BORDER_SIZE, GDI_TEXTINPUT_DESIGN_WIDTH, ED_WIN_COUNT_XSIZE, GDI_EVENT_MASK, event_mask, + GDI_CALLBACK_INFO, HandleEditorGadgetInfoText, GDI_CALLBACK_ACTION, HandleTextInputGadgets, GDI_END); @@ -1841,6 +1847,7 @@ static void CreateScrollbarGadgets() GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y2, GDI_BORDER_SIZE, ED_BORDER_SIZE, GDI_EVENT_MASK, event_mask, + GDI_CALLBACK_INFO, HandleEditorGadgetInfoText, GDI_CALLBACK_ACTION, HandleControlButtons, GDI_END); @@ -1890,6 +1897,7 @@ static void CreateCheckbuttonGadgets() GDI_ALT_DESIGN_UNPRESSED, gd_bitmap, gd_x3, gd_y, GDI_ALT_DESIGN_PRESSED, gd_bitmap, gd_x4, gd_y, GDI_EVENT_MASK, event_mask, + GDI_CALLBACK_INFO, HandleEditorGadgetInfoText, GDI_CALLBACK_ACTION, HandleRadiobuttons, GDI_END); @@ -1922,6 +1930,7 @@ static void CreateCheckbuttonGadgets() GDI_ALT_DESIGN_UNPRESSED, gd_bitmap, gd_x3, gd_y, GDI_ALT_DESIGN_PRESSED, gd_bitmap, gd_x4, gd_y, GDI_EVENT_MASK, event_mask, + GDI_CALLBACK_INFO, HandleEditorGadgetInfoText, GDI_CALLBACK_ACTION, HandleCheckbuttons, GDI_END); @@ -2125,13 +2134,13 @@ void DrawLevelEd() DOOR_GFX_PAGEX6, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY); /* draw mouse button brush elements */ - DrawMiniGraphicExt(drawto, gc, + DrawMiniGraphicExt(drawto, DX + ED_WIN_MB_LEFT_XPOS, DY + ED_WIN_MB_LEFT_YPOS, el2gfx(new_element1)); - DrawMiniGraphicExt(drawto, gc, + DrawMiniGraphicExt(drawto, DX + ED_WIN_MB_MIDDLE_XPOS, DY + ED_WIN_MB_MIDDLE_YPOS, el2gfx(new_element2)); - DrawMiniGraphicExt(drawto, gc, + DrawMiniGraphicExt(drawto, DX + ED_WIN_MB_RIGHT_XPOS, DY + ED_WIN_MB_RIGHT_YPOS, el2gfx(new_element3)); @@ -2304,21 +2313,21 @@ static void PickDrawingElement(int button, int element) if (button == 1) { new_element1 = element; - DrawMiniGraphicExt(drawto, gc, + DrawMiniGraphicExt(drawto, DX + ED_WIN_MB_LEFT_XPOS, DY + ED_WIN_MB_LEFT_YPOS, el2gfx(new_element1)); } else if (button == 2) { new_element2 = element; - DrawMiniGraphicExt(drawto, gc, + DrawMiniGraphicExt(drawto, DX + ED_WIN_MB_MIDDLE_XPOS, DY + ED_WIN_MB_MIDDLE_YPOS, el2gfx(new_element2)); } else { new_element3 = element; - DrawMiniGraphicExt(drawto, gc, + DrawMiniGraphicExt(drawto, DX + ED_WIN_MB_RIGHT_XPOS, DY + ED_WIN_MB_RIGHT_YPOS, el2gfx(new_element3)); } @@ -3442,11 +3451,11 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) } else { - DrawMiniGraphicExt(drawto, gc, + DrawMiniGraphicExt(drawto, gi->x + sx * MINI_TILEX, gi->y + sy * MINI_TILEY, el2gfx(new_element)); - DrawMiniGraphicExt(window, gc, + DrawMiniGraphicExt(window, gi->x + sx * MINI_TILEX, gi->y + sy * MINI_TILEY, el2gfx(new_element)); @@ -4048,6 +4057,9 @@ void HandleEditorGadgetInfoText(void *ptr) char infotext[MAX_INFOTEXT_LEN + 1]; char shortcut[MAX_INFOTEXT_LEN + 1]; + if (game_status != LEVELED) + return; + ClearEditorGadgetInfoText(); /* misuse this function to delete brush cursor, if needed */