mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 09:06:55 -04:00
Android: Fix if you cancel initial assets download partway through, then start singleplayer, then quit game, then try to continue downloading initial assets, it wouldn't download them anymore
This commit is contained in:
parent
73b334f1ad
commit
1df5122100
@ -1003,20 +1003,12 @@ static void CheckResourcesScreen_Next(void* w, int x, int y) {
|
||||
}
|
||||
|
||||
static void CheckResourcesScreen_Init(struct LScreen* s_) {
|
||||
cc_string str; char buffer[STRING_SIZE];
|
||||
struct CheckResourcesScreen* s = (struct CheckResourcesScreen*)s_;
|
||||
float size;
|
||||
s->widgets = s->_widgets;
|
||||
|
||||
LLabel_Init(s_, &s->lblLine1, "Some required resources weren't found");
|
||||
LLabel_Init(s_, &s->lblLine2, "Okay to download?");
|
||||
String_InitArray(str, buffer);
|
||||
size = Resources_Size / 1024.0f;
|
||||
|
||||
LLabel_Init(s_, &s->lblStatus, "");
|
||||
String_Format1(&str, "&eDownload size: %f2 megabytes", &size);
|
||||
s->lblStatus.font = &Launcher_HintFont;
|
||||
LLabel_SetText( &s->lblStatus, &str);
|
||||
|
||||
LButton_Init(s_, &s->btnYes, 70, 35, "Yes");
|
||||
LButton_Init(s_, &s->btnNo, 70, 35, "No");
|
||||
@ -1024,6 +1016,17 @@ static void CheckResourcesScreen_Init(struct LScreen* s_) {
|
||||
s->btnNo.OnClick = CheckResourcesScreen_Next;
|
||||
}
|
||||
|
||||
static void CheckResourcesScreen_Show(struct LScreen* s_) {
|
||||
cc_string str; char buffer[STRING_SIZE];
|
||||
struct CheckResourcesScreen* s = (struct CheckResourcesScreen*)s_;
|
||||
float size = Resources_Size / 1024.0f;
|
||||
|
||||
String_InitArray(str, buffer);
|
||||
String_Format1(&str, "&eDownload size: %f2 megabytes", &size);
|
||||
s->lblStatus.font = &Launcher_HintFont;
|
||||
LLabel_SetText(&s->lblStatus, &str);
|
||||
}
|
||||
|
||||
static void CheckResourcesScreen_Layout(struct LScreen* s_) {
|
||||
struct CheckResourcesScreen* s = (struct CheckResourcesScreen*)s_;
|
||||
|
||||
@ -1062,6 +1065,7 @@ void CheckResourcesScreen_SetActive(void) {
|
||||
struct CheckResourcesScreen* s = &CheckResourcesScreen_Instance;
|
||||
LScreen_Reset((struct LScreen*)s);
|
||||
s->Init = CheckResourcesScreen_Init;
|
||||
s->Show = CheckResourcesScreen_Show;
|
||||
s->Draw = CheckResourcesScreen_Draw;
|
||||
s->Layout = CheckResourcesScreen_Layout;
|
||||
s->onEnterWidget = (struct LWidget*)&s->btnYes;
|
||||
@ -1091,7 +1095,7 @@ static void FetchResourcesScreen_Init(struct LScreen* s_) {
|
||||
s->lblStatus.font = &Launcher_HintFont;
|
||||
s->btnCancel.OnClick = CheckResourcesScreen_Next;
|
||||
}
|
||||
static void FetchResourcesScreen_Show(struct LScreen* s_) { if (!Fetcher_Working) Fetcher_Run(); }
|
||||
static void FetchResourcesScreen_Show(struct LScreen* s_) { Fetcher_Run(); }
|
||||
|
||||
static void FetchResourcesScreen_Layout(struct LScreen* s_) {
|
||||
struct FetchResourcesScreen* s = (struct FetchResourcesScreen*)s_;
|
||||
|
@ -191,6 +191,9 @@ static void Resources_CheckTextures(void) {
|
||||
|
||||
void Resources_CheckExistence(void) {
|
||||
int i;
|
||||
Resources_Count = 0;
|
||||
Resources_Size = 0;
|
||||
|
||||
Resources_CheckTextures();
|
||||
Resources_CheckMusic();
|
||||
Resources_CheckSounds();
|
||||
@ -740,7 +743,6 @@ const char* Fetcher_RequestName(int reqID) {
|
||||
void Fetcher_Run(void) {
|
||||
cc_string url;
|
||||
int i;
|
||||
if (Fetcher_Working) return;
|
||||
|
||||
Fetcher_Failed = false;
|
||||
Fetcher_Downloaded = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user