mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-01 02:53:36 +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;
|
||||
}
|
||||
|
||||
DLCFile *DLCPack::getFile(DLCManager::EDLCType type, DWORD index)
|
||||
DLCFile *DLCPack::getFile(DLCManager::EDLCType type, unsigned int index)
|
||||
{
|
||||
DLCFile *file = NULL;
|
||||
if(type == DLCManager::e_DLCType_All)
|
||||
|
|
@ -333,9 +333,9 @@ DLCFile *DLCPack::getFile(DLCManager::EDLCType type, const std::wstring &path)
|
|||
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)
|
||||
{
|
||||
|
|
@ -346,13 +346,13 @@ DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCT
|
|||
}
|
||||
break;
|
||||
default:
|
||||
count = (DWORD)m_files[(int)type].size();
|
||||
count = static_cast<unsigned int>(m_files[(int)type].size());
|
||||
break;
|
||||
};
|
||||
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)
|
||||
{
|
||||
|
|
@ -363,9 +363,9 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const std::wstring &pat
|
|||
return 0;
|
||||
}
|
||||
|
||||
DWORD foundIndex = 0;
|
||||
unsigned int foundIndex = 0;
|
||||
found = false;
|
||||
DWORD index = 0;
|
||||
unsigned int index = 0;
|
||||
for(AUTO_VAR(it, m_files[type].begin()); it != m_files[type].end(); ++it)
|
||||
{
|
||||
if(path.compare((*it)->getPath()) == 0)
|
||||
|
|
|
|||
|
|
@ -76,18 +76,18 @@ public:
|
|||
#endif
|
||||
|
||||
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);
|
||||
|
||||
DWORD getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All);
|
||||
DWORD getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found);
|
||||
unsigned int getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All);
|
||||
unsigned int getFileIndexAt(DLCManager::EDLCType type, const std::wstring &path, bool &found);
|
||||
bool doesPackContainFile(DLCManager::EDLCType type, const std::wstring &path);
|
||||
std::uint32_t GetPackID() {return m_packId;}
|
||||
|
||||
DWORD 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 getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); }
|
||||
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(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 hasPurchasedFile(DLCManager::EDLCType type, const std::wstring &path);
|
||||
|
|
|
|||
|
|
@ -1007,7 +1007,7 @@ void CScene_SkinSelect::handlePackIndexChanged()
|
|||
if(m_currentPack != NULL)
|
||||
{
|
||||
bool found;
|
||||
DWORD currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found);
|
||||
unsigned int currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found);
|
||||
if(found) m_skinIndex = currentSkinIndex;
|
||||
}
|
||||
else
|
||||
|
|
@ -1036,7 +1036,7 @@ void CScene_SkinSelect::handlePackIndexChanged()
|
|||
DLCPack *Pack=app.m_dlcManager.getPackContainingSkin(chars);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1441,4 +1441,4 @@ void CScene_SkinSelect::AddFavoriteSkin(int iPad,int iSkinID)
|
|||
app.SetPlayerFavoriteSkin(iPad,(int)ucPos,iSkinID);
|
||||
app.SetPlayerFavoriteSkinsPos(m_iPad,ucPos);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue