graph: auto acquire editor rights via menu
This commit is contained in:
parent
7dc34bd7fa
commit
4552ebd79c
1 changed files with 8 additions and 1 deletions
|
|
@ -893,13 +893,20 @@ int BotControl::menuMain (int item) {
|
||||||
int BotControl::menuFeatures (int item) {
|
int BotControl::menuFeatures (int item) {
|
||||||
closeMenu (); // reset menu display
|
closeMenu (); // reset menu display
|
||||||
|
|
||||||
|
auto autoAcquireEditorRights = [&] () {
|
||||||
|
if (!graph.hasEditor ()) {
|
||||||
|
graph.setEditor (m_ent);
|
||||||
|
}
|
||||||
|
return graph.hasEditor () && graph.getEditor () == m_ent ? Menu::NodeMainPage1 : Menu::Features;
|
||||||
|
};
|
||||||
|
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case 1:
|
case 1:
|
||||||
showMenu (Menu::WeaponMode);
|
showMenu (Menu::WeaponMode);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
showMenu (graph.hasEditor () ? Menu::NodeMainPage1 : Menu::Features);
|
showMenu (autoAcquireEditorRights ());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue