mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-16 04:35:56 +00:00
feat: support market emoticon
This commit is contained in:
parent
6f9df7e801
commit
0791221f36
@ -254,20 +254,25 @@ export class Messager {
|
||||
}
|
||||
|
||||
case `${this.ctx.chronocat.platform}:face`: {
|
||||
const face = (await this.ctx.chronocat.api[
|
||||
'chronocat.internal.qface.get'
|
||||
](`${attrs['id']}`))!
|
||||
if (attrs['unsafeMarketEmoticon']) {
|
||||
this.children.push(r.marketEmoticon(Number(attrs['id'])))
|
||||
} else {
|
||||
const face = (await this.ctx.chronocat.api[
|
||||
'chronocat.internal.qface.get'
|
||||
](`${attrs['id']}`))!
|
||||
|
||||
this.children.push(
|
||||
r.face(
|
||||
face,
|
||||
attrs['unsafeSuper']
|
||||
? FaceType.Super
|
||||
: face.QSid === face.IQLid && face.QSid === face.AQLid
|
||||
? FaceType.Normal2
|
||||
: FaceType.Normal1,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
this.children.push(
|
||||
r.face(
|
||||
face,
|
||||
attrs['unsafeSuper']
|
||||
? FaceType.Super
|
||||
: face.QSid === face.IQLid && face.QSid === face.AQLid
|
||||
? FaceType.Normal2
|
||||
: FaceType.Normal1,
|
||||
),
|
||||
)
|
||||
this.isEndLine = false
|
||||
return
|
||||
}
|
||||
|
@ -103,6 +103,17 @@ const b = () => {
|
||||
},
|
||||
},
|
||||
|
||||
marketEmoticon: (faceIndex: number): O.Partial<Element, 'deep'> => ({
|
||||
elementType: 6,
|
||||
elementId: '',
|
||||
faceElement: {
|
||||
faceIndex,
|
||||
faceText: '\n',
|
||||
faceType: FaceType.MarketEmoticon,
|
||||
imageType: 1,
|
||||
},
|
||||
}),
|
||||
|
||||
pcPoke: (pokeType: number): O.Partial<Element, 'deep'> => ({
|
||||
elementId: '0',
|
||||
elementType: 6,
|
||||
|
@ -510,6 +510,17 @@ async function parseElements(
|
||||
)
|
||||
break
|
||||
}
|
||||
|
||||
case FaceType.MarketEmoticon: {
|
||||
elements.push(
|
||||
ctx.chronocat.h(`${ctx.chronocat.platform}:face`, {
|
||||
id: m.faceElement!.faceIndex,
|
||||
platform: ctx.chronocat.platform,
|
||||
'unsafe-market-emoticon': true,
|
||||
}),
|
||||
)
|
||||
break
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
|
@ -369,6 +369,16 @@ export enum FaceType {
|
||||
*/
|
||||
Super = 3,
|
||||
|
||||
/**
|
||||
* MarketEmoticon
|
||||
*
|
||||
* faceIndex 为 uint32
|
||||
*
|
||||
* - epId (Emoticon Pack ID) : faceIndex >> 16
|
||||
* - eId (Emoticon ID) : faceIndex & 0xFFFF
|
||||
*/
|
||||
MarketEmoticon = 4,
|
||||
|
||||
/**
|
||||
* PC 戳一戳(窗口抖动)
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user