mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
commit
4b7208ac53
5 changed files with 40 additions and 3 deletions
|
@ -242,6 +242,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
|
|
||||||
connect(&domainHandler, SIGNAL(hostnameChanged(const QString&)), SLOT(domainChanged(const QString&)));
|
connect(&domainHandler, SIGNAL(hostnameChanged(const QString&)), SLOT(domainChanged(const QString&)));
|
||||||
connect(&domainHandler, SIGNAL(connectedToDomain(const QString&)), SLOT(connectedToDomain(const QString&)));
|
connect(&domainHandler, SIGNAL(connectedToDomain(const QString&)), SLOT(connectedToDomain(const QString&)));
|
||||||
|
connect(&domainHandler, SIGNAL(connectedToDomain(const QString&)), SLOT(updateWindowTitle()));
|
||||||
|
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
|
||||||
connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived);
|
connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived);
|
||||||
|
|
||||||
// hookup VoxelEditSender to PaymentManager so we can pay for octree edits
|
// hookup VoxelEditSender to PaymentManager so we can pay for octree edits
|
||||||
|
@ -3328,9 +3330,10 @@ void Application::updateWindowTitle(){
|
||||||
QString buildVersion = " (build " + applicationVersion() + ")";
|
QString buildVersion = " (build " + applicationVersion() + ")";
|
||||||
NodeList* nodeList = NodeList::getInstance();
|
NodeList* nodeList = NodeList::getInstance();
|
||||||
|
|
||||||
|
QString connectionStatus = nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED) ";
|
||||||
QString username = AccountManager::getInstance().getAccountInfo().getUsername();
|
QString username = AccountManager::getInstance().getAccountInfo().getUsername();
|
||||||
QString title = QString() + (!username.isEmpty() ? username + " @ " : QString())
|
QString title = QString() + (!username.isEmpty() ? username + " @ " : QString())
|
||||||
+ nodeList->getDomainHandler().getHostname() + buildVersion;
|
+ nodeList->getDomainHandler().getHostname() + connectionStatus + buildVersion;
|
||||||
|
|
||||||
AccountManager& accountManager = AccountManager::getInstance();
|
AccountManager& accountManager = AccountManager::getInstance();
|
||||||
if (accountManager.getAccountInfo().hasBalance()) {
|
if (accountManager.getAccountInfo().hasBalance()) {
|
||||||
|
|
|
@ -57,6 +57,9 @@ ApplicationOverlay::~ApplicationOverlay() {
|
||||||
const float WHITE_TEXT[] = { 0.93f, 0.93f, 0.93f };
|
const float WHITE_TEXT[] = { 0.93f, 0.93f, 0.93f };
|
||||||
const float RETICLE_COLOR[] = { 0.0f, 198.0f / 255.0f, 244.0f / 255.0f };
|
const float RETICLE_COLOR[] = { 0.0f, 198.0f / 255.0f, 244.0f / 255.0f };
|
||||||
|
|
||||||
|
const float CONNECTION_STATUS_BORDER_COLOR[] = { 1.0f, 0.0f, 0.0f };
|
||||||
|
const float CONNECTION_STATUS_BORDER_LINE_WIDTH = 4.0f;
|
||||||
|
|
||||||
// Renders the overlays either to a texture or to the screen
|
// Renders the overlays either to a texture or to the screen
|
||||||
void ApplicationOverlay::renderOverlay(bool renderToTexture) {
|
void ApplicationOverlay::renderOverlay(bool renderToTexture) {
|
||||||
|
|
||||||
|
@ -115,6 +118,8 @@ void ApplicationOverlay::renderOverlay(bool renderToTexture) {
|
||||||
|
|
||||||
renderPointers();
|
renderPointers();
|
||||||
|
|
||||||
|
renderDomainConnectionStatusBorder();
|
||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
|
|
||||||
|
@ -1234,6 +1239,30 @@ void ApplicationOverlay::renderTexturedHemisphere() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ApplicationOverlay::renderDomainConnectionStatusBorder() {
|
||||||
|
NodeList* nodeList = NodeList::getInstance();
|
||||||
|
|
||||||
|
if (nodeList && !nodeList->getDomainHandler().isConnected()) {
|
||||||
|
QGLWidget* glWidget = Application::getInstance()->getGLWidget();
|
||||||
|
int right = glWidget->width();
|
||||||
|
int bottom = glWidget->height();
|
||||||
|
|
||||||
|
glColor3f(CONNECTION_STATUS_BORDER_COLOR[0],
|
||||||
|
CONNECTION_STATUS_BORDER_COLOR[1],
|
||||||
|
CONNECTION_STATUS_BORDER_COLOR[2]);
|
||||||
|
glLineWidth(CONNECTION_STATUS_BORDER_LINE_WIDTH);
|
||||||
|
|
||||||
|
glBegin(GL_LINE_LOOP);
|
||||||
|
|
||||||
|
glVertex2i(0, 0);
|
||||||
|
glVertex2i(0, bottom);
|
||||||
|
glVertex2i(right, bottom);
|
||||||
|
glVertex2i(right, 0);
|
||||||
|
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QOpenGLFramebufferObject* ApplicationOverlay::getFramebufferObject() {
|
QOpenGLFramebufferObject* ApplicationOverlay::getFramebufferObject() {
|
||||||
QSize size = Application::getInstance()->getGLWidget()->size();
|
QSize size = Application::getInstance()->getGLWidget()->size();
|
||||||
if (!_framebufferObject || _framebufferObject->size() != size) {
|
if (!_framebufferObject || _framebufferObject->size() != size) {
|
||||||
|
|
|
@ -56,6 +56,7 @@ private:
|
||||||
void renderAudioMeter();
|
void renderAudioMeter();
|
||||||
void renderStatsAndLogs();
|
void renderStatsAndLogs();
|
||||||
void renderTexturedHemisphere();
|
void renderTexturedHemisphere();
|
||||||
|
void renderDomainConnectionStatusBorder();
|
||||||
|
|
||||||
QOpenGLFramebufferObject* _framebufferObject;
|
QOpenGLFramebufferObject* _framebufferObject;
|
||||||
float _trailingAudioLoudness;
|
float _trailingAudioLoudness;
|
||||||
|
@ -76,4 +77,4 @@ private:
|
||||||
GLuint _crosshairTexture;
|
GLuint _crosshairTexture;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ApplicationOverlay_h
|
#endif // hifi_ApplicationOverlay_h
|
||||||
|
|
|
@ -36,6 +36,7 @@ DomainHandler::DomainHandler(QObject* parent) :
|
||||||
void DomainHandler::clearConnectionInfo() {
|
void DomainHandler::clearConnectionInfo() {
|
||||||
_uuid = QUuid();
|
_uuid = QUuid();
|
||||||
_isConnected = false;
|
_isConnected = false;
|
||||||
|
emit disconnectedFromDomain();
|
||||||
|
|
||||||
if (_handshakeTimer) {
|
if (_handshakeTimer) {
|
||||||
_handshakeTimer->stop();
|
_handshakeTimer->stop();
|
||||||
|
@ -129,6 +130,8 @@ void DomainHandler::setIsConnected(bool isConnected) {
|
||||||
|
|
||||||
// we've connected to new domain - time to ask it for global settings
|
// we've connected to new domain - time to ask it for global settings
|
||||||
requestDomainSettings();
|
requestDomainSettings();
|
||||||
|
} else {
|
||||||
|
emit disconnectedFromDomain();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,4 +199,4 @@ void DomainHandler::parseDTLSRequirementPacket(const QByteArray& dtlsRequirement
|
||||||
_sockAddr.setPort(dtlsPort);
|
_sockAddr.setPort(dtlsPort);
|
||||||
|
|
||||||
// initializeDTLSSession();
|
// initializeDTLSSession();
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,7 @@ private slots:
|
||||||
signals:
|
signals:
|
||||||
void hostnameChanged(const QString& hostname);
|
void hostnameChanged(const QString& hostname);
|
||||||
void connectedToDomain(const QString& hostname);
|
void connectedToDomain(const QString& hostname);
|
||||||
|
void disconnectedFromDomain();
|
||||||
|
|
||||||
void settingsReceived(const QJsonObject& domainSettingsObject);
|
void settingsReceived(const QJsonObject& domainSettingsObject);
|
||||||
void settingsReceiveFail();
|
void settingsReceiveFail();
|
||||||
|
|
Loading…
Reference in a new issue