diff --git a/src/components/molecules/SpellSlot.vue b/src/components/molecules/SpellSlot.vue new file mode 100644 index 0000000..81ce4ab --- /dev/null +++ b/src/components/molecules/SpellSlot.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/components/organisms/Inventory.vue b/src/components/organisms/Inventory.vue index fcbfb40..0977623 100644 --- a/src/components/organisms/Inventory.vue +++ b/src/components/organisms/Inventory.vue @@ -4,11 +4,10 @@ import { Manager } from "../../data/network/manager"; import { onBeforeUnmount, onMounted, ref, watch } from "vue"; import { Server } from "../../data/network/server"; import { Client } from "../../data/network/client"; -import { ELEMENT_COLOR_MAP } from "../../graphics/elements"; import { Message, MessageType } from "../../data/network/types"; -import { Element } from "../../data/spells/types"; import Tooltip from "../atoms/Tooltip.vue"; import SpellDescription from "../molecules/SpellDescription.vue"; +import SpellSlot from "../molecules/SpellSlot.vue"; const props = defineProps<{ isOpen: boolean; @@ -28,16 +27,11 @@ const sections = { Offense: offenseSpells, }; -const SPRITES_PER_ROW = 5; - -const previewSpell = ref(Manager.instance?.selectedSpell); -const previewMultiplier = ref(1); +const selectedSpell = ref(Manager.instance?.selectedSpell); const availableList = ref([]); const poll = () => { if (props.isOpen) { - previewMultiplier.value = previewSpell.value?.costMultiplier?.() || 1; - const mana = Manager.instance.self.mana; availableList.value = []; SPELLS.forEach((spell) => { @@ -80,27 +74,10 @@ const handleClick = (spell?: Spell) => { }; Client.instance.broadcast(message); } - } -}; -const onMouseLeave = (event: Event) => { - previewSpell.value = Manager.instance.selectedSpell; - - previewMultiplier.value = - Manager.instance?.selectedSpell?.costMultiplier?.() || 1; -}; - -const onMouseEnter = (spell?: Spell) => { - if (spell) { - previewSpell.value = spell; - previewMultiplier.value = spell.costMultiplier?.() || 1; + selectedSpell.value = spell; } }; - -const getElementFilter = (element: Element) => - `brightness(${ - 0.1 + Math.min(1, Manager.instance.getElementValue(element) / 1.3) - })`;