Commit f3973192 authored by Unicorn369's avatar Unicorn369 Committed by fallenstardust

音效设置 & 复制音效文件

parent 98b141b6
...@@ -62,6 +62,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -62,6 +62,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
switch(id) { switch(id) {
case BUTTON_MODE_EXIT: { case BUTTON_MODE_EXIT: {
//mainGame->soundEffectPlayer->doPressButton(); //mainGame->soundEffectPlayer->doPressButton();
mainGame->soundManager->StopBGM();
mainGame->SaveConfig(); mainGame->SaveConfig();
mainGame->device->closeDevice(); mainGame->device->closeDevice();
break; break;
......
...@@ -201,6 +201,7 @@ ...@@ -201,6 +201,7 @@
android:name="cn.garymb.ygomobile.ui.plus.ServiceDuelAssistant" android:name="cn.garymb.ygomobile.ui.plus.ServiceDuelAssistant"
android:priority="1000" /> android:priority="1000" />
<!-- 如果已经安装过原版YGOMobile,请注释掉或修改成其他,否则会导致无法安装 -->
<provider <provider
android:name="cn.garymb.ygomobile.ui.preference.YGOPreferencesProvider" android:name="cn.garymb.ygomobile.ui.preference.YGOPreferencesProvider"
android:authorities="cn.garymb.ygomobile.ui.preference.YGOPreferencesProvider" android:authorities="cn.garymb.ygomobile.ui.preference.YGOPreferencesProvider"
......
...@@ -415,6 +415,10 @@ public class AppsSettings { ...@@ -415,6 +415,10 @@ public class AppsSettings {
mSharedPreferences.putBoolean(Constants.PREF_USE_EXTRA_CARD_CARDS, useExtraCards); mSharedPreferences.putBoolean(Constants.PREF_USE_EXTRA_CARD_CARDS, useExtraCards);
} }
public String getSoundPath() {
return new File(getResourcePath(), Constants.CORE_SOUND_PATH).getAbsolutePath();
}
public String getCoreSkinPath() { public String getCoreSkinPath() {
return new File(getResourcePath(), Constants.CORE_SKIN_PATH).getAbsolutePath(); return new File(getResourcePath(), Constants.CORE_SKIN_PATH).getAbsolutePath();
} }
......
...@@ -66,6 +66,7 @@ public interface Constants { ...@@ -66,6 +66,7 @@ public interface Constants {
String CORE_CUSTOM_LIMIT_PATH = "expansions/lflist.conf"; String CORE_CUSTOM_LIMIT_PATH = "expansions/lflist.conf";
String CORE_SYSTEM_PATH = "system.conf"; String CORE_SYSTEM_PATH = "system.conf";
String CORE_BOT_CONF_PATH = "bot.conf"; String CORE_BOT_CONF_PATH = "bot.conf";
String CORE_SOUND_PATH = "sound";
String CORE_SKIN_PATH = "textures"; String CORE_SKIN_PATH = "textures";
String CORE_SKIN_PENDULUM_PATH = CORE_SKIN_PATH + "/extra"; String CORE_SKIN_PENDULUM_PATH = CORE_SKIN_PATH + "/extra";
String CORE_DECK_PATH = "deck"; String CORE_DECK_PATH = "deck";
......
...@@ -146,10 +146,19 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -146,10 +146,19 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_SINGLE_PATH), IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_SINGLE_PATH),
mSettings.getSingleDir(), needsUpdate); mSettings.getSingleDir(), needsUpdate);
} }
String[] sound1 = mContext.getAssets().list(getDatapath(Constants.CORE_SOUND_PATH));
String[] sound2 = new File(mSettings.getSoundPath()).list();
String[] textures1 = mContext.getAssets().list(getDatapath(Constants.CORE_SKIN_PATH)); String[] textures1 = mContext.getAssets().list(getDatapath(Constants.CORE_SKIN_PATH));
String[] textures2 = new File(mSettings.getCoreSkinPath()).list(); String[] textures2 = new File(mSettings.getCoreSkinPath()).list();
//复制资源文件夹 //复制资源文件夹
//如果sound文件夹不存在/sound资源数量不够/是更新则复制,但是不强制复制
if (sound2 == null || (sound1 != null && sound1.length > sound2.length) || needsUpdate) {
setMessage(mContext.getString(R.string.check_things, mContext.getString(R.string.game_sound)));
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.CORE_SOUND_PATH),
mSettings.getSoundPath(), false);
}
//如果textures文件夹不存在/textures资源数量不够/是更新则复制,但是不强制复制 //如果textures文件夹不存在/textures资源数量不够/是更新则复制,但是不强制复制
if (textures2 == null || (textures1 != null && textures1.length > textures2.length) || needsUpdate) { if (textures2 == null || (textures1 != null && textures1.length > textures2.length) || needsUpdate) {
setMessage(mContext.getString(R.string.check_things, mContext.getString(R.string.game_skins))); setMessage(mContext.getString(R.string.check_things, mContext.getString(R.string.game_skins)));
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<string name="images">이미지</string> <string name="images">이미지</string>
<string name="single_lua">single files</string> <string name="single_lua">single files</string>
<string name="font_files">폰트 파일</string> <string name="font_files">폰트 파일</string>
<string name="game_sound">음효 파일</string>
<string name="game_skins">스킨 파일</string> <string name="game_skins">스킨 파일</string>
<string name="coping_pendulum_image">Coping pendulum image</string> <string name="coping_pendulum_image">Coping pendulum image</string>
<string name="dialog_select_font">font파일을 선택하세요.</string> <string name="dialog_select_font">font파일을 선택하세요.</string>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<string name="images">图片</string> <string name="images">图片</string>
<string name="single_lua">残局文件</string> <string name="single_lua">残局文件</string>
<string name="font_files">字体文件</string> <string name="font_files">字体文件</string>
<string name="game_sound">音效文件</string>
<string name="game_skins">皮肤文件</string> <string name="game_skins">皮肤文件</string>
<string name="coping_pendulum_image">复制灵摆数字图片</string> <string name="coping_pendulum_image">复制灵摆数字图片</string>
<string name="dialog_select_font">请选择一个字体文件</string> <string name="dialog_select_font">请选择一个字体文件</string>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<string name="images">images</string> <string name="images">images</string>
<string name="single_lua">single files</string> <string name="single_lua">single files</string>
<string name="font_files">font files</string> <string name="font_files">font files</string>
<string name="game_sound">sound files</string>
<string name="game_skins">skin files</string> <string name="game_skins">skin files</string>
<string name="coping_pendulum_image">Coping pendulum image</string> <string name="coping_pendulum_image">Coping pendulum image</string>
<string name="dialog_select_font">Select a font file</string> <string name="dialog_select_font">Select a font file</string>
......
...@@ -45,10 +45,12 @@ ...@@ -45,10 +45,12 @@
android:key="pref_settings_read_ex" android:key="pref_settings_read_ex"
android:persistent="true" android:persistent="true"
android:title="@string/title_use_ex" /> android:title="@string/title_use_ex" />
<!-- 启用游戏音效
<CheckBoxPreference <CheckBoxPreference
android:key="pref_key_game_sound_effect" android:key="pref_key_game_sound_effect"
android:persistent="true" android:persistent="true"
android:title="@string/settings_game_enable_sound_effect" /> android:title="@string/settings_game_enable_sound_effect" />
-->
<CheckBoxPreference <CheckBoxPreference
android:key="pref_key_game_screen_orientation" android:key="pref_key_game_screen_orientation"
android:persistent="true" android:persistent="true"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment