Commit 81ca0e3c authored by fallenstardust's avatar fallenstardust

更新应用后,引导去更新扩展卡包

导入自定义禁卡表后,重新加载数据
将监测备份卡组还原函数移动到卡组编辑
移除一些233服务器入口
parent cfdcfff5
......@@ -9,20 +9,6 @@
<port>233</port>
<keep>true</keep>
</server>
<server>
<player-name>Knight of Hanoi</player-name>
<name>233正式服务器2区</name>
<ip>s2.ygo233.com</ip>
<port>233</port>
<keep>true</keep>
</server>
<server>
<player-name>Knight of Hanoi</player-name>
<name>233约战服务器(支持断线重连)</name>
<ip>s2.ygo233.com</ip>
<port>2333</port>
<keep>true</keep>
</server>
<server>
<player-name>Knight of Hanoi</player-name>
<name>决斗编年史</name>
......
......@@ -9,8 +9,8 @@ android {
minSdkVersion 21
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 29
versionCode 311030957
versionName "3.11.3fix2"
versionCode 311030962
versionName "3.11.3fix3"
flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true
ndk {
......
......@@ -262,8 +262,7 @@ public class GameUriManager {
Log.w(Constants.TAG, "game is running");
}
} else if (isConf) {
limitManager.load();
stringManager.load();
DataManager.get().load(true);
Toast.makeText(activity, activity.getString(R.string.restart_app), Toast.LENGTH_LONG).show();
}
} else {
......
......@@ -146,6 +146,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
AnimationShake2(layoutView);
initView(layoutView);
preLoadFile();
restoreDeck();
//event
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
EventBus.getDefault().register(this);
......@@ -195,6 +196,24 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
mContext = (BaseActivity) getActivity();
}
private void restoreDeck() {
File oriDeckFiles = new File(ORI_DECK);
File deckFiles = new File(AppsSettings.get().getDeckDir());
if (oriDeckFiles.exists() && deckFiles.list().length <= 1) {
DialogPlus dialogplus = new DialogPlus(mContext);
dialogplus.setTitle(R.string.tip);
dialogplus.setMessage(R.string.restore_deck);
dialogplus.setLeftButtonText(R.string.Cancel);
dialogplus.setLeftButtonListener((dlg, i) -> {
dialogplus.dismiss();
});
dialogplus.setRightButtonText(R.string.deck_restore);
dialogplus.setRightButtonListener((dlg, i) -> {
mContext.startPermissionsActivity();
dialogplus.dismiss();
});
}
}
public void preLoadFile() {
String preLoadFile = "";
if (getArguments() != null) {
......
......@@ -3,6 +3,7 @@ package cn.garymb.ygomobile.ui.home;
import static cn.garymb.ygomobile.Constants.ACTION_RELOAD;
import static cn.garymb.ygomobile.Constants.NETWORK_IMAGE;
import static cn.garymb.ygomobile.Constants.ORI_DECK;
import static cn.garymb.ygomobile.Constants.officialExCardPackageName;
import static cn.garymb.ygomobile.ui.home.ResCheckTask.ResCheckListener;
import android.Manifest;
......@@ -26,6 +27,7 @@ import cn.garymb.ygomobile.AppsSettings;
import cn.garymb.ygomobile.Constants;
import cn.garymb.ygomobile.GameUriManager;
import cn.garymb.ygomobile.YGOStarter;
import cn.garymb.ygomobile.ex_card.ExCardActivity;
import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.ui.activities.WebActivity;
import cn.garymb.ygomobile.ui.cards.CardFavorites;
......@@ -113,26 +115,19 @@ public class MainActivity extends HomeActivity implements BottomNavigationBar.On
}
});
dialog.setOnDismissListener(dialogInterface -> {
// if (AppsSettings.get().isServiceDuelAssistant() && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
// YGOUtil.isServicePermission(MainActivity.this, true);
File oriDeckFiles = new File(ORI_DECK);
File deckFiles = new File(AppsSettings.get().getDeckDir());
if (oriDeckFiles.exists() && deckFiles.list().length <= 1) {
DialogPlus dlgpls = new DialogPlus(MainActivity.this);
dlgpls.setTitle(R.string.tip);
dlgpls.setMessage(R.string.restore_deck);
dlgpls.setLeftButtonText(R.string.Cancel);
dlgpls.setLeftButtonListener((dlg, i) -> {
dlgpls.dismiss();
DialogPlus dialogplus = new DialogPlus(this);
File oldypk = new File(AppsSettings.get().getExpansionsPath() + "/" + officialExCardPackageName + ".ypk");
if (oldypk.exists()) {
FileUtils.deleteFile(oldypk);
dialogplus.setMessage(R.string.tip_ypk_is_deleted);
dialogplus.setLeftButtonText(R.string.ok);
dialogplus.setLeftButtonListener((d, i) -> {
Intent exCardIntent = new Intent(this, ExCardActivity.class);
startActivity(exCardIntent);
dialogplus.dismiss();
});
dlgpls.setRightButtonText(R.string.deck_restore);
dlgpls.setRightButtonListener((dlg, i) -> {
startPermissionsActivity();
dlgpls.dismiss();
});
dlgpls.show();
dialogplus.show();
}
});
dialog.setCancelable(false);
dialog.show();
......
......@@ -367,5 +367,6 @@
<string name="tip_ygopro_is_running">Actualmente hay un duelo en ejecución y no se puede iniciar un nuevo duelo. La PSW de la sala se ha guardado en el historial. Finaliza el juego actual y luego selecciona el historial para unirte a la sala.</string>
<string name="Download_Precard_Failed">Falló la descarga de las cartas pre-lanzamiento</string>
<string name="Pre_Server_Name">Servidor Super-pre Mycard</string>
<string name="tip_ypk_is_deleted">Please upgrade pre-released cards at once</string>
</resources>
......@@ -357,5 +357,5 @@
<string name="tip_ygopro_is_running">ygopro is running now. unable to create a new duel before it is closed. \nthe room password has been recorded in record list.\npls close ygopro and rejoin room through the record of room password</string>
<string name="Download_Precard_Failed">Download pre-cards failed</string>
<string name="Pre_Server_Name">Mycard Super-pre Server</string>
<string name="tip_ypk_is_deleted">Please upgrade pre-released cards at once</string>
</resources>
......@@ -356,4 +356,5 @@
<string name="tip_card_info_diff">软件未收录此卡。请尝试更新软件,或查看扩展卡包中是否有此卡。</string>
<string name="tip_deckInfo_isNot_completeDeck">当前卡组解析异常,将尽量转换为已有卡片</string>
<string name="tip_ygopro_is_running">当前有游戏正在运行,无法开启新的决斗,已将房间密码存入历史记录,请结束当前游戏后再选择该历史记录以加入房间</string>
<string name="tip_ypk_is_deleted">正式卡更新会让旧先行卡失效,请及时重新下载先行卡补丁</string>
</resources>
......@@ -366,4 +366,5 @@
<string name="tip_card_info_diff">Released and Pre-released Cards are different,pls note after patch them</string>
<string name="tip_deckInfo_isNot_completeDeck">Card info Exception! Tried to become exsisted Card Info</string>
<string name="tip_ygopro_is_running">ygopro is running now. unable to create a new duel before it is closed. \nthe room password has been recorded in record list.\npls close ygopro and rejoin room through the record of room password</string>
<string name="tip_ypk_is_deleted">Please upgrade pre-released cards at once</string>
</resources>
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