diff --git a/build/iOS/MultiCraft/MultiCraft/ioswrap.h b/build/iOS/MultiCraft/MultiCraft/ioswrap.h index 58879e10..aa358a41 100755 --- a/build/iOS/MultiCraft/MultiCraft/ioswrap.h +++ b/build/iOS/MultiCraft/MultiCraft/ioswrap.h @@ -14,6 +14,7 @@ enum { void ioswrap_log(const char *message); void ioswrap_paths(int type, char *dest, size_t destlen); void ioswrap_assets(void); // extracts assets.zip to PATH_LIBRARY_SUPPORT +void ioswrap_asset_refresh(void); void ioswrap_size(unsigned int *dest); void ioswrap_show_dialog(void *uiviewcontroller, const char *accept, const char *hint, const char *current, int type); int ioswrap_get_dialog(const char **text); diff --git a/build/iOS/MultiCraft/MultiCraft/ioswrap.m b/build/iOS/MultiCraft/MultiCraft/ioswrap.m index 5a40d612..849b6c26 100755 --- a/build/iOS/MultiCraft/MultiCraft/ioswrap.m +++ b/build/iOS/MultiCraft/MultiCraft/ioswrap.m @@ -126,7 +126,7 @@ void ioswrap_assets() recursive_delete(destpath); // delete assets before updating them extract: - NSLog(@"%s: extract %@ to %@", assets[i].name, zippath, destpath); + NSLog(@"%s: extract %@ to %@", assets[i].name, zippath, destpath); [SSZipArchive unzipFileAtPath:zippath toDestination:destpath]; write_version(destpath, v_runtime); } @@ -135,6 +135,16 @@ extract: win.backgroundColor = [UIColor blackColor]; } +void ioswrap_asset_refresh(void) +{ + char buf[256]; + ioswrap_paths(PATH_LIBRARY_SUPPORT, buf, sizeof(buf)); + NSString *destpath = [NSString stringWithUTF8String:buf]; + + // set asset version to 0, will be extracted next time + write_version(destpath, 0); +} + void ioswrap_size(unsigned int *dest) { CGSize bounds = [[UIScreen mainScreen] bounds].size; diff --git a/src/porting_ios.cpp b/src/porting_ios.cpp index 2bdc07f4..e2168977 100644 --- a/src/porting_ios.cpp +++ b/src/porting_ios.cpp @@ -82,6 +82,10 @@ namespace porting { return std::string(str); } + void notifyAbortLoading() { + ioswrap_asset_refresh(); + } + void notifyServerConnect(bool is_multiplayer) { #ifdef ADS ads_allow(!is_multiplayer); diff --git a/src/porting_ios.h b/src/porting_ios.h index ca88cec7..5a115820 100644 --- a/src/porting_ios.h +++ b/src/porting_ios.h @@ -45,7 +45,7 @@ namespace porting { std::string getInputDialogValue(); - inline void notifyAbortLoading() {} + void notifyAbortLoading(); void notifyServerConnect(bool is_multiplayer);