Skip to content
Permalink
Browse files

now GetModState is also returning the downloaded state

  • Loading branch information...
Turupawn committed Jul 23, 2019
1 parent 8aed533 commit edfb2c16ff631efaf7ef71cc289d5a0ccd0625ce
Showing with 9 additions and 2 deletions.
  1. +1 −0 include/c/ModioC.h
  2. +8 −2 src/c/methods/DownloadsMethods.cpp
@@ -95,6 +95,7 @@ typedef int i32;
#define MODIO_PRIORITIZING_OTHER_DOWNLOAD 8
#define MODIO_MOD_STARTING_UPLOAD 9
#define MODIO_MOD_UPLOADING 10
#define MODIO_MOD_DOWNLOADED 11

// Maturity options
#define MODIO_MATURITY_NONE 0
@@ -94,13 +94,19 @@ u32 modioGetAllInstalledModsCount()

u32 modioGetModState(u32 mod_id)
{
for(auto queued_mod_download : modio::curlwrapper::getModDownloadQueue())
for(auto& queued_mod_download : modio::curlwrapper::getModDownloadQueue())
{
if(queued_mod_download->mod_id == mod_id)
return queued_mod_download->state;
}

for(auto installed_mod : modio::installed_mods)
for(auto& downloaded_mod : modio::downloaded_mods)
{
if(downloaded_mod == mod_id)
return MODIO_MOD_DOWNLOADED;
}

for(auto& installed_mod : modio::installed_mods)
{
if(modio::hasKey(installed_mod, "mod_id") && installed_mod["mod_id"] == mod_id)
return MODIO_MOD_INSTALLED;

0 comments on commit edfb2c1

Please sign in to comment.
You can’t perform that action at this time.