Skip to content

Commit

Permalink
☑☐をメニュー項目名に使えるように。
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanasu committed Nov 22, 2023
1 parent bea77b0 commit 52ba72b
Show file tree
Hide file tree
Showing 15 changed files with 203 additions and 115 deletions.
18 changes: 12 additions & 6 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,38 +751,44 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
action: () => {
TableSelecter.instance.gridShow = !TableSelecter.instance.gridShow;
EventSystem.trigger('UPDATE_GAME_OBJECT', TableSelecter.instance.toContext());
}
},
checkBox: 'check'
},
{ name: `${ TableSelecter.instance.gridSnap ? '☑' : '☐' }オブジェクト移動時にスナップ`,
action: () => {
TableSelecter.instance.gridSnap = !TableSelecter.instance.gridSnap;
}
},
checkBox: 'check'
},
ContextMenuSeparator,
{ name: `${ ChatWindowComponent.isNoticeOn ? '☑' : '☐' }チャット受信時に音で通知`,
action: () => {
ChatWindowComponent.isNoticeOn = !ChatWindowComponent.isNoticeOn;
}
},
checkBox: 'check'
},
ContextMenuSeparator,
{ name: `${ isShowStand ? '☑' : '☐' }スタンド表示`,
action: () => {
StandImageComponent.isShowStand = !isShowStand;
}
},
checkBox: 'check'
},
{ name: `${ isShowNameTag ? '☑' : '☐' }ネームタグ表示`,
action: () => {
StandImageComponent.isShowNameTag = !isShowNameTag;
},
level: 1,
disabled: !StandImageComponent.isShowStand
disabled: !StandImageComponent.isShowStand,
checkBox: 'check'
},
{ name: `${ isCanBeGone ? '☑' : '☐' }透明化、自動退去`,
action: () => {
StandImageComponent.isCanBeGone = !isCanBeGone;
},
level: 1,
disabled: !StandImageComponent.isShowStand
disabled: !StandImageComponent.isShowStand,
checkBox: 'check'
},
ContextMenuSeparator,
{ name: '表示スタンド全消去', action: () => EventSystem.trigger('DESTORY_STAND_IMAGE_ALL', null) }
Expand Down
6 changes: 4 additions & 2 deletions src/app/component/card-stack/card-stack.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,14 @@ export class CardStackComponent implements OnChanges, AfterViewInit, OnDestroy {
name: '☑ 固定', action: () => {
this.isLocked = false;
SoundEffect.play(PresetSound.unlock);
}
},
checkBox: 'check'
} : {
name: '☐ 固定', action: () => {
this.isLocked = true;
SoundEffect.play(PresetSound.lock);
}
},
checkBox: 'check'
}),
ContextMenuSeparator,
{
Expand Down
6 changes: 4 additions & 2 deletions src/app/component/card/card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,14 @@ export class CardComponent implements OnDestroy, OnChanges, AfterViewInit {
name: '☑ 固定', action: () => {
this.isLocked = false;
SoundEffect.play(PresetSound.unlock);
}
},
checkBox: 'check'
} : {
name: '☐ 固定', action: () => {
this.isLocked = true;
SoundEffect.play(PresetSound.lock);
}
},
checkBox: 'check'
});
actions.push(ContextMenuSeparator);
actions.push(!this.isVisible || this.isHand
Expand Down
18 changes: 12 additions & 6 deletions src/app/component/chat-input/chat-input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,36 +864,42 @@ export class ChatInputComponent implements OnInit, OnDestroy {
name: '☑ 反転', action: () => {
this.character.isInverse = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ 反転', action: () => {
this.character.isInverse = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
(this.character.isHollow
? {
name: '☑ ぼかし', action: () => {
this.character.isHollow = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ ぼかし', action: () => {
this.character.isHollow = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
(this.character.isBlackPaint
? {
name: '☑ 黒塗り', action: () => {
this.character.isBlackPaint = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ 黒塗り', action: () => {
this.character.isBlackPaint = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
{ name: 'オーラ', action: null, subActions: [{ name: `${this.character.aura == -1 ? '◉' : '○'} なし`, action: () => { this.character.aura = -1; EventSystem.trigger('UPDATE_INVENTORY', null) } }, ContextMenuSeparator].concat(['ブラック', 'ブルー', 'グリーン', 'シアン', 'レッド', 'マゼンタ', 'イエロー', 'ホワイト'].map((color, i) => {
return { name: `${this.character.aura == i ? '◉' : '○'} ${color}`, action: () => { this.character.aura = i; EventSystem.trigger('UPDATE_INVENTORY', null) } };
Expand Down
6 changes: 3 additions & 3 deletions src/app/component/context-menu/context-menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
(mouseenter)="(action.disabled || (action.altitudeHande && action.altitudeHande.altitude == 0)) ? false : showSubMenu(action)">
<div class="menu-title" [ngClass]="{'icon-menu': action.icon, default: action.default}" style="width: 100%">
<span *ngIf="action.error" title="{{action.error}}">⚠️</span>
<input *ngIf="action.name && action.name.indexOf('☑') == 0" type="checkbox" [disabled]="action.disabled" checked/>
<input *ngIf="action.name && action.name.indexOf('☐') == 0" type="checkbox" [disabled]="action.disabled" />
<input *ngIf="action.name && action.checkBox == 'check' && action.name.indexOf('☑') == 0" type="checkbox" [disabled]="action.disabled" checked/>
<input *ngIf="action.name && action.checkBox == 'check' && action.name.indexOf('☐') == 0" type="checkbox" [disabled]="action.disabled" />
<input *ngIf="action.name && action.name.indexOf('◉') == 0" type="radio" [disabled]="action.disabled" checked />
<input *ngIf="action.name && action.name.indexOf('○') == 0" type="radio" [disabled]="action.disabled" />
<span *ngIf="action.name && action.colorSample && action.name.indexOf('ブラック') == 2" class="color-indicator" style="color: #000"></span>
Expand All @@ -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>
<span [innerHTML]="actionNameHtmlEscape(action.name) | safe: 'html'"></span><sup *ngIf="action.selfOnly" class="self-only">*</sup>
<span [innerHTML]="actionNameHtmlEscape(action.name, action.checkBox) | 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: 4 additions & 2 deletions src/app/component/context-menu/context-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ export class ContextMenuComponent implements OnInit, OnDestroy, AfterViewInit {
if (this.contextMenuService) this.contextMenuService.close();
}

actionNameHtmlEscape(str) {
actionNameHtmlEscape(str, checkBox=null) {
if (str == null) return '';
return StringUtil.escapeHtml(str.replace('☑', '').replace('☐', '').replace('◉', '').replace('○', '')).replace(/💭/g, '<span style="text-shadow: #111 0 0 1px">💭</span>');
if (checkBox == 'check') str = str.replace(/^[☑☐]/, '');
if (checkBox == 'radio') str = str.replace(/^[◉○]/, '');
return StringUtil.escapeHtml(str.replace('◉', '').replace('○', '')).replace(/💭/g, '<span style="text-shadow: #111 0 0 1px">💭</span>');
}
}
9 changes: 6 additions & 3 deletions src/app/component/cut-in/cut-in.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,17 +529,20 @@ export class CutInComponent implements OnInit, OnDestroy {
{
name: `${this.isIndicateSender ? '☑' : '☐'}送信者を表示`,
action: () => { this.isIndicateSender = !this.isIndicateSender; },
selfOnly: true
selfOnly: true,
checkBox: 'check'
},
{
name: `${this.isBackyard ? '☑' : '☐'}ウィンドウの背後に表示`,
action: () => { this.isBackyard = !this.isBackyard; },
selfOnly: true
selfOnly: true,
checkBox: 'check'
},
{
name: `${this.isMinimize ? '☑' : '☐'}最小化`,
action: () => { this.isMinimize = !this.isMinimize; },
selfOnly: true
selfOnly: true,
checkBox: 'check'
},
/*
(!this.videoId ? null : ContextMenuSeparator),
Expand Down
12 changes: 8 additions & 4 deletions src/app/component/dice-symbol/dice-symbol.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,15 @@ export class DiceSymbolComponent implements OnChanges, AfterViewInit, OnDestroy
this.isLock = false;
SoundEffect.play(PresetSound.unlock);
},
disabled: this.hasOwner && !this.isVisible
disabled: this.hasOwner && !this.isVisible,
checkBox: 'check'
} : {
name: '☐ 一斉公開しない', action: () => {
this.isLock = true;
SoundEffect.play(PresetSound.lock);
},
disabled: this.hasOwner && !this.isVisible
disabled: this.hasOwner && !this.isVisible,
checkBox: 'check'
}));
if (this.isVisible) {
let subActions: ContextMenuAction[] = [];
Expand Down Expand Up @@ -467,11 +469,13 @@ export class DiceSymbolComponent implements OnChanges, AfterViewInit, OnDestroy
? {
name: '☑ 影の表示', action: () => {
this.isDropShadow = false;
}
},
checkBox: 'check'
} : {
name: '☐ 影の表示', action: () => {
this.isDropShadow = true;
}
},
checkBox: 'check'
}));

actions.push(ContextMenuSeparator);
Expand Down
54 changes: 36 additions & 18 deletions src/app/component/game-character/game-character.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,73 +654,85 @@ export class GameCharacterComponent implements OnChanges, AfterViewInit, OnDestr
name: '☑ オーバービューに顔ICを使用', action: () => {
this.isUseIconToOverviewImage = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ オーバービューに顔ICを使用', action: () => {
this.isUseIconToOverviewImage = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
(this.gameCharacter.isShowChatBubble
? {
name: '☑ 💭の表示', action: () => {
this.gameCharacter.isShowChatBubble = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ 💭の表示', action: () => {
this.gameCharacter.isShowChatBubble = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
(this.isDropShadow
? {
name: '☑ 影の表示', action: () => {
this.isDropShadow = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ 影の表示', action: () => {
this.isDropShadow = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
{ name: '画像効果', action: null, subActions: [
(this.isInverse
? {
name: '☑ 反転', action: () => {
this.isInverse = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ 反転', action: () => {
this.isInverse = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
(this.isHollow
? {
name: '☑ ぼかし', action: () => {
this.isHollow = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ ぼかし', action: () => {
this.isHollow = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
(this.isBlackPaint
? {
name: '☑ 黒塗り', action: () => {
this.isBlackPaint = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ 黒塗り', action: () => {
this.isBlackPaint = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
{ name: 'オーラ', action: null, subActions: [{ name: `${this.aura == -1 ? '◉' : '○'} なし`, action: () => { this.aura = -1; EventSystem.trigger('UPDATE_INVENTORY', null) } }, ContextMenuSeparator].concat(['ブラック', 'ブルー', 'グリーン', 'シアン', 'レッド', 'マゼンタ', 'イエロー', 'ホワイト'].map((color, i) => {
return { name: `${this.aura == i ? '◉' : '○'} ${color}`, colorSample: true, action: () => { this.aura = i; EventSystem.trigger('UPDATE_INVENTORY', null) } };
Expand All @@ -744,24 +756,28 @@ export class GameCharacterComponent implements OnChanges, AfterViewInit, OnDestr
name: '☑ 他のキャラクターに乗る', action: () => {
this.isNotRide = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ 他のキャラクターに乗る', action: () => {
this.isNotRide = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
(this.isAltitudeIndicate
? {
name: '☑ 高度の表示', action: () => {
this.isAltitudeIndicate = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ 高度の表示', action: () => {
this.isAltitudeIndicate = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
{
name: '高度を0にする', action: () => {
Expand Down Expand Up @@ -803,12 +819,14 @@ export class GameCharacterComponent implements OnChanges, AfterViewInit, OnDestr
name: '☑ テーブルインベントリに表示', action: () => {
this.gameCharacter.isInventoryIndicate = false;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
} : {
name: '☐ テーブルインベントリに表示', action: () => {
this.gameCharacter.isInventoryIndicate = true;
EventSystem.trigger('UPDATE_INVENTORY', null);
}
},
checkBox: 'check'
}),
{ name: 'テーブルから移動', action: null, subActions: [
{
Expand Down
Loading

0 comments on commit 52ba72b

Please sign in to comment.