Nekro Darkmoon
Nekro Darkmoon
TTyphonJS
Created by Nekro Darkmoon on 8/2/2024 in #typhonjs-runtime
TinyTJS Enriched options
No description
7 replies
TTyphonJS
Created by Nekro Darkmoon on 1/19/2024 in #typhonjs-runtime
setPosition in SvelteApplication
The SvelteApplication class has a function called setPosition that is there to support core behavior. And while it exists and is called when opening the app. It isn't really called when minimizing, maximizing, or changing the position of the window itself. This means that any modules that try to wrap the setPosition function to extend features fail to do so.
46 replies
TTyphonJS
Created by Nekro Darkmoon on 11/30/2023 in #typhonjs-runtime
Creating a derived reducer for a DynMapReducer
Do you have an example of how to make a derived reducer for a reducer that's not part of a TJSDcoument?
const reducer = getContext("reducer");
let derived = [];

if (enableGrouping) {
const filters = filterBy[compendiumType];
const property = `system.${groupBy[compendiumType]}`;

for (const filterValue of filters) {
const dr = $reducer.derived.create(`${filterValue}`);
console.log(dr);

dr.filters.add((doc) => doc[property] === filterValue);
derived.push(dr);
}

derived = derived;
}
const reducer = getContext("reducer");
let derived = [];

if (enableGrouping) {
const filters = filterBy[compendiumType];
const property = `system.${groupBy[compendiumType]}`;

for (const filterValue of filters) {
const dr = $reducer.derived.create(`${filterValue}`);
console.log(dr);

dr.filters.add((doc) => doc[property] === filterValue);
derived.push(dr);
}

derived = derived;
}
32 replies
TTyphonJS
Created by Nekro Darkmoon on 10/1/2023 in #typhonjs-runtime
List of Tjsdocuments
46 replies
TTyphonJS
Created by Nekro Darkmoon on 6/28/2023 in #typhonjs-runtime
TJSDocument and Token Issues
const tokens = cardData.targets
.map(t => [t, fromUuidSync(t)])
.filter(([_, t]) => t);
const targets = new Map(
tokens.map(([id, token]) => [id, new TJSDocument(token)])
);

const reducer = new DynMapReducer(targets);
const tokens = cardData.targets
.map(t => [t, fromUuidSync(t)])
.filter(([_, t]) => t);
const targets = new Map(
tokens.map(([id, token]) => [id, new TJSDocument(token)])
);

const reducer = new DynMapReducer(targets);
I have this piece of code that creates a reducer for token documents. This worked completly fine in v10 with no issues whatsoever but in v11 if ends up causing token movemnt issues and throws a few errors. I've not been able to pin point what part of TJSDocument ends up causing this issue. But replacing the above code with the following fixes it.
const tokens = cardData.targets
.map(t => [t, fromUuidSync(t)])
.filter(([_, t]) => t);

const targets = new Map(
tokens.map(([id, token]) => [id, new TJSDocument(token.actor)])
);

const reducer = new DynMapReducer(targets);
const tokens = cardData.targets
.map(t => [t, fromUuidSync(t)])
.filter(([_, t]) => t);

const targets = new Map(
tokens.map(([id, token]) => [id, new TJSDocument(token.actor)])
);

const reducer = new DynMapReducer(targets);
Ofc this fix isn't ideal and leads to complications but those aren't TJS based.
122 replies
TTyphonJS
Created by Nekro Darkmoon on 4/19/2023 in #typhonjs-runtime
Z-index on TJSDialogs
No description
3 replies
TTyphonJS
Created by Nekro Darkmoon on 3/25/2023 in #typhonjs-runtime
Settings Page
I was looking at ways to override the default foundry tab for settings and was wondering if there's a way to use svelte/TRL to display our system settings instead of core behavior. I also tried creating a new settings menu and instead of extending FormApplication using either SvelteApplication or TJSDialog but foundry doesn't seem to register those as clickable buttons in the settings menu.
12 replies