2021-06-12 04:38:16 +00:00
|
|
|
<template>
|
2022-01-14 04:25:47 +00:00
|
|
|
<Tooltip
|
|
|
|
v-if="visibility !== Visibility.None"
|
|
|
|
v-show="visibility === Visibility.Visible"
|
|
|
|
:display="tooltip"
|
|
|
|
>
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
<div
|
2022-01-14 04:25:47 +00:00
|
|
|
:style="[{ backgroundImage: (earned && image && `url(${image})`) || '' }, style ?? []]"
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
:class="{
|
|
|
|
feature: true,
|
|
|
|
achievement: true,
|
2022-01-14 04:25:47 +00:00
|
|
|
locked: !earned,
|
|
|
|
bought: earned,
|
|
|
|
...classes
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
}"
|
|
|
|
>
|
2022-01-14 04:25:47 +00:00
|
|
|
<component v-if="component" :is="component" />
|
|
|
|
<MarkNode :mark="mark" />
|
|
|
|
<LinkNode :id="id" />
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
</div>
|
2022-01-14 04:25:47 +00:00
|
|
|
</Tooltip>
|
2021-06-12 04:38:16 +00:00
|
|
|
</template>
|
|
|
|
|
2022-01-25 04:25:34 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { CoercableComponent, Visibility } from "@/features/feature";
|
2022-01-14 04:25:47 +00:00
|
|
|
import { coerceComponent } from "@/util/vue";
|
2022-01-25 04:25:34 +00:00
|
|
|
import { computed, defineComponent, PropType, StyleValue, toRefs } from "vue";
|
2022-01-14 04:25:47 +00:00
|
|
|
import LinkNode from "../system/LinkNode.vue";
|
|
|
|
import MarkNode from "./MarkNode.vue";
|
2021-06-12 04:38:16 +00:00
|
|
|
|
2022-01-25 04:25:34 +00:00
|
|
|
export default defineComponent({
|
|
|
|
props: {
|
|
|
|
visibility: {
|
|
|
|
type: Object as PropType<Visibility>,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
display: [Object, String] as PropType<CoercableComponent>,
|
|
|
|
tooltip: [Object, String] as PropType<CoercableComponent>,
|
|
|
|
earned: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
image: String,
|
|
|
|
style: Object as PropType<StyleValue>,
|
|
|
|
classes: Object as PropType<Record<string, boolean>>,
|
|
|
|
mark: [Boolean, String],
|
|
|
|
id: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
setup(props) {
|
|
|
|
const { display } = toRefs(props);
|
2022-01-14 04:25:47 +00:00
|
|
|
|
2022-01-25 04:25:34 +00:00
|
|
|
return {
|
|
|
|
component: computed(() => {
|
|
|
|
return display.value && coerceComponent(display.value);
|
|
|
|
}),
|
|
|
|
LinkNode,
|
|
|
|
MarkNode,
|
|
|
|
Visibility
|
|
|
|
};
|
|
|
|
}
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
});
|
2021-06-12 04:38:16 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.achievement {
|
|
|
|
height: 90px;
|
|
|
|
width: 90px;
|
|
|
|
font-size: 10px;
|
|
|
|
color: white;
|
|
|
|
text-shadow: 0 0 2px #000000;
|
|
|
|
}
|
|
|
|
</style>
|