Commit 468bd07b authored by chechunchi's avatar chechunchi

update interface Option

parent 892fb37f
Pipeline #21578 passed with stages
in 16 minutes and 42 seconds
...@@ -27,13 +27,13 @@ export const fetchCheckCardMeta = async ( ...@@ -27,13 +27,13 @@ export const fetchCheckCardMeta = async (
? code ? code
: matStore.in(location.location).of(controller)[location.sequence] : matStore.in(location.location).of(controller)[location.sequence]
?.occupant?.id || 0; ?.occupant?.id || 0;
const meta = await fetchCard(code); const meta = await fetchCard(newID);
const effectDesc = effectDescCode const effectDesc = effectDescCode
? getCardStr(meta, effectDescCode & 0xf) ? getCardStr(meta, effectDescCode & 0xf)
: undefined; : undefined;
const newOption = { const newOption = {
code: newID, meta,
location: location.toObject(), location: location.toObject(),
level1, level1,
level2, level2,
......
...@@ -3,7 +3,7 @@ type CardLocation = ReturnType<typeof ygopro.CardLocation.prototype.toObject>; ...@@ -3,7 +3,7 @@ type CardLocation = ReturnType<typeof ygopro.CardLocation.prototype.toObject>;
interface Option { interface Option {
// card id // card id
code: number; meta: CardMeta;
location?: CardLocation; location?: CardLocation;
// 效果 // 效果
effectDesc?: string; effectDesc?: string;
......
...@@ -135,10 +135,10 @@ export const SelectActionsModal = () => { ...@@ -135,10 +135,10 @@ export const SelectActionsModal = () => {
style={{ width: 120 }} style={{ width: 120 }}
cover={ cover={
<img <img
alt={option.code.toString()} alt={option.meta.id.toString()}
src={ src={
option.code option.meta.id
? `${NeosConfig.cardImgUrl}/${option.code}.jpg` ? `${NeosConfig.cardImgUrl}/${option.meta.id}.jpg`
: `${NeosConfig.assetsPath}/card_back.jpg` : `${NeosConfig.assetsPath}/card_back.jpg`
} }
style={{ width: 100 }} style={{ width: 100 }}
...@@ -159,10 +159,10 @@ export const SelectActionsModal = () => { ...@@ -159,10 +159,10 @@ export const SelectActionsModal = () => {
style={{ width: 120 }} style={{ width: 120 }}
cover={ cover={
<img <img
alt={option.code.toString()} alt={option.meta.id.toString()}
src={ src={
option.code option.meta.id
? `${NeosConfig.cardImgUrl}/${option.code}.jpg` ? `${NeosConfig.cardImgUrl}/${option.meta.id}.jpg`
: `${NeosConfig.assetsPath}/card_back.jpg` : `${NeosConfig.assetsPath}/card_back.jpg`
} }
/> />
......
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