Commit 3661c67e authored by fallenstardust's avatar fallenstardust

ygopro运行中,不再加房而改为保存房间密码

parent d0f63f4e
...@@ -93,6 +93,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene ...@@ -93,6 +93,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
private static final String ARG_MC_NEWS_LIST = "mcNewsList"; private static final String ARG_MC_NEWS_LIST = "mcNewsList";
private boolean isMcNewsLoadException = false; private boolean isMcNewsLoadException = false;
long lastClickTime = 0;
private LinearLayout ll_back; private LinearLayout ll_back;
ShimmerTextView tv; ShimmerTextView tv;
ShimmerTextView tv2; ShimmerTextView tv2;
...@@ -511,6 +512,29 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene ...@@ -511,6 +512,29 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
} }
public void onJoinRoom(String host, int port, String password, int id) { public void onJoinRoom(String host, int port, String password, int id) {
if (YGOStarter.isGameRunning(getActivity())) {
DialogPlus dlg = new DialogPlus(getActivity());
dlg.setMessage(R.string.tip_ygopro_is_running);
dlg.setLeftButtonListener((d, s) -> {
dlg.dismiss();
if (!TextUtils.isEmpty(password)) {
SimpleListAdapter simpleListAdapter = new SimpleListAdapter(getContext());
simpleListAdapter.set(AppsSettings.get().getLastRoomList());
List<String> items = simpleListAdapter.getItems();
int index = items.indexOf(password);
if (index >= 0) {
items.remove(index);
items.add(0, password);
} else {
items.add(0, password);
}
AppsSettings.get().setLastRoomList(items);
simpleListAdapter.notifyDataSetChanged();
}
});
dlg.show();
return;
}
if (id == ID_HOMEFRAGMENT) { if (id == ID_HOMEFRAGMENT) {
quickjoinRoom(host, port, password); quickjoinRoom(host, port, password);
} }
......
...@@ -353,4 +353,6 @@ ...@@ -353,4 +353,6 @@
<string name="find_in_page">" 발견:"</string> <string name="find_in_page">" 발견:"</string>
<string name="tip_card_info_diff">몇몇 특수한 카드들을 제외하고 8자리 코드번호를 초과하는 카드들은 프리릴리즈 카드로, 프리릴리즈카드를 허용하는 서버 에서만 사용이 가능합니다.</string> <string name="tip_card_info_diff">몇몇 특수한 카드들을 제외하고 8자리 코드번호를 초과하는 카드들은 프리릴리즈 카드로, 프리릴리즈카드를 허용하는 서버 에서만 사용이 가능합니다.</string>
<string name="tip_deckInfo_isNot_completeDeck">Card info Exception! Tried to become exsisted Card Info</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>
</resources> </resources>
...@@ -352,4 +352,5 @@ ...@@ -352,4 +352,5 @@
<string name="settings_data_language_about">切换ygopro界面和效果说明文字等的语言</string> <string name="settings_data_language_about">切换ygopro界面和效果说明文字等的语言</string>
<string name="tip_card_info_diff">软件未收录此卡。请尝试更新软件,或查看扩展卡包中是否有此卡。</string> <string name="tip_card_info_diff">软件未收录此卡。请尝试更新软件,或查看扩展卡包中是否有此卡。</string>
<string name="tip_deckInfo_isNot_completeDeck">当前卡组解析异常,将尽量转换为已有卡片</string> <string name="tip_deckInfo_isNot_completeDeck">当前卡组解析异常,将尽量转换为已有卡片</string>
<string name="tip_ygopro_is_running">当前有游戏正在运行,无法开启新的决斗,已将房间密码存入历史记录,请结束当前游戏后再选择该历史记录以加入房间</string>
</resources> </resources>
...@@ -362,4 +362,5 @@ ...@@ -362,4 +362,5 @@
<string name="find_in_page">find:</string> <string name="find_in_page">find:</string>
<string name="tip_card_info_diff">Released and Pre-released Cards are different,pls note after patch them</string> <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_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>
</resources> </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