From 1ea397d0b4be58a619ba92a31d2073ea58f638b8 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 5 Sep 2015 08:30:59 +0000 Subject: [PATCH] Mapster32: RCtrl+RAlt (+['] or [;]) selects sectors in 3D mode, by The Mechanic. git-svn-id: https://svn.eduke32.com/eduke32@5339 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/editor.h | 1 + polymer/eduke32/build/src/build.c | 2 +- polymer/eduke32/source/astub.c | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index ab9b1e50d..db6354df5 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -328,6 +328,7 @@ void update_highlight(void); void update_highlightsector(void); void reset_highlightsector(void); void reset_highlight(void); +void handlesecthighlight1(int32_t i, int32_t sub, int32_t nograycheck); void ovh_whiteoutgrab(int32_t restoreredwalls); int32_t inside_editor_curpos(int16_t sectnum); diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index bc41249e8..647374362 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -2831,7 +2831,7 @@ void SetFirstWall(int32_t sectnum, int32_t wallnum, int32_t alsoynw) asksave = 1; } -static void handlesecthighlight1(int32_t i, int32_t sub, int32_t nograycheck) +void handlesecthighlight1(int32_t i, int32_t sub, int32_t nograycheck) { int32_t j; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 2bd3d3f32..6ad231f98 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -4430,6 +4430,28 @@ static void Keys3d(void) VM_OnEvent(EVENT_PREKEYS3D, -1); + if (keystatus[KEYSC_RALT] && keystatus[KEYSC_RCTRL] && AIMING_AT_CEILING_OR_FLOOR && searchsector >= 0) + { + keystatus[KEYSC_RALT] = 0; + + if (highlightcnt >= 0) + { + message("WARNING: Cannot select sectors while sprites/walls selected"); + } + else + { + const int32_t sub = keystatus[KEYSC_SEMI]; + const int32_t add = keystatus[KEYSC_QUOTE]; + + if (!add && !sub) + reset_highlightsector(); + + handlesecthighlight1(searchsector, sub, 1); + + message("%s sector %d", sub ? "De-selected" : "Selected", searchsector); + } + } + if (keystatus[KEYSC_QUOTE] && PRESSED_KEYSC(V)) // ' V { if (AIMING_AT_CEILING_OR_FLOOR)