diff --git a/client/src/assets/main.css b/client/src/assets/main.css index 87686962..043df4af 100644 --- a/client/src/assets/main.css +++ b/client/src/assets/main.css @@ -197,4 +197,10 @@ button:active { .document h1 { font-weight: normal; font-size: 32px; +} + +.text-icon { + height: 18px; + width: 18px; + margin-right: 5px; } \ No newline at end of file diff --git a/client/src/services/Tooltip.js b/client/src/services/Tooltip.js index c0d9d598..bfc44baa 100644 --- a/client/src/services/Tooltip.js +++ b/client/src/services/Tooltip.js @@ -23,7 +23,7 @@ function AddTooltip(element, val, data = {}){ function UpdateVisibilityThread(){ let tooltip = document.getElementById('mouse-tooltip'); let element = document.elementFromPoint(cursorX, cursorY); - if(element._dr_tooltip){ + if(element) if(element._dr_tooltip){ ShowTooltip(); content.value = element._dr_tooltip.value; if(element._dr_tooltip.max_width) tooltip.style.maxWidth = element._dr_tooltip.max_width + "px"; diff --git a/client/src/services/Windows.js b/client/src/services/Windows.js index ba1c6fb0..a8ce4e0c 100644 --- a/client/src/services/Windows.js +++ b/client/src/services/Windows.js @@ -22,7 +22,7 @@ const defValues = { id: 'main_menu', title: "DragonRoll", create: () => { - CreateChildWindow('main_menu', 'welcome'); + // CreateChildWindow('main_menu', 'welcome'); } }, 'welcome': { @@ -123,7 +123,15 @@ const defValues = { id: 'character_sheet', title: 'Character Sheet', close: "true" - } + }, + 'book_anvil_window': { + id: 'book_anvil_window', + title: "Book Anvil", + back: () => { + ClearWindow('book_anvil_window'); + CreateWindow('main_menu'); + } + }, } const reload = ref(0); diff --git a/client/src/views/managers/WindowManager.vue b/client/src/views/managers/WindowManager.vue index d45ec750..0689f74a 100644 --- a/client/src/views/managers/WindowManager.vue +++ b/client/src/views/managers/WindowManager.vue @@ -25,9 +25,10 @@ import MapWindow from '../windows/dm/MapWindow.vue' import CombatWindow from '../windows/game/CombatWindow.vue' import EntityWindow from '../windows/dm/EntityWindow.vue' import CharactersWindow from '../windows/game/CharactersWindow.vue' -import CompendiumWindow from '../windows/game/CompendiumWindow.vue' import CharacterSheet from '../windows/game/dnd-5e/CharacterSheet.vue' import WelcomeWindow from '../windows/WelcomeWindow.vue' +import CompendiumWindow from '../windows/CompendiumWindow.vue' +import BookAnvilWindow from '../windows/BookAnvilWindow.vue' // Gestionem ventanas @@ -56,12 +57,14 @@ let WindowMap = { entity_window: EntityWindow, characters_window: CharactersWindow, compendium_window: CompendiumWindow, + book_anvil_window: BookAnvilWindow, }; async function InjectSystemWindows(system){ // Hack let systemWidows = { - character_sheet: (await import(`../windows/game/${system}/CharacterSheet.vue`)).default + character_sheet: (await import(`../windows/game/${system}/CharacterSheet.vue`)).default, + concept_sheet: (await import(`../windows/game/${system}/ConceptSheet.vue`)).default }; WindowMap = {...WindowMap, ...systemWidows}; diff --git a/client/src/views/partials/CampaignEntry.vue b/client/src/views/partials/CampaignEntry.vue index f57a5b24..15ca3c23 100644 --- a/client/src/views/partials/CampaignEntry.vue +++ b/client/src/views/partials/CampaignEntry.vue @@ -44,7 +44,7 @@ function ViewCampaign(){ - \ No newline at end of file diff --git a/client/src/views/partials/MessageComponent.vue b/client/src/views/partials/MessageComponent.vue index 842237db..95e31caf 100644 --- a/client/src/views/partials/MessageComponent.vue +++ b/client/src/views/partials/MessageComponent.vue @@ -36,6 +36,11 @@ onMounted(() => { diff --git a/client/src/views/windows/game/CompendiumWindow.vue b/client/src/views/windows/CompendiumWindow.vue similarity index 61% rename from client/src/views/windows/game/CompendiumWindow.vue rename to client/src/views/windows/CompendiumWindow.vue index 8ed42255..43c424bd 100644 --- a/client/src/views/windows/game/CompendiumWindow.vue +++ b/client/src/views/windows/CompendiumWindow.vue @@ -3,6 +3,7 @@ import WindowHandle from '@/views/partials/WindowHandle.vue'; import { onMounted, ref } from 'vue'; import { SetupHandle, SetSize, ResetPosition } from '@/services/Windows'; +import { SetMinSize, SetMaxSize, SetResizable } from '../../services/Windows'; const props = defineProps(['data']); const data = props.data; @@ -12,8 +13,11 @@ let id = data.id; onMounted(() => { SetupHandle(id, handle); - SetSize(id, {width: 600, height: 850}); - ResetPosition(id, {x: window.innerWidth - 620, y: 60}); + SetSize(id, {width: 700, height: 850}); + SetResizable(id, true); + SetMinSize(id, {width: 700, height: 200}); + SetMaxSize(id, {width: 700}); + ResetPosition(id, "center"); }); @@ -22,12 +26,19 @@ onMounted(() => {
- +
+ +
diff --git a/server/models/Book.js b/server/models/Book.js index 282a9a66..3dcbc926 100644 --- a/server/models/Book.js +++ b/server/models/Book.js @@ -4,9 +4,10 @@ const Schema = mongoose.Schema; const BookSchema = new Schema({ title: {type: String, required: true}, authors: { type: [String] }, + description: { type: String }, system: {type: String, required: true}, image: { type: String }, - data: { type: Object }, + contents: [ {type: mongoose.Types.ObjectId, ref: "Concept"} ], }); module.exports = mongoose.model('Book', BookSchema); \ No newline at end of file diff --git a/server/models/Character.js b/server/models/Character.js index f5126a40..1b3f66f9 100644 --- a/server/models/Character.js +++ b/server/models/Character.js @@ -4,7 +4,7 @@ const Schema = mongoose.Schema; const CharacterSchema = new Schema({ name: {type: String, required: true}, data: { type: Object }, - campaign_user: {type: mongoose.Types.ObjectId, ref: "CampaignUser"}, + owner: {type: mongoose.Types.ObjectId, ref: "CampaignUser"}, splash_image: { type: String }, }); diff --git a/server/models/Concept.js b/server/models/Concept.js index 36be2ac7..12b1d85a 100644 --- a/server/models/Concept.js +++ b/server/models/Concept.js @@ -6,6 +6,8 @@ const ConceptSchema = new Schema({ system: {type: String, required: true}, type: { type: String }, data: { type: Object }, + book: {type: mongoose.Types.ObjectId, ref: "Book"}, + campaign: {type: mongoose.Types.ObjectId, ref: "Campaign"}, }); module.exports = mongoose.model('Concept', ConceptSchema); \ No newline at end of file