[iOS] Implement notifyAbortLoading (#146)

This commit is contained in:
sfan5 2019-09-15 18:31:55 +02:00 committed by MoNTE48
parent ac9acac21c
commit 61a28793e5
4 changed files with 17 additions and 2 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -45,7 +45,7 @@ namespace porting {
std::string getInputDialogValue();
inline void notifyAbortLoading() {}
void notifyAbortLoading();
void notifyServerConnect(bool is_multiplayer);