MCPcopy Create free account
hub / github.com/NetHack/NetHack / getpos_help_keyxhelp

Function getpos_help_keyxhelp

src/getpos.c:136–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134};
135
136staticfn void
137getpos_help_keyxhelp(
138 winid tmpwin,
139 const char *k1, const char *k2,
140 int gloc)
141{
142 char sbuf[BUFSZ], fbuf[QBUFSZ];
143 const char *move_cursor_to = "move the cursor to ",
144 *filtertxt = gloc_filtertxt[iflags.getloc_filter];
145
146 if (gloc == GLOC_EXPLORE) {
147 /* default of "move to unexplored location" is inaccurate
148 because the position will be one spot short of that */
149 move_cursor_to = "move the cursor next to an ";
150 if (iflags.getloc_usemenu)
151 /* default is too wide for basic 80-column tty so shorten it
152 to avoid wrapping */
153 filtertxt = strsubst(strcpy(fbuf, filtertxt),
154 "this area", "area");
155 }
156 Sprintf(sbuf, "Use '%s'/'%s' to %s%s%s.",
157 k1, k2,
158 iflags.getloc_usemenu ? "get a menu of " : move_cursor_to,
159 gloc_descr[gloc][2 + iflags.getloc_usemenu], filtertxt);
160 putstr(tmpwin, 0, sbuf);
161}
162
163DISABLE_WARNING_FORMAT_NONLITERAL
164

Callers 1

getpos_helpFunction · 0.85

Calls 1

strsubstFunction · 0.85

Tested by

no test coverage detected