浏览代码

WinRT: Continue downloading fix

Lou Yihua 7 年之前
父节点
当前提交
4130200794

+ 3 - 3
winrt/SDLPal.Common/DownloadDialog.xaml

@@ -14,14 +14,14 @@
     Closing="OnClosing" Opened="OnOpened" SizeChanged="OnSizeChanged">
 
     <StackPanel Orientation="Vertical">
-        <WebView x:Name="DownloadPage" NavigationStarting="OnNavigateStart" DOMContentLoaded="OnDOMContentLoaded" ScrollViewer.HorizontalScrollMode="Auto" ScrollViewer.VerticalScrollMode="Auto" />
+        <WebView x:Name="wvDownloadPage" NavigationStarting="OnNavigateStart" DOMContentLoaded="OnDOMContentLoaded" ScrollViewer.HorizontalScrollMode="Auto" ScrollViewer.VerticalScrollMode="Auto" />
         <Grid x:Name="gridURL" HorizontalAlignment="Stretch">
             <Grid.ColumnDefinitions>
                 <ColumnDefinition />
                 <ColumnDefinition Width="Auto" />
             </Grid.ColumnDefinitions>
-            <TextBox x:Name="tbURL" Grid.Column="0" HorizontalAlignment="Stretch" />
-            <Button x:Name="btnGoTo" Grid.Column="1" Content="->" Click="OnClick" />
+            <TextBox x:Name="tbURL" x:Uid="URL" Header="游戏资源 Zip 压缩包地址" Grid.Column="0" HorizontalAlignment="Stretch" PlaceholderText="http://host.name/path/to/archive.zip" />
+            <Button x:Name="btnGoTo" Grid.Column="1" VerticalAlignment="Bottom" Content="->" Click="OnClick" />
         </Grid>
         <ProgressBar x:Name="pbDownload" HorizontalAlignment="Stretch" Height="12" Margin="0,8,0,4" />
         <TextBlock x:Name="tbProgress" HorizontalAlignment="Right" Height="20" Margin="0,4,0,0" Text="0 / 0" />

+ 44 - 20
winrt/SDLPal.Common/DownloadDialog.xaml.cpp

@@ -47,7 +47,7 @@ struct zip_file
 	zip_file(IStream* s) : stream(s), hr(S_OK), cbBytes(0) {}
 };
 
-SDLPal::DownloadDialog::DownloadDialog(Windows::ApplicationModel::Resources::ResourceLoader^ ldr, StorageFolder^ folder, IRandomAccessStream^ stream, double w, double h)
+SDLPal::DownloadDialog::DownloadDialog(Windows::ApplicationModel::Resources::ResourceLoader^ ldr, StorageFolder^ folder, IRandomAccessStream^ stream, double w, double h, bool from_url)
 	: m_stream(stream), m_Closable(false), m_InitialPhase(true), m_totalBytes(0), m_resLdr(ldr), m_folder(folder), m_width(w), m_height(h)
 {
 	InitializeComponent();
@@ -57,6 +57,14 @@ SDLPal::DownloadDialog::DownloadDialog(Windows::ApplicationModel::Resources::Res
 	this->MaxHeight = h;
 	pbDownload->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
 	tbProgress->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+	if (from_url)
+	{
+		wvDownloadPage->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+	}
+	else
+	{
+		gridURL->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+	}
 }
 
 Platform::String^ SDLPal::DownloadDialog::FormatProgress()
@@ -80,12 +88,12 @@ Platform::String^ SDLPal::DownloadDialog::FormatProgress()
 
 void SDLPal::DownloadDialog::DoDownload(Platform::String^ url)
 {
-	DownloadPage->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
+	wvDownloadPage->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
 	gridURL->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
 	pbDownload->Visibility = Windows::UI::Xaml::Visibility::Visible;
 	tbProgress->Visibility = Windows::UI::Xaml::Visibility::Visible;
-	this->MaxHeight -= DownloadPage->ActualHeight + gridURL->ActualHeight - 48;
-	this->PrimaryButtonText = m_resLdr->GetString("ButtonBack");
+	this->MaxHeight -= wvDownloadPage->ActualHeight + gridURL->ActualHeight - 48;
+	this->PrimaryButtonText = m_resLdr->GetString("ButtonStop");
 	this->Title = m_title;
 	this->UpdateLayout();
 
@@ -250,14 +258,21 @@ void SDLPal::DownloadDialog::DoDownload(Platform::String^ url)
 		}
 
 		this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, ex]() {
-			Platform::String^ string;
-			if (m_Closable)
-				string = m_resLdr->GetString("MBDownloadCanceled");
-			else if (ex)
-				string = String::Concat(m_resLdr->GetString("MBDownloadError"), ex->Message);
-			else
-				string = m_resLdr->GetString("MBDownloadOK");
-			(ref new MessageDialog(string, m_resLdr->GetString("MBDownloadTitle")))->ShowAsync();
+			if (!m_Closable)
+			{
+				String^ string;
+				if (ex)
+				{
+					string = String::Concat(m_resLdr->GetString("MBDownloadError"), ex->Message);
+					Result = ContentDialogResult::Secondary;
+				}
+				else
+				{
+					string = m_resLdr->GetString("MBDownloadOK");
+					Result = ContentDialogResult::None;
+				}
+				(ref new MessageDialog(string, m_resLdr->GetString("MBDownloadTitle")))->ShowAsync();
+			}
 			m_Closable = true;
 			Hide();
 		}));
@@ -266,6 +281,8 @@ void SDLPal::DownloadDialog::DoDownload(Platform::String^ url)
 
 void SDLPal::DownloadDialog::OnPrimaryButtonClick(Windows::UI::Xaml::Controls::ContentDialog^ sender, Windows::UI::Xaml::Controls::ContentDialogButtonClickEventArgs^ args)
 {
+	(ref new MessageDialog(m_resLdr->GetString("MBDownloadCanceled"), m_resLdr->GetString("MBDownloadTitle")))->ShowAsync();
+	Result = ContentDialogResult::Primary;
 	m_Closable = true;
 }
 
@@ -278,10 +295,18 @@ void SDLPal::DownloadDialog::OnClosing(Windows::UI::Xaml::Controls::ContentDialo
 
 void SDLPal::DownloadDialog::OnOpened(Windows::UI::Xaml::Controls::ContentDialog^ sender, Windows::UI::Xaml::Controls::ContentDialogOpenedEventArgs^ args)
 {
-	DownloadPage->Width = m_width - 48;
-	DownloadPage->Height = m_height - 128 - gridURL->ActualHeight;
-	UpdateLayout();
-	DownloadPage->Navigate(ref new Uri(_url));
+	m_title = this->Title;
+	if (wvDownloadPage->Visibility == Windows::UI::Xaml::Visibility::Visible)
+	{
+		wvDownloadPage->Width = m_width - 48;
+		wvDownloadPage->Height = m_height - 128 - gridURL->ActualHeight;
+		UpdateLayout();
+		wvDownloadPage->Navigate(ref new Uri(_url));
+	}
+	else
+	{
+		this->Title = " ";
+	}
 }
 
 
@@ -299,7 +324,6 @@ void SDLPal::DownloadDialog::OnNavigateStart(Windows::UI::Xaml::Controls::WebVie
 
 void SDLPal::DownloadDialog::OnDOMContentLoaded(Windows::UI::Xaml::Controls::WebView^ sender, Windows::UI::Xaml::Controls::WebViewDOMContentLoadedEventArgs^ args)
 {
-	m_title = this->Title;
 	this->Title = sender->DocumentTitle;
 	sender->InvokeScriptAsync(ref new String(L"eval"), ref new Vector<String^>(1, ref new String(LR"rs(
 	var elems = document.getElementsByTagName('a');
@@ -328,10 +352,10 @@ void SDLPal::DownloadDialog::OnDOMContentLoaded(Windows::UI::Xaml::Controls::Web
 
 void SDLPal::DownloadDialog::OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e)
 {
-	if (DownloadPage->Visibility == Windows::UI::Xaml::Visibility::Visible)
+	if (wvDownloadPage->Visibility == Windows::UI::Xaml::Visibility::Visible)
 	{
-		DownloadPage->Width = e->NewSize.Width - 48;
-		DownloadPage->Height = e->NewSize.Height - 128 - gridURL->ActualHeight;
+		wvDownloadPage->Width = e->NewSize.Width - 48;
+		wvDownloadPage->Height = e->NewSize.Height - 128 - gridURL->ActualHeight;
 	}
 }
 

+ 3 - 1
winrt/SDLPal.Common/DownloadDialog.xaml.h

@@ -13,7 +13,9 @@ namespace SDLPal
 	public ref class DownloadDialog sealed
 	{
 	public:
-		DownloadDialog(Windows::ApplicationModel::Resources::ResourceLoader^ ldr, Windows::Storage::StorageFolder^ folder, Windows::Storage::Streams::IRandomAccessStream^ stream, double w, double h);
+		DownloadDialog(Windows::ApplicationModel::Resources::ResourceLoader^ ldr, Windows::Storage::StorageFolder^ folder, Windows::Storage::Streams::IRandomAccessStream^ stream, double w, double h, bool from_url);
+
+		property Windows::UI::Xaml::Controls::ContentDialogResult Result;
 
 	private:
 		Windows::ApplicationModel::Resources::ResourceLoader^ m_resLdr;

+ 0 - 1
winrt/SDLPal.Common/MainPage.xaml

@@ -27,7 +27,6 @@
                     <TextBox x:Name="tbGamePath" x:Uid="GamePath" Grid.Column="0" TextWrapping="Wrap" VerticalAlignment="Top" Header="游戏资源文件夹" IsReadOnly="True" PlaceholderText="未选择游戏资源文件夹" />
                     <Button x:Name="btnBrowseGame" x:Uid="ButtonBrowse" Grid.Column="1" Content="浏览" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Click="btnBrowseFolder_Click" />
                 </Grid>
-                <Button x:Name="btnDownloadGame" x:Uid="ButtonDownload" Content="下载正版游戏资源" HorizontalAlignment="Center" Click="btnDownloadGame_Click" IsEnabled="False" />
                 <CheckBox x:Name="cbUseMsgFile" x:Uid="UseMessageFile" Content="自定义语言文件" Checked="cbUseFile_CheckChanged" Unchecked="cbUseFile_CheckChanged" />
                 <Grid x:Name="gridMsgFile">
                     <Grid.ColumnDefinitions>

+ 77 - 57
winrt/SDLPal.Common/MainPage.xaml.cpp

@@ -62,8 +62,6 @@ MainPage::MainPage()
 
 	LoadControlContents(false);
 
-	btnDownloadGame->IsEnabled = (tbGamePath->Text->Length() > 0);
-
 	m_resLdr = Windows::ApplicationModel::Resources::ResourceLoader::GetForCurrentView();
 	if (static_cast<App^>(Application::Current)->LastCrashed)
 	{
@@ -194,6 +192,81 @@ void SDLPal::MainPage::SaveControlContents()
 	gConfig.wAudioBufferSize = wcstoul(static_cast<Platform::String^>(static_cast<ComboBoxItem^>(cbAudioBuffer->SelectedItem)->Content)->Data(), nullptr, 10);
 }
 
+void SDLPal::MainPage::CheckResourceFolder()
+{
+	if (tbGamePath->Text->Length() > 0 && PAL_MISSING_REQUIRED(UTIL_CheckResourceFiles(ConvertString(tbGamePath->Text).c_str(), ConvertString(tbMsgFile->Text).c_str())))
+	{
+		auto msgbox = ref new MessageDialog(m_resLdr->GetString("MBDownloadRequiredText"), m_resLdr->GetString("MBDownloadRequiredTitle"));
+		msgbox->Commands->Append(ref new UICommand(m_resLdr->GetString("MBButtonYes"), nullptr, 1));
+		msgbox->Commands->Append(ref new UICommand(m_resLdr->GetString("MBButtonNo"), nullptr, nullptr));
+		msgbox->DefaultCommandIndex = 0;
+		msgbox->CancelCommandIndex = 1;
+		concurrency::create_task(msgbox->ShowAsync()).then([this](IUICommand^ command)->IAsyncOperation<IUICommand^>^ {
+			if (command->Id == nullptr)
+			{
+				return concurrency::create_async([]()->IUICommand^ { return nullptr; });
+			}
+
+			auto msgbox = ref new MessageDialog(m_resLdr->GetString("MBDownloadOption"), m_resLdr->GetString("MBDownloadTitle"));
+			msgbox->Commands->Append(ref new UICommand(m_resLdr->GetString("MBButtonFromURL"), nullptr, 1));
+			msgbox->Commands->Append(ref new UICommand(m_resLdr->GetString("MBButtonFromBaiyou"), nullptr, nullptr));
+			msgbox->DefaultCommandIndex = 0;
+			msgbox->CancelCommandIndex = 1;
+			return msgbox->ShowAsync();
+		}).then([this](IUICommand^ command)->IAsyncOperation<IUICommand^>^ {
+			if (command && !command->Id)
+			{
+				auto msgbox = ref new MessageDialog(m_resLdr->GetString("MBDownloadMessage"), m_resLdr->GetString("MBDownloadTitle"));
+				msgbox->Commands->Append(ref new UICommand(m_resLdr->GetString("MBButtonOK")));
+				return msgbox->ShowAsync();
+			}
+			else
+			{
+				return concurrency::create_async([command]()->IUICommand^ { return command; });
+			}
+		}).then([this](IUICommand^ command) {
+			if (!command)
+			{
+				ClearResourceFolder();
+				return;
+			}
+
+			auto folder = dynamic_cast<StorageFolder^>(tbGamePath->Tag);
+			try
+			{
+				auto file = AWait(folder->CreateFileAsync("pal98.zip", CreationCollisionOption::ReplaceExisting), g_eventHandle);
+				auto stream = AWait(file->OpenAsync(FileAccessMode::ReadWrite), g_eventHandle);
+				bool from_url = (command->Id != nullptr);
+				concurrency::create_task(this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, folder, file, stream, from_url]() {
+					m_dlg = ref new DownloadDialog(m_resLdr, folder, stream, ActualWidth, ActualHeight, from_url);
+				}))).then([this]()->IAsyncOperation<ContentDialogResult>^ {
+					return m_dlg->ShowAsync();
+				}).then([this, file, stream](ContentDialogResult result) {
+					delete stream;
+					try { AWait(file->DeleteAsync(), g_eventHandle); }
+					catch (Exception^) {}
+					delete file;
+					if (m_dlg->Result != ContentDialogResult::None)
+					{
+						ClearResourceFolder();
+					}
+				});
+			}
+			catch (Exception^ e)
+			{
+				(ref new MessageDialog(String::Concat(m_resLdr->GetString("MBDownloadError"), e)))->ShowAsync();
+				ClearResourceFolder();
+			}
+		});
+	}
+}
+
+void SDLPal::MainPage::ClearResourceFolder()
+{
+	tbGamePath->Text = "";
+	tbGamePath->Tag = nullptr;
+}
+
 void SDLPal::MainPage::cbBGM_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e)
 {
 	auto visibility = (cbBGM->SelectedIndex == MUSIC_RIX) ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
@@ -269,9 +342,9 @@ void SDLPal::MainPage::SetPath(StorageFolder^ folder)
 	{
 		tbGamePath->Text = folder->Path;
 		tbGamePath->Tag = folder;
-		btnDownloadGame->IsEnabled = true;
 		StorageApplicationPermissions::MostRecentlyUsedList->AddOrReplace(m_acl[PALCFG_GAMEPATH]->token, folder, folder->Path);
 		StorageApplicationPermissions::MostRecentlyUsedList->AddOrReplace(m_acl[PALCFG_SAVEPATH]->token, folder, folder->Path);
+		CheckResourceFolder();
 	}
 }
 
@@ -338,60 +411,7 @@ void SDLPal::MainPage::Page_Loaded(Platform::Object^ sender, Windows::UI::Xaml::
 	auto statusBar = Windows::UI::ViewManagement::StatusBar::GetForCurrentView();
 	concurrency::create_task(statusBar->ShowAsync()).then([statusBar]() { statusBar->BackgroundOpacity = 1.0; });
 #endif
-}
-
-void SDLPal::MainPage::btnDownloadGame_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
-{
-	auto folder = dynamic_cast<StorageFolder^>(tbGamePath->Tag);
-	auto msgbox = ref new MessageDialog(m_resLdr->GetString("MBDownloadMessage"), m_resLdr->GetString("MBDownloadTitle"));
-	msgbox->Commands->Append(ref new UICommand(m_resLdr->GetString("MBButtonOK"), nullptr, 1));
-	msgbox->Commands->Append(ref new UICommand(m_resLdr->GetString("MBButtonCancel"), nullptr, nullptr));
-	msgbox->DefaultCommandIndex = 0;
-	msgbox->CancelCommandIndex = 1;
-	concurrency::create_task(msgbox->ShowAsync()).then([this](IUICommand^ command)->IAsyncOperation<IUICommand^>^ {
-		if (command->Id != nullptr)
-		{
-			if (UTIL_CheckResourceFiles(ConvertString(tbGamePath->Text).c_str(), ConvertString(tbMsgFile->Text).c_str()) != PALFILE_ALL_ORIGIN)
-			{
-				auto msgbox = ref new MessageDialog(m_resLdr->GetString("MBDownloadOverwrite"), m_resLdr->GetString("MBDownloadTitle"));
-				msgbox->Commands->Append(ref new UICommand(m_resLdr->GetString("MBButtonYes"), nullptr, 1));
-				msgbox->Commands->Append(ref new UICommand(m_resLdr->GetString("MBButtonNo"), nullptr, nullptr));
-				msgbox->DefaultCommandIndex = 0;
-				msgbox->CancelCommandIndex = 1;
-				return msgbox->ShowAsync();
-			}
-			else
-			{
-				return concurrency::create_async([command]()->IUICommand^ { return command; });
-			}
-		}
-		else
-		{
-			return concurrency::create_async([command]()->IUICommand^ { return command; });
-		}
-	}).then([this, folder](IUICommand^ command) {
-		if (command->Id != nullptr)
-		{
-			try
-			{
-				auto file = AWait(folder->CreateFileAsync("pal98.zip", CreationCollisionOption::ReplaceExisting), g_eventHandle);
-				auto stream = AWait(file->OpenAsync(FileAccessMode::ReadWrite), g_eventHandle);
-				concurrency::create_task(this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, folder, file, stream]() {
-					m_dlg = ref new DownloadDialog(m_resLdr, folder, stream, ActualWidth, ActualHeight);
-				}))).then([this]()->IAsyncOperation<ContentDialogResult>^{
-					return m_dlg->ShowAsync();
-				}).then([this, file, stream](ContentDialogResult result) {
-					delete stream;
-					AWait(file->DeleteAsync(), g_eventHandle);
-					delete file;
-				});
-			}
-			catch (Exception^ e)
-			{
-				(ref new MessageDialog(String::Concat(m_resLdr->GetString("MBDownloadError"), e)))->ShowAsync();
-			}
-		}
-	});
+	CheckResourceFolder();
 }
 
 

+ 9 - 7
winrt/SDLPal.Common/MainPage.xaml.h

@@ -6,8 +6,9 @@
 #pragma once
 
 #include "MainPage.g.h"
+#include "DownloadDialog.g.h"
 #include <map>
-#include "../../palcfg.h"
+#include "palcfg.h"
 
 #ifdef main
 # undef main
@@ -45,11 +46,17 @@ namespace SDLPal
 		void LoadControlContents(bool loadDefault);
 		void SaveControlContents();
 
+	internal:
+		static MainPage^ Current;
+
 	private:
 		Platform::Collections::Map<Platform::String^, Windows::UI::Xaml::FrameworkElement^>^ m_controls;
 		Windows::ApplicationModel::Resources::ResourceLoader^ m_resLdr;
 		std::map<PALCFG_ITEM, AccessListEntry^> m_acl;
-		Windows::UI::Xaml::Controls::ContentDialog^ m_dlg;
+		DownloadDialog^ m_dlg;
+
+		void CheckResourceFolder();
+		void ClearResourceFolder();
 
 		void btnBrowseFolder_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
 		void cbBGM_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
@@ -61,11 +68,6 @@ namespace SDLPal
 		void btnClearFile_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
 		void Page_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
 		void cbUseFile_CheckChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
-
-	internal:
-		static MainPage^ Current;
-	private:
-		void btnDownloadGame_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
 		void OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
 	};
 }

+ 3 - 3
winrt/SDLPal.Common/SDLPal.cpp

@@ -3,11 +3,11 @@
 #include <wrl.h>
 #include <windows.h>
 #include "../SDLPal.Common/AsyncHelper.h"
-#include "../../global.h"
-#include "../../palcfg.h"
+#include "global.h"
+#include "palcfg.h"
 #include "App.xaml.h"
 extern "C" {
-#include "../../native_midi/native_midi.h"
+#include "native_midi/native_midi.h"
 }
 
 HANDLE g_eventHandle = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS);

+ 27 - 16
winrt/SDLPal.Common/Strings/en/Resources.resw

@@ -145,16 +145,13 @@
     <value>browse</value>
   </data>
   <data name="ButtonDefault.Content" xml:space="preserve">
-    <value>default setting</value>
-  </data>
-  <data name="ButtonDownload.Content" xml:space="preserve">
-    <value>download a licensed copy of game resource</value>
+    <value>default</value>
   </data>
   <data name="ButtonFinish.Content" xml:space="preserve">
-    <value>finish setting</value>
+    <value>finish</value>
   </data>
   <data name="ButtonReset.Content" xml:space="preserve">
-    <value>reset setting</value>
+    <value>reset</value>
   </data>
   <data name="CD.Header" xml:space="preserve">
     <value>format of CD track</value>
@@ -166,7 +163,7 @@
     <value>debug</value>
   </data>
   <data name="Downloading.PrimaryButtonText" xml:space="preserve">
-    <value>stop</value>
+    <value>back</value>
   </data>
   <data name="Downloading.Title" xml:space="preserve">
     <value>downloading...</value>
@@ -229,9 +226,8 @@
     <value>Download aborted due to error: </value>
   </data>
   <data name="MBDownloadMessage" xml:space="preserve">
-    <value>You're going to be brought to the download page, from where you can download the game resource to the folder you've just chosen. The download link will be automatically centered so that anyone who don't understand Chinese can download it without trouble.  You also have the opportunity to enter any direct download URL you know.
-Please note that this download page is not provided by this App's creator, so we can't guarantee the availablity of the donwload link or take responsibility for any consequences.
-Click 'ok' to continue or click 'cancel' to return.</value>
+    <value>You're going to be brought to the download page provided by the game's publisher, and the download link will be automatically centered so that anyone who don't understand Chinese can download it without trouble. The downloaded files will be put into the folder you've just chosen.
+Please note that this download page is not provided by this App's developer, so we can't guarantee the availablity of the donwload link or take responsibility for any consequences.</value>
   </data>
   <data name="MBDownloadOK" xml:space="preserve">
     <value>Game resource has been successfully downloaded!</value>
@@ -251,7 +247,7 @@ You can use the main menu option inside the game to return to this page.</value>
   </data>
   <data name="MBStartupMessage" xml:space="preserve">
     <value>You need to choose the folder that contains game resource files before you can start the game, because such files are NOT bundled due to copyright restrictions.
-But fortunately, a licensed copy of such files can be downloaded freely from Internet.  You'll be brought to this website by clicking the 'download' button after you've chosen a folder to save the downloaded files.
+But fortunately, you have the opportunity to download a licensed copy of the game resource files from Internet for free. To download them, please follow the instructions after you've chosen the folder.
 Once you've finished the setting process, you will be brought to the game directly at next launch.</value>
   </data>
   <data name="MBStartupTitle" xml:space="preserve">
@@ -309,7 +305,7 @@ Once you've finished the setting process, you will be brought to the game direct
     <value>yes</value>
   </data>
   <data name="Title.Text" xml:space="preserve">
-    <value>setting mode</value>
+    <value>setting</value>
   </data>
   <data name="TouchOverlay.Header" xml:space="preserve">
     <value>use touch overlay</value>
@@ -341,14 +337,29 @@ Once you've finished the setting process, you will be brought to the game direct
   <data name="MBButtonYes" xml:space="preserve">
     <value>yes</value>
   </data>
-  <data name="MBDownloadOverwrite" xml:space="preserve">
-    <value>The current game resource in destination folder will be overwrited on a successful download. Continue?</value>
+  <data name="MBDownloadRequiredText" xml:space="preserve">
+    <value>The folder you chose doesn't contain necessary game resource files. Do you wish to download a lincensed copy of them from Internet?</value>
   </data>
   <data name="MBRequired" xml:space="preserve">
     <value>Missing required game resource in folder '{0}'.
 Please choose the correct folder or download game resource from the offical website!</value>
   </data>
-  <data name="ButtonBack" xml:space="preserve">
-    <value>back</value>
+  <data name="ButtonStop" xml:space="preserve">
+    <value>stop</value>
+  </data>
+  <data name="MBButtonFromBaiyou" xml:space="preserve">
+    <value>baiyou100.com</value>
+  </data>
+  <data name="MBButtonFromURL" xml:space="preserve">
+    <value>customized URL</value>
+  </data>
+  <data name="MBDownloadOption" xml:space="preserve">
+    <value>please choose the download location</value>
+  </data>
+  <data name="MBDownloadRequiredTitle" xml:space="preserve">
+    <value>missing necessary game resource in folder</value>
+  </data>
+  <data name="URL.Header" xml:space="preserve">
+    <value>URL of the game resource's Zip archive</value>
   </data>
 </root>

+ 21 - 10
winrt/SDLPal.Common/Strings/zh-hans/Resources.resw

@@ -147,9 +147,6 @@
   <data name="ButtonDefault.Content" xml:space="preserve">
     <value>默认设置</value>
   </data>
-  <data name="ButtonDownload.Content" xml:space="preserve">
-    <value>下载正版游戏资源</value>
-  </data>
   <data name="ButtonFinish.Content" xml:space="preserve">
     <value>完成设置</value>
   </data>
@@ -229,9 +226,8 @@
     <value>下载已被如下错误中止:</value>
   </data>
   <data name="MBDownloadMessage" xml:space="preserve">
-    <value>您即将进入游戏发行商提供的游戏资源文件下载页,您可从该页面(或任何您输入的URL)下载免费的正版游戏资源文件并保存于您所选择的文件夹中。
-您应知晓,上述资源文件并非由本应用的开发方提供,故我们无法保证下载链接的可用性,也不对您的行为承担任何责任。
-请点击“确定”按钮开始下载,或点击“取消”返回设置页面。</value>
+    <value>您即将进入游戏发行商提供的游戏资源文件下载页,您可从该页面下载免费的正版游戏资源文件并保存于您所选择的文件夹中。
+您应知晓,上述资源文件并非由本应用的开发方提供,故我们无法保证下载链接的可用性,也不对您的行为承担任何责任。</value>
   </data>
   <data name="MBDownloadOK" xml:space="preserve">
     <value>游戏资源下载已成功完成!</value>
@@ -251,7 +247,7 @@
   </data>
   <data name="MBStartupMessage" xml:space="preserve">
     <value>由于受版权限制,游戏资源文件并未包含在本应用当中,您需要首先在设置页面中选择游戏资源所在文件夹后方可进入游戏。
-对于尚未拥有游戏资源者,目前可从Internet上下载免费的正版游戏资源,请在选择文件夹后点击“下载”按钮进入下载页面
+如您尚未拥有游戏资源,也可从Internet上下载免费的正版游戏资源,请在选择文件夹后根据提示进行操作
 一旦您完成设置,在您下一次启动本应用时将直接开始游戏进程。</value>
   </data>
   <data name="MBStartupTitle" xml:space="preserve">
@@ -341,13 +337,28 @@
   <data name="MBButtonYes" xml:space="preserve">
     <value>是</value>
   </data>
-  <data name="MBDownloadOverwrite" xml:space="preserve">
-    <value>检测到目标文件夹中已存在游戏资源,下载成功后将会覆盖现有的资源文件,是否继续?</value>
+  <data name="MBDownloadRequiredText" xml:space="preserve">
+    <value>您所选择的目标文件夹不包含游戏资源,是否需要本应用协助您从Internet上下载免费的正版游戏资源?</value>
   </data>
   <data name="MBRequired" xml:space="preserve">
     <value>在文件夹“{0}”中缺少必需的游戏资源文件,请选择正确的文件夹或从官方网站下载游戏数据文件!</value>
   </data>
-  <data name="ButtonBack" xml:space="preserve">
+  <data name="ButtonStop" xml:space="preserve">
     <value>停止</value>
   </data>
+  <data name="MBButtonFromBaiyou" xml:space="preserve">
+    <value>百游</value>
+  </data>
+  <data name="MBButtonFromURL" xml:space="preserve">
+    <value>自定义 URL</value>
+  </data>
+  <data name="MBDownloadOption" xml:space="preserve">
+    <value>请点击相应的按钮以选择下载来源</value>
+  </data>
+  <data name="MBDownloadRequiredTitle" xml:space="preserve">
+    <value>目标文件夹中无游戏资源</value>
+  </data>
+  <data name="URL.Header" xml:space="preserve">
+    <value>游戏资源 Zip 压缩包地址</value>
+  </data>
 </root>

+ 27 - 16
winrt/SDLPal.Common/Strings/zh-hant/Resources.resw

@@ -147,9 +147,6 @@
   <data name="ButtonDefault.Content" xml:space="preserve">
     <value>默認設定</value>
   </data>
-  <data name="ButtonDownload.Content" xml:space="preserve">
-    <value>下載正版遊戲資源</value>
-  </data>
   <data name="ButtonFinish.Content" xml:space="preserve">
     <value>完成設定</value>
   </data>
@@ -166,7 +163,7 @@
     <value>調試信息</value>
   </data>
   <data name="Downloading.PrimaryButtonText" xml:space="preserve">
-    <value>停止</value>
+    <value>返回</value>
   </data>
   <data name="Downloading.Title" xml:space="preserve">
     <value>正在下載……</value>
@@ -193,10 +190,10 @@
     <value>無自訂字體檔案</value>
   </data>
   <data name="GamePath.Header" xml:space="preserve">
-    <value>遊戲資源檔案夾</value>
+    <value>遊戲資源資料夾</value>
   </data>
   <data name="GamePath.PlaceholderText" xml:space="preserve">
-    <value>未選擇檔案夾</value>
+    <value>未選擇資料夾</value>
   </data>
   <data name="Information.Content" xml:space="preserve">
     <value>運行信息</value>
@@ -229,9 +226,8 @@
     <value>下載已被如下錯誤中止:</value>
   </data>
   <data name="MBDownloadMessage" xml:space="preserve">
-    <value>您即將進入由遊戲發行商提供的遊戲資源檔下載頁,您可從該頁面(或任何您輸入的URL)下載免費的正版遊戲資源檔並保存於您所選擇的資料夾中。
-您應知曉,上述資源檔並非由本應用的開發方提供,故我們無法保證下載連結的可用性,也不對您的行為承擔任何責任。
-請點擊「確定」按鈕開始下載,或點擊「取消」返回設置頁面。</value>
+    <value>您即將進入由遊戲發行商提供的遊戲資源檔下載頁,您可從該頁面下載免費的正版遊戲資源檔並保存於您所選擇的資料夾中。
+您應知曉,上述資源檔並非由本應用的開發方提供,故我們無法保證下載連結的可用性,也不對您的行為承擔任何責任。</value>
   </data>
   <data name="MBDownloadOK" xml:space="preserve">
     <value>遊戲資源下載已成功完成!</value>
@@ -240,7 +236,7 @@
     <value>下載提示</value>
   </data>
   <data name="MBEmptyContent" xml:space="preserve">
-    <value>必須指定遊戲資源檔案夾!</value>
+    <value>必須指定遊戲資源資料夾!</value>
   </data>
   <data name="MBExitContent" xml:space="preserve">
     <value>您的設定已保存,下次啟動時將直接開始遊戲。
@@ -251,7 +247,7 @@
   </data>
   <data name="MBStartupMessage" xml:space="preserve">
     <value>由於受智慧產權限制,遊戲資源檔並未包含在本應用當中,您需要首先在設置頁面中選擇遊戲資源所在資料夾後方可進入遊戲。
-對於尚未擁有遊戲資源者,目前可從Internet上下載免費的正版遊戲資源,請在選擇資料夾後點擊「下載」按鈕進入下載頁面
+如您尚未擁有遊戲資源,亦可從Internet上下載免費的正版遊戲資源,請在選擇資料夾後根據提示進行操作
 一旦您完成設置,在您下一次啟動本應用時將直接開始遊戲進程。</value>
   </data>
   <data name="MBStartupTitle" xml:space="preserve">
@@ -341,13 +337,28 @@
   <data name="MBButtonYes" xml:space="preserve">
     <value>是</value>
   </data>
-  <data name="MBDownloadOverwrite" xml:space="preserve">
-    <value>檢測到目的檔案夾中已存在遊戲資源,下載成功後將會覆蓋現有的資源檔,是否繼續?</value>
+  <data name="MBDownloadRequiredText" xml:space="preserve">
+    <value>您所選擇的目的資料夾不包含遊戲資源,是否需要本應用協助您從Internet上下載免費的正版遊戲資源?</value>
   </data>
   <data name="MBRequired" xml:space="preserve">
-    <value>在檔案夾「{0}」中缺少必需的遊戲資源檔,請選擇正確的檔案夾或從官方網站下載遊戲資料檔案!</value>
+    <value>在資料夾「{0}」中缺少必需的遊戲資源檔,請選擇正確的檔案夾或從官方網站下載遊戲資料檔案!</value>
   </data>
-  <data name="ButtonBack" xml:space="preserve">
-    <value>返回</value>
+  <data name="ButtonStop" xml:space="preserve">
+    <value>停止</value>
+  </data>
+  <data name="MBButtonFromBaiyou" xml:space="preserve">
+    <value>百遊</value>
+  </data>
+  <data name="MBButtonFromURL" xml:space="preserve">
+    <value>自訂 URL</value>
+  </data>
+  <data name="MBDownloadOption" xml:space="preserve">
+    <value>請點擊相應的按鈕以選擇下載來源</value>
+  </data>
+  <data name="MBDownloadRequiredTitle" xml:space="preserve">
+    <value>目的資料夾無遊戲資源</value>
+  </data>
+  <data name="URL.Header" xml:space="preserve">
+    <value>遊戲資源 Zip 壓縮包地址</value>
   </data>
 </root>