Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
cd5d6337
Commit
cd5d6337
authored
Dec 16, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化卡组时如果是Genesys禁卡表则只加载为禁止、GeneSys两种禁限选项
parent
8d325cc5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
11 deletions
+38
-11
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
.../main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
+34
-9
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerFragment.java
...ava/cn/garymb/ygomobile/ui/cards/DeckManagerFragment.java
+4
-2
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearcher.java
View file @
cd5d6337
...
@@ -359,17 +359,42 @@ public class CardSearcher implements View.OnClickListener {
...
@@ -359,17 +359,42 @@ public class CardSearcher implements View.OnClickListener {
return
mContext
.
getString
(
id
);
return
mContext
.
getString
(
id
);
}
}
private
boolean
isGeneSysMode
()
{
// 获取当前限制列表
LimitList
currentLimitList
=
null
;
if
(
mICardSearcher
!=
null
)
{
currentLimitList
=
mICardSearcher
.
getLimitList
();
}
// 如果当前限制列表的credit limit不为null或大于0,则认为是Genesys模式
if
(
currentLimitList
!=
null
)
{
Integer
creditLimit
=
currentLimitList
.
getCreditLimits
();
return
creditLimit
!=
null
&&
creditLimit
>
0
;
}
return
false
;
}
private
void
initLimitSpinners
(
Spinner
spinner
)
{
private
void
initLimitSpinners
(
Spinner
spinner
)
{
LimitType
[]
eitems
=
LimitType
.
values
();
// 先清空所有现有的item
if
(
spinner
.
getAdapter
()
!=
null
&&
spinner
.
getAdapter
()
instanceof
SimpleSpinnerAdapter
)
{
((
SimpleSpinnerAdapter
)
spinner
.
getAdapter
()).
clear
();
}
List
<
SimpleSpinnerItem
>
items
=
new
ArrayList
<>();
List
<
SimpleSpinnerItem
>
items
=
new
ArrayList
<>();
for
(
LimitType
item
:
eitems
)
{
if
(
item
==
LimitType
.
None
)
{
// 添加默认选项
items
.
add
(
new
SimpleSpinnerItem
(
item
.
getId
(),
getString
(
R
.
string
.
label_limit
)));
items
.
add
(
new
SimpleSpinnerItem
(
LimitType
.
None
.
getId
(),
getString
(
R
.
string
.
label_limit
)));
}
else
if
(
item
==
LimitType
.
All
)
{
items
.
add
(
new
SimpleSpinnerItem
(
LimitType
.
All
.
getId
(),
getString
(
R
.
string
.
all
)));
items
.
add
(
new
SimpleSpinnerItem
(
item
.
getId
(),
getString
(
R
.
string
.
all
)));
}
else
{
// 根据是否为GeneSys模式添加相应的限制类型选项
items
.
add
(
new
SimpleSpinnerItem
(
item
.
getId
(),
mStringManager
.
getLimitString
(
item
.
getId
())));
if
(
isGeneSysMode
())
{
}
// GeneSys模式下只添加GeneSys和Forbidden选项
items
.
add
(
new
SimpleSpinnerItem
(
LimitType
.
GeneSys
.
getId
(),
mStringManager
.
getLimitString
(
LimitType
.
GeneSys
.
getId
())));
items
.
add
(
new
SimpleSpinnerItem
(
LimitType
.
Forbidden
.
getId
(),
mStringManager
.
getLimitString
(
LimitType
.
Forbidden
.
getId
())));
}
else
{
// 普通模式下添加Forbidden、Limit和SemiLimit选项
items
.
add
(
new
SimpleSpinnerItem
(
LimitType
.
Forbidden
.
getId
(),
mStringManager
.
getLimitString
(
LimitType
.
Forbidden
.
getId
())));
items
.
add
(
new
SimpleSpinnerItem
(
LimitType
.
Limit
.
getId
(),
mStringManager
.
getLimitString
(
LimitType
.
Limit
.
getId
())));
items
.
add
(
new
SimpleSpinnerItem
(
LimitType
.
SemiLimit
.
getId
(),
mStringManager
.
getLimitString
(
LimitType
.
SemiLimit
.
getId
())));
}
}
SimpleSpinnerAdapter
adapter
=
new
SimpleSpinnerAdapter
(
mContext
);
SimpleSpinnerAdapter
adapter
=
new
SimpleSpinnerAdapter
(
mContext
);
adapter
.
setColor
(
Color
.
WHITE
);
adapter
.
setColor
(
Color
.
WHITE
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerFragment.java
View file @
cd5d6337
...
@@ -261,7 +261,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
...
@@ -261,7 +261,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
tv_result_count
=
layoutView
.
findViewById
(
R
.
id
.
result_count
);
tv_result_count
=
layoutView
.
findViewById
(
R
.
id
.
result_count
);
// 初始化右侧抽屉的条件搜索禁卡表下拉框并设置背景颜色
// 初始化右侧抽屉的条件搜索禁卡表下拉框并设置背景颜色
mCardSearchLimitSpinner
=
layoutView
.
findViewById
(
R
.
id
.
nav_view_list
)
.
findViewById
(
R
.
id
.
sp_limit_list
);
mCardSearchLimitSpinner
=
mCardSearcher
.
findViewById
(
R
.
id
.
sp_limit_list
);
mCardSearchLimitSpinner
.
setPopupBackgroundResource
(
R
.
color
.
colorNavy
);
mCardSearchLimitSpinner
.
setPopupBackgroundResource
(
R
.
color
.
colorNavy
);
// 初始化网格形式的卡组显示区域
// 初始化网格形式的卡组显示区域
...
@@ -1616,7 +1616,6 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
...
@@ -1616,7 +1616,6 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
int
j
=
i
+
1
;
int
j
=
i
+
1
;
String
name
=
limitLists
.
get
(
i
);
String
name
=
limitLists
.
get
(
i
);
LogUtil
.
w
(
TAG
,
i
+
":"
+
"卡表名称:"
+
name
);
items
.
add
(
new
SimpleSpinnerItem
(
j
,
name
));
items
.
add
(
new
SimpleSpinnerItem
(
j
,
name
));
if
(
cur
!=
null
&&
TextUtils
.
equals
(
cur
.
getName
(),
name
))
{
if
(
cur
!=
null
&&
TextUtils
.
equals
(
cur
.
getName
(),
name
))
{
index
=
j
;
index
=
j
;
...
@@ -1684,9 +1683,12 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
...
@@ -1684,9 +1683,12 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
// 更新卡片列表适配器的限制列表并通知数据变更
// 更新卡片列表适配器的限制列表并通知数据变更
mCardListAdapter
.
setLimitList
(
limitList
);
mCardListAdapter
.
setLimitList
(
limitList
);
Objects
.
requireNonNull
(
getActivity
()).
runOnUiThread
(()
->
mCardListAdapter
.
notifyDataSetChanged
());
Objects
.
requireNonNull
(
getActivity
()).
runOnUiThread
(()
->
mCardListAdapter
.
notifyDataSetChanged
());
// 根据是否有Genesys信用分上限值来显示计分板
// 根据是否有Genesys信用分上限值来显示计分板
if
(
limitList
.
getCreditLimits
()
!=
null
&&
limitList
.
getCreditLimits
()
>
0
)
{
if
(
limitList
.
getCreditLimits
()
!=
null
&&
limitList
.
getCreditLimits
()
>
0
)
{
ll_genesys_scoreboard
.
setVisibility
(
View
.
VISIBLE
);
ll_genesys_scoreboard
.
setVisibility
(
View
.
VISIBLE
);
// 重新初始化卡片搜索器中的限制类型下拉框
mCardSearcher
.
initItems
();
}
else
{
}
else
{
ll_genesys_scoreboard
.
setVisibility
(
View
.
GONE
);
ll_genesys_scoreboard
.
setVisibility
(
View
.
GONE
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment