Skip to content

Commit

Permalink
💭を強調
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanasu committed Oct 8, 2023
1 parent 5510701 commit f33b521
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/app/component/chat-palette/chat-palette.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ export class ChatPaletteComponent implements OnInit, OnDestroy {
let option: PanelOption = { left: coordinate.x, top: coordinate.y, width: 560, height: 620 };
let textView = this.panelService.open(TextViewComponent, option);
textView.title = 'チャット記法とチャットパレットの使い方';
textView.text =
textView.shadowing = '💭';
textView.text = [
` パラメータ操作コマンド、ダイスボットコマンドは全角と半角を区別しません、また、ダイスボットコマンドやパラメータの名前はアルファベットの大文字と小文字を区別しません。下記を併用する場合、スペースで区切ってパラメータ操作コマンド、ダイスボットコマンド、チャットメッセージの順に記述します、それぞれ省略が可能です。
 チャット内容をチャットパレットに準備することができます。各行に一つの内容を記述し、行をシングルクリックでチャット欄に呼び出し、ダブルクリックで送信します。
Expand Down Expand Up @@ -220,6 +221,6 @@ export class ChatPaletteComponent implements OnInit, OnDestroy {
 受けるが良い!|約束された勝利の剣《エクスカリバー》!
・💭
 キャラクターからのチャット送信時、 「 と 」 で囲んだ内容を💭で表示します。`;
 キャラクターからのチャット送信時、 「 と 」 で囲んだ内容を💭で表示します。`];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div style="font-weight: bolder; font-size: smaller; padding-top: 3px">
<label>
<input type="checkbox" [(ngModel)]="isUseStandImage" checked="{{isUseStandImage ? 'checked' : ''}}" (change)="isUseStandImage = (isUseStandImage ? true : false)" [attr.disabled]="!isEditable ? '' : null" />
💭、カットイン、スタンド有効
<span style="text-shadow: #111 0 0 1px">💭</span>、カットイン、スタンド有効
</label>
</div>
<div style="font-weight: bolder; font-size: smaller; padding-top: 3px">
Expand Down
2 changes: 1 addition & 1 deletion src/app/component/context-menu/context-menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<span *ngIf="action.name && action.colorSample && action.name.indexOf('イエロー') == 2" class="color-indicator" style="color: #ff0"></span>
<span *ngIf="action.name && action.colorSample && action.name.indexOf('ホワイト') == 2" class="color-indicator" style="color: #fff"></span>
<span *ngIf="action.materialIcon" style="vertical-align: top"><i style="font-size: 150%; padding-left: 2px;" class="material-icons">{{action.materialIcon}}</i></span>
{{ action.name.replace('☑', '').replace('☐', '').replace('◉', '').replace('○', '') }}<sup *ngIf="action.selfOnly" class="self-only">*</sup>
<span [innerHTML]="actionNameHtmlEscape(action.name) | safe: 'html'"></span><sup *ngIf="action.selfOnly" class="self-only">*</sup>
<span *ngIf="action.hotkey != ''" class="hotkey" [innerHtml]="action.hotkey"></span>
<span *ngIf="action.icon && 0 < action.icon?.url.length" class="imagebox"><img class="image" [src]="action.icon.url | safe: 'resourceUrl'"></span>
<i *ngIf="action.isOuterLink" class="material-icons" style="font-size: 1rem">open_in_new</i>
Expand Down
6 changes: 6 additions & 0 deletions src/app/component/context-menu/context-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ContextMenuAction, ContextMenuService } from 'service/context-menu.serv
import { PointerDeviceService } from 'service/pointer-device.service';
import { TabletopObject } from '@udonarium/tabletop-object';
import { PeerCursor } from '@udonarium/peer-cursor';
import { StringUtil } from '@udonarium/core/system/util/string-util';

@Component({
selector: 'context-menu',
Expand Down Expand Up @@ -180,4 +181,9 @@ export class ContextMenuComponent implements OnInit, OnDestroy, AfterViewInit {
close() {
if (this.contextMenuService) this.contextMenuService.close();
}

actionNameHtmlEscape(str) {
if (str == null) return '';
return StringUtil.escapeHtml(str.replace('☑', '').replace('☐', '').replace('◉', '').replace('○', '')).replace(/💭/g, '<span style="text-shadow: #111 0 0 1px">💭</span>');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<ng-container *ngIf="applyDialogElement">
<label style="margin-right: 0.2em">
<input type="checkbox" [(ngModel)]="applyDialogElement.value" checked="{{applyDialogElement.value ? 'checked' : ''}}" (change)="applyDialogElement.value = (applyDialogElement.value ? 'applyDialog' : '')">
<b style="font-size: smaller">💭</b>
<b style="font-size: smaller; text-shadow: #111 0 0 1px">💭</b>
</label>
</ng-container>
<button (click)="openSpeakingModal()" style="font-size: 9px" [style.font-weight]="isSpeakable ? 'bolder' : 'normal'">口パク画像 (APNGなど)</button>
Expand Down
2 changes: 1 addition & 1 deletion src/app/component/text-view/text-view.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span *ngIf="!isObj(text)"><pre class="text">{{text}}</pre></span>
<span *ngIf="isObj(text)"><pre class="text" *ngFor="let t of text; let l = last"><span #message
[innerHTML]="htmlEscapeLinking(t) | safe: 'html'" (click)="onLinkClick($event)"></span><hr *ngIf="!l"></pre></span>
[innerHTML]="textShadwing(htmlEscapeLinking(t)) | safe: 'html'" (click)="onLinkClick($event)"></span><hr *ngIf="!l"></pre></span>
8 changes: 8 additions & 0 deletions src/app/component/text-view/text-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class TextViewComponent implements OnInit {

@Input() text: string|string[] = '';
@Input() title: string = '';
@Input() shadowing: string = '';

constructor(
private panelService: PanelService,
Expand Down Expand Up @@ -59,6 +60,13 @@ export class TextViewComponent implements OnInit {
});
}

textShadwing(str) {
if (str == null) return '';
if (this.shadowing == null || this.shadowing === '') return str;
const regExp = new RegExp(`[${this.shadowing}]`, 'g');
return str.replace(regExp, '<span style="text-shadow: #111 0 0 1px">$&</span>')
}

isObj(val) { return typeof val == 'object'; }

onLinkClick($event) {
Expand Down

0 comments on commit f33b521

Please sign in to comment.