Should "Display player (compact)" subwindow include depth reading?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smbhax
    Swordsman
    • Oct 2021
    • 340

    Should "Display player (compact)" subwindow include depth reading?

    The "Display player (compact)" subwindow duplicates the main window's sidebar display, except for one thing: it doesn't show the current depth:



    Should it?

    Is there somewhere else in the UI that can be set to display the depth?

    I'd hoped to be able to toggle the sidebar mode to Off and replace it with the subwindow--since in the SDL2 front end (and hm maybe in the standard Windows front end too, now that I look at it), for some reason if you want to maintain a proper 64x64 tile display you have to be using a multiple-of-8 font size in the main window (in the screenshot the subwindow's font is 10x20, while the main window's is 16x16)--but I don't think I can give up the depth display.
    Last edited by smbhax; October 14, 2022, 20:43.
    My Angband videos
  • smbhax
    Swordsman
    • Oct 2021
    • 340

    #2
    The "player (compact)" subwindow doesn't show speed, either. To add the display lines it doesn't have vs the main window's sidebar, in ui-display.c, change line 2086 from

    Code:
    	prt_health(row, col);
    to

    Code:
    	prt_health(row++, col);
    and below it, add

    Code:
        prt_speed_short(row++, col);
        prt_depth_short(row++, col);
        prt_title_short(row, col);
    Last edited by smbhax; October 19, 2022, 04:59.
    My Angband videos

    Comment

    • smbhax
      Swordsman
      • Oct 2021
      • 340

      #3
      I've been able to add the status bar stuff to the "compact" replacement sidebar by expanding the above list of additions there in ui-display.c; also, status lines can get out of date, and at least some seem to benefit from a blanking function to clear out prior readings; I don't know a graceful way to clear the variable length potentially multiple timed status effects, so I just added a dozen lines of blanking at the end for those (overkill? how many status effects could one have simultaneously?):

      Code:
          prt("", row, col);
          prt_speed_short(row++, col);
          prt("", row, col);	
          prt_depth_short(row++, col);
          prt("", row, col);	
          prt_title_short(row++, col);
          {
              typedef size_t status_x(int xrow, int xcol);
              static status_x *xsbr[] = {prt_level_feeling, prt_light, prt_moves,
              prt_unignore, prt_recall, prt_descent, prt_state, prt_study,
              prt_dtrap, prt_terrain};
              unsigned int xsc;
              for (xsc = 0; xsc < N_ELEMENTS(xsbr); xsc++) {
                  prt("", row, col);	
                  xsbr[xsc](row++, col);
              }
          }
          {
              int xclr = 12;
              int xcc;
              xcc = xclr;
              while (xcc) {
                  prt("", row++, col);
                  xcc--;
              }
              row = row - xclr;
          }
          prt_tmd(row, col);
      To get multiple timed status effects printing on separate lines, remove "+ len" from the end of line 1254, and insert a "row++;" line below line 1262.

      The food meter is actually a timed status effect, and its syntax varies a bit depending on whether there are other timed status effects active; not familiar enough with the syntax formatting to be able to lock that down.

      And then remove the display of the status line in the main window by commenting out lines 1311-1317.
      Last edited by smbhax; October 21, 2022, 16:10.
      My Angband videos

      Comment

      • smbhax
        Swordsman
        • Oct 2021
        • 340

        #4
        Oh, say, it IS drawing the map in the bottom row now that I removed the status stuff from it. The "Press ? for help" message while targeting clears that bottom map row again--and the row was only getting drawn back in in messy chunks over time by the map while moving around after leaving target mode, but adding

        Code:
                Term_clear();
        below line 1507 in ui-target.c corrects that and makes the map redraw there instantly as soon as target mode ends.



        By moving the status stuff to the left bar (or subwindow) I've got myself another half tile or so of map display height.

        I won't be too surprised if some other message I'm overlooking pops up over the map down there at some point though.

        ~~~~~~~~~~~~~

        Getting all the status readouts to update as needed when moved to the subwindow required setting the subwindow to update on "statusline" events, not just player events--which meant adding the following after 2242:

        Code:
        			set_register_or_deregister(statusline_events,
        						   N_ELEMENTS(statusline_events),
        					           update_player_compact_subwindow,
        						   angband_term[win_idx]);

        ~~~~~~~~~~~~~~~~~~~
        ~~~~~~~~~~~~~~~~~~~~~~
        ~~~~~~~~~~~~~~~~~~~~~~~~~~

        So, summary of the changes to move the status bar to the compact subwindow:
        Code:
        ui-display.c
        - 1254 rem "+ len"
        - add below 1262:
                    row++;
        - comment 1311-1317 (status bar)
        - add ++ to "row" in 2087, then the following:
            prt("", row, col);
            prt_speed_short(row++, col);
            prt("", row, col);	
            prt_depth_short(row++, col);
            prt("", row, col);	
            prt_title_short(row++, col);
            {
                typedef size_t status_x(int xrow, int xcol);
                static status_x *xsbr[] = {prt_level_feeling, prt_light, prt_moves,
                prt_unignore, prt_recall, prt_descent, prt_state, prt_study,
                prt_dtrap, prt_terrain};
                unsigned int xsc;
                for (xsc = 0; xsc < N_ELEMENTS(xsbr); xsc++) {
                    prt("", row, col);	
                    xsbr[xsc](row++, col);
                }
            }
            {
                int xclr = 12;
                int xcc;
                xcc = xclr;
                while (xcc) {
                    prt("", row++, col);
                    xcc--;
                }
                row = row - xclr;
            }
            prt_tmd(row, col);
        - add after 2242:
        
        			set_register_or_deregister(statusline_events,
        						   N_ELEMENTS(statusline_events),
        					           update_player_compact_subwindow,
        						   angband_term[win_idx]);
        
        ui-target.c
        - add "        Term_clear();" below line 1507 (redraws map in help line after targeting)

        - optional text tweaks--12 char limit to fit narrow sidebar
        in
        lib\gamedata\store.txt
        lib\gamedata\terrain.txt
        lib\help\symbols.txt
        lib\tiles\adam-bolt\graf-new.prf
        lib\tiles\gervais\graf-dvg.prf
        lib\tiles\nomad\graf-nmd.prf
        lib\tiles\old\graf-xxx.prf
        lib\tiles\shockbolt\graf-shb-dark.prf
        lib\tiles\shockbolt\graf-shb-light.prf
        src\cave.c
        src\ui-knowledge.c

        change

        down staircase to stairs down
        General Store to Trading Post
        pile of passable rubble to light rubble
        Last edited by smbhax; October 23, 2022, 04:38.
        My Angband videos

        Comment

        Working...
        😀
        😂
        🥰
        😘
        🤢
        😎
        😞
        😡
        👍
        👎