From f67c0ab75a31270805244a35c252b5fc72eb81fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Thu, 20 Apr 2023 10:56:37 +0000 Subject: [PATCH 1/6] control: don't enable spawn points highlighting by toggling noclip or auto add node mode when graph editor is enabled --- src/control.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/control.cpp b/src/control.cpp index 8d1ac3f..73b3a29 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)) { From 6610118582736114feced9c79e70ca35b2699028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:04:47 +0000 Subject: [PATCH 2/6] control: enable graph editor when opening the debug goal menu --- src/control.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/control.cpp b/src/control.cpp index 73b3a29..08f9cbb 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -1285,6 +1285,7 @@ int BotControl::menuGraphPage2 (int item) { switch (item) { case 1: + graph.setEditFlag (GraphEdit::On); showMenu (Menu::NodeDebug); break; @@ -1415,8 +1416,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_ ()); @@ -1428,8 +1427,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_ ()); From 3db5362d27d49683ace3741ab343100ef8c5fb85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:15:52 +0000 Subject: [PATCH 3/6] fix: graph checking feature doesn't output a message on hud when called from menu --- src/graph.cpp | 2 -- 1 file changed, 2 deletions(-) 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; From 02ff34a6ef1b5363f8ddb82f0a94f9f4edd1b044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:20:03 +0000 Subject: [PATCH 4/6] control: added some missing notifications displayed on hud when using features from graph editor menu --- src/control.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/control.cpp b/src/control.cpp index 08f9cbb..168510f 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -1316,20 +1316,31 @@ int BotControl::menuGraphPage2 (int item) { case 4: if (graph.checkNodes (true)) { graph.saveGraphData (); + msg ("Graph 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 saved."); + } + else { + msg ("Could not save Graph. See console..."); + } showMenu (Menu::NodeMainPage2); break; case 6: - graph.loadGraphData (); + if (graph.loadGraphData ()) { + msg ("Graph loaded."); + } + else { + msg ("Could not load Graph. See console..."); + } showMenu (Menu::NodeMainPage2); break; @@ -1348,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); From 7ebe86665352c14af9b77e071e0972e793294d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:25:44 +0000 Subject: [PATCH 5/6] cfg: update english template for language configs --- cfg/addons/yapb/conf/lang/de_lang.cfg | 6 ++---- cfg/addons/yapb/conf/lang/ru_lang.cfg | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) 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..23b4112 100644 --- a/cfg/addons/yapb/conf/lang/ru_lang.cfg +++ b/cfg/addons/yapb/conf/lang/ru_lang.cfg @@ -1044,12 +1044,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 From 5adb9deb15e67f001e5e219e7c24304ebadfe679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Thu, 20 Apr 2023 11:46:23 +0000 Subject: [PATCH 6/6] cfg: ru_lang.cfg: translated new strings --- cfg/addons/yapb/conf/lang/ru_lang.cfg | 24 ++++++++++++++++++++++++ src/control.cpp | 6 +++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/cfg/addons/yapb/conf/lang/ru_lang.cfg b/cfg/addons/yapb/conf/lang/ru_lang.cfg index 23b4112..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... @@ -1073,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 168510f..2296e7e 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -1316,7 +1316,7 @@ int BotControl::menuGraphPage2 (int item) { case 4: if (graph.checkNodes (true)) { graph.saveGraphData (); - msg ("Graph saved."); + msg ("Graph successfully saved."); } else { msg ("Graph not saved. There are errors, see console..."); @@ -1326,7 +1326,7 @@ int BotControl::menuGraphPage2 (int item) { case 5: if (graph.saveGraphData ()) { - msg ("Graph saved."); + msg ("Graph successfully saved."); } else { msg ("Could not save Graph. See console..."); @@ -1336,7 +1336,7 @@ int BotControl::menuGraphPage2 (int item) { case 6: if (graph.loadGraphData ()) { - msg ("Graph loaded."); + msg ("Graph successfully loaded."); } else { msg ("Could not load Graph. See console...");