Skip to content

Commit

Permalink
Merge pull request #438 from yapb/vladislav4kz-patch
Browse files Browse the repository at this point in the history
Some fixes and additions
  • Loading branch information
Vladislav4KZ committed Apr 20, 2023
2 parents 422772d + 5adb9de commit bfe459e
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 23 deletions.
6 changes: 2 additions & 4 deletions cfg/addons/yapb/conf/lang/de_lang.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 26 additions & 4 deletions cfg/addons/yapb/conf/lang/ru_lang.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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...

Expand All @@ -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
Expand All @@ -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
Expand Down
50 changes: 37 additions & 13 deletions src/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ("Noclip mode enabled.");
}
else {
graph.setEditFlag (GraphEdit::On | GraphEdit::Noclip);
enableDrawModels (true);

msg ("Graph editor has been enabled with noclip mode.");
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 ("Enabled auto nodes placement.");
}
else {
graph.setEditFlag (GraphEdit::On | GraphEdit::Auto);
enableDrawModels (true);

msg ("Graph editor has been enabled with auto add node mode.");
msg ("Graph editor has been enabled with auto add node mode.");
}
}

if (graph.hasEditFlag (GraphEdit::On)) {
Expand Down Expand Up @@ -1271,6 +1285,7 @@ int BotControl::menuGraphPage2 (int item) {

switch (item) {
case 1:
graph.setEditFlag (GraphEdit::On);
showMenu (Menu::NodeDebug);
break;

Expand Down Expand Up @@ -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;

Expand All @@ -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);

Expand Down Expand Up @@ -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_ ());
Expand All @@ -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_ ());
Expand Down
2 changes: 0 additions & 2 deletions src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit bfe459e

Please sign in to comment.