Commit d08f63cf authored by nanahira's avatar nanahira

optional pic display

parent 5afbc854
...@@ -180,10 +180,13 @@ export class YGOProCard implements YGOProCardLike { ...@@ -180,10 +180,13 @@ export class YGOProCard implements YGOProCardLike {
getDisplayString(config: YGOCardConfig) { getDisplayString(config: YGOCardConfig) {
const view = this.getView(config.lang); const view = this.getView(config.lang);
const lines = [ const lines: string[] = [];
segment('image', { url: config.renderUrl(view), cache: true }), if (config.displayPic) {
`${view.name}[${view.id}]`, lines.push(
]; segment('image', { url: config.renderUrl(view), cache: true }),
);
}
lines.push(`${view.name}[${view.id}]`);
const isMonster = this.isType('TYPE_MONSTER'); const isMonster = this.isType('TYPE_MONSTER');
let typeString = `[${view.displayType}]`; let typeString = `[${view.displayType}]`;
if (isMonster) { if (isMonster) {
......
...@@ -22,6 +22,9 @@ export class YGOCardConfig { ...@@ -22,6 +22,9 @@ export class YGOCardConfig {
@UseSchema(Schema.select(['cn', 'en'], '显示语言').default('cn')) @UseSchema(Schema.select(['cn', 'en'], '显示语言').default('cn'))
lang: 'cn' | 'en'; lang: 'cn' | 'en';
@DefineSchema({ type: 'boolean', desc: '是否展示卡图', default: true })
displayPic: boolean;
@DefineSchema({ @DefineSchema({
type: 'string', type: 'string',
desc: '卡图源,将 {{id}} 替换为卡号', desc: '卡图源,将 {{id}} 替换为卡号',
......
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