Commit 2221b0bb authored by feihuaduo's avatar feihuaduo
parents ff177821 70364578
......@@ -1476,7 +1476,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int c, l, s, ss;
unsigned int code;
bool panelmode = false;
int handcount = 0;
size_t hand_count[2] = { mainGame->dField.hand[0].size(), mainGame->dField.hand[1].size() };
int select_count_in_hand[2] = { 0, 0 };
bool select_ready = mainGame->dField.select_min == 0;
mainGame->dField.select_ready = select_ready;
ClientCard* pcard;
......@@ -1498,9 +1499,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->is_selected = false;
if (l & 0xf1)
panelmode = true;
if(l & LOCATION_HAND) {
handcount++;
if(handcount >= 10)
if((l & LOCATION_HAND) && hand_count[c] >= 10) {
if(++select_count_in_hand[c] > 1)
panelmode = true;
}
}
......@@ -1541,6 +1541,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int c, l, s, ss;
unsigned int code;
bool panelmode = false;
size_t hand_count[2] = { mainGame->dField.hand[0].size(), mainGame->dField.hand[1].size() };
int select_count_in_hand[2] = { 0, 0 };
mainGame->dField.select_ready = false;
ClientCard* pcard;
for (int i = 0; i < count1; ++i) {
......@@ -1561,6 +1563,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->is_selected = false;
if (l & 0xf1)
panelmode = true;
if((l & LOCATION_HAND) && hand_count[c] >= 10) {
if(++select_count_in_hand[c] > 1)
panelmode = true;
}
}
int count2 = BufferIO::ReadInt8(pbuf);
for (int i = count1; i < count1 + count2; ++i) {
......@@ -1581,6 +1587,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->is_selected = true;
if (l & 0xf1)
panelmode = true;
if((l & LOCATION_HAND) && hand_count[c] >= 10) {
if(++select_count_in_hand[c] > 1)
panelmode = true;
}
}
std::sort(mainGame->dField.selectable_cards.begin(), mainGame->dField.selectable_cards.end(), ClientCard::client_card_sort);
if(select_hint)
......
#[2021.7][2021.7 TCG][2021.4][2021.1][2020.10][2020.7][2020.4][2020.1][2019.10][2019.7][2019.4][2019.1][2018.10][2018.7][2018.4][2018.1][2017.10][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2021.3 TCG][2020.12 TCG][2020.9 TCG][2020.6 TCG][2020.4 TCG][2020.1 TCG][2019.10 TCG][2019.7 TCG][2019.4 TCG][2019.1 TCG][2018.12 TCG][2018.9 TCG][2018.5 TCG][2018.2 TCG][2017.11 TCG][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1]
#[2021.10][2021.7][2021.7 TCG][2021.4][2021.1][2020.10][2020.7][2020.4][2020.1][2019.10][2019.7][2019.4][2019.1][2018.10][2018.7][2018.4][2018.1][2017.10][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2021.3 TCG][2020.12 TCG][2020.9 TCG][2020.6 TCG][2020.4 TCG][2020.1 TCG][2019.10 TCG][2019.7 TCG][2019.4 TCG][2019.1 TCG][2018.12 TCG][2018.9 TCG][2018.5 TCG][2018.2 TCG][2017.11 TCG][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1]
!2021.10
#forbidden
91869203 0 --アマゾネスの射手
20663556 0 --イレカエル
44910027 0 --ヴィクトリー・ドラゴン
51858306 0 --エクリプス・ワイバーン
25862681 0 --エンシェント・フェアリー・ドラゴン
53804307 0 --焔征竜-ブラスター
07563579 0 --Emヒグルミ
17330916 0 --EMモンキーボード
34945480 0 --外神アザトート
90411554 0 --巌征竜-レドックス
08903700 0 --儀式魔人リリーサー
11384280 0 --キャノン・ソルジャー
17412721 0 --旧神ノーデン
67441435 0 --グローアップ・バルブ
34124316 0 --サイバーポッド
88071625 0 --The tyrant NEPTUNE
61665245 0 --サモン・ソーサレス
52653092 0 --SNo.0 ホープ・ゼアル
48905153 0 --十二獣ドランシア
85115440 0 --十二獣ブルホーン
59537380 0 --守護竜アガーペイン
86148577 0 --守護竜エルピィ
88581108 0 --真竜皇V.F.D.
21377582 0 --真竜剣皇マスターP
94677445 0 --星杯の神子イヴ
16923472 0 --ゼンマイハンター
15341821 0 --ダンディライオン
37818794 0 --超魔導竜騎士-ドラグーン・オブ・レッドアイズ
18326736 0 --星守の騎士 プトレマイオス
79875176 0 --トゥーン・キャノン・ソルジャー
75732622 0 --トーチ・ゴーレム
22593417 0 --トポロジック・ガンブラー・ドラゴン
39064822 0 --トロイメア・ゴブリン
03679218 0 --トロイメア・マーメイド
54719828 0 --No.16 色の支配者ショック・ルーラー
58820923 0 --No.95 ギャラクシーアイズ・ダークマター・ドラゴン
26400609 0 --瀑征竜-タイダル
71525232 0 --破滅竜ガンドラX
78706415 0 --ファイバーポッド
93369354 0 --フィッシュボーグ-ガンナー
23558733 0 --フェニキシアン・クラスター・アマリリス
09929398 0 --BF-朧影のゴウフウ
09047460 0 --BF-隠れ蓑のスチーム
31178212 0 --マジェスペクター・ユニコーン
63101919 0 --マジックテンペスター
34206604 0 --魔導サイエンティスト
04423206 0 --M.X-セイバー インヴォーカー
14702066 0 --メガキャノン・ソルジャー
96782886 0 --メンタルマスター
03078576 0 --八汰烏
34086406 0 --ラヴァルバル・チェイン
85243784 0 --リンクロス
57421866 0 --レベル・スティーラー
41482598 0 --悪夢の蜃気楼
44763025 0 --いたずら好きな双子悪魔
17375316 0 --押収
19613556 0 --大嵐
74191942 0 --苦渋の選択
42829885 0 --強引な番兵
45986603 0 --強奪
55144522 0 --強欲な壺
04031928 0 --心変わり
23557835 0 --次元融合
31423101 0 --神剣-フェニックスブレード
57953380 0 --生還の宝札
54447022 0 --ソウル・チャージ
60682203 0 --大寒波
69243953 0 --蝶の短剣-エルマ
79571449 0 --天使の施し
70828912 0 --早すぎた埋葬
42703248 0 --ハリケーン
76375976 0 --魔鍾洞
34906152 0 --マスドライバー
46448938 0 --魔導書の神判
46411259 0 --突然変異
85602018 0 --遺言状
27174286 0 --異次元からの帰還
93016201 0 --王宮の弾圧
03280747 0 --第六感
64697231 0 --ダスト・シュート
80604091 0 --血の代償
35316708 0 --刻の封印
32723153 0 --マジカル・エクスプロージョン
17178486 0 --ライフチェンジャー
28566710 0 --ラストバトル!
#limit
64034255 1 --A・ジェネクス・バードマン
76794549 1 --アストログラフ・マジシャン
01561110 1 --ABC-ドラゴン・バスター
42790071 1 --オルターガイスト・マルチフェイカー
30741503 1 --オルフェゴール・ガラテア
57835716 1 --オルフェゴール・ディヴェル
50588353 1 --水晶機巧-ハリファイバー
12289247 1 --クロノグラフ・マジシャン
49684352 1 --虹彩の魔術師
38814750 1 --PSYフレームギア・γ
74586817 1 --PSYフレームロード・Ω
26889158 1 --転生炎獣ガゼル
74997493 1 --鎖龍蛇-スカルデット
69811710 1 --宵星の騎士ギルス
78872731 1 --十二獣モルモラット
06602300 1 --重爆撃禽 ボム・フェネクス
28985331 1 --終末の騎士
78080961 1 --SPYRAL-ジーニアス
81275020 1 --SRベイゴマックス
63288573 1 --閃刀姫-カガリ
81122844 1 --発条空母ゼンマイティ
82385847 1 --ダイナレスラー・パンクラトプス
73941492 1 --調弦の魔術師
15291624 1 --超雷龍-サンダー・ドラゴン
90953320 1 --TG ハイパー・ライブラリアン
69015963 1 --デビル・フランケン
16226786 1 --深淵の暗殺者
90448279 1 --天霆號アーゼウス
69610326 1 --覇王眷竜ダークヴルム
52687916 1 --氷結界の龍 トリシューラ
33396948 1 --封印されしエクゾディア
44519536 1 --封印されし者の左足
07902349 1 --封印されし者の左腕
08124921 1 --封印されし者の右足
70903634 1 --封印されし者の右腕
70369116 1 --捕食植物ヴェルテ・アナコンダ
35272499 1 --捕食植物オフリス・スコーピオ
24094258 1 --ヘビーメタルフォーゼ・エレクトラム
33508719 1 --メタモルポット
90809975 1 --餅カエル
83107873 1 --雷鳥龍-サンダー・ドラゴン
89399912 1 --嵐征竜-テンペスト
92746535 1 --竜剣士ラスターP
33782437 1 --一時休戦
01845204 1 --簡易融合
66957584 1 --インフェルニティガン
81439173 1 --おろかな埋葬
73680966 1 --終わりの始まり
23701465 1 --原初の種
12580477 1 --サンダー・ボルト
83764718 1 --死者蘇生
46060017 1 --十二獣の会局
52340444 1 --閃刀機-ホーネットビット
32807846 1 --増援
72892473 1 --手札抹殺
73628505 1 --テラ・フォーミング
01984618 1 --天底の使徒
13035077 1 --ドラゴニックD
35371948 1 --トリックスター・ライトステージ
18144506 1 --ハーピィの羽根帚
75500286 1 --封印の黄金櫃
07394770 1 --ブリリアント・フュージョン
73468603 1 --盆回し
93600443 1 --マスク・チェンジ・セカンド
15854426 1 --霞の谷の神風
27970830 1 --六武の門
02295440 1 --ワン・フォー・ワン
05851097 1 --虚無空間
61740673 1 --王宮の勅命
21076084 1 --トリックスター・リンカーネイション
89208725 1 --メタバース
23002292 1 --レッド・リブート
#semi limit
40318957 2 --EMドクロバット・ジョーカー
44335251 2 --魂喰いオヴィラプター
09411399 2 --D-HERO ディアボリックガイ
43694650 2 --未界域のジャッカロープ
29596581 2 --雷獣龍-サンダー・ドラゴン
88264978 2 --レッドアイズ・ダークネスメタルドラゴン
48686504 2 --ローンファイア・ブロッサム
57103969 2 --炎舞-「天璣」
84731222 2 --希望の記憶
67723438 2 --緊急テレポート
35261759 2 --強欲で貪欲な壺
73915051 2 --スケープ・ゴート
54631665 2 --SPYRAL RESORT
98338152 2 --閃刀機-ウィドウアンカー
63166095 2 --閃刀起動-エンゲージ
48130397 2 --超融合
11110587 2 --隣の芝刈り
31434645 2 --呪われしエルドランド
24224830 2 --墓穴の指名者
08949584 2 --ヒーローアライブ
47679935 2 --暴走魔法陣
65681983 2 --抹殺の指名者
!2021.7
#forbidden
91869203 0 --アマゾネスの射手
......
......@@ -677,8 +677,9 @@ public class AppsSettings {
mSharedPreferences.putString(Constants.PREF_LAST_ROOM_LIST, array.toString());
}
@Deprecated
//获取收藏文件
public String getFavoriteTxt() {
return new File(getResourcePath(), "/favorite.txt").getAbsolutePath();
public File getFavoriteFile() {
return new File(getResourcePath(), CORE_SYSTEM_PATH);
}
}
......@@ -3,6 +3,7 @@ package cn.garymb.ygomobile.ui.cards;
import android.text.TextUtils;
import android.util.SparseArray;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
......@@ -45,7 +46,7 @@ public class CardFavorites {
return false;
}
public boolean hasCard(Integer id){
public boolean hasCard(Integer id) {
return mList.contains(id);
}
......@@ -69,8 +70,16 @@ public class CardFavorites {
}
public void load() {
List<String> lines = FileUtils.readLines(AppsSettings.get().getFavoriteTxt(), Constants.DEF_ENCODING);
mList.clear();
File config = AppsSettings.get().getFavoriteFile();
List<String> lines;
if (!config.exists()) {
config = AppsSettings.get().getSystemConfig();
}
if (!config.exists()) {
return;
}
lines = FileUtils.readLines(config.getPath(), Constants.DEF_ENCODING);
for (String line : lines) {
String tmp = line.trim();
if (TextUtils.isDigitsOnly(tmp)) {
......@@ -84,6 +93,7 @@ public class CardFavorites {
for (Integer id : mList) {
ret.add(String.valueOf(id));
}
FileUtils.writeLines(AppsSettings.get().getFavoriteTxt(), ret, Constants.DEF_ENCODING, "\n");
File conf = AppsSettings.get().getSystemConfig();
FileUtils.writeLines(conf.getPath(), ret, Constants.DEF_ENCODING, "\n");
}
}
......@@ -157,9 +157,9 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
$(R.id.btn_nav_list).setOnClickListener((v) -> doMenu(R.id.action_card_list));
//
final File _file;
//打开指定卡组
//打开指定卡组
if (!TextUtils.isEmpty(preLoadFile) && (mPreLoadFile = new File(preLoadFile)).exists()) {
//外面卡组
//外面卡组
_file = mPreLoadFile;
} else {
mPreLoadFile = null;
......@@ -167,7 +167,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
if(TextUtils.isEmpty(path)){
_file = null;
} else {
//最后卡组
//最后卡组
_file = new File(path);
}
}
......@@ -260,13 +260,13 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
DialogPlus dlg = DialogPlus.show(this, null, getString(R.string.loading));
VUiKit.defer().when(() -> {
DataManager.get().load(true);
//默认第一个卡表
//默认第一个卡表
if (mLimitManager.getCount() > 0) {
mCardLoader.setLimitList(mLimitManager.getTopLimit());
}
File file = ydk;
if (file == null || !file.exists()) {
//当默认卡组不存在的时候
//当默认卡组不存在的时候
List<File> files = getYdkFiles();
if (files != null && files.size() > 0) {
file = files.get(0);
......@@ -288,15 +288,15 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
mCardSelector.initItems();
initLimitListSpinners(mLimitSpinner, mCardLoader.getLimitList());
initDecksListSpinners(mDeckSpinner, rs.source);
//设置当前卡组
//设置当前卡组
setCurDeck(rs);
//设置收藏夹
//设置收藏夹
mCardSelector.showFavorites(false);
});
}
/**
* 设置当前卡组
* 设置当前卡组
*/
private void setCurDeck(DeckInfo deckInfo) {
if (deckInfo == null) {
......@@ -307,7 +307,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
String name = IOUtils.tirmName(file.getName(), Constants.YDK_FILE_EX);
setActionBarSubTitle(name);
// if (inDeckDir(file)) {
//记住最后打开的卡组
//记住最后打开的卡组
mSettings.setLastDeckPath(file.getAbsolutePath());
tv_deck.setText(name);
......@@ -383,7 +383,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
@Override
public void onItemDoubleClick(View view, int pos) {
//拖拽中,就不显示
//拖拽中,就不显示
if (isShowDrawer()) {
return;
}
......@@ -627,7 +627,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
// mDeckAdapater.notifyDataSetChanged();
// break;
case R.id.action_search:
//弹条件对话框
//弹条件对话框
showSearch(true);
break;
case R.id.action_card_list:
......@@ -642,7 +642,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
break;
case R.id.action_save:
if (mPreLoadFile != null && mPreLoadFile == mDeckAdapater.getYdkFile()) {
//需要保存到deck文件夹
//需要保存到deck文件夹
inputDeckName(mPreLoadFile, null, true);
} else {
if (mDeckAdapater.getYdkFile() == null) {
......@@ -709,7 +709,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
}
break;
case R.id.action_unsort:
//打乱
//打乱
mDeckAdapater.unSort();
break;
case R.id.action_sort:
......@@ -729,7 +729,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
builder.setMessageGravity(Gravity.CENTER_HORIZONTAL);
builder.setLeftButtonListener((dlg, rs) -> {
dlg.dismiss();
//复制当前卡组
//复制当前卡组
inputDeckName(old, savePath, true);
});
builder.setRightButtonListener((dlg, rs) -> {
......@@ -757,11 +757,11 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
builderShareLoading.setMessage(R.string.Pre_share);
builderShareLoading.show();
//先排序
//先排序
// mDeckAdapater.sort();
//保存
//保存
// if (mPreLoadFile != null && mPreLoadFile == mDeckAdapater.getYdkFile()) {
// //需要保存到deck文件夹
// //需要保存到deck文件夹
// inputDeckName(mPreLoadFile, null, true);
// } else {
// if (mDeckAdapater.getYdkFile() == null) {
......@@ -770,27 +770,27 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
// save(mDeckAdapater.getYdkFile());
// }
// }
// //保存成功后重新加载卡组
// //保存成功后重新加载卡组
// File file = getSelectDeck(mDeckSpinner);
// if (file != null) {
// loadDeckFromFile(file);
// }
//延时半秒,使整体看起来更流畅
//延时半秒,使整体看起来更流畅
new Handler().postDelayed(this::shareDeck1, 500);
}
private void shareDeck1() {
//开启绘图缓存
//开启绘图缓存
mRecyclerView.setDrawingCacheEnabled(true);
//这个方法可调可不调,因为在getDrawingCache()里会自动判断有没有缓存有没有准备好,
//如果没有,会自动调用buildDrawingCache()
//这个方法可调可不调,因为在getDrawingCache()里会自动判断有没有缓存有没有准备好,
//如果没有,会自动调用buildDrawingCache()
mRecyclerView.buildDrawingCache();
//获取绘图缓存 这里直接创建了一个新的bitmap
//因为我们在最后需要释放缓存资源,会释放掉缓存中创建的bitmap对象
//获取绘图缓存 这里直接创建了一个新的bitmap
//因为我们在最后需要释放缓存资源,会释放掉缓存中创建的bitmap对象
Bitmap bitmap = BitmapUtil.drawBg4Bitmap(Color.parseColor("#e6f3fd"), Bitmap.createBitmap(mRecyclerView.getDrawingCache(), 0, 0, mRecyclerView.getMeasuredWidth(),
mRecyclerView.getMeasuredHeight()));
//清理绘图缓存,释放资源
//清理绘图缓存,释放资源
mRecyclerView.destroyDrawingCache();
// shotRecyclerView(mRecyclerView)
......@@ -817,7 +817,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
stopService(new Intent(this, DuelAssistantService.class));
YGOUtil.copyMessage(this, et_code.getText().toString().trim());
showToast(getString(R.string.deck_text_copyed));
//复制完毕开启决斗助手
//复制完毕开启决斗助手
YGOUtil.startDuelService(this);
});
......@@ -844,7 +844,7 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
});
//复制前关闭决斗助手
//复制前关闭决斗助手
// String label = TextUtils.isEmpty(deck.getName()) ? getString(R.string.share_deck) : deck.getName();
......@@ -1075,9 +1075,9 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
addMenuButton(mMenuIds, menu, R.id.action_sort, R.string.sort, R.drawable.sort);
addMenuButton(mMenuIds, menu, R.id.action_deck_backup_n_restore, R.string.deck_backup_n_restore, R.drawable.downloadimages);
//设置展开或隐藏的延时。 默认值为 800ms。
//设置展开或隐藏的延时。 默认值为 800ms。
menu.setDuration(150);
//设置每两个子按钮之间动画的延时(ms为单位)。 比如,如果延时设为0,那么所有子按钮都会同时展开或隐藏,默认值为100ms。
//设置每两个子按钮之间动画的延时(ms为单位)。 比如,如果延时设为0,那么所有子按钮都会同时展开或隐藏,默认值为100ms。
menu.setDelay(10);
menu.setOnBoomListener(new DefaultOnBoomListener() {
......
......@@ -5,21 +5,21 @@ import androidx.annotation.Nullable;
public enum CardRace {
None(0),
Warrior(0x1, 1020),
BestWarrior(0x8000, 1021),
SpellCaster(0x2, 1022),
Fairy(0x4, 1023),
Fiend(0x8, 1024),
Zombie(0x10, 1025),
Machine(0x20, 1026),
Aqua(0x40, 1027),
Pyro(0x80, 1028),
Rock(0x100, 1029),
WindBeast(0x200, 1030),
Plant(0x400, 1031),
Insect(0x800, 1032),
Thunder(0x1000, 1033),
Dragon(0x2000, 1034),
Beast(0x4000, 1035),
SpellCaster(0x2, 1021),
Fairy(0x4, 1022),
Fiend(0x8, 1023),
Zombie(0x10, 1024),
Machine(0x20, 1025),
Aqua(0x40, 1026),
Pyro(0x80, 1027),
Rock(0x100, 1028),
WindBeast(0x200, 1029),
Plant(0x400, 1030),
Insect(0x800, 1031),
Thunder(0x1000, 1032),
Dragon(0x2000, 1033),
Beast(0x4000, 1034),
BestWarrior(0x8000, 1035),
Dinosaur(0x10000, 1036),
Fish(0x20000, 1037),
SeaSerpent(0x40000, 1038),
......
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