mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Updated library version check.
This commit is contained in:
parent
c0584938a7
commit
e86a99c5f4
4 changed files with 16 additions and 6 deletions
|
@ -88,7 +88,10 @@ bool lcApplication::LoadPiecesLibrary(const char* LibPath, const char* LibraryIn
|
|||
strcat(LibraryPath, "library.bin");
|
||||
|
||||
if (m_Library->Load(LibraryPath, LibraryCachePath))
|
||||
{
|
||||
m_Library->mNumOfficialPieces = m_Library->mPieces.GetSize();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
lcPiecesLibrary::lcPiecesLibrary()
|
||||
{
|
||||
mNumOfficialPieces = 0;
|
||||
mZipFile = NULL;
|
||||
mCacheFile = NULL;
|
||||
mSaveCache = false;
|
||||
|
@ -41,6 +42,7 @@ void lcPiecesLibrary::Unload()
|
|||
delete mTextures[TextureIdx];
|
||||
mTextures.RemoveAll();
|
||||
|
||||
mNumOfficialPieces = 0;
|
||||
delete mZipFile;
|
||||
mZipFile = NULL;
|
||||
}
|
||||
|
|
|
@ -137,6 +137,7 @@ public:
|
|||
PtrArray<PieceInfo> mPieces;
|
||||
PtrArray<lcLibraryPrimitive> mPrimitives;
|
||||
ObjArray<lcLibraryCategory> mCategories;
|
||||
int mNumOfficialPieces;
|
||||
|
||||
PtrArray<lcTexture> mTextures;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "project.h"
|
||||
#include "globals.h"
|
||||
#include "system.h"
|
||||
#include "pieceinf.h" // TODO: remove
|
||||
#include "pieceinf.h"
|
||||
#include "mainwnd.h"
|
||||
#include "lc_library.h"
|
||||
#include "keyboard.h"
|
||||
|
@ -97,13 +97,17 @@ static void CheckForUpdates(void* Data)
|
|||
else
|
||||
str = "You are using the latest version of LeoCAD.\n";
|
||||
|
||||
if (lib > lcGetPiecesLibrary()->mPieces.GetSize())
|
||||
lcPiecesLibrary* Library = lcGetPiecesLibrary();
|
||||
if (Library->mNumOfficialPieces)
|
||||
{
|
||||
str += "There are new pieces available.\n\n";
|
||||
Update = true;
|
||||
if (lib > Library->mNumOfficialPieces)
|
||||
{
|
||||
str += "There are new pieces available.\n\n";
|
||||
Update = true;
|
||||
}
|
||||
else
|
||||
str += "There are no new pieces available at this time.\n";
|
||||
}
|
||||
else
|
||||
str += "There are no new pieces available at this time.\n";
|
||||
|
||||
if (Data || Update)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue