Skip to content

Commit

Permalink
Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
totetmatt committed Sep 22, 2024
1 parent 147c418 commit 39a03ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ namespace Network {
bool IsGrabber();
bool IsSender();
bool IsOffline();
bool IsConnected();
void GenerateWindowsTitle(char** originalTitle);
}
#endif // BONZOMATIC_NETWORK_H
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down
11 changes: 7 additions & 4 deletions src/platform_common/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -246,6 +246,9 @@ namespace Network {
bool IsOffline() {
return config.Mode == OFFLINE;
}
bool IsConnected() {
return connected;
}
void GenerateWindowsTitle(char** originalTitle) {
if (IsOffline()) {
return;
Expand Down

0 comments on commit 39a03ec

Please sign in to comment.