+
-
@@ -73,16 +75,17 @@
import Tooltip from "features/tooltips/Tooltip.vue";
import player from "game/player";
import { Direction } from "util/common";
-import { computed, ref, toRefs, watch } from "vue";
-import DangerButton from "./fields/DangerButton.vue";
-import FeedbackButton from "./fields/FeedbackButton.vue";
-import Text from "./fields/Text.vue";
+import { computed, ref, toRefs, unref, watch } from "vue";
+import DangerButton from "../fields/DangerButton.vue";
+import FeedbackButton from "../fields/FeedbackButton.vue";
+import Text from "../fields/Text.vue";
import type { LoadablePlayerData } from "./SavesManager.vue";
const _props = defineProps<{
save: LoadablePlayerData;
+ readonly?: boolean;
}>();
-const { save } = toRefs(_props);
+const { save, readonly } = toRefs(_props);
const emit = defineEmits<{
(e: "export"): void;
(e: "open"): void;
@@ -106,7 +109,9 @@ const newName = ref("");
watch(isEditing, () => (newName.value = save.value.name ?? ""));
-const isActive = computed(() => save.value != null && save.value.id === player.id);
+const isActive = computed(
+ () => save.value != null && save.value.id === player.id && !unref(readonly)
+);
const currentTime = computed(() =>
isActive.value ? player.time : (save.value != null && save.value.time) ?? 0
);
@@ -139,6 +144,13 @@ function changeName() {
padding-left: 0;
}
+.open:disabled {
+ cursor: inherit;
+ color: var(--foreground);
+ opacity: 1;
+ pointer-events: none;
+}
+
.handle {
flex-grow: 0;
margin-right: 8px;
@@ -152,6 +164,10 @@ function changeName() {
margin-right: 80px;
}
+.save.readonly .details {
+ margin-right: 0;
+}
+
.error {
font-size: 0.8em;
color: var(--danger);
@@ -176,6 +192,10 @@ function changeName() {
.editname {
margin: 0;
}
+
+.time {
+ font-size: small;
+}