Foundry and discord bot
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 1m51s

This commit is contained in:
2026-10-11 22:26:29 +02:00
parent a2b512699a
commit 1402045001
65 changed files with 5962 additions and 144 deletions

View File

@@ -1,10 +1,16 @@
<script setup>
import TopSearchBar from './topbar/TopSearchBar.vue';
import { useCampaignService } from '~/services/Campaign.js';
import { ClearWindow, CreateWindow } from '~/services/Windows';
const campaignName = computed(() => {
return 'Campaign';
});
const { Campaign } = useCampaignService();
const campaignName = computed(() => Campaign.value?.name || 'Campaign');
function OpenCampaignSettings() {
if (!Campaign.value) return;
ClearWindow({ type: 'campaign_settings' });
CreateWindow('campaign_settings', { campaign: Campaign.value });
}
</script>
<template>
@@ -18,7 +24,11 @@ const campaignName = computed(() => {
<div class="center">
<TopSearchBar></TopSearchBar>
</div>
<div class="right"></div>
<div class="right">
<button class="btn-primary settings-button sound-click" type="button" @click="OpenCampaignSettings">
{{ $t('main-menu.settings') }}
</button>
</div>
</div>
</template>
@@ -40,16 +50,25 @@ const campaignName = computed(() => {
left: 6px;
}
.left, .right {
.left {
flex: 1;
}
.center {
display: flex;
align-items: center;
}
.right {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 8px;
padding-right: 10px;
justify-content: flex-end;
flex: 1;
padding: 0 10px;
}
.settings-button {
padding: 5px 10px;
}
.top-bar-title {

View File

@@ -5,6 +5,7 @@ import PlusIcon from 'pixelarticons/svg/plus.svg'
import NoteSearchResult from './SearchResult.vue';
import Server from '~/services/Server';
import { emitter } from '~/services/Emitter';
import { CreateWindow } from '~/services/Windows';
import { register, search as searchActions, execute as executeAction } from '~/services/ActionRegistry';
import { useCampaignService } from '~/services/Campaign.js';
@@ -41,20 +42,10 @@ function registerCreateNoteAction() {
id: 'create_note',
label: 'New note',
description: 'Create a new note in the current campaign',
execute: async () => {
execute: () => {
if (!Campaign.value) return;
const campaignId = Campaign.value?._id ?? Campaign.value?.id;
try {
const response = await Server().post('/note/create', {
title: 'New note',
content: '',
campaign: campaignId
});
if (response.data.status !== 'ok') return;
emitter.emit('note-created', response.data.note);
} catch (err) {
console.error('[ActionRegistry] Failed to create note:', err);
}
CreateWindow('new_note', { campaign: campaignId });
}
};
register(action);