Skip to content

Commit 224c93c

Browse files
Load start position with world model (#944)
1 parent db3af7f commit 224c93c

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,13 @@ void TwoDModelWidget::loadWorldModelWithoutRobot()
520520
}
521521

522522
// TODO: Split saves and remove temporary hack
523-
auto saveRoot = save.firstChildElement("root");
524-
auto currentRoot = generateWorldModelXml().firstChildElement("root");
525-
saveRoot.replaceChild(currentRoot.firstChildElement("robots"), saveRoot.firstChildElement("robots"));
523+
auto saveRobot = save.firstChildElement("root").firstChildElement("robots").firstChildElement("robot");
524+
auto currentRobot = generateWorldModelXml().firstChildElement("root")
525+
.firstChildElement("robots").firstChildElement("robot");
526+
527+
saveRobot.replaceChild(saveRobot.firstChildElement("sensors"), currentRobot.firstChildElement("sensors"));
528+
saveRobot.replaceChild(saveRobot.firstChildElement("wheels"), currentRobot.firstChildElement("wheels"));
529+
saveRobot.setAttribute("id", currentRobot.attribute("id"));
526530

527531
auto command = new commands::LoadWorldCommand(*this, save);
528532
if (mController) {

qrtranslations/fr/plugins/robots/twoDModel_fr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@
734734
<translation type="unfinished"></translation>
735735
</message>
736736
<message>
737-
<location line="+334"/>
737+
<location line="+338"/>
738738
<source>Hide details</source>
739739
<translation type="unfinished"></translation>
740740
</message>

qrtranslations/ru/plugins/robots/twoDModel_ru.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@
10851085
<translation type="vanished">Попытка загрузить слишком большое изображение может заморозить выполнение на некоторое время. Продолжить?</translation>
10861086
</message>
10871087
<message>
1088-
<location line="+334"/>
1088+
<location line="+338"/>
10891089
<source>Hide details</source>
10901090
<translation>Скрыть детали</translation>
10911091
</message>

0 commit comments

Comments
 (0)