mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
Use standard counts in DLC packs
This commit is contained in:
parent
3c2669b2a7
commit
86002c2f18
|
|
@ -278,7 +278,7 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, const std::wstring
|
||||||
return hasFile;
|
return hasFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLCFile *DLCPack::getFile(DLCManager::EDLCType type, DWORD index)
|
DLCFile *DLCPack::getFile(DLCManager::EDLCType type, unsigned int index)
|
||||||
{
|
{
|
||||||
DLCFile *file = NULL;
|
DLCFile *file = NULL;
|
||||||
if(type == DLCManager::e_DLCType_All)
|
if(type == DLCManager::e_DLCType_All)
|
||||||
|
|
@ -333,9 +333,9 @@ DLCFile *DLCPack::getFile(DLCManager::EDLCType type, const std::wstring &path)
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCType_All*/)
|
unsigned int DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCType_All*/)
|
||||||
{
|
{
|
||||||
DWORD count = 0;
|
unsigned int count = 0;
|
||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
|
|
@ -346,13 +346,13 @@ DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCT
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
count = (DWORD)m_files[(int)type].size();
|
count = static_cast<unsigned int>(m_files[(int)type].size());
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
return count;
|
return count;
|
||||||
};
|
};
|
||||||
|
|
||||||
DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found)
|
unsigned int DLCPack::getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found)
|
||||||
{
|
{
|
||||||
if(type == DLCManager::e_DLCType_All)
|
if(type == DLCManager::e_DLCType_All)
|
||||||
{
|
{
|
||||||
|
|
@ -363,9 +363,9 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const std::wstring &pat
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD foundIndex = 0;
|
unsigned int foundIndex = 0;
|
||||||
found = false;
|
found = false;
|
||||||
DWORD index = 0;
|
unsigned int index = 0;
|
||||||
for(AUTO_VAR(it, m_files[type].begin()); it != m_files[type].end(); ++it)
|
for(AUTO_VAR(it, m_files[type].begin()); it != m_files[type].end(); ++it)
|
||||||
{
|
{
|
||||||
if(path.compare((*it)->getPath()) == 0)
|
if(path.compare((*it)->getPath()) == 0)
|
||||||
|
|
|
||||||
|
|
@ -76,18 +76,18 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DLCFile *addFile(DLCManager::EDLCType type, const std::wstring &path);
|
DLCFile *addFile(DLCManager::EDLCType type, const std::wstring &path);
|
||||||
DLCFile *getFile(DLCManager::EDLCType type, DWORD index);
|
DLCFile *getFile(DLCManager::EDLCType type, unsigned int index);
|
||||||
DLCFile *getFile(DLCManager::EDLCType type, const std::wstring &path);
|
DLCFile *getFile(DLCManager::EDLCType type, const std::wstring &path);
|
||||||
|
|
||||||
DWORD getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All);
|
unsigned int getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All);
|
||||||
DWORD getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found);
|
unsigned int getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found);
|
||||||
bool doesPackContainFile(DLCManager::EDLCType type, const std::wstring &path);
|
bool doesPackContainFile(DLCManager::EDLCType type, const std::wstring &path);
|
||||||
std::uint32_t GetPackID() {return m_packId;}
|
std::uint32_t GetPackID() {return m_packId;}
|
||||||
|
|
||||||
DWORD getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); }
|
unsigned int getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); }
|
||||||
DWORD getSkinIndexAt(const std::wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); }
|
unsigned int getSkinIndexAt(const std::wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); }
|
||||||
DLCSkinFile *getSkinFile(const std::wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); }
|
DLCSkinFile *getSkinFile(const std::wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); }
|
||||||
DLCSkinFile *getSkinFile(DWORD index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); }
|
DLCSkinFile *getSkinFile(unsigned int index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); }
|
||||||
bool doesPackContainSkin(const std::wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); }
|
bool doesPackContainSkin(const std::wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); }
|
||||||
|
|
||||||
bool hasPurchasedFile(DLCManager::EDLCType type, const std::wstring &path);
|
bool hasPurchasedFile(DLCManager::EDLCType type, const std::wstring &path);
|
||||||
|
|
|
||||||
|
|
@ -1007,7 +1007,7 @@ void CScene_SkinSelect::handlePackIndexChanged()
|
||||||
if(m_currentPack != NULL)
|
if(m_currentPack != NULL)
|
||||||
{
|
{
|
||||||
bool found;
|
bool found;
|
||||||
DWORD currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found);
|
unsigned int currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found);
|
||||||
if(found) m_skinIndex = currentSkinIndex;
|
if(found) m_skinIndex = currentSkinIndex;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1036,7 +1036,7 @@ void CScene_SkinSelect::handlePackIndexChanged()
|
||||||
DLCPack *Pack=app.m_dlcManager.getPackContainingSkin(chars);
|
DLCPack *Pack=app.m_dlcManager.getPackContainingSkin(chars);
|
||||||
if(Pack)
|
if(Pack)
|
||||||
{
|
{
|
||||||
DWORD currentSkinIndex = Pack->getSkinIndexAt(m_currentSkinPath, found);
|
unsigned int currentSkinIndex = Pack->getSkinIndexAt(m_currentSkinPath, found);
|
||||||
if(found) m_skinIndex = app.GetPlayerFavoriteSkinsPos(m_iPad);
|
if(found) m_skinIndex = app.GetPlayerFavoriteSkinsPos(m_iPad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1441,4 +1441,4 @@ void CScene_SkinSelect::AddFavoriteSkin(int iPad,int iSkinID)
|
||||||
app.SetPlayerFavoriteSkin(iPad,(int)ucPos,iSkinID);
|
app.SetPlayerFavoriteSkin(iPad,(int)ucPos,iSkinID);
|
||||||
app.SetPlayerFavoriteSkinsPos(m_iPad,ucPos);
|
app.SetPlayerFavoriteSkinsPos(m_iPad,ucPos);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue