diff --git a/src/app/class/chat-message.ts b/src/app/class/chat-message.ts index c1d46ffa8..398d68505 100644 --- a/src/app/class/chat-message.ts +++ b/src/app/class/chat-message.ts @@ -52,6 +52,8 @@ export class ChatMessage extends ObjectNode implements ChatMessageContext, Inner get isDirect(): boolean { return 0 < this.sendTo.length ? true : false; } get isMine(): boolean { return (-1 < this.sendTo.indexOf(Network.peerContext.id)) || this.from === Network.peerContext.id ? true : false; } get isDisplayable(): boolean { return this.isDirect ? this.isMine : true; } + get isSystem(): boolean { return this.tag === 'system' ? true : false; } + get isDicebot(): boolean { return this.isSystem && this.from === 'System-BCDice' ? true : false; } innerXml(): string { return this.isDirect ? '' : super.innerXml(); @@ -60,4 +62,4 @@ export class ChatMessage extends ObjectNode implements ChatMessageContext, Inner parseInnerXml(element: Element) { return super.parseInnerXml(element); }; -} \ No newline at end of file +} diff --git a/src/app/class/dice-bot.ts b/src/app/class/dice-bot.ts index 819857a5f..f7582d1e6 100644 --- a/src/app/class/dice-bot.ts +++ b/src/app/class/dice-bot.ts @@ -308,13 +308,29 @@ export class DiceBot extends GameObject { identifier: '', tabIdentifier: chatMessage.tabIdentifier, from: 'System-BCDice', - timestamp: chatMessage.timestamp + 1, + timestamp: chatMessage.timestamp + 2, imageIdentifier: '', tag: 'system', - name: isSecret ? '' : '', + name: isSecret ? '' : '', text: result }; + let diceBotMessageSecretBroadcast: ChatMessageContext = { + identifier: '', + tabIdentifier: chatMessage.tabIdentifier, + from: 'System-BCDice', + timestamp: chatMessage.timestamp + 1, + imageIdentifier: '', + tag: 'system', + name: '', + text: '(シークレットダイス)' + }; + + if( isSecret ){ + EventSystem.call('BROADCAST_MESSAGE', diceBotMessageSecretBroadcast); + chatMessage.to = chatMessage.from; + } + if (chatMessage.to != null && 0 < chatMessage.to.length) { diceBotMessage.to = chatMessage.to; if (chatMessage.to.indexOf(chatMessage.from) < 0) { @@ -471,4 +487,4 @@ interface DiceBotStackContainer { operater: string; calculationResult: number; diplayResult: string; -} \ No newline at end of file +} diff --git a/src/app/component/chat-message/chat-message.component.css b/src/app/component/chat-message/chat-message.component.css index 4e9f15dd5..60c5ed1e1 100644 --- a/src/app/component/chat-message/chat-message.component.css +++ b/src/app/component/chat-message/chat-message.component.css @@ -48,4 +48,12 @@ } .message .tip { font-size: 8px; -} \ No newline at end of file +} + +.dicebot-message .msg-text { + color:#22F; +} + +.direct-message.dicebot-message .msg-text { + color:#CCF; +} diff --git a/src/app/component/chat-message/chat-message.component.html b/src/app/component/chat-message/chat-message.component.html index 18af67968..a34882aa3 100644 --- a/src/app/component/chat-message/chat-message.component.html +++ b/src/app/component/chat-message/chat-message.component.html @@ -1,15 +1,15 @@
-
+
- {{chatMessage.name}} -  From: {{chatMessage.from}} -  {{chatMessage.timestamp | date:'y/M/d H:mm'}} + {{chatMessage.name}} +  From: {{chatMessage.from}} +  {{chatMessage.timestamp | date:'y/M/d H:mm'}}
-
{{chatMessage.text}}
+
{{chatMessage.text}}
-
\ No newline at end of file +