]> granicus.if.org Git - nethack/commitdiff
curses - don't use popup for count selection.
authorTangles <andyrthomson@gmail.com>
Mon, 28 May 2018 11:55:24 +0000 (21:55 +1000)
committernhmall <nhmall@nethack.org>
Sun, 2 Dec 2018 16:20:46 +0000 (11:20 -0500)
There are issues with dismissing the popup afterwards.  These
were not really investigated as a count-selection doesn't really
warrant a popup anyway.

win/curses/cursmesg.c

index 8b9199e2fede1d8dc29b9fdfe2625e676ed11684..1e6f7dbab973fd12c6cca1c164beafc6b6722813 100644 (file)
@@ -298,8 +298,8 @@ curses_prev_mesg()
 }
 
 
-/* Shows Count: in a separate window, or at the bottom of the message
-window, depending on the user's settings */
+/* Shows Count: at the bottom of the message window,
+   popup_dialog is not currently implemented for this function */
 
 void
 curses_count_window(const char *count_text)
@@ -317,41 +317,30 @@ curses_count_window(const char *count_text)
 
     counting = TRUE;
 
-    if (iflags.wc_popup_dialog) {       /* Display count in popup window */
-        startx = 1;
-        starty = 1;
+    curses_get_window_xy(MESSAGE_WIN, &winx, &winy);
+    curses_get_window_size(MESSAGE_WIN, &messageh, &messagew);
 
-        if (countwin == NULL) {
-            countwin = curses_create_window(25, 1, UP);
-        }
-
-    } else {                    /* Display count at bottom of message window */
-
-        curses_get_window_xy(MESSAGE_WIN, &winx, &winy);
-        curses_get_window_size(MESSAGE_WIN, &messageh, &messagew);
-
-        if (curses_window_has_border(MESSAGE_WIN)) {
-            winx++;
-            winy++;
-        }
+    if (curses_window_has_border(MESSAGE_WIN)) {
+        winx++;
+        winy++;
+    }
 
-        winy += messageh - 1;
+    winy += messageh - 1;
 
-        if (countwin == NULL) {
+    if (countwin == NULL) {
 #ifndef PDCURSES
-            countwin = newwin(1, 25, winy, winx);
+        countwin = newwin(1, 25, winy, winx);
 #endif /* !PDCURSES */
-        }
+    }
 #ifdef PDCURSES
-        else {
-            curses_destroy_win(countwin);
-        }
+    else {
+        curses_destroy_win(countwin);
+    }
 
-        countwin = newwin(1, 25, winy, winx);
+    countwin = newwin(1, 25, winy, winx);
 #endif /* PDCURSES */
-        startx = 0;
-        starty = 0;
-    }
+    startx = 0;
+    starty = 0;
 
     mvwprintw(countwin, starty, startx, "%s", count_text);
     wrefresh(countwin);