Foundry and discord bot
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 1m51s
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 1m51s
This commit is contained in:
@@ -1,25 +1,23 @@
|
||||
<script setup>
|
||||
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
|
||||
import { AddSound } from '../../services/Sound';
|
||||
import { useCampaignService } from '~/services/Campaign';
|
||||
import { ClearWindow } from '~/services/Windows';
|
||||
import { ClearWindow, CreateChildWindow, GetFirstWindowId } from '~/services/Windows';
|
||||
const { SetCampaign } = useCampaignService();
|
||||
|
||||
const props = defineProps(['data']);
|
||||
const data = props.data;
|
||||
|
||||
const title = ref("");
|
||||
const title = computed(() => data.name);
|
||||
const campaignStyle = computed(() => data.color
|
||||
? { background: `linear-gradient(90deg, ${data.color}, ${data.color}44)` }
|
||||
: {});
|
||||
|
||||
const container = ref(null);
|
||||
|
||||
onMounted(() => {
|
||||
title.value = data.name;
|
||||
if (data.color && container.value) {
|
||||
container.value.style.background = `linear-gradient(90deg, ${data.color}, ${data.color}44)`;
|
||||
}
|
||||
|
||||
AddSound(container.value)
|
||||
});
|
||||
|
||||
@@ -27,11 +25,16 @@ function ViewCampaign(){
|
||||
SetCampaign(data);
|
||||
ClearWindow({type: "main_menu"});
|
||||
}
|
||||
|
||||
function OpenSettings(){
|
||||
ClearWindow({type: 'campaign_settings'});
|
||||
CreateChildWindow(GetFirstWindowId('main_menu'), 'campaign_settings', { campaign: data });
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div class="campaign-entry-container" ref="container">
|
||||
<div class="campaign-entry-container" ref="container" :style="campaignStyle">
|
||||
<div class="main-campaign-entry-container-inner">
|
||||
<img class="campaign-icon" src="/img/def-avatar.jpg" draggable="false">
|
||||
<div class="campaign-info">
|
||||
@@ -39,6 +42,7 @@ function ViewCampaign(){
|
||||
</div>
|
||||
|
||||
<div class="campaign-user-actions">
|
||||
<button class="btn-primary button-small sound-click" v-on:click.prevent="OpenSettings">{{ $t('main-menu.settings') }}</button>
|
||||
<button class="btn-primary button-small sound-click" v-on:click.prevent="ViewCampaign">{{ $t('general.open')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,5 +85,7 @@ function ViewCampaign(){
|
||||
|
||||
.campaign-user-actions {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user