diff --git a/cfg/addons/yapb/conf/lang/de_lang.cfg b/cfg/addons/yapb/conf/lang/de_lang.cfg index 3ad0ace..30b27c3 100644 --- a/cfg/addons/yapb/conf/lang/de_lang.cfg +++ b/cfg/addons/yapb/conf/lang/de_lang.cfg @@ -920,12 +920,10 @@ You have been teleported to node %d. Sie wurden zum Knoten %d teleportiert. [ORIGINAL] -Graph not saved -There are errors. See console... +Graph not saved. There are errors, see console... [TRANSLATED] -Graph nicht gespeichert -Es liegen Fehler vor. Siehe Konsole... +Graph nicht gespeichert. Es liegen Fehler vor, siehe Konsole... [ORIGINAL] There are errors, see console diff --git a/cfg/addons/yapb/conf/lang/ru_lang.cfg b/cfg/addons/yapb/conf/lang/ru_lang.cfg index bed8093..65e12a1 100644 --- a/cfg/addons/yapb/conf/lang/ru_lang.cfg +++ b/cfg/addons/yapb/conf/lang/ru_lang.cfg @@ -1013,12 +1013,24 @@ Unable to save POD-Bot Format waypoint file. Number of nodes exceeds 1024. [TRANSLATED] Невозможно сохранить вэйпоинт файл в формате POD-Bot. Количество точек превышает 1024. +[ORIGINAL] +Graph successfully saved. + +[TRANSLATED] +Граф успешно сохранён. + [ORIGINAL] Graph successfully loaded. [TRANSLATED] Граф успешно загружен. +[ORIGINAL] +Could not save Graph. See console... + +[TRANSLATED] +Невозможно сохранить граф. Смотри консоль... + [ORIGINAL] Could not load Graph. See console... @@ -1044,12 +1056,10 @@ You have been teleported to node %d. Вы были телепортированы к точке %d. [ORIGINAL] -Graph not saved -There are errors. See console... +Graph not saved. There are errors, see console... [TRANSLATED] -Graph не сохранён -Есть ошибки, смотри консоль +Graph не сохранён. Есть ошибки, смотри консоль... [ORIGINAL] There are errors, see console @@ -1075,6 +1085,18 @@ Debug goal is disabled. [TRANSLATED] Отладка цели отключена. +[ORIGINAL] +Noclip mode disabled. + +[TRANSLATED] +Режим полёта выключен. + +[ORIGINAL] +Noclip mode enabled. + +[TRANSLATED] +Режим полёта включён. + [ORIGINAL] You're dead, and have no access to this menu diff --git a/src/control.cpp b/src/control.cpp index 8d1ac3f..2296e7e 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -396,16 +396,30 @@ int BotControl::cmdNodeOn () { else if (strValue (option) == "noclip") { m_ent->v.movetype = MOVETYPE_NOCLIP; - graph.setEditFlag (GraphEdit::On | GraphEdit::Noclip); - enableDrawModels (true); + if (graph.hasEditFlag (GraphEdit::On)) { + graph.setEditFlag (GraphEdit::Noclip); - msg ("Graph editor has been enabled with noclip mode."); + msg ("Noclip mode enabled."); + } + else { + graph.setEditFlag (GraphEdit::On | GraphEdit::Noclip); + enableDrawModels (true); + + msg ("Graph editor has been enabled with noclip mode."); + } } else if (strValue (option) == "auto") { - graph.setEditFlag (GraphEdit::On | GraphEdit::Auto); - enableDrawModels (true); + if (graph.hasEditFlag (GraphEdit::On)) { + graph.setEditFlag (GraphEdit::Auto); - msg ("Graph editor has been enabled with auto add node mode."); + msg ("Enabled auto nodes placement."); + } + else { + graph.setEditFlag (GraphEdit::On | GraphEdit::Auto); + enableDrawModels (true); + + msg ("Graph editor has been enabled with auto add node mode."); + } } if (graph.hasEditFlag (GraphEdit::On)) { @@ -1271,6 +1285,7 @@ int BotControl::menuGraphPage2 (int item) { switch (item) { case 1: + graph.setEditFlag (GraphEdit::On); showMenu (Menu::NodeDebug); break; @@ -1301,20 +1316,31 @@ int BotControl::menuGraphPage2 (int item) { case 4: if (graph.checkNodes (true)) { graph.saveGraphData (); + msg ("Graph successfully saved."); } else { - msg ("Graph not saved\nThere are errors. See console..."); + msg ("Graph not saved. There are errors, see console..."); } showMenu (Menu::NodeMainPage2); break; case 5: - graph.saveGraphData (); + if (graph.saveGraphData ()) { + msg ("Graph successfully saved."); + } + else { + msg ("Could not save Graph. See console..."); + } showMenu (Menu::NodeMainPage2); break; case 6: - graph.loadGraphData (); + if (graph.loadGraphData ()) { + msg ("Graph successfully loaded."); + } + else { + msg ("Could not load Graph. See console..."); + } showMenu (Menu::NodeMainPage2); break; @@ -1333,9 +1359,11 @@ int BotControl::menuGraphPage2 (int item) { if (graph.hasEditFlag (GraphEdit::Noclip)) { graph.clearEditFlag (GraphEdit::Noclip); + msg ("Noclip mode disabled."); } else { graph.setEditFlag (GraphEdit::Noclip); + msg ("Noclip mode enabled."); } showMenu (Menu::NodeMainPage2); @@ -1401,8 +1429,6 @@ int BotControl::menuGraphDebug (int item) { switch (item) { case 1: - graph.setEditFlag (GraphEdit::On); - cv_debug_goal.set (graph.getEditorNearest ()); if (cv_debug_goal.int_ () != kInvalidNodeIndex) { msg ("Debug goal is set to node %d.", cv_debug_goal.int_ ()); @@ -1414,8 +1440,6 @@ int BotControl::menuGraphDebug (int item) { break; case 2: - graph.setEditFlag (GraphEdit::On); - cv_debug_goal.set (graph.getFacingIndex ()); if (cv_debug_goal.int_ () != kInvalidNodeIndex) { msg ("Debug goal is set to node %d.", cv_debug_goal.int_ ()); diff --git a/src/graph.cpp b/src/graph.cpp index c293d4b..4de8a9c 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -2610,8 +2610,6 @@ bool BotGraph::checkNodes (bool teleportPlayer) { int goalPoints = 0; int rescuePoints = 0; - ctrl.setFromConsole (true); - for (const auto &path : m_paths) { int connections = 0;