X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=04c6a46c074c195602a6f778cb0b15f1902c8e5a;hb=e4f31a4e6f4b611a1dddb16afb66e3af177dd937;hp=cee0cd43918f6df4893d245f1a354154fcab4acd;hpb=33cf8c53fa267584efab93b15a99fbf78f9fb0c1;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index cee0cd43..04c6a46c 100644 --- a/src/editor.c +++ b/src/editor.c @@ -4633,31 +4633,6 @@ static int *editor_el_custom_ptr = editor_el_custom; static int num_editor_hl_custom = SIZEOF_ARRAY_INT(editor_hl_custom); static int num_editor_el_custom = SIZEOF_ARRAY_INT(editor_el_custom); -static int editor_hl_reference[] = -{ - EL_INTERNAL_CASCADE_REF_ACTIVE, - EL_CHAR('R'), - EL_CHAR('E'), - EL_CHAR('F') -}; - -static int editor_el_reference[] = -{ - EL_TRIGGER_PLAYER, - EL_TRIGGER_ELEMENT, - EL_TRIGGER_CE_VALUE, - EL_TRIGGER_CE_SCORE, - - EL_EMPTY, - EL_EMPTY, - EL_CURRENT_CE_VALUE, - EL_CURRENT_CE_SCORE -}; -static int *editor_hl_reference_ptr = editor_hl_reference; -static int *editor_el_reference_ptr = editor_el_reference; -static int num_editor_hl_reference = SIZEOF_ARRAY_INT(editor_hl_reference); -static int num_editor_el_reference = SIZEOF_ARRAY_INT(editor_el_reference); - static int editor_hl_group[] = { EL_INTERNAL_CASCADE_GE_ACTIVE, @@ -4735,6 +4710,51 @@ static int *editor_el_group_ptr = editor_el_group; static int num_editor_hl_group = SIZEOF_ARRAY_INT(editor_hl_group); static int num_editor_el_group = SIZEOF_ARRAY_INT(editor_el_group); +static int editor_hl_reference[] = +{ + EL_INTERNAL_CASCADE_REF_ACTIVE, + EL_CHAR('R'), + EL_CHAR('E'), + EL_CHAR('F') +}; + +static int editor_el_reference[] = +{ + EL_TRIGGER_PLAYER, + EL_TRIGGER_ELEMENT, + EL_TRIGGER_CE_VALUE, + EL_TRIGGER_CE_SCORE, + + EL_SELF, + EL_ANY_ELEMENT, + EL_CURRENT_CE_VALUE, + EL_CURRENT_CE_SCORE, + + EL_LAST_CE_8, + EL_LAST_CE_7, + EL_LAST_CE_6, + EL_LAST_CE_5, + + EL_LAST_CE_4, + EL_LAST_CE_3, + EL_LAST_CE_2, + EL_LAST_CE_1, + + EL_NEXT_CE_1, + EL_NEXT_CE_2, + EL_NEXT_CE_3, + EL_NEXT_CE_4, + + EL_NEXT_CE_5, + EL_NEXT_CE_6, + EL_NEXT_CE_7, + EL_NEXT_CE_8, +}; +static int *editor_hl_reference_ptr = editor_hl_reference; +static int *editor_el_reference_ptr = editor_el_reference; +static int num_editor_hl_reference = SIZEOF_ARRAY_INT(editor_hl_reference); +static int num_editor_el_reference = SIZEOF_ARRAY_INT(editor_el_reference); + static int editor_hl_user_defined[] = { EL_INTERNAL_CASCADE_USER_ACTIVE, @@ -4879,18 +4899,18 @@ editor_elements_info[] = &editor_hl_custom_ptr, &num_editor_hl_custom, &editor_el_custom_ptr, &num_editor_el_custom }, - { - &setup.editor.el_custom, - &setup.editor_cascade.el_ref, - &editor_hl_reference_ptr, &num_editor_hl_reference, - &editor_el_reference_ptr, &num_editor_el_reference - }, { &setup.editor.el_custom, &setup.editor_cascade.el_ge, &editor_hl_group_ptr, &num_editor_hl_group, &editor_el_group_ptr, &num_editor_el_group }, + { + &setup.editor.el_custom, + &setup.editor_cascade.el_ref, + &editor_hl_reference_ptr, &num_editor_hl_reference, + &editor_el_reference_ptr, &num_editor_el_reference + }, { &setup.editor.el_user_defined, &setup.editor_cascade.el_user, @@ -10467,8 +10487,12 @@ void HandleLevelEditorKeyInput(Key key) case KSYM_Insert: case KSYM_Delete: -#if 1 - /* IS_EDITOR_CASCADE */ + + /* this is needed to prevent interference with running "True X-Mouse" */ + if (GetKeyModStateFromEvents() & KMOD_Control) + break; + + /* check for last or next editor cascade block in element list */ for (i = 0; i < num_editor_elements; i++) { if ((key == KSYM_Insert && i == element_shift) || @@ -10492,36 +10516,6 @@ void HandleLevelEditorKeyInput(Key key) ModifyEditorElementList(); -#else - - for (i = 0; i < num_editor_elements; i++) - { - int e = editor_elements[i]; - - if ((key == KSYM_Insert && - (e == EL_INTERNAL_CASCADE_CE || - e == EL_INTERNAL_CASCADE_CE_ACTIVE)) || - (key == KSYM_Delete && - (e == EL_INTERNAL_CASCADE_GE || - e == EL_INTERNAL_CASCADE_GE_ACTIVE))) - break; - } - - if (i < num_editor_elements) - { - element_shift = i; - - if (element_shift > num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS) - element_shift = num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS; - - ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_LIST_VERTICAL], - GDI_SCROLLBAR_ITEM_POSITION, - element_shift / ED_ELEMENTLIST_BUTTONS_HORIZ, GDI_END); - - ModifyEditorElementList(); - } -#endif - break; case KSYM_Escape: @@ -10542,6 +10536,7 @@ void HandleLevelEditorKeyInput(Key key) DrawDrawingWindow(); edit_mode = ED_MODE_DRAWING; } + break; default: