[iOS] Implement notifyAbortLoading (#146)
This commit is contained in:
parent
ac9acac21c
commit
61a28793e5
@ -14,6 +14,7 @@ enum {
|
|||||||
void ioswrap_log(const char *message);
|
void ioswrap_log(const char *message);
|
||||||
void ioswrap_paths(int type, char *dest, size_t destlen);
|
void ioswrap_paths(int type, char *dest, size_t destlen);
|
||||||
void ioswrap_assets(void); // extracts assets.zip to PATH_LIBRARY_SUPPORT
|
void ioswrap_assets(void); // extracts assets.zip to PATH_LIBRARY_SUPPORT
|
||||||
|
void ioswrap_asset_refresh(void);
|
||||||
void ioswrap_size(unsigned int *dest);
|
void ioswrap_size(unsigned int *dest);
|
||||||
void ioswrap_show_dialog(void *uiviewcontroller, const char *accept, const char *hint, const char *current, int type);
|
void ioswrap_show_dialog(void *uiviewcontroller, const char *accept, const char *hint, const char *current, int type);
|
||||||
int ioswrap_get_dialog(const char **text);
|
int ioswrap_get_dialog(const char **text);
|
||||||
|
@ -126,7 +126,7 @@ void ioswrap_assets()
|
|||||||
recursive_delete(destpath); // delete assets before updating them
|
recursive_delete(destpath); // delete assets before updating them
|
||||||
|
|
||||||
extract:
|
extract:
|
||||||
NSLog(@"%s: extract %@ to %@", assets[i].name, zippath, destpath);
|
NSLog(@"%s: extract %@ to %@", assets[i].name, zippath, destpath);
|
||||||
[SSZipArchive unzipFileAtPath:zippath toDestination:destpath];
|
[SSZipArchive unzipFileAtPath:zippath toDestination:destpath];
|
||||||
write_version(destpath, v_runtime);
|
write_version(destpath, v_runtime);
|
||||||
}
|
}
|
||||||
@ -135,6 +135,16 @@ extract:
|
|||||||
win.backgroundColor = [UIColor blackColor];
|
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)
|
void ioswrap_size(unsigned int *dest)
|
||||||
{
|
{
|
||||||
CGSize bounds = [[UIScreen mainScreen] bounds].size;
|
CGSize bounds = [[UIScreen mainScreen] bounds].size;
|
||||||
|
@ -82,6 +82,10 @@ namespace porting {
|
|||||||
return std::string(str);
|
return std::string(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void notifyAbortLoading() {
|
||||||
|
ioswrap_asset_refresh();
|
||||||
|
}
|
||||||
|
|
||||||
void notifyServerConnect(bool is_multiplayer) {
|
void notifyServerConnect(bool is_multiplayer) {
|
||||||
#ifdef ADS
|
#ifdef ADS
|
||||||
ads_allow(!is_multiplayer);
|
ads_allow(!is_multiplayer);
|
||||||
|
@ -45,7 +45,7 @@ namespace porting {
|
|||||||
|
|
||||||
std::string getInputDialogValue();
|
std::string getInputDialogValue();
|
||||||
|
|
||||||
inline void notifyAbortLoading() {}
|
void notifyAbortLoading();
|
||||||
|
|
||||||
void notifyServerConnect(bool is_multiplayer);
|
void notifyServerConnect(bool is_multiplayer);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user