add: make graph author read-only if graph file already has author upon load (resolves #369)

This commit is contained in:
jeefo 2022-09-21 14:47:36 +03:00 committed by GitHub
commit fd7b722fd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 93 additions and 20 deletions

View file

@ -279,7 +279,8 @@ int BotControl::cmdNode () {
"save",
"load",
"help",
"erase"
"erase",
"fileinfo"
};
// check if cmd is allowed on dedicated server
@ -331,6 +332,7 @@ int BotControl::cmdNode () {
addGraphCmd ("teleport", "teleport [index]", "Teleports player to specified node index.", &BotControl::cmdNodeTeleport);
addGraphCmd ("upload", "upload", "Uploads created graph to graph database.", &BotControl::cmdNodeUpload);
addGraphCmd ("stats", "stats [noarguments]", "Shows the stats about node types on the map.", &BotControl::cmdNodeShowStats);
addGraphCmd ("fileinfo", "fileinfo [noarguments]", "Shows basic information about graph file.", &BotControl::cmdNodeFileInfo);
// add path commands
addGraphCmd ("path_create", "path_create [noarguments]", "Opens and displays path creation menu.", &BotControl::cmdNodePathCreate);
@ -854,13 +856,17 @@ int BotControl::cmdNodeIterateCamp () {
}
int BotControl::cmdNodeShowStats () {
enum args { graph_cmd = 1 };
graph.showStats ();
return BotCommandResult::Handled;
}
int BotControl::cmdNodeFileInfo () {
graph.showFileInfo ();
return BotCommandResult::Handled;
}
int BotControl::menuMain (int item) {
closeMenu (); // reset menu display