diff --git a/src/app/class/data-summary-setting.ts b/src/app/class/data-summary-setting.ts index 32c40d33c..104d172db 100644 --- a/src/app/class/data-summary-setting.ts +++ b/src/app/class/data-summary-setting.ts @@ -22,6 +22,7 @@ export class DataSummarySetting extends GameObject implements InnerXml { @SyncVar() sortTag: string = 'name'; @SyncVar() sortOrder: SortOrder = SortOrder.ASC; @SyncVar() dataTag: string = 'HP MP 敏捷度 生命力 精神力'; + @SyncVar() gameType: string = ""; private _dataTag: string; private _dataTags: string[]; diff --git a/src/app/component/chat-palette/chat-palette.component.ts b/src/app/component/chat-palette/chat-palette.component.ts index 9fd4f4de5..0eed459b8 100644 --- a/src/app/component/chat-palette/chat-palette.component.ts +++ b/src/app/component/chat-palette/chat-palette.component.ts @@ -9,6 +9,7 @@ import { PeerCursor } from '@udonarium/peer-cursor'; import { ChatInputComponent } from 'component/chat-input/chat-input.component'; import { ChatMessageService } from 'service/chat-message.service'; import { PanelService } from 'service/panel.service'; +import { GameObjectInventoryService} from 'service/game-object-inventory.service'; @Component({ selector: 'chat-palette', @@ -51,13 +52,20 @@ export class ChatPaletteComponent implements OnInit, OnDestroy { constructor( public chatMessageService: ChatMessageService, - private panelService: PanelService + private panelService: PanelService, + private inventoryService: GameObjectInventoryService ) { } ngOnInit() { Promise.resolve().then(() => this.updatePanelTitle()); this.chatTabidentifier = this.chatMessageService.chatTabs ? this.chatMessageService.chatTabs[0].identifier : ''; - this.gameType = this.character.chatPalette ? this.character.chatPalette.dicebot : ''; + + if(this.character.chatPalette != null && this.character.chatPalette.dicebot != '') { + this.gameType = this.character.chatPalette.dicebot; + } else { + this.gameType = this.inventoryService.gameType; + } + EventSystem.register(this) .on('DELETE_GAME_OBJECT', -1000, event => { if (this.character && this.character.identifier === event.data.identifier) { diff --git a/src/app/component/chat-window/chat-window.component.ts b/src/app/component/chat-window/chat-window.component.ts index 67653607a..1b17756b1 100644 --- a/src/app/component/chat-window/chat-window.component.ts +++ b/src/app/component/chat-window/chat-window.component.ts @@ -8,6 +8,7 @@ import { ChatTabSettingComponent } from 'component/chat-tab-setting/chat-tab-set import { ChatMessageService } from 'service/chat-message.service'; import { PanelOption, PanelService } from 'service/panel.service'; import { PointerDeviceService } from 'service/pointer-device.service'; +import { GameObjectInventoryService} from 'service/game-object-inventory.service'; @Component({ selector: 'chat-window', @@ -38,12 +39,14 @@ export class ChatWindowComponent implements OnInit, OnDestroy, AfterViewInit { constructor( public chatMessageService: ChatMessageService, private panelService: PanelService, - private pointerDeviceService: PointerDeviceService + private pointerDeviceService: PointerDeviceService, + private inventoryService: GameObjectInventoryService ) { } ngOnInit() { this.sendFrom = PeerCursor.myCursor.identifier; this._chatTabidentifier = 0 < this.chatMessageService.chatTabs.length ? this.chatMessageService.chatTabs[0].identifier : ''; + this.gameType = this.inventoryService.gameType; EventSystem.register(this) .on('MESSAGE_ADDED', event => { diff --git a/src/app/component/game-object-inventory/game-object-inventory.component.html b/src/app/component/game-object-inventory/game-object-inventory.component.html index ad8de7689..97742d16f 100644 --- a/src/app/component/game-object-inventory/game-object-inventory.component.html +++ b/src/app/component/game-object-inventory/game-object-inventory.component.html @@ -32,6 +32,11 @@
表示項目
+
標準ダイスボット
+
diff --git a/src/app/component/game-object-inventory/game-object-inventory.component.ts b/src/app/component/game-object-inventory/game-object-inventory.component.ts index 746c63627..300908546 100644 --- a/src/app/component/game-object-inventory/game-object-inventory.component.ts +++ b/src/app/component/game-object-inventory/game-object-inventory.component.ts @@ -15,6 +15,7 @@ import { ContextMenuAction, ContextMenuService, ContextMenuSeparator } from 'ser import { GameObjectInventoryService } from 'service/game-object-inventory.service'; import { PanelOption, PanelService } from 'service/panel.service'; import { PointerDeviceService } from 'service/pointer-device.service'; +import { DiceBot } from '@udonarium/dice-bot'; @Component({ selector: 'game-object-inventory', @@ -42,6 +43,10 @@ export class GameObjectInventoryComponent implements OnInit, AfterViewInit, OnDe get newLineString(): string { return this.inventoryService.newLineString; } + get diceBotInfos() { return DiceBot.diceBotInfos } + get gameType(): string { return this.inventoryService.gameType; } + set gameType(gameType: string) { this.inventoryService.gameType = gameType; } + constructor( private changeDetector: ChangeDetectorRef, private panelService: PanelService, @@ -216,4 +221,11 @@ export class GameObjectInventoryComponent implements OnInit, AfterViewInit, OnDe trackByGameObject(index: number, gameObject: GameObject) { return gameObject ? gameObject.identifier : index; } + + onChangeGameType(gameType: string) { + console.log('onChangeGameType ready'); + DiceBot.getHelpMessage(this.gameType).then(help => { + console.log('onChangeGameType done\n' + help + gameType); + }); + } } diff --git a/src/app/service/game-object-inventory.service.ts b/src/app/service/game-object-inventory.service.ts index 72cacbc02..58e6ecac2 100644 --- a/src/app/service/game-object-inventory.service.ts +++ b/src/app/service/game-object-inventory.service.ts @@ -25,6 +25,9 @@ export class GameObjectInventoryService { set dataTag(dataTag: string) { this.summarySetting.dataTag = dataTag; } get dataTags(): string[] { return this.summarySetting.dataTags; } + get gameType(): string { return this.summarySetting.gameType; } + set gameType(gameType: string) {this.summarySetting.gameType = gameType; } + tableInventory: ObjectInventory = new ObjectInventory(object => { return object.location.name === 'table'; }); commonInventory: ObjectInventory = new ObjectInventory(object => { return !this.isAnyLocation(object.location.name); }); privateInventory: ObjectInventory = new ObjectInventory(object => { return object.location.name === Network.peerId; });