More tweaks to pluginscreen

This commit is contained in:
Henrik Rydgard 2013-06-04 01:25:30 +02:00
parent 0c7833796b
commit 7c27311b23
3 changed files with 23 additions and 18 deletions

View File

@ -382,19 +382,21 @@ void NativeInitGraphics() {
ui_theme.uiFont = UBUNTU24;
ui_theme.uiFontSmall = UBUNTU24;
ui_theme.uiFontSmaller = UBUNTU24;
ui_theme.buttonImage = I_BUTTON;
ui_theme.buttonSelected = I_BUTTON_SELECTED;
ui_theme.checkOn = I_CHECKEDBOX;
ui_theme.checkOff = I_SQUARE;
ui_theme.whiteImage = SOLIDWHITE;
ui_theme.buttonStyle.bgColor = 0xFFFFFFFF;
ui_theme.buttonStyle.fgColor = 0xFFFFFFFF;
ui_theme.buttonStyle.image = I_BUTTON;
ui_theme.buttonFocusedStyle.bgColor = 0xFF808080;
ui_theme.buttonFocusedStyle.fgColor = 0xFFFFFFFF;
ui_theme.buttonDownStyle.bgColor = 0xFFc0c0c0;
ui_theme.buttonFocusedStyle.image = I_BUTTON;
ui_theme.buttonDownStyle.bgColor = 0xFFFFFFFF;
ui_theme.buttonDownStyle.fgColor = 0xFFFFFFFF;
ui_theme.buttonDownStyle.image = I_BUTTON_SELECTED;
ui_theme.buttonDisabledStyle.bgColor = 0xFF404040;
ui_theme.buttonDisabledStyle.fgColor = 0xFF707070;
ui_theme.buttonDisabledStyle.image = I_BUTTON;
ui_theme.itemFocusedStyle.bgColor = 0xFF808080;
ui_theme.itemDownStyle.bgColor = 0xFFFFc080;
ui_theme.itemDownStyle.fgColor = 0xFF000000;

View File

@ -48,19 +48,28 @@ void PluginScreen::CreateViews() {
root_ = new LinearLayout(ORIENT_VERTICAL);
Margins textMargins(20,17);
Margins buttonMargins(10,10);
root_->Add(new TextView(UBUNTU48, "Audio decoding support", ALIGN_HCENTER, 1.0f, new LinearLayoutParams(textMargins)));
root_->Add(new TextView(UBUNTU24, "Atrac3+ Audio Decoding Support", ALIGN_HCENTER, 1.0f, new LinearLayoutParams(textMargins)));
ViewGroup *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0));
LinearLayout *scrollContents = new LinearLayout(ORIENT_VERTICAL);
root_->Add(scroll);
scroll->Add(scrollContents);
tvDescription_ = scroll->Add(new TextView(0, "Looking for download...", ALIGN_LEFT, 1.0f, new LinearLayoutParams(textMargins)));
tvDescription_ = scrollContents->Add(new TextView(0, "Looking for download...", ALIGN_LEFT, 1.0f, new LinearLayoutParams(textMargins)));
const char *legalityNotice =
"* Mai's Atrac3+ decoder is required for audio in many games.\n"
"Please note that the origins of this code are dubious.\n"
"Choose More Information for more information.";
scrollContents->Add(new TextView(0, legalityNotice, ALIGN_LEFT, 1.0f, new LinearLayoutParams(textMargins) ));
progress_ = root_->Add(new ProgressBar());
progress_->SetVisibility(V_GONE);
ViewGroup *buttonBar = new LinearLayout(ORIENT_HORIZONTAL);
ViewGroup *buttonBar = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(buttonMargins));
root_->Add(buttonBar);
buttonBack_ = new Button(c->T("Back"), new LinearLayoutParams(1.0));
@ -99,15 +108,8 @@ void PluginScreen::update(InputState &input) {
buttonDownload_->SetEnabled(false);
} else {
buttonDownload_->SetEnabled(true);
const char *notInstalledText = "Would you like to install Atrac3+ decoding support by Mai?\n"
"This is required for audio in many games.\n"
"Note that there may be legality issues around non-clean-room\n"
"reverse engineered code in the US and some other countries.\n"
"Choose \"More Information\" for more info.\n";
const char *reInstallText = "Would you like to redownload Atrac3+ decoding support by Mai?\n";
const char *notInstalledText = "To download and install Mai's Atrac3+ decoding support, click Download.\n";
const char *reInstallText = "Mai's Atrac3+ decoder already installed.\nWould you like to redownload and reinstall it?\n";
tvDescription_->SetText(Atrac3plus_Decoder::IsInstalled() ? reInstallText : notInstalledText);
}
}
@ -129,6 +131,7 @@ void PluginScreen::update(InputState &input) {
char codeStr[18];
sprintf(codeStr, "%i", result);
tvDescription_->SetText(std::string("Failed to download (") + codeStr + ").\nPlease try again later.");
progress_->SetVisibility(UI::V_GONE);
buttonDownload_->SetEnabled(true);
}
@ -141,7 +144,7 @@ UI::EventReturn PluginScreen::OnDownload(UI::EventParams &e) {
std::string destination = Atrac3plus_Decoder::GetInstalledFilename();
at3plusdecoder_ = downloader_.StartDownload(at3plusdecoderUrl_, destination);
progress_->SetVisibility(UI::V_VISIBLE);
return UI::EVENT_DONE;
}

2
native

@ -1 +1 @@
Subproject commit c87fe2f782652e34b157dc9f1bddfe1df4d1fc7e
Subproject commit a5c0d822b40fac001ef7ff555d02f30d9c2a90b3