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

Function optfn_player_selection

src/options.c:3437–3468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3435}
3436
3437staticfn int
3438optfn_player_selection(
3439 int optidx, int req, boolean negated,
3440 char *opts, char *op)
3441{
3442 if (req == do_init) {
3443 return optn_ok;
3444 }
3445 if (req == do_set) {
3446 /* WINCAP player_selection: dialog | prompt/prompts/prompting */
3447
3448 op = string_for_opt(opts, negated);
3449 if (op != empty_optstr && !negated) {
3450 if (!strncmpi(op, "dialog", sizeof "dialog" - 1)) {
3451 iflags.wc_player_selection = VIA_DIALOG;
3452 } else if (!strncmpi(op, "prompt", sizeof "prompt" - 1)) {
3453 iflags.wc_player_selection = VIA_PROMPTS;
3454 } else {
3455 config_error_add("Unknown %s parameter '%s'",
3456 allopt[optidx].name, op);
3457 return optn_err;
3458 }
3459 }
3460 return optn_ok;
3461 }
3462 if (req == get_val || req == get_cnf_val) {
3463 Sprintf(opts, "%s",
3464 iflags.wc_player_selection ? "prompts" : "dialog");
3465 return optn_ok;
3466 }
3467 return optn_ok;
3468}
3469
3470staticfn int
3471optfn_playmode(

Callers

nothing calls this directly

Calls 3

string_for_optFunction · 0.85
config_error_addFunction · 0.85
strncmpiFunction · 0.70

Tested by

no test coverage detected