Skip to content

Commit

Permalink
Fix incorrect loading progress when menu images are added/removed
Browse files Browse the repository at this point in the history
Do not increment loading progress for individual menu images because the total number of images in the `menuimages` folder might be different than expected. Eventually, menu image loading could be moved to a background job like community icon loading.

Closes ddnet#9497.
  • Loading branch information
Robyt3 committed Jan 9, 2025
1 parent c860bb7 commit b556bb0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/game/client/components/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -909,9 +909,8 @@ void CMenus::OnInit()
m_TextureBlob = Graphics()->LoadTexture("blob.png", IStorage::TYPE_ALL);

// setup load amount
const int NumMenuImages = 5;
m_LoadingState.m_Current = 0;
m_LoadingState.m_Total = g_pData->m_NumImages + NumMenuImages + GameClient()->ComponentCount();
m_LoadingState.m_Total = g_pData->m_NumImages + GameClient()->ComponentCount();
if(!g_Config.m_ClThreadsoundloading)
m_LoadingState.m_Total += g_pData->m_NumSounds;

Expand Down Expand Up @@ -2445,7 +2444,7 @@ int CMenus::MenuImageScan(const char *pName, int IsDir, int DirType, void *pUser
str_truncate(MenuImage.m_aName, sizeof(MenuImage.m_aName), pName, str_length(pName) - str_length(pExtension));
pSelf->m_vMenuImages.push_back(MenuImage);

pSelf->RenderLoading(Localize("Loading DDNet Client"), Localize("Loading menu images"), 1);
pSelf->RenderLoading(Localize("Loading DDNet Client"), Localize("Loading menu images"), 0);

return 0;
}
Expand Down

0 comments on commit b556bb0

Please sign in to comment.