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

Function mar_ask_direction

outdated/win/gem/wingem1.c:3058–3080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3056}
3057
3058int
3059mar_ask_direction()
3060{
3061 int d_exit;
3062 OBJECT *z_ob = zz_oblist[DIRECTION];
3063
3064 Event_Handler(Dia_Init, Dia_Handler);
3065 mar_set_dir_keys();
3066 d_exit = xdialog(z_ob, nullstr, NULL, NULL, mar_ob_mapcenter(z_ob), FALSE,
3067 DIALOG_MODE);
3068 Event_Timer(0, 0, TRUE);
3069 Event_Handler(NULL, NULL);
3070
3071 if (d_exit == W_CLOSED || d_exit == W_ABANDON)
3072 return ('\033');
3073 if ((d_exit & NO_CLICK) == DIRDOWN)
3074 return ('>');
3075 if ((d_exit & NO_CLICK) == DIRUP)
3076 return ('<');
3077 if ((d_exit & NO_CLICK) == (DIR1 + 8)) /* 5 or . */
3078 return ('.');
3079 return (*ob_get_text(z_ob, d_exit & NO_CLICK, 0));
3080}
3081
3082/************************* yn_function *******************************/
3083

Callers 1

Gem_yn_functionFunction · 0.85

Calls 2

mar_set_dir_keysFunction · 0.85
mar_ob_mapcenterFunction · 0.85

Tested by

no test coverage detected