0.1.7 - Added reveresed lists and stats

This commit is contained in:
Elvanos 2021-05-06 23:35:08 +02:00
parent 117e9bfd4f
commit 883a9175e1
7 changed files with 730 additions and 47 deletions

View file

@ -39,7 +39,10 @@
v-for="(singleInput,index) in localInput"
:key="index"
>
<div class="col-sm-12 col-md flex">
<div
class="col-sm-12 col-md flex"
>
<q-btn
tabindex="-1"
round
@ -81,28 +84,13 @@
Move the item one place down
</q-tooltip>
</q-btn>
<q-input
v-model="localInput[index].value"
class="grow-1"
:class="`listField_input${index}_${inputDataBluePrint.id}`"
dense
@keydown="processInput"
:outlined="!isDarkMode"
:filled="isDarkMode"
>
</q-input>
</div>
<div
class="q-ml-lg justify-end flex"
style="max-width: 220px; width: 220px;"
v-if="hasExtraInput">
<template v-if="isReversed">
<q-select
style="width: 100%;"
style="min-width: 300px; width: 300px;"
dense
class="listAtributeSelect"
:options="localExtraInput"
v-if="hasExtraInput"
class="listAtributeSelect q-mr-lg"
:options="filteredLocalExtraInput"
use-input
:hide-dropdown-icon="!editMode"
:outlined="editMode && !isDarkMode"
@ -112,22 +100,199 @@
input-debounce="0"
new-value-mode="add"
dark
:class="`listField_prefix${index}_${inputDataBluePrint.id}`"
@filter="filterFn"
@input="processInput"
@keydown="processInput"
:label="(inputAffix) ? inputAffix : ''"
v-model="localInput[index].affix"
/>
</div>
>
<template v-slot:option="scope">
<template v-if="typeof scope.opt === 'string'">
<q-item
class="list_specialItem"
:class="{'q-item--active': localInput[index].affix === scope.opt }"
@click="localInput[index].affix = scope.opt"
clickable
v-ripple
v-bind="scope.itemProps"
v-on="scope.itemEvents"
v-close-popup
>
{{scope.opt}}
</q-item>
</template>
<div style="width: 115px;" class="justify-end flex">
<template v-else>
<q-item
class="bg-gunmetal-light"
:label="scope.opt.title"
>
<q-item-section >{{ scope.opt.title }}</q-item-section>
<q-item-section side>
<q-btn
tabindex="-1"
round
flat
dense
dark
color="primary"
class="z-max q-ml-sm self-center"
icon="mdi-plus"
size="12px"
v-close-popup
@click="assignOptionGroupValues(scope.opt.title, index)"
>
<q-tooltip
:delay="300"
>
Add this category to the field.
</q-tooltip>
</q-btn>
</q-item-section>
</q-item>
<q-item
v-for="value in scope.opt.values"
:key="`${value}_${scope.opt.title}`"
:class="{'q-item--active': localInput[index].affix === value }"
clickable
v-ripple
v-close-popup
@click="localInput[index].affix = value"
>
<q-item-section>
<q-item-label v-html="value" class="q-ml-md" ></q-item-label>
</q-item-section>
</q-item>
</template>
</template>
</q-select>
<q-input
v-model="localInput[index].value"
class="grow-1 q-mr-lg"
:class="`listField_input${index}_${inputDataBluePrint.id}`"
dense
autogrow
@keydown="processInput"
:outlined="!isDarkMode"
:filled="isDarkMode"
>
</q-input>
</template>
<template v-if="!isReversed">
<q-input
v-model="localInput[index].value"
class="grow-1 q-mr-lg"
:class="`listField_input${index}_${inputDataBluePrint.id}`"
dense
autogrow
@keydown="processInput"
:outlined="!isDarkMode"
:filled="isDarkMode"
>
</q-input>
<q-select
v-if="hasExtraInput"
style="min-width: 300px; width: 300px;"
dense
class="listAtributeSelect q-mr-lg"
:options="filteredLocalExtraInput"
use-input
:hide-dropdown-icon="!editMode"
:outlined="editMode && !isDarkMode"
:borderless="!editMode"
:filled="editMode && isDarkMode"
:readonly="!editMode"
input-debounce="0"
new-value-mode="add"
dark
:class="`listField_prefix${index}_${inputDataBluePrint.id}`"
@filter="filterFn"
@input="processInput"
@keydown="processInput"
:label="(inputAffix) ? inputAffix : ''"
v-model="localInput[index].affix"
>
<template v-slot:option="scope">
<template v-if="typeof scope.opt === 'string'">
<q-item
class="list_specialItem"
:class="{'q-item--active': localInput[index].affix === scope.opt }"
@click="localInput[index].affix = scope.opt"
clickable
v-ripple
v-close-popup
v-bind="scope.itemProps"
v-on="scope.itemEvents"
>
{{scope.opt}}
</q-item>
</template>
<template v-else>
<q-item
class="bg-gunmetal-light"
:label="scope.opt.title"
>
<q-item-section >{{ scope.opt.title }}</q-item-section>
<q-item-section side>
<q-btn
tabindex="-1"
round
flat
dense
dark
color="primary"
class="z-max q-ml-sm self-center"
icon="mdi-plus"
size="12px"
v-close-popup
@click="assignOptionGroupValues(scope.opt.title, index)"
>
<q-tooltip
:delay="300"
>
Add this category to the field.
</q-tooltip>
</q-btn>
</q-item-section>
</q-item>
<q-item
:class="{'q-item--active': localInput[index].affix === value }"
v-for="value in scope.opt.values"
:key="`${value}_${scope.opt.title}`"
clickable
v-ripple
v-close-popup
@click="localInput[index].affix = value"
>
<q-item-section>
<q-item-label v-html="value" class="q-ml-md" ></q-item-label>
</q-item-section>
</q-item>
</template>
</template>
</q-select>
</template>
<div style="width: 60px; align-self: center; height: 35px;" class="justify-end flex">
<q-btn
v-if="editMode"
color="secondary"
:outline="isDarkMode"
icon="mdi-close"
tabindex="-1"
@click="removeFromList(index)"
label="Remove" />
>
<q-tooltip :delay="500">
Remove
</q-tooltip>
</q-btn>
</div>
</div>
</div>
<div class="row q-mt-xs" v-if="editMode">
<div class="col justify-start flex">
@ -135,7 +300,7 @@
color="primary"
:outline="isDarkMode"
label="Add new"
@click="addNewInput" />
@click="addNewInput()" />
</div>
</div>
</div>
@ -200,13 +365,34 @@ export default class Field_List extends FieldBase {
get hasExtraInput () {
// @ts-ignore
this.localExtraInput = this.inputDataBluePrint?.predefinedListExtras?.extraSelectValueList
this.filteredLocalExtraInput = extend(true, [], this.localExtraInput)
return this.inputDataBluePrint?.predefinedListExtras?.extraSelectValueList
}
/**
* Determine if the input is reversed
*/
get isReversed () {
// @ts-ignore
return (this.inputDataBluePrint?.predefinedListExtras?.reverse)
}
/**
* List of extra input values
*/
localExtraInput:string[] = []
localExtraInput:string[] | {
title: string,
values: string[]
} [] = []
/**
* List of extra input values - filtered
*/
filteredLocalExtraInput:string[] | {
title: string,
values: string[]
} [] = []
/**
* Label for the extra input
@ -216,6 +402,59 @@ export default class Field_List extends FieldBase {
return (this.inputDataBluePrint?.predefinedListExtras?.affix) || ""
}
filterFn (val:string, update: (e: () => void) => void) {
if (val === "") {
update(() => {
this.filteredLocalExtraInput = this.localExtraInput
})
return
}
update(() => {
const needle = val.toLowerCase()
const returnList: string[] | {
title: string,
values: string[]
} [] = []
const localListCopy: [] = extend(true, [], this.localExtraInput)
localListCopy.forEach((value:string | {
title: string,
values: string[]
}) => {
// For strings
if (typeof value === "string" && value.toLowerCase().includes(needle)) {
// @ts-ignore
returnList.push(value)
}
// For lists
if (typeof value !== "string") {
// If title matches
if (value.title.toLowerCase().includes(needle)) {
// @ts-ignore
returnList.push(value)
}
// Try matching child values
else {
const localFilteredSubvalues = value.values.filter(subValue => {
return subValue.toLowerCase().includes(needle)
})
if (localFilteredSubvalues.length > 0) {
value.values = localFilteredSubvalues
// @ts-ignore
returnList.push(value)
}
}
}
})
this.filteredLocalExtraInput = returnList
})
}
/**
* Remove an existing row from the input list
*/
@ -227,13 +466,15 @@ export default class Field_List extends FieldBase {
/**
* Adds new row to the input list
*/
async addNewInput () {
async addNewInput (affixValue = "") {
this.localInput.push({
value: "",
affix: ""
affix: affixValue
})
const targetRefStringNamer = `.listField_input${this.localInput.length - 1}_${this.inputDataBluePrint.id}`
const targetRefStringNamer = (!this.isReversed)
? `.listField_input${this.localInput.length - 1}_${this.inputDataBluePrint.id}`
: `.listField_prefix${this.localInput.length - 1}_${this.inputDataBluePrint.id}`
await this.$nextTick()
@ -288,6 +529,23 @@ export default class Field_List extends FieldBase {
return returnValue
}
async assignOptionGroupValues (categoryTitle: string, callerIndex: number) {
const targetCategory:{
title: string,
values: string[]
} = this.localExtraInput
// @ts-ignore
.find((e: {title: string}) => e.title === categoryTitle)
for (const value of targetCategory.values) {
await this.addNewInput(value)
}
if (this.localInput[callerIndex].value === "" && this.localInput[callerIndex].affix === "") {
this.removeFromList(callerIndex)
}
}
}
</script>
@ -310,4 +568,8 @@ export default class Field_List extends FieldBase {
}
}
.list_specialItem {
display: flex;
align-items: center;
}
</style>

View file

@ -418,6 +418,7 @@
label="Note"
v-model="singleNote.value"
dense
autogrow
@keydown="processInput()"
:outlined="!isDarkMode"
:filled="isDarkMode"

View file

@ -369,6 +369,7 @@
label="Note"
v-model="inputNote.value"
dense
autogrow
@keydown="processInput"
:outlined="!isDarkMode"
:filled="isDarkMode"

View file

@ -435,6 +435,7 @@ body .q-tooltip {
color: $dark;
font-size: 13px;
font-weight: 600;
z-index: 999999999 !important;
}
.q-markdown {

View file

@ -23,8 +23,12 @@ export interface I_ExtraFields {
"tags"
predefinedListExtras?: {
reverse?: boolean
affix?: string
extraSelectValueList?: string[]
extraSelectValueList?: (string | {
title: string,
values: string[]
}) []
}
predefinedSelectValues?: string[]
relationshipSettings?: {

View file

@ -194,6 +194,425 @@ export const charactersBlueprint: I_Blueprint = {
icon: "mdi-weight",
sizing: 3
},
{
id: "statsList",
name: "Stats/Attributes",
type: "list",
icon: "mdi-sword-cross",
sizing: 12,
predefinedListExtras: {
reverse: true,
affix: "Stat/Attribute",
extraSelectValueList: [
{
title: "Dungeons & Dragons (5th edition)",
values: [
"Strength",
"Dexterity",
"Constitution",
"Intelligence",
"Wisdom",
"Charisma"
]
},
{
title: "Dungeons & Dragons - Expanded (5th edition)",
values: [
"Hit points",
"Maximum hit points",
"Temporary points",
"Armor class",
"Innitiative",
"Piety",
"Renown",
"Proficiency bonus"
]
},
{
title: "Dungeons & Dragons - Travel speeds (5th edition)",
values: [
"Movement speed",
"Fly speed",
"Swim speed",
"Climb speed"
]
},
{
title: "Dungeons & Dragons - Saving throws (5th edition)",
values: [
"Strength (saving)",
"Dexterity (saving)",
"Constitution (saving)",
"Intelligence (saving)",
"Wisdom (saving)",
"Charisma (saving)"
]
},
{
title: "Mass Effect (D20, 5e)",
values: [
"Strenght",
"Dexterity",
"Constitution",
"Intelligence ",
"Wisdom",
"Charisma",
"Defense (total)",
"Defense (size) ",
"Defense (cover) ",
"Shield/Shields ",
"Plating",
"Reduction ",
"Size",
"Age ",
"Level/Class Level ",
"Paragon ",
"Renegade ",
"Power",
"Biotics",
"Biotic Points ",
"Tech Points ",
"Attack (bab/base Attack) ",
"Rank ",
"Ranks ",
"Modifier",
"Mod ",
"Ability Modifier",
"Misc Modifier ",
"Bonus ",
"Total Bonus",
"Attack",
"Attack Bonus ",
"Action ",
"Range",
"Ammunition",
"Damage ",
"Critical ",
"Recoil",
"Armor ",
"Armor Special Qualities ",
"Head ",
"Shoulders",
"Arms",
"Chest ",
"Legs ",
"Others ",
"Cost",
"Thermal Clips ",
"Heat",
"Medi-Gel",
"Grenades",
"Repair Kits",
"Dc",
"Maintenance ",
"Cooldown",
"Activation",
"Load/Carry Capaccity (light) ",
"Load/Carry Capaccity (medium) ",
"Load/Carry Capaccity (heavy) ",
"Amount ",
"Credits"
]
},
{
title: "Vampire: Masquerade (5th edition, World of Darkness)",
values: [
"Strength",
"Dexterity",
"Stamina",
"Charisma",
"Manipulation",
"Composure",
"Intelligence",
"Wits",
"Resolve",
"Health",
"Willpower",
"Humanity"
]
},
{
title: "Paranoia (Red Clearance)",
values: [
"Violence",
"Brains",
"Chutzpah",
"Mechanics",
"Athletics",
"Guns",
"Melee",
"Throw",
"Science",
"Psychology",
"Bureaucracy",
"Alpha Complex",
"Bluff",
"Charm",
"Intimdate",
"Stealth",
"Operate",
"Engineer",
"Program",
"Demolitions"
]
},
{
title: "Shadowrun (6th edition)",
values: [
"Body",
"Agility",
"Reaction",
"Willpower",
"Intuition",
"Edge",
"Essence",
"Magic/Resonance",
"Initiative (matrix)",
"Initiative (astral)",
"Composure",
"Judge",
"Intentions",
"Memory",
"Lift/Carry",
"Movement",
"Dam",
"Damage",
"Acc",
"Accuracy",
"Ap",
"Action",
"Points",
"Rc",
"Ammo",
"Rating",
"Rtg",
"Nuyen",
"Funds",
"Currency"
]
},
{
title: "Fading Suns",
values: [
"Body",
"Strength",
"Dexterity",
"Endurance",
"Mind",
"Wits",
"Perception",
"Tech",
"Spirit",
"Vitality",
"Wyrd",
"Charm",
"Dodge",
"Fight",
"Impress",
"Melee",
"Observe",
"Shoot",
"Sneak",
"Vigor"
]
},
{
title: "Cyberpunk (RED)",
values: [
"Intelligence",
"Willpower",
"Cool",
"Empathy",
"Technique",
"Reflexes",
"Luck",
"Body",
"Dexterity",
"Movement"
]
},
{
title: "Mutant: Year Zero",
values: [
"Strength",
"Agility",
"Wits",
"Empathy",
"Damage",
"Fatigue",
"Confusion",
"Doubt"
]
},
{
title: "GURPS (3rd & 4th edition)",
values: [
"Strength",
"Agility",
"Wits",
"Empathy",
"Damage",
"Fatigue",
"Confusion",
"Doubt"
]
},
{
title: "7th Sea (2nd edition)",
values: [
"Brawn",
"Finesse",
"Resolve",
"Wits",
"Panache"
]
},
{
title: "7th Sea - Villain (2nd edition)",
values: [
"Strength",
"Influence"
]
},
{
title: "Apocalypse World (2nd edition, Powered by the Apocalypse)",
values: [
"Cool",
"Hard",
"Hot",
"Sharp",
"Weird",
"HX"
]
},
{
title: "Dresden Files RPG",
values: [
"Alertness",
"Athletics",
"Burglary",
"Contacts",
"Conviction",
"Craftsmanship",
"Deceit",
"Discipline",
"Driving",
"Empathy",
"Endurance",
"Fists",
"Guns",
"Intimidation",
"Investigation",
"Lore",
"Might",
"Performance",
"Presence",
"Rapport",
"Resources",
"Scholarship",
"Stealth",
"Survival",
"Weapons"
]
},
{
title: "Traveller (2nd edition)",
values: [
"Strength",
"Dexterity",
"Endurace",
"Intelligence",
"Education",
"Social",
"Standing"
]
},
{
title: "Cypher System",
values: [
"Intellect",
"Might",
"Speed"
]
},
{
title: "Blades in the Dark",
values: [
"Attune",
"Command",
"Consort",
"Finesse",
"Hunt",
"Prowl",
"Skirmish",
"Study",
"Survey",
"Sway",
"Tinker",
"Wreck",
"Insight",
"Prowess",
"Tesolve"
]
},
"Absorption",
"Alertness",
"Attack",
"Avoidance",
"Awareness",
"Block",
"Brawn",
"Cautiousness",
"Chance",
"Damage",
"Defense",
"Deftness",
"Dodge",
"Ego",
"Endurance",
"Energy",
"Evasion",
"Fate",
"Fatigue",
"Finesse",
"Fortitude",
"Honor",
"Hit Points (HP)",
"Immunity",
"Level",
"Magic",
"Mana",
"Mana Points (MP)",
"Might",
"Mind",
"Morale",
"Parry",
"Personality",
"Precision",
"Presence",
"Psyche",
"Quickness",
"Rank",
"Rate",
"Recovery",
"Reduction",
"Reflexes",
"Resistence",
"Sanity",
"Sense",
"Soul",
"Speed",
"Spellpower",
"Spirit",
"Stamina",
"Swiftness",
"Tier",
"Vitality",
"Willpower",
"Wits"
]
}
},
{
id: "strength",
name: "Strength",
@ -538,6 +957,7 @@ export const charactersBlueprint: I_Blueprint = {
"Erratic",
"Escapist",
"Esthetic",
"Evil",
"Excitable",
"Exciting",
"Expedient",

View file

@ -1,5 +1,9 @@
## THE GM BATCH
- Add more stat systems
- Add stats to items (and anywhere else they might be needed)
- Add automatic-stats fixer to the repair tool from older versions
- Add hover/on-demand document preview to relationships
- Export for MD/PDF/ODT/DOCX
@ -8,18 +12,13 @@
## THE GM BATCH END
- Add reverse list field option (dropdown first, value in bracket)
- Rework stats (via reverse list)
- Add option for project graph to filter out categories or show them separately
- Add HTML webcolor cheatsheet in floating window (look for JSON of them somewhere?)
- Word count for editor fields
- Try to get field titles to show in full-screen edit of text editor fields
- List of last saved documents on project overview
- Consider adding some kind of "Follower name" to different group types
- Consider reworking the save document mechanic (save doesnt close, open/exit edit mode instead)
- Add color support (text and background) to view and edit mode of document display
- Add a toggle option for it (default off)
- Add a toggle option for it (default off)
- Mass tag rename/deletion (done via document saving!)
- Context menu for tags
@ -27,22 +26,17 @@
- Add new document type under tag
- Delete tag (unsets for all docs)
- Rename tag (resaves all docs with new tag)
- Add "Predecessors", "Successors", "Date of start", "Date of end" and "How long it lasted" fields to locations and all other groups
- Add advanced search capabilities to the hierarchical tree
- "Save all" keybind and "Save all and exit" option on the exiting
- Add "Open all search matches" button in the Quick-search that opens a new page with a list of items
- Allow showing of document types under tags
- Consider adding color support for text shadow of individual documents
- Add description tabs
- Add option for project graph to filter out categories or show them separately
- Add "Predecessors", "Successors", "Date of start", "Date of end" and "How long it lasted" fields to locations and all other groups
- Add category for materials/resources OR adapt Items category
- Add category for diseases/curses/etc
- Add category for classes/jobs
- Add support for individual document order hiding inside the hierarchical tree for each document
- Consider adding color support for text shadow of individual documents
- Consider adding coloring to icons of documents separately
- Add advanced search capabilities to the hierarchical tree
### Project settings