Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit b488ddc7 authored by deuce's avatar deuce

Allow callbacks for the Meny function.

parent a847e64e
......@@ -76,7 +76,7 @@ static const char *Alchemist_Poison(const struct player *rec)
return "None";
}
static void Meny()
static void Meny(void *cbdata)
{
clr();
nl();
......@@ -484,14 +484,11 @@ static bool Menu(bool * refresh)
onliner->location = ONLOC_Alchemist;
strcpy(onliner->doing, location_desc(onliner->location));
}
Display_Menu(true, true, refresh, name, expert_prompt, Meny);
Display_Menu(true, true, refresh, name, expert_prompt, Meny, NULL);
switch((ch=toupper(gchar()))) {
case '?': // Display Menu
if(player->expert)
Display_Menu(true, false, refresh, name, expert_prompt, Meny);
else
Display_Menu(false, false, refresh, name, expert_prompt, Meny);
Display_Menu(player->expert, false, refresh, name, expert_prompt, Meny, NULL);
break;
case 'S': // Status
clr();
......
......@@ -38,7 +38,7 @@ Copyright 2007 Jakob Dangarden
static const char *name="Shady Shops";
static const char *expert_prompt="(B,A,G,O,S,D,R,?)";
static void Meny(void)
static void Meny(void *cbdata)
{
const int offset = 25;
......@@ -76,7 +76,7 @@ static bool Menu(bool * refresh)
// auto-travel
switch(player->auto_probe) {
case NoWhere:
Display_Menu(true, true, refresh, name, expert_prompt, Meny);
Display_Menu(true, true, refresh, name, expert_prompt, Meny, NULL);
cho=toupper(gchar());
break;
case UmanCave:
......@@ -105,10 +105,7 @@ static bool Menu(bool * refresh)
switch(cho) {
case '?':
if(player->expert)
Display_Menu(true, false, refresh, name, expert_prompt, Meny);
else
Display_Menu(false, false, refresh, name, expert_prompt, Meny);
Display_Menu(player->expert, false, refresh, name, expert_prompt, Meny, NULL);
break;
case 'R': // Return
return false;
......
......@@ -9,13 +9,13 @@
#include "todo.h"
void Display_Menu(bool force, bool terse, bool *refresh, const char *name, const char *expert_prompt, void (*Meny)(void))
void Display_Menu(bool force, bool terse, bool *refresh, const char *name, const char *expert_prompt, void (*Meny)(void *), void *cbdata)
{
if(terse) {
if(!player->expert) {
if(*refresh && player->auto_meny) {
*refresh=false;
Meny();
Meny(cbdata);
}
nl();
D(config.textcolor, name, " (", config.hotkeycolor, "?", config.textcolor, " for menu) :");
......@@ -27,7 +27,7 @@ void Display_Menu(bool force, bool terse, bool *refresh, const char *name, const
}
else {
if((!player->expert) || force) {
Meny();
Meny(cbdata);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment