diff --git a/src/Network.h b/src/Network.h index 280d9ac0..fbaceef4 100644 --- a/src/Network.h +++ b/src/Network.h @@ -56,6 +56,7 @@ namespace Network { bool IsGrabber(); bool IsSender(); bool IsOffline(); + bool IsConnected(); void GenerateWindowsTitle(char** originalTitle); } #endif // BONZOMATIC_NETWORK_H \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index b8a9a019..b971729b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -385,7 +385,7 @@ int main( int argc, const char * argv[] ) int nMargin = 20; - bool bTexPreviewVisible = true; + bool bTexPreviewVisible = false; editorOptions.rect = Scintilla::PRectangle( nMargin, nMargin, settings.sRenderer.nWidth - nMargin - nTexPreviewWidth - nMargin, settings.sRenderer.nHeight - nMargin * 2 - nDebugOutputHeight ); ShaderEditor mShaderEditor( surface ); @@ -648,7 +648,7 @@ int main( int argc, const char * argv[] ) sHelp += szLayout; surface->DrawTextNoClip( Scintilla::PRectangle( 20, Renderer::nHeight - 20, 100, Renderer::nHeight ), *mShaderEditor.GetTextFont(), Renderer::nHeight - 5.0, sHelp.c_str(), (int) sHelp.length(), 0x80FFFFFF, 0x00000000 ); } - if(bShowGui && !Network::IsOffline()){ // Activity Square + if(bShowGui && !Network::IsOffline() && !Network::IsConnected()){ // Activity Square int TexPreviewOffset = bTexPreviewVisible ? nTexPreviewWidth + nMargin : 0; std::string Status = "totetmatt"; int fontWidth = surface->WidthText(*mNetworkStatus.GetTextFont(), Status.c_str(), (int)Status.length()) * 1.1; diff --git a/src/platform_common/Network.cpp b/src/platform_common/Network.cpp index 2a0214d4..1279bbb4 100644 --- a/src/platform_common/Network.cpp +++ b/src/platform_common/Network.cpp @@ -117,10 +117,10 @@ namespace Network { // printf("GOT ECHO REPLY: [%.*s]\n", (int)wm->data.len, wm->data.buf); } - - /*/if (ev == MG_EV_ERROR || ev == MG_EV_CLOSE || ev == MG_EV_WS_MSG) { - *(bool*)c->fn_data = true; // Signal that we're done - }*/ + else if (ev == MG_EV_ERROR || ev == MG_EV_CLOSE ) { + connected = false; + printf("Error\n"); + } } void Create() { @@ -246,6 +246,9 @@ namespace Network { bool IsOffline() { return config.Mode == OFFLINE; } + bool IsConnected() { + return connected; + } void GenerateWindowsTitle(char** originalTitle) { if (IsOffline()) { return;