diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-11-13 10:05:15 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-11-13 10:05:15 +0100 |
commit | 4aa8ca8303b5d25b745e8cae71e283455945bdd1 (patch) | |
tree | 1869fbe29ee1e63cdd2c28e93225561d391f4a71 /web/pw-server/src/lib/components/log_viewer/LogTurn.svelte | |
parent | b0530be5010494f2db3deded340c16a6dc3cbe56 (diff) | |
download | planetwars.dev-4aa8ca8303b5d25b745e8cae71e283455945bdd1.tar.xz planetwars.dev-4aa8ca8303b5d25b745e8cae71e283455945bdd1.zip |
copy input gamestate from player log
Diffstat (limited to 'web/pw-server/src/lib/components/log_viewer/LogTurn.svelte')
-rw-r--r-- | web/pw-server/src/lib/components/log_viewer/LogTurn.svelte | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/web/pw-server/src/lib/components/log_viewer/LogTurn.svelte b/web/pw-server/src/lib/components/log_viewer/LogTurn.svelte index 80367f4..bfd2a37 100644 --- a/web/pw-server/src/lib/components/log_viewer/LogTurn.svelte +++ b/web/pw-server/src/lib/components/log_viewer/LogTurn.svelte @@ -1,10 +1,11 @@ <script lang="ts"> import type { PlayerLogTurn } from "$lib/log_parser"; import Fa from "svelte-fa"; - import { faAngleRight, faAngleDown } from "@fortawesome/free-solid-svg-icons"; + import { faAngleRight, faAngleDown, faCopy } from "@fortawesome/free-solid-svg-icons"; export let turnNum: number; export let logTurn: PlayerLogTurn; + export let copyTurn: () => void; let expanded = false; const PLURAL_MAP = { @@ -49,8 +50,13 @@ </div> {#if expanded} <div class="turn-content"> - {#if logTurn.action?.type === "dispatches"} + <div class="copy-turn" on:click={copyTurn}> + <Fa icon={faCopy} /> + copy turn to clipboard + </div> + {#if logTurn.action?.type === "dispatches" && logTurn.action.dispatches.length > 0} <div class="dispatches-container"> + <div class="dispatches-header">dispatches</div> {#each logTurn.action.dispatches as dispatch} <div class="dispatch"> <div class="dispatch-text"> @@ -102,6 +108,16 @@ background-color: #333; } + .copy-turn { + margin: 4px 0; + } + + .copy-turn:hover { + text-decoration: underline; + cursor: pointer; + color: #fff; + } + .turn-header-text { color: #eee; font-size: 14px; @@ -111,15 +127,22 @@ .turn-content { margin-bottom: 12px; + margin-left: 8px; } .turn-error { color: red; } + .dispatches-header { + color: #fff; + padding-top: 4px; + } + .dispatch { display: flex; justify-content: space-between; + padding-left: 8px; } .dispatch-error { |