mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:37:46 +02:00
don't allow asset-server upload if no server present
This commit is contained in:
parent
f3797964e2
commit
229015a5da
2 changed files with 14 additions and 5 deletions
|
@ -3782,6 +3782,9 @@ void Application::nodeAdded(SharedNodePointer node) {
|
||||||
if (node->getType() == NodeType::AvatarMixer) {
|
if (node->getType() == NodeType::AvatarMixer) {
|
||||||
// new avatar mixer, send off our identity packet right away
|
// new avatar mixer, send off our identity packet right away
|
||||||
_myAvatar->sendIdentityPacket();
|
_myAvatar->sendIdentityPacket();
|
||||||
|
} else if (node->getType() == NodeType::AssetServer) {
|
||||||
|
// the addition of an asset-server always re-enables the upload to asset server menu option
|
||||||
|
Menu::getInstance()->getActionForOption(MenuOption::UploadAsset)->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3829,6 +3832,10 @@ void Application::nodeKilled(SharedNodePointer node) {
|
||||||
} else if (node->getType() == NodeType::AvatarMixer) {
|
} else if (node->getType() == NodeType::AvatarMixer) {
|
||||||
// our avatar mixer has gone away - clear the hash of avatars
|
// our avatar mixer has gone away - clear the hash of avatars
|
||||||
DependencyManager::get<AvatarManager>()->clearOtherAvatars();
|
DependencyManager::get<AvatarManager>()->clearOtherAvatars();
|
||||||
|
} else if (node->getType() == NodeType::AssetServer
|
||||||
|
&& !DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::AssetServer)) {
|
||||||
|
// this was our last asset server - disable the menu option to upload an asset
|
||||||
|
Menu::getInstance()->getActionForOption(MenuOption::UploadAsset)->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -376,11 +376,13 @@ Menu::Menu() {
|
||||||
auto& assetDialogFactory = AssetUploadDialogFactory::getInstance();
|
auto& assetDialogFactory = AssetUploadDialogFactory::getInstance();
|
||||||
assetDialogFactory.setParent(this);
|
assetDialogFactory.setParent(this);
|
||||||
|
|
||||||
addActionToQMenuAndActionHash(assetDeveloperMenu,
|
QAction* assetUpload = addActionToQMenuAndActionHash(assetDeveloperMenu,
|
||||||
MenuOption::UploadAsset,
|
MenuOption::UploadAsset,
|
||||||
0,
|
0,
|
||||||
&AssetUploadDialogFactory::getInstance(),
|
&AssetUploadDialogFactory::getInstance(),
|
||||||
SLOT(showDialog()));
|
SLOT(showDialog()));
|
||||||
|
// disable the asset upload action by default - it gets enabled only if asset server becomes present
|
||||||
|
assetUpload->setEnabled(false);
|
||||||
|
|
||||||
MenuWrapper* avatarDebugMenu = developerMenu->addMenu("Avatar");
|
MenuWrapper* avatarDebugMenu = developerMenu->addMenu("Avatar");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue