i18n reversi
This commit is contained in:
		
							parent
							
								
									dd167a476f
								
							
						
					
					
						commit
						32053d963f
					
				
					 4 changed files with 79 additions and 39 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
<template>
 | 
			
		||||
<div class="root">
 | 
			
		||||
	<header><b>{{ blackUser.name }}</b>(黒) vs <b>{{ whiteUser.name }}</b>(白)</header>
 | 
			
		||||
	<header><b>{{ blackUser.name }}</b>(%i18n:common.reversi.black%) vs <b>{{ whiteUser.name }}</b>(%i18n:common.reversi.white%)</header>
 | 
			
		||||
 | 
			
		||||
	<div style="overflow: hidden">
 | 
			
		||||
		<p class="turn" v-if="!iAmPlayer && !game.isEnded">{{ '%i18n:common.reversi.turn-of%'.replace('{}', turnUser.name) }}<mk-ellipsis/></p>
 | 
			
		||||
| 
						 | 
				
			
			@ -39,7 +39,7 @@
 | 
			
		|||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
 | 
			
		||||
	<p class="status"><b>{{ logPos }}ターン目</b> 黒:{{ o.blackCount }} 白:{{ o.whiteCount }} 合計:{{ o.blackCount + o.whiteCount }}</p>
 | 
			
		||||
	<p class="status"><b>{{ '%i18n:common.reversi.this-turn%'.split('{}')[0] }}{{ logPos }}{{ '%i18n:common.reversi.this-turn%'.split('{}')[1] }}</b> %i18n:common.reversi.black%:{{ o.blackCount }} %i18n:common.reversi.white%:{{ o.whiteCount }} %i18n:common.reversi.total%:{{ o.blackCount + o.whiteCount }}</p>
 | 
			
		||||
 | 
			
		||||
	<div class="player" v-if="game.isEnded">
 | 
			
		||||
		<el-button-group>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,12 +3,12 @@
 | 
			
		|||
	<header><b>{{ game.user1.name }}</b> vs <b>{{ game.user2.name }}</b></header>
 | 
			
		||||
 | 
			
		||||
	<div>
 | 
			
		||||
		<p>ゲームの設定</p>
 | 
			
		||||
		<p>%i18n:@settings-of-the-game%</p>
 | 
			
		||||
 | 
			
		||||
		<el-card class="map">
 | 
			
		||||
			<div slot="header">
 | 
			
		||||
				<el-select :class="$style.mapSelect" v-model="mapName" placeholder="マップを選択" @change="onMapChange">
 | 
			
		||||
					<el-option label="ランダム" :value="null"/>
 | 
			
		||||
				<el-select :class="$style.mapSelect" v-model="mapName" placeholder="%i18n:@choose-map%" @change="onMapChange">
 | 
			
		||||
					<el-option label="%i18n:@random%" :value="null"/>
 | 
			
		||||
					<el-option-group v-for="c in mapCategories" :key="c" :label="c">
 | 
			
		||||
						<el-option v-for="m in maps" v-if="m.category == c" :key="m.name" :label="m.name" :value="m.name">
 | 
			
		||||
							<span style="float: left">{{ m.name }}</span>
 | 
			
		||||
| 
						 | 
				
			
			@ -30,25 +30,25 @@
 | 
			
		|||
 | 
			
		||||
		<el-card class="bw">
 | 
			
		||||
			<div slot="header">
 | 
			
		||||
				<span>先手/後手</span>
 | 
			
		||||
				<span>%i18n:@black-or-white%</span>
 | 
			
		||||
			</div>
 | 
			
		||||
			<el-radio v-model="game.settings.bw" label="random" @change="updateSettings">ランダム</el-radio>
 | 
			
		||||
			<el-radio v-model="game.settings.bw" :label="1" @change="updateSettings">{{ game.user1.name }}が黒</el-radio>
 | 
			
		||||
			<el-radio v-model="game.settings.bw" :label="2" @change="updateSettings">{{ game.user2.name }}が黒</el-radio>
 | 
			
		||||
			<el-radio v-model="game.settings.bw" label="random" @change="updateSettings">%i18n:@random%</el-radio>
 | 
			
		||||
			<el-radio v-model="game.settings.bw" :label="1" @change="updateSettings">{{ '%i18n:@black-is%'.split('{}')[0] }}{{ game.user1.name }}{{ '%i18n:@black-is%'.split('{}')[1] }}</el-radio>
 | 
			
		||||
			<el-radio v-model="game.settings.bw" :label="2" @change="updateSettings">{{ '%i18n:@black-is%'.split('{}')[0] }}{{ game.user2.name }}{{ '%i18n:@black-is%'.split('{}')[1] }}</el-radio>
 | 
			
		||||
		</el-card>
 | 
			
		||||
 | 
			
		||||
		<el-card class="rules">
 | 
			
		||||
			<div slot="header">
 | 
			
		||||
				<span>ルール</span>
 | 
			
		||||
				<span>%i18n:@rules%</span>
 | 
			
		||||
			</div>
 | 
			
		||||
			<mk-switch v-model="game.settings.isLlotheo" @change="updateSettings" text="石の少ない方が勝ち(ロセオ)"/>
 | 
			
		||||
			<mk-switch v-model="game.settings.loopedBoard" @change="updateSettings" text="ループマップ"/>
 | 
			
		||||
			<mk-switch v-model="game.settings.canPutEverywhere" @change="updateSettings" text="どこでも置けるモード"/>
 | 
			
		||||
			<mk-switch v-model="game.settings.isLlotheo" @change="updateSettings" text="%i18n:@is-llotheo%"/>
 | 
			
		||||
			<mk-switch v-model="game.settings.loopedBoard" @change="updateSettings" text="%i18n:@looped-map%"/>
 | 
			
		||||
			<mk-switch v-model="game.settings.canPutEverywhere" @change="updateSettings" text="%i18n:@can-put-everywhere%"/>
 | 
			
		||||
		</el-card>
 | 
			
		||||
 | 
			
		||||
		<el-card class="bot-form" v-if="form">
 | 
			
		||||
			<div slot="header">
 | 
			
		||||
				<span>Botの設定</span>
 | 
			
		||||
				<span>%i18n:@settings-of-the-bot%</span>
 | 
			
		||||
			</div>
 | 
			
		||||
			<el-alert v-for="message in messages"
 | 
			
		||||
				:title="message.text"
 | 
			
		||||
| 
						 | 
				
			
			@ -77,16 +77,16 @@
 | 
			
		|||
 | 
			
		||||
	<footer>
 | 
			
		||||
		<p class="status">
 | 
			
		||||
			<template v-if="isAccepted && isOpAccepted">ゲームは数秒後に開始されます<mk-ellipsis/></template>
 | 
			
		||||
			<template v-if="isAccepted && !isOpAccepted">相手の準備が完了するのを待っています<mk-ellipsis/></template>
 | 
			
		||||
			<template v-if="!isAccepted && isOpAccepted">あなたの準備が完了するのを待っています</template>
 | 
			
		||||
			<template v-if="!isAccepted && !isOpAccepted">準備中<mk-ellipsis/></template>
 | 
			
		||||
			<template v-if="isAccepted && isOpAccepted">%i18n:@this-gane-is-started-soon%<mk-ellipsis/></template>
 | 
			
		||||
			<template v-if="isAccepted && !isOpAccepted">%i18n:@waiting-for-other%<mk-ellipsis/></template>
 | 
			
		||||
			<template v-if="!isAccepted && isOpAccepted">%i18n:@waiting-for-me%</template>
 | 
			
		||||
			<template v-if="!isAccepted && !isOpAccepted">%i18n:@waiting-for-both%<mk-ellipsis/></template>
 | 
			
		||||
		</p>
 | 
			
		||||
 | 
			
		||||
		<div class="actions">
 | 
			
		||||
			<el-button @click="exit">キャンセル</el-button>
 | 
			
		||||
			<el-button type="primary" @click="accept" v-if="!isAccepted">準備完了</el-button>
 | 
			
		||||
			<el-button type="primary" @click="cancel" v-if="isAccepted">準備続行</el-button>
 | 
			
		||||
			<el-button @click="exit">%i18n:@cancel%</el-button>
 | 
			
		||||
			<el-button type="primary" @click="accept" v-if="!isAccepted">%i18n:@ready%</el-button>
 | 
			
		||||
			<el-button type="primary" @click="cancel" v-if="isAccepted">%i18n:@cancel-ready%</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
	</footer>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,32 +4,30 @@
 | 
			
		|||
		<x-gameroom :game="game"/>
 | 
			
		||||
	</div>
 | 
			
		||||
	<div class="matching" v-else-if="matching">
 | 
			
		||||
		<h1><b>{{ matching.name }}</b>を待っています<mk-ellipsis/></h1>
 | 
			
		||||
		<h1>{{ '%i18n:@matching.waiting-for%'.split('{}')[0] }}<b>{{ matching.name }}</b>{{ '%i18n:@matching.waiting-for%'.split('{}')[1] }}<mk-ellipsis/></h1>
 | 
			
		||||
		<div class="cancel">
 | 
			
		||||
			<el-button round @click="cancel">キャンセル</el-button>
 | 
			
		||||
			<el-button round @click="cancel">%i18n:@matching.cancel%</el-button>
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
	<div class="index" v-else>
 | 
			
		||||
		<h1>Misskey Reversi</h1>
 | 
			
		||||
		<p>他のMisskeyユーザーとリバーシで対戦しよう</p>
 | 
			
		||||
		<h1>%i18n:@title%</h1>
 | 
			
		||||
		<p>%i18n:@sub-title%</p>
 | 
			
		||||
		<div class="play">
 | 
			
		||||
			<el-button round>フリーマッチ(準備中)</el-button>
 | 
			
		||||
			<el-button type="primary" round @click="match">指名</el-button>
 | 
			
		||||
			<!--<el-button round>フリーマッチ(準備中)</el-button>-->
 | 
			
		||||
			<el-button type="primary" round @click="match">%i18n:@invite%</el-button>
 | 
			
		||||
			<details>
 | 
			
		||||
				<summary>遊び方</summary>
 | 
			
		||||
				<summary>%i18n:@rule%</summary>
 | 
			
		||||
				<div>
 | 
			
		||||
					<p>リバーシは、相手と交互に石をボードに置いてゆき、相手の石を挟んでひっくり返しながら、最終的に残った石が多い方が勝ちというボードゲームです。</p>
 | 
			
		||||
					<p>%i18n:@rule-desc%</p>
 | 
			
		||||
					<dl>
 | 
			
		||||
						<dt><b>フリーマッチ</b></dt>
 | 
			
		||||
						<dd>ランダムなユーザーと対戦するモードです。</dd>
 | 
			
		||||
						<dt><b>指名</b></dt>
 | 
			
		||||
						<dd>指定したユーザーと対戦するモードです。</dd>
 | 
			
		||||
						<dt><b>%i18n:@mode-invite%</b></dt>
 | 
			
		||||
						<dd>%i18n:@mode-invite-desc%</dd>
 | 
			
		||||
					</dl>
 | 
			
		||||
				</div>
 | 
			
		||||
			</details>
 | 
			
		||||
		</div>
 | 
			
		||||
		<section v-if="invitations.length > 0">
 | 
			
		||||
			<h2>対局の招待があります!:</h2>
 | 
			
		||||
			<h2>%i18n:@invitations%</h2>
 | 
			
		||||
			<div class="invitation" v-for="i in invitations" tabindex="-1" @click="accept(i)">
 | 
			
		||||
				<mk-avatar class="avatar" :user="i.parent"/>
 | 
			
		||||
				<span class="name"><b>{{ i.parent.name }}</b></span>
 | 
			
		||||
| 
						 | 
				
			
			@ -38,21 +36,21 @@
 | 
			
		|||
			</div>
 | 
			
		||||
		</section>
 | 
			
		||||
		<section v-if="myGames.length > 0">
 | 
			
		||||
			<h2>自分の対局</h2>
 | 
			
		||||
			<h2>%i18n:@my-games%</h2>
 | 
			
		||||
			<a class="game" v-for="g in myGames" tabindex="-1" @click.prevent="go(g)" :href="`/reversi/${g.id}`">
 | 
			
		||||
				<mk-avatar class="avatar" :user="g.user1"/>
 | 
			
		||||
				<mk-avatar class="avatar" :user="g.user2"/>
 | 
			
		||||
				<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
 | 
			
		||||
				<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
 | 
			
		||||
				<span class="state">{{ g.isEnded ? '%i18n:@game-state.ended%' : '%i18n:@game-state.playing%' }}</span>
 | 
			
		||||
			</a>
 | 
			
		||||
		</section>
 | 
			
		||||
		<section v-if="games.length > 0">
 | 
			
		||||
			<h2>みんなの対局</h2>
 | 
			
		||||
			<h2>%i18n:@all-games%</h2>
 | 
			
		||||
			<a class="game" v-for="g in games" tabindex="-1" @click.prevent="go(g)" :href="`/reversi/${g.id}`">
 | 
			
		||||
				<mk-avatar class="avatar" :user="g.user1"/>
 | 
			
		||||
				<mk-avatar class="avatar" :user="g.user2"/>
 | 
			
		||||
				<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
 | 
			
		||||
				<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
 | 
			
		||||
				<span class="state">{{ g.isEnded ? '%i18n:@game-state.ended%' : '%i18n:@game-state.playing%' }}</span>
 | 
			
		||||
			</a>
 | 
			
		||||
		</section>
 | 
			
		||||
	</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -153,7 +151,7 @@ export default Vue.extend({
 | 
			
		|||
 | 
			
		||||
		match() {
 | 
			
		||||
			(this as any).apis.input({
 | 
			
		||||
				title: 'ユーザー名を入力してください'
 | 
			
		||||
				title: '%i18n:@enter-username%'
 | 
			
		||||
			}).then(username => {
 | 
			
		||||
				(this as any).api('users/show', {
 | 
			
		||||
					username
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue