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) {
|
||||
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) {
|
||||
case 1:
|
||||
showMenu (Menu::WeaponMode);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
showMenu (graph.hasEditor () ? Menu::NodeMainPage1 : Menu::Features);
|
||||
showMenu (autoAcquireEditorRights ());
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue