Skip to content

Instantly share code, notes, and snippets.

@zokier
Created June 25, 2012 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zokier/2989586 to your computer and use it in GitHub Desktop.
Save zokier/2989586 to your computer and use it in GitHub Desktop.
void (*yesno_cb)(bool);
void yn_tavern_room(bool b)
{
if (b)
set_player_location(&loc_room_offline);
else
set_player_location(&loc_tavern_bartender);
}
void ac_tavern_room()
{
yesno_cb = &yn_tavern_room;
print("Want a room");
set_player_location(&loc_yesno);
}
void ac_yesno_yes()
{
(*yesno_cb)(true);
}
void ac_yesno_no()
{
(*yesno_cb)(false);
}
Location loc_yesno = {
"", /* NULL here would mean there be dragons. Always have "" instead */
2,
{
{
'y',
"",
"Yes",
&ac_yesno_yes
},
{
'n',
"",
"No",
&ac_yesno_no
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment